@json-to-office/jto 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +444 -99
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/HomePage-DMpdYyZ0.js +251 -0
- package/dist/client/assets/HomePage-DMpdYyZ0.js.map +1 -0
- package/dist/client/assets/JsonEditorPage-Ct7wb9iA.js +3 -0
- package/dist/client/assets/JsonEditorPage-Ct7wb9iA.js.map +1 -0
- package/dist/client/assets/MonacoPluginProvider-B2fWYflh.js +85 -0
- package/dist/client/assets/MonacoPluginProvider-B2fWYflh.js.map +1 -0
- package/dist/client/assets/_virtual_jto-plugin-type-libs-BlMraosv.js +25700 -0
- package/dist/client/assets/_virtual_jto-plugin-type-libs-BlMraosv.js.map +1 -0
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CNoAasd3.js +2 -0
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CNoAasd3.js.map +1 -0
- package/dist/client/assets/editor-DFnlAOyt.js +16 -0
- package/dist/client/assets/editor-DFnlAOyt.js.map +1 -0
- package/dist/client/assets/{editor-monaco-json-DcTTqcqQ.js → editor-monaco-json-B_1-Wxq5.js} +5 -5
- package/dist/client/assets/{editor-monaco-json-DcTTqcqQ.js.map → editor-monaco-json-B_1-Wxq5.js.map} +1 -1
- package/dist/client/assets/{editor-refs-store-QHdkA6Kl.js → editor-refs-store-DHeIvmr6.js} +2 -2
- package/dist/client/assets/{editor-refs-store-QHdkA6Kl.js.map → editor-refs-store-DHeIvmr6.js.map} +1 -1
- package/dist/client/assets/index-Bj6ZAKUc.css +1 -0
- package/dist/client/assets/index-CeZaIyj_.js +5 -0
- package/dist/client/assets/index-CeZaIyj_.js.map +1 -0
- package/dist/client/assets/preview-CugO7y1j.js +4 -0
- package/dist/client/assets/preview-CugO7y1j.js.map +1 -0
- package/dist/client/assets/radix-ui-BzbaiLpZ.js +51 -0
- package/dist/client/assets/radix-ui-BzbaiLpZ.js.map +1 -0
- package/dist/client/assets/{ui-vendor-Bq4-oNFL.js → ui-vendor-BsAtAN16.js} +94 -64
- package/dist/client/assets/ui-vendor-BsAtAN16.js.map +1 -0
- package/dist/client/assets/useQualityAnalysis-DH2idzAY.js +6 -0
- package/dist/client/assets/useQualityAnalysis-DH2idzAY.js.map +1 -0
- package/dist/client/index.html +4 -4
- package/dist/render-server.js.map +1 -1
- package/package.json +6 -4
- package/dist/client/assets/HomePage-DQ0sOZFI.js +0 -106
- package/dist/client/assets/HomePage-DQ0sOZFI.js.map +0 -1
- package/dist/client/assets/JsonEditorPage-D1TS-GDF.js +0 -3
- package/dist/client/assets/JsonEditorPage-D1TS-GDF.js.map +0 -1
- package/dist/client/assets/MonacoPluginProvider-BQ2eYUHv.js +0 -3
- package/dist/client/assets/MonacoPluginProvider-BQ2eYUHv.js.map +0 -1
- package/dist/client/assets/editor-5uqC0zMy.js +0 -9
- package/dist/client/assets/editor-5uqC0zMy.js.map +0 -1
- package/dist/client/assets/index-CrzIwHLS.css +0 -1
- package/dist/client/assets/index-DlPjoC1v.js +0 -5
- package/dist/client/assets/index-DlPjoC1v.js.map +0 -1
- package/dist/client/assets/preview-C3z7o0yn.js +0 -2
- package/dist/client/assets/preview-C3z7o0yn.js.map +0 -1
- package/dist/client/assets/radix-ui-DFNP5I4e.js +0 -51
- package/dist/client/assets/radix-ui-DFNP5I4e.js.map +0 -1
- package/dist/client/assets/ui-vendor-Bq4-oNFL.js.map +0 -1
- package/dist/client/assets/useQualityAnalysis-D5-WU4pX.js +0 -6
- package/dist/client/assets/useQualityAnalysis-D5-WU4pX.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e='"use strict";(()=>{var bg=Object.create;var Na=Object.defineProperty;var xg=Object.getOwnPropertyDescriptor;var Og=Object.getOwnPropertyNames;var Sg=Object.getPrototypeOf,Ig=Object.prototype.hasOwnProperty;var wg=(e,t,n)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cg=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ge=(e,t)=>{for(var n in t)Na(e,n,{get:t[n],enumerable:!0})},Pg=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Og(t))!Ig.call(e,i)&&i!==n&&Na(e,i,{get:()=>t[i],enumerable:!(o=xg(t,i))||o.enumerable});return e};var Am=(e,t,n)=>(n=e!=null?bg(Sg(e)):{},Pg(t||!e||!e.__esModule?Na(n,"default",{value:e,enumerable:!0}):n,e));var $=(e,t,n)=>wg(e,typeof t!="symbol"?t+"":t,n);var Fl=Cg((pG,Ad)=>{Ad.exports={}});var ml={};Ge(ml,{Any:()=>$t,Argument:()=>ri,Array:()=>fr,AsyncIterator:()=>hr,Awaited:()=>Or,BigInt:()=>br,Boolean:()=>En,Capitalize:()=>Si,Clone:()=>ne,CloneRest:()=>Rg,CloneType:()=>qr,Composite:()=>ui,Const:()=>di,Constructor:()=>gr,ConstructorParameters:()=>fi,CreateType:()=>h,Date:()=>$n,Enum:()=>hi,Exclude:()=>Cr,ExcludeFromMappedResult:()=>Jc,ExcludeFromTemplateLiteral:()=>Wc,Extends:()=>wr,ExtendsCheck:()=>Ir,ExtendsFromMappedKey:()=>Hc,ExtendsFromMappedResult:()=>zc,ExtendsResolverError:()=>qa,ExtendsResult:()=>y,ExtendsUndefinedCheck:()=>Qr,Extract:()=>Pr,ExtractFromMappedResult:()=>Xc,ExtractFromTemplateLiteral:()=>Yc,FormatRegistry:()=>wt,FromTypes:()=>po,Function:()=>at,Hint:()=>Ue,Increment:()=>sy,Index:()=>Ut,IndexFromComputed:()=>ob,IndexFromMappedKey:()=>jc,IndexFromMappedResult:()=>vc,IndexFromPropertyKey:()=>$c,IndexFromPropertyKeys:()=>co,IndexPropertyKeys:()=>Me,InstanceType:()=>gi,Instantiate:()=>xi,Integer:()=>Oi,Intersect:()=>Se,IntersectEvaluated:()=>si,Intrinsic:()=>At,IntrinsicFromMappedKey:()=>el,IsTemplateLiteralExpressionFinite:()=>Xr,IsTemplateLiteralFinite:()=>ai,Iterator:()=>xr,JavaScriptTypeBuilder:()=>Xa,JsonTypeBuilder:()=>mo,KeyOf:()=>Sr,KeyOfFromMappedResult:()=>Mc,KeyOfPattern:()=>vn,KeyOfPropertyEntries:()=>mi,KeyOfPropertyKeys:()=>_e,KeyOfPropertyKeysToRest:()=>ku,Kind:()=>g,KindGuard:()=>vt,Literal:()=>v,Lowercase:()=>Ii,Mapped:()=>li,MappedFunctionReturnType:()=>vu,MappedKey:()=>Ty,MappedResult:()=>G,Module:()=>Ti,Never:()=>R,Not:()=>Li,Null:()=>jn,Number:()=>De,Object:()=>V,Omit:()=>Dt,OmitFromMappedKey:()=>nl,OmitFromMappedResult:()=>tl,Optional:()=>Oe,OptionalFromMappedResult:()=>kc,OptionalKind:()=>we,Parameters:()=>Ai,Partial:()=>Tr,PartialFromMappedResult:()=>sl,PatternBoolean:()=>ka,PatternBooleanExact:()=>cy,PatternNever:()=>Cu,PatternNeverExact:()=>Tc,PatternNumber:()=>oo,PatternNumberExact:()=>ur,PatternString:()=>Da,PatternStringExact:()=>dr,Pick:()=>Mt,PickFromMappedKey:()=>al,PickFromMappedResult:()=>ol,Promise:()=>Fn,Readonly:()=>Re,ReadonlyFromMappedResult:()=>Uc,ReadonlyKind:()=>gt,ReadonlyOptional:()=>Mn,Record:()=>_n,RecordKey:()=>Qc,RecordPattern:()=>yi,RecordValue:()=>bi,Recursive:()=>Ni,Ref:()=>st,RegExp:()=>Ei,Required:()=>Lr,RequiredFromMappedResult:()=>cl,Rest:()=>Ri,ReturnType:()=>Fi,SetComplement:()=>wy,SetDistinct:()=>Lc,SetIncludes:()=>Ma,SetIntersect:()=>Pu,SetIntersectMany:()=>Ac,SetIsSubset:()=>Sy,SetUnion:()=>Iy,SetUnionMany:()=>Nc,String:()=>Pe,Symbol:()=>Un,TModule:()=>Wa,TemplateLiteral:()=>Rn,TemplateLiteralExpressionGenerate:()=>so,TemplateLiteralFiniteError:()=>Ba,TemplateLiteralGenerate:()=>Nn,TemplateLiteralGenerateError:()=>_a,TemplateLiteralParse:()=>Ln,TemplateLiteralParseExact:()=>An,TemplateLiteralParserError:()=>oi,TemplateLiteralPattern:()=>Ka,TemplateLiteralPatternError:()=>Va,TemplateLiteralSyntax:()=>Fc,TemplateLiteralToUnion:()=>Zr,Transform:()=>vi,TransformDecodeBuilder:()=>Ja,TransformEncodeBuilder:()=>Ya,TransformKind:()=>se,Tuple:()=>Be,Type:()=>r,TypeBoxError:()=>N,TypeGuard:()=>u,TypeRegistry:()=>Ct,Uint8Array:()=>Dn,Uncapitalize:()=>wi,Undefined:()=>kn,Union:()=>_,UnionEvaluated:()=>jt,Unknown:()=>Ye,Unsafe:()=>$i,Uppercase:()=>Ci,ValueGuard:()=>Ne,Void:()=>ji});var Ne={};Ge(Ne,{HasPropertyKey:()=>Ea,IsArray:()=>fe,IsAsyncIterator:()=>hc,IsBigInt:()=>zo,IsBoolean:()=>Ht,IsDate:()=>Cn,IsFunction:()=>gc,IsIterator:()=>yc,IsNull:()=>bc,IsNumber:()=>qe,IsObject:()=>X,IsRegExp:()=>Ho,IsString:()=>ee,IsSymbol:()=>xc,IsUint8Array:()=>lr,IsUndefined:()=>he});function Ea(e,t){return t in e}function hc(e){return X(e)&&!fe(e)&&!lr(e)&&Symbol.asyncIterator in e}function fe(e){return Array.isArray(e)}function zo(e){return typeof e=="bigint"}function Ht(e){return typeof e=="boolean"}function Cn(e){return e instanceof globalThis.Date}function gc(e){return typeof e=="function"}function yc(e){return X(e)&&!fe(e)&&!lr(e)&&Symbol.iterator in e}function bc(e){return e===null}function qe(e){return typeof e=="number"}function X(e){return typeof e=="object"&&e!==null}function Ho(e){return e instanceof globalThis.RegExp}function ee(e){return typeof e=="string"}function xc(e){return typeof e=="symbol"}function lr(e){return e instanceof globalThis.Uint8Array}function he(e){return e===void 0}function Tg(e){return e.map(t=>Ra(t))}function Lg(e){return new Date(e.getTime())}function Ag(e){return new Uint8Array(e)}function Ng(e){return new RegExp(e.source,e.flags)}function Eg(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Ra(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Ra(e[n]);return t}function Ra(e){return fe(e)?Tg(e):Cn(e)?Lg(e):lr(e)?Ag(e):Ho(e)?Ng(e):X(e)?Eg(e):e}function ne(e){return Ra(e)}function Rg(e){return e.map(t=>qr(t))}function qr(e,t){return t===void 0?ne(e):ne({...t,...e})}function Wo(e){return E(e)&&globalThis.Symbol.asyncIterator in e}function Jo(e){return E(e)&&globalThis.Symbol.iterator in e}function Fa(e){return E(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function Fg(e){return E(e)&&!L(e)&&Jt(e.constructor)&&e.constructor.name!=="Object"}function Yo(e){return e instanceof globalThis.Promise}function ve(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function Oc(e){return e instanceof globalThis.Map}function Sc(e){return e instanceof globalThis.Set}function vg(e){return e instanceof globalThis.RegExp}function it(e){return globalThis.ArrayBuffer.isView(e)}function $g(e){return e instanceof globalThis.Int8Array}function Pn(e){return e instanceof globalThis.Uint8Array}function jg(e){return e instanceof globalThis.Uint8ClampedArray}function Ug(e){return e instanceof globalThis.Int16Array}function kg(e){return e instanceof globalThis.Uint16Array}function Dg(e){return e instanceof globalThis.Int32Array}function Mg(e){return e instanceof globalThis.Uint32Array}function Bg(e){return e instanceof globalThis.Float32Array}function _g(e){return e instanceof globalThis.Float64Array}function Vg(e){return e instanceof globalThis.BigInt64Array}function Kg(e){return e instanceof globalThis.BigUint64Array}function T(e,t){return t in e}function E(e){return e!==null&&typeof e=="object"}function L(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function oe(e){return e===void 0}function Wt(e){return e===null}function Ft(e){return typeof e=="boolean"}function ie(e){return typeof e=="number"}function Xo(e){return globalThis.Number.isInteger(e)}function ht(e){return typeof e=="bigint"}function Y(e){return typeof e=="string"}function Jt(e){return typeof e=="function"}function Yt(e){return typeof e=="symbol"}function ze(e){return ht(e)||Ft(e)||Wt(e)||ie(e)||Y(e)||Yt(e)||oe(e)}var ge;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(s,c){return e.ExactOptionalPropertyTypes?c in s:s[c]!==void 0}e.IsExactOptionalProperty=t;function n(s){let c=E(s);return e.AllowArrayObject?c:c&&!L(s)}e.IsObjectLike=n;function o(s){return n(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=o;function i(s){return e.AllowNaN?ie(s):Number.isFinite(s)}e.IsNumberLike=i;function a(s){let c=oe(s);return e.AllowNullVoid?c||s===null:c}e.IsVoidLike=a})(ge||(ge={}));function Gg(e){return globalThis.Object.freeze(e).map(t=>Zo(t))}function qg(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Zo(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Zo(e[n]);return globalThis.Object.freeze(t)}function Zo(e){return fe(e)?Gg(e):Cn(e)?e:lr(e)?e:Ho(e)?e:X(e)?qg(e):e}function h(e,t){let n=t!==void 0?{...t,...e}:e;switch(ge.InstanceMode){case"freeze":return Zo(n);case"clone":return ne(n);default:return n}}var N=class extends Error{constructor(t){super(t)}};var vt={};Ge(vt,{IsAny:()=>va,IsArgument:()=>$a,IsArray:()=>yt,IsAsyncIterator:()=>zr,IsBigInt:()=>Hr,IsBoolean:()=>Xt,IsComputed:()=>bt,IsConstructor:()=>xt,IsDate:()=>Nm,IsFunction:()=>Ot,IsImport:()=>zg,IsInteger:()=>St,IsIntersect:()=>le,IsIterator:()=>Wr,IsKind:()=>mr,IsKindOf:()=>j,IsLiteral:()=>Ee,IsLiteralBoolean:()=>Yg,IsLiteralNumber:()=>Jg,IsLiteralString:()=>Wg,IsLiteralValue:()=>Qo,IsMappedKey:()=>He,IsMappedResult:()=>ae,IsNever:()=>pr,IsNot:()=>Em,IsNull:()=>ro,IsNumber:()=>It,IsObject:()=>de,IsOptional:()=>ke,IsPromise:()=>Jr,IsProperties:()=>Hg,IsReadonly:()=>Tn,IsRecord:()=>Yr,IsRecursive:()=>Xg,IsRef:()=>me,IsRegExp:()=>ja,IsSchema:()=>ce,IsString:()=>Zt,IsSymbol:()=>no,IsTemplateLiteral:()=>We,IsThis:()=>Rm,IsTransform:()=>z,IsTuple:()=>Je,IsUint8Array:()=>Fm,IsUndefined:()=>Qt,IsUnion:()=>B,IsUnknown:()=>vm,IsUnsafe:()=>$m,IsVoid:()=>jm});var se=Symbol.for("TypeBox.Transform"),gt=Symbol.for("TypeBox.Readonly"),we=Symbol.for("TypeBox.Optional"),Ue=Symbol.for("TypeBox.Hint"),g=Symbol.for("TypeBox.Kind");function Tn(e){return X(e)&&e[gt]==="Readonly"}function ke(e){return X(e)&&e[we]==="Optional"}function va(e){return j(e,"Any")}function $a(e){return j(e,"Argument")}function yt(e){return j(e,"Array")}function zr(e){return j(e,"AsyncIterator")}function Hr(e){return j(e,"BigInt")}function Xt(e){return j(e,"Boolean")}function bt(e){return j(e,"Computed")}function xt(e){return j(e,"Constructor")}function Nm(e){return j(e,"Date")}function Ot(e){return j(e,"Function")}function zg(e){return j(e,"Import")}function St(e){return j(e,"Integer")}function Hg(e){return X(e)}function le(e){return j(e,"Intersect")}function Wr(e){return j(e,"Iterator")}function j(e,t){return X(e)&&g in e&&e[g]===t}function Wg(e){return Ee(e)&&ee(e.const)}function Jg(e){return Ee(e)&&qe(e.const)}function Yg(e){return Ee(e)&&Ht(e.const)}function Qo(e){return Ht(e)||qe(e)||ee(e)}function Ee(e){return j(e,"Literal")}function He(e){return j(e,"MappedKey")}function ae(e){return j(e,"MappedResult")}function pr(e){return j(e,"Never")}function Em(e){return j(e,"Not")}function ro(e){return j(e,"Null")}function It(e){return j(e,"Number")}function de(e){return j(e,"Object")}function Jr(e){return j(e,"Promise")}function Yr(e){return j(e,"Record")}function Xg(e){return X(e)&&Ue in e&&e[Ue]==="Recursive"}function me(e){return j(e,"Ref")}function ja(e){return j(e,"RegExp")}function Zt(e){return j(e,"String")}function no(e){return j(e,"Symbol")}function We(e){return j(e,"TemplateLiteral")}function Rm(e){return j(e,"This")}function z(e){return X(e)&&se in e}function Je(e){return j(e,"Tuple")}function Qt(e){return j(e,"Undefined")}function B(e){return j(e,"Union")}function Fm(e){return j(e,"Uint8Array")}function vm(e){return j(e,"Unknown")}function $m(e){return j(e,"Unsafe")}function jm(e){return j(e,"Void")}function mr(e){return X(e)&&g in e&&ee(e[g])}function ce(e){return va(e)||$a(e)||yt(e)||Xt(e)||Hr(e)||zr(e)||bt(e)||xt(e)||Nm(e)||Ot(e)||St(e)||le(e)||Wr(e)||Ee(e)||He(e)||ae(e)||pr(e)||Em(e)||ro(e)||It(e)||de(e)||Jr(e)||Yr(e)||me(e)||ja(e)||Zt(e)||no(e)||We(e)||Rm(e)||Je(e)||Qt(e)||B(e)||Fm(e)||vm(e)||$m(e)||jm(e)||mr(e)}var u={};Ge(u,{IsAny:()=>Mm,IsArgument:()=>Bm,IsArray:()=>_m,IsAsyncIterator:()=>Vm,IsBigInt:()=>Km,IsBoolean:()=>Gm,IsComputed:()=>qm,IsConstructor:()=>zm,IsDate:()=>Hm,IsFunction:()=>Wm,IsImport:()=>ny,IsInteger:()=>Jm,IsIntersect:()=>Ym,IsIterator:()=>Xm,IsKind:()=>wu,IsKindOf:()=>U,IsLiteral:()=>ti,IsLiteralBoolean:()=>oy,IsLiteralNumber:()=>Qm,IsLiteralString:()=>Zm,IsLiteralValue:()=>eu,IsMappedKey:()=>tu,IsMappedResult:()=>ru,IsNever:()=>nu,IsNot:()=>ou,IsNull:()=>iu,IsNumber:()=>au,IsObject:()=>su,IsOptional:()=>ry,IsPromise:()=>cu,IsProperties:()=>Ua,IsReadonly:()=>ty,IsRecord:()=>lu,IsRecursive:()=>iy,IsRef:()=>pu,IsRegExp:()=>mu,IsSchema:()=>Ce,IsString:()=>uu,IsSymbol:()=>du,IsTemplateLiteral:()=>fu,IsThis:()=>hu,IsTransform:()=>gu,IsTuple:()=>yu,IsUint8Array:()=>xu,IsUndefined:()=>bu,IsUnion:()=>Pc,IsUnionLiteral:()=>ay,IsUnknown:()=>Ou,IsUnsafe:()=>Su,IsVoid:()=>Iu,TypeGuardUnknownTypeError:()=>Ic});var Ic=class extends N{},Zg=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Um(e){try{return new RegExp(e),!0}catch{return!1}}function wc(e){if(!ee(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function km(e){return Cc(e)||Ce(e)}function ei(e){return he(e)||zo(e)}function te(e){return he(e)||qe(e)}function Cc(e){return he(e)||Ht(e)}function Z(e){return he(e)||ee(e)}function Qg(e){return he(e)||ee(e)&&wc(e)&&Um(e)}function ey(e){return he(e)||ee(e)&&wc(e)}function Dm(e){return he(e)||Ce(e)}function ty(e){return X(e)&&e[gt]==="Readonly"}function ry(e){return X(e)&&e[we]==="Optional"}function Mm(e){return U(e,"Any")&&Z(e.$id)}function Bm(e){return U(e,"Argument")&&qe(e.index)}function _m(e){return U(e,"Array")&&e.type==="array"&&Z(e.$id)&&Ce(e.items)&&te(e.minItems)&&te(e.maxItems)&&Cc(e.uniqueItems)&&Dm(e.contains)&&te(e.minContains)&&te(e.maxContains)}function Vm(e){return U(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Z(e.$id)&&Ce(e.items)}function Km(e){return U(e,"BigInt")&&e.type==="bigint"&&Z(e.$id)&&ei(e.exclusiveMaximum)&&ei(e.exclusiveMinimum)&&ei(e.maximum)&&ei(e.minimum)&&ei(e.multipleOf)}function Gm(e){return U(e,"Boolean")&&e.type==="boolean"&&Z(e.$id)}function qm(e){return U(e,"Computed")&&ee(e.target)&&fe(e.parameters)&&e.parameters.every(t=>Ce(t))}function zm(e){return U(e,"Constructor")&&e.type==="Constructor"&&Z(e.$id)&&fe(e.parameters)&&e.parameters.every(t=>Ce(t))&&Ce(e.returns)}function Hm(e){return U(e,"Date")&&e.type==="Date"&&Z(e.$id)&&te(e.exclusiveMaximumTimestamp)&&te(e.exclusiveMinimumTimestamp)&&te(e.maximumTimestamp)&&te(e.minimumTimestamp)&&te(e.multipleOfTimestamp)}function Wm(e){return U(e,"Function")&&e.type==="Function"&&Z(e.$id)&&fe(e.parameters)&&e.parameters.every(t=>Ce(t))&&Ce(e.returns)}function ny(e){return U(e,"Import")&&Ea(e,"$defs")&&X(e.$defs)&&Ua(e.$defs)&&Ea(e,"$ref")&&ee(e.$ref)&&e.$ref in e.$defs}function Jm(e){return U(e,"Integer")&&e.type==="integer"&&Z(e.$id)&&te(e.exclusiveMaximum)&&te(e.exclusiveMinimum)&&te(e.maximum)&&te(e.minimum)&&te(e.multipleOf)}function Ua(e){return X(e)&&Object.entries(e).every(([t,n])=>wc(t)&&Ce(n))}function Ym(e){return U(e,"Intersect")&&!(ee(e.type)&&e.type!=="object")&&fe(e.allOf)&&e.allOf.every(t=>Ce(t)&&!gu(t))&&Z(e.type)&&(Cc(e.unevaluatedProperties)||Dm(e.unevaluatedProperties))&&Z(e.$id)}function Xm(e){return U(e,"Iterator")&&e.type==="Iterator"&&Z(e.$id)&&Ce(e.items)}function U(e,t){return X(e)&&g in e&&e[g]===t}function Zm(e){return ti(e)&&ee(e.const)}function Qm(e){return ti(e)&&qe(e.const)}function oy(e){return ti(e)&&Ht(e.const)}function ti(e){return U(e,"Literal")&&Z(e.$id)&&eu(e.const)}function eu(e){return Ht(e)||qe(e)||ee(e)}function tu(e){return U(e,"MappedKey")&&fe(e.keys)&&e.keys.every(t=>qe(t)||ee(t))}function ru(e){return U(e,"MappedResult")&&Ua(e.properties)}function nu(e){return U(e,"Never")&&X(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function ou(e){return U(e,"Not")&&Ce(e.not)}function iu(e){return U(e,"Null")&&e.type==="null"&&Z(e.$id)}function au(e){return U(e,"Number")&&e.type==="number"&&Z(e.$id)&&te(e.exclusiveMaximum)&&te(e.exclusiveMinimum)&&te(e.maximum)&&te(e.minimum)&&te(e.multipleOf)}function su(e){return U(e,"Object")&&e.type==="object"&&Z(e.$id)&&Ua(e.properties)&&km(e.additionalProperties)&&te(e.minProperties)&&te(e.maxProperties)}function cu(e){return U(e,"Promise")&&e.type==="Promise"&&Z(e.$id)&&Ce(e.item)}function lu(e){return U(e,"Record")&&e.type==="object"&&Z(e.$id)&&km(e.additionalProperties)&&X(e.patternProperties)&&(t=>{let n=Object.getOwnPropertyNames(t.patternProperties);return n.length===1&&Um(n[0])&&X(t.patternProperties)&&Ce(t.patternProperties[n[0]])})(e)}function iy(e){return X(e)&&Ue in e&&e[Ue]==="Recursive"}function pu(e){return U(e,"Ref")&&Z(e.$id)&&ee(e.$ref)}function mu(e){return U(e,"RegExp")&&Z(e.$id)&&ee(e.source)&&ee(e.flags)&&te(e.maxLength)&&te(e.minLength)}function uu(e){return U(e,"String")&&e.type==="string"&&Z(e.$id)&&te(e.minLength)&&te(e.maxLength)&&Qg(e.pattern)&&ey(e.format)}function du(e){return U(e,"Symbol")&&e.type==="symbol"&&Z(e.$id)}function fu(e){return U(e,"TemplateLiteral")&&e.type==="string"&&ee(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function hu(e){return U(e,"This")&&Z(e.$id)&&ee(e.$ref)}function gu(e){return X(e)&&se in e}function yu(e){return U(e,"Tuple")&&e.type==="array"&&Z(e.$id)&&qe(e.minItems)&&qe(e.maxItems)&&e.minItems===e.maxItems&&(he(e.items)&&he(e.additionalItems)&&e.minItems===0||fe(e.items)&&e.items.every(t=>Ce(t)))}function bu(e){return U(e,"Undefined")&&e.type==="undefined"&&Z(e.$id)}function ay(e){return Pc(e)&&e.anyOf.every(t=>Zm(t)||Qm(t))}function Pc(e){return U(e,"Union")&&Z(e.$id)&&X(e)&&fe(e.anyOf)&&e.anyOf.every(t=>Ce(t))}function xu(e){return U(e,"Uint8Array")&&e.type==="Uint8Array"&&Z(e.$id)&&te(e.minByteLength)&&te(e.maxByteLength)}function Ou(e){return U(e,"Unknown")&&Z(e.$id)}function Su(e){return U(e,"Unsafe")}function Iu(e){return U(e,"Void")&&e.type==="void"&&Z(e.$id)}function wu(e){return X(e)&&g in e&&ee(e[g])&&!Zg.includes(e[g])}function Ce(e){return X(e)&&(Mm(e)||Bm(e)||_m(e)||Gm(e)||Km(e)||Vm(e)||qm(e)||zm(e)||Hm(e)||Wm(e)||Jm(e)||Ym(e)||Xm(e)||ti(e)||tu(e)||ru(e)||nu(e)||ou(e)||iu(e)||au(e)||su(e)||cu(e)||lu(e)||pu(e)||mu(e)||uu(e)||du(e)||fu(e)||hu(e)||yu(e)||bu(e)||Pc(e)||xu(e)||Ou(e)||Su(e)||Iu(e)||wu(e))}function sy(e){return(parseInt(e)+1).toString()}var ka="(true|false)",oo="(0|[1-9][0-9]*)",Da="(.*)",Cu="(?!.*)",cy=`^${ka}$`,ur=`^${oo}$`,dr=`^${Da}$`,Tc=`^${Cu}$`;var wt={};Ge(wt,{Clear:()=>py,Delete:()=>my,Entries:()=>ly,Get:()=>fy,Has:()=>uy,Set:()=>dy});var io=new Map;function ly(){return new Map(io)}function py(){return io.clear()}function my(e){return io.delete(e)}function uy(e){return io.has(e)}function dy(e,t){io.set(e,t)}function fy(e){return io.get(e)}var Ct={};Ge(Ct,{Clear:()=>gy,Delete:()=>yy,Entries:()=>hy,Get:()=>Oy,Has:()=>by,Set:()=>xy});var ao=new Map;function hy(){return new Map(ao)}function gy(){return ao.clear()}function yy(e){return ao.delete(e)}function by(e){return ao.has(e)}function xy(e,t){ao.set(e,t)}function Oy(e){return ao.get(e)}function Ma(e,t){return e.includes(t)}function Sy(e,t){return e.every(n=>Ma(t,n))}function Lc(e){return[...new Set(e)]}function Pu(e,t){return e.filter(n=>t.includes(n))}function Iy(e,t){return[...e,...t]}function wy(e,t){return e.filter(n=>!t.includes(n))}function Cy(e,t){return e.reduce((n,o)=>Pu(n,o),t)}function Ac(e){return e.length===1?e[0]:e.length>1?Cy(e.slice(1),e[0]):[]}function Nc(e){let t=[];for(let n of e)t.push(...n);return t}function $t(e){return h({[g]:"Any"},e)}function fr(e,t){return h({[g]:"Array",type:"array",items:e},t)}function ri(e){return h({[g]:"Argument",index:e})}function hr(e,t){return h({[g]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function re(e,t,n){return h({[g]:"Computed",target:e,parameters:t},n)}function Py(e,t){let{[t]:n,...o}=e;return o}function ue(e,t){return t.reduce((n,o)=>Py(n,o),e)}function R(e){return h({[g]:"Never",not:{}},e)}function Ty(e){return h({[g]:"MappedKey",keys:e})}function G(e){return h({[g]:"MappedResult",properties:e})}function gr(e,t,n){return h({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function at(e,t,n){return h({[g]:"Function",type:"Function",parameters:e,returns:t},n)}function ni(e,t){return h({[g]:"Union",anyOf:e},t)}function Ly(e){return e.some(t=>ke(t))}function Tu(e){return e.map(t=>ke(t)?Ay(t):t)}function Ay(e){return ue(e,[we])}function Ny(e,t){return Ly(e)?Oe(ni(Tu(e),t)):ni(Tu(e),t)}function jt(e,t){return e.length===1?h(e[0],t):e.length===0?R(t):Ny(e,t)}function _(e,t){return e.length===0?R(t):e.length===1?h(e[0],t):ni(e,t)}var oi=class extends N{};function Ey(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Ec(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function yr(e,t){return Ec(e,t,"(")}function ii(e,t){return Ec(e,t,")")}function Lu(e,t){return Ec(e,t,"|")}function Ry(e){if(!(yr(e,0)&&ii(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(yr(e,n)&&(t+=1),ii(e,n)&&(t-=1),t===0&&n!==e.length-1)return!1;return!0}function Fy(e){return e.slice(1,e.length-1)}function vy(e){let t=0;for(let n=0;n<e.length;n++)if(yr(e,n)&&(t+=1),ii(e,n)&&(t-=1),Lu(e,n)&&t===0)return!0;return!1}function $y(e){for(let t=0;t<e.length;t++)if(yr(e,t))return!0;return!1}function jy(e){let[t,n]=[0,0],o=[];for(let a=0;a<e.length;a++)if(yr(e,a)&&(t+=1),ii(e,a)&&(t-=1),Lu(e,a)&&t===0){let s=e.slice(n,a);s.length>0&&o.push(Ln(s)),n=a+1}let i=e.slice(n);return i.length>0&&o.push(Ln(i)),o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"or",expr:o}}function Uy(e){function t(i,a){if(!yr(i,a))throw new oi("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<i.length;c++)if(yr(i,c)&&(s+=1),ii(i,c)&&(s-=1),s===0)return[a,c];throw new oi("TemplateLiteralParser: Unclosed group parens in expression")}function n(i,a){for(let s=a;s<i.length;s++)if(yr(i,s))return[a,s];return[a,i.length]}let o=[];for(let i=0;i<e.length;i++)if(yr(e,i)){let[a,s]=t(e,i),c=e.slice(a,s+1);o.push(Ln(c)),i=s}else{let[a,s]=n(e,i),c=e.slice(a,s);c.length>0&&o.push(Ln(c)),i=s-1}return o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"and",expr:o}}function Ln(e){return Ry(e)?Ln(Fy(e)):vy(e)?jy(e):$y(e)?Uy(e):{type:"const",const:Ey(e)}}function An(e){return Ln(e.slice(1,e.length-1))}var Ba=class extends N{};function ky(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function Dy(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function My(e){return e.type==="const"&&e.const===".*"}function Xr(e){return ky(e)||My(e)?!1:Dy(e)?!0:e.type==="and"?e.expr.every(t=>Xr(t)):e.type==="or"?e.expr.every(t=>Xr(t)):e.type==="const"?!0:(()=>{throw new Ba("Unknown expression type")})()}function ai(e){let t=An(e.pattern);return Xr(t)}var _a=class extends N{};function*Au(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of Au(e.slice(1)))yield`${t}${n}`}function*By(e){return yield*Au(e.expr.map(t=>[...so(t)]))}function*_y(e){for(let t of e.expr)yield*so(t)}function*Vy(e){return yield e.const}function*so(e){return e.type==="and"?yield*By(e):e.type==="or"?yield*_y(e):e.type==="const"?yield*Vy(e):(()=>{throw new _a("Unknown expression")})()}function Nn(e){let t=An(e.pattern);return Xr(t)?[...so(t)]:[]}function v(e,t){return h({[g]:"Literal",const:e,type:typeof e},t)}function En(e){return h({[g]:"Boolean",type:"boolean"},e)}function br(e){return h({[g]:"BigInt",type:"bigint"},e)}function De(e){return h({[g]:"Number",type:"number"},e)}function Pe(e){return h({[g]:"String",type:"string"},e)}function*Ky(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield En():t==="number"?yield De():t==="bigint"?yield br():t==="string"?yield Pe():yield(()=>{let n=t.split("|").map(o=>v(o.trim()));return n.length===0?R():n.length===1?n[0]:jt(n)})()}function*Gy(e){if(e[1]!=="{"){let t=v("$"),n=Rc(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let n=Ky(e.slice(2,t)),o=Rc(e.slice(t+1));return yield*[...n,...o]}yield v(e)}function*Rc(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let n=v(e.slice(0,t)),o=Gy(e.slice(t));return yield*[n,...o]}yield v(e)}function Fc(e){return[...Rc(e)]}var Va=class extends N{};function qy(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Nu(e,t){return We(e)?e.pattern.slice(1,e.pattern.length-1):B(e)?`(${e.anyOf.map(n=>Nu(n,t)).join("|")})`:It(e)?`${t}${oo}`:St(e)?`${t}${oo}`:Hr(e)?`${t}${oo}`:Zt(e)?`${t}${Da}`:Ee(e)?`${t}${qy(e.const.toString())}`:Xt(e)?`${t}${ka}`:(()=>{throw new Va(`Unexpected Kind \'${e[g]}\'`)})()}function Ka(e){return`^${e.map(t=>Nu(t,"")).join("")}$`}function Zr(e){let n=Nn(e).map(o=>v(o));return jt(n)}function Rn(e,t){let n=ee(e)?Ka(Fc(e)):Ka(e);return h({[g]:"TemplateLiteral",type:"string",pattern:n},t)}function zy(e){return Nn(e).map(n=>n.toString())}function Hy(e){let t=[];for(let n of e)t.push(...Me(n));return t}function Wy(e){return[e.toString()]}function Me(e){return[...new Set(We(e)?zy(e):B(e)?Hy(e.anyOf):Ee(e)?Wy(e.const):It(e)?["[number]"]:St(e)?["[number]"]:[])]}function Jy(e,t,n){let o={};for(let i of Object.getOwnPropertyNames(t))o[i]=Ut(e,Me(t[i]),n);return o}function Yy(e,t,n){return Jy(e,t.properties,n)}function vc(e,t,n){let o=Yy(e,t,n);return G(o)}function Ru(e,t){return e.map(n=>$c(n,t))}function Xy(e){return e.filter(t=>!pr(t))}function Zy(e,t){return si(Xy(Ru(e,t)))}function Qy(e){return e.some(t=>pr(t))?[]:e}function eb(e,t){return jt(Qy(Ru(e,t)))}function tb(e,t){return t in e?e[t]:t==="[number]"?jt(e):R()}function rb(e,t){return t==="[number]"?e:R()}function nb(e,t){return t in e?e[t]:R()}function $c(e,t){return le(e)?Zy(e.allOf,t):B(e)?eb(e.anyOf,t):Je(e)?tb(e.items??[],t):yt(e)?rb(e.items,t):de(e)?nb(e.properties,t):R()}function co(e,t){return t.map(n=>$c(e,n))}function Eu(e,t){return jt(co(e,t))}function ob(e,t){return re("Index",[e,t])}function Ut(e,t,n){if(me(e)||me(t)){let o="Index types using Ref parameters require both Type and Key to be of TSchema";if(!ce(e)||!ce(t))throw new N(o);return re("Index",[e,t])}return ae(t)?vc(e,t,n):He(t)?jc(e,t,n):h(ce(t)?Eu(e,Me(t)):Eu(e,t),n)}function ib(e,t,n){return{[t]:Ut(e,[t],ne(n))}}function ab(e,t,n){return t.reduce((o,i)=>({...o,...ib(e,i,n)}),{})}function sb(e,t,n){return ab(e,t.keys,n)}function jc(e,t,n){let o=sb(e,t,n);return G(o)}function xr(e,t){return h({[g]:"Iterator",type:"Iterator",items:e},t)}function cb(e){let t=[];for(let n in e)ke(e[n])||t.push(n);return t}function lb(e,t){let n=cb(e),o=n.length>0?{[g]:"Object",type:"object",properties:e,required:n}:{[g]:"Object",type:"object",properties:e};return h(o,t)}var V=lb;function Fn(e,t){return h({[g]:"Promise",type:"Promise",item:e},t)}function pb(e){return h(ue(e,[gt]))}function mb(e){return h({...e,[gt]:"Readonly"})}function ub(e,t){return t===!1?pb(e):mb(e)}function Re(e,t){let n=t??!0;return ae(e)?Uc(e,n):ub(e,n)}function db(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Re(e[o],t);return n}function fb(e,t){return db(e.properties,t)}function Uc(e,t){let n=fb(e,t);return G(n)}function Be(e,t){return h(e.length>0?{[g]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[g]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function Fu(e,t){return e in t?Pt(e,t[e]):G(t)}function hb(e){return{[e]:v(e)}}function gb(e){let t={};for(let n of e)t[n]=v(n);return t}function yb(e,t){return Ma(t,e)?hb(e):gb(t)}function bb(e,t){let n=yb(e,t);return Fu(e,n)}function ci(e,t){return t.map(n=>Pt(e,n))}function xb(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=Pt(e,t[o]);return n}function Pt(e,t){let n={...t};return ke(t)?Oe(Pt(e,ue(t,[we]))):Tn(t)?Re(Pt(e,ue(t,[gt]))):ae(t)?Fu(e,t.properties):He(t)?bb(e,t.keys):xt(t)?gr(ci(e,t.parameters),Pt(e,t.returns),n):Ot(t)?at(ci(e,t.parameters),Pt(e,t.returns),n):zr(t)?hr(Pt(e,t.items),n):Wr(t)?xr(Pt(e,t.items),n):le(t)?Se(ci(e,t.allOf),n):B(t)?_(ci(e,t.anyOf),n):Je(t)?Be(ci(e,t.items??[]),n):de(t)?V(xb(e,t.properties),n):yt(t)?fr(Pt(e,t.items),n):Jr(t)?Fn(Pt(e,t.item),n):t}function vu(e,t){let n={};for(let o of e)n[o]=Pt(o,t);return n}function li(e,t,n){let o=ce(e)?Me(e):e,i=t({[g]:"MappedKey",keys:o}),a=vu(o,i);return V(a,n)}function Ob(e){return h(ue(e,[we]))}function Sb(e){return h({...e,[we]:"Optional"})}function Ib(e,t){return t===!1?Ob(e):Sb(e)}function Oe(e,t){let n=t??!0;return ae(e)?kc(e,n):Ib(e,n)}function wb(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Oe(e[o],t);return n}function Cb(e,t){return wb(e.properties,t)}function kc(e,t){let n=Cb(e,t);return G(n)}function pi(e,t={}){let n=e.every(i=>de(i)),o=ce(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return h(t.unevaluatedProperties===!1||ce(t.unevaluatedProperties)||n?{...o,[g]:"Intersect",type:"object",allOf:e}:{...o,[g]:"Intersect",allOf:e},t)}function Pb(e){return e.every(t=>ke(t))}function Tb(e){return ue(e,[we])}function $u(e){return e.map(t=>ke(t)?Tb(t):t)}function Lb(e,t){return Pb(e)?Oe(pi($u(e),t)):pi($u(e),t)}function si(e,t={}){if(e.length===1)return h(e[0],t);if(e.length===0)return R(t);if(e.some(n=>z(n)))throw new Error("Cannot intersect transform types");return Lb(e,t)}function Se(e,t){if(e.length===1)return h(e[0],t);if(e.length===0)return R(t);if(e.some(n=>z(n)))throw new Error("Cannot intersect transform types");return pi(e,t)}function st(...e){let[t,n]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new N("Ref: $ref must be a string");return h({[g]:"Ref",$ref:t},n)}function Ab(e,t){return re("Awaited",[re(e,t)])}function Nb(e){return re("Awaited",[st(e)])}function Eb(e){return Se(ju(e))}function Rb(e){return _(ju(e))}function Fb(e){return Or(e)}function ju(e){return e.map(t=>Or(t))}function Or(e,t){return h(bt(e)?Ab(e.target,e.parameters):le(e)?Eb(e.allOf):B(e)?Rb(e.anyOf):Jr(e)?Fb(e.item):me(e)?Nb(e.$ref):e,t)}function Uu(e){let t=[];for(let n of e)t.push(_e(n));return t}function vb(e){let t=Uu(e);return Nc(t)}function $b(e){let t=Uu(e);return Ac(t)}function jb(e){return e.map((t,n)=>n.toString())}function Ub(e){return["[number]"]}function kb(e){return globalThis.Object.getOwnPropertyNames(e)}function Db(e){return Dc?globalThis.Object.getOwnPropertyNames(e).map(n=>n[0]==="^"&&n[n.length-1]==="$"?n.slice(1,n.length-1):n):[]}function _e(e){return le(e)?vb(e.allOf):B(e)?$b(e.anyOf):Je(e)?jb(e.items??[]):yt(e)?Ub(e.items):de(e)?kb(e.properties):Yr(e)?Db(e.patternProperties):[]}var Dc=!1;function vn(e){Dc=!0;let t=_e(e);return Dc=!1,`^(${t.map(o=>`(${o})`).join("|")})$`}function Mb(e,t){return re("KeyOf",[re(e,t)])}function Bb(e){return re("KeyOf",[st(e)])}function _b(e,t){let n=_e(e),o=ku(n),i=jt(o);return h(i,t)}function ku(e){return e.map(t=>t==="[number]"?De():v(t))}function Sr(e,t){return bt(e)?Mb(e.target,e.parameters):me(e)?Bb(e.$ref):ae(e)?Mc(e,t):_b(e,t)}function Vb(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Sr(e[o],ne(t));return n}function Kb(e,t){return Vb(e.properties,t)}function Mc(e,t){let n=Kb(e,t);return G(n)}function mi(e){let t=_e(e),n=co(e,t);return t.map((o,i)=>[t[i],n[i]])}function Gb(e){let t=[];for(let n of e)t.push(..._e(n));return Lc(t)}function qb(e){return e.filter(t=>!pr(t))}function zb(e,t){let n=[];for(let o of e)n.push(...co(o,[t]));return qb(n)}function Hb(e,t){let n={};for(let o of t)n[o]=si(zb(e,o));return n}function ui(e,t){let n=Gb(e),o=Hb(e,n);return V(o,t)}function $n(e){return h({[g]:"Date",type:"Date"},e)}function jn(e){return h({[g]:"Null",type:"null"},e)}function Un(e){return h({[g]:"Symbol",type:"symbol"},e)}function kn(e){return h({[g]:"Undefined",type:"undefined"},e)}function Dn(e){return h({[g]:"Uint8Array",type:"Uint8Array"},e)}function Ye(e){return h({[g]:"Unknown"},e)}function Wb(e){return e.map(t=>Bc(t,!1))}function Jb(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Re(Bc(e[n],!1));return t}function Ga(e,t){return t===!0?e:Re(e)}function Bc(e,t){return hc(e)?Ga($t(),t):yc(e)?Ga($t(),t):fe(e)?Re(Be(Wb(e))):lr(e)?Dn():Cn(e)?$n():X(e)?Ga(V(Jb(e)),t):gc(e)?Ga(at([],Ye()),t):he(e)?kn():bc(e)?jn():xc(e)?Un():zo(e)?br():qe(e)?v(e):Ht(e)?v(e):ee(e)?v(e):V({})}function di(e,t){return h(Bc(e,!0),t)}function fi(e,t){return xt(e)?Be(e.parameters,t):R(t)}function hi(e,t){if(he(e))throw new Error("Enum undefined or empty");let n=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),i=[...new Set(n)].map(a=>v(a));return _(i,{...t,[Ue]:"Enum"})}var qa=class extends N{},y;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(y||(y={}));function Tt(e){return e===y.False?e:y.True}function lo(e){throw new qa(e)}function ye(e){return u.IsNever(e)||u.IsIntersect(e)||u.IsUnion(e)||u.IsUnknown(e)||u.IsAny(e)}function be(e,t){return u.IsNever(t)?Gu(e,t):u.IsIntersect(t)?za(e,t):u.IsUnion(t)?qc(e,t):u.IsUnknown(t)?Wu(e,t):u.IsAny(t)?Gc(e,t):lo("StructuralRight")}function Gc(e,t){return y.True}function Yb(e,t){return u.IsIntersect(t)?za(e,t):u.IsUnion(t)&&t.anyOf.some(n=>u.IsAny(n)||u.IsUnknown(n))?y.True:u.IsUnion(t)?y.Union:u.IsUnknown(t)||u.IsAny(t)?y.True:y.Union}function Xb(e,t){return u.IsUnknown(e)?y.False:u.IsAny(e)?y.Union:u.IsNever(e)?y.True:y.False}function Zb(e,t){return u.IsObject(t)&&Ha(t)?y.True:ye(t)?be(e,t):u.IsArray(t)?Tt(Q(e.items,t.items)):y.False}function Qb(e,t){return ye(t)?be(e,t):u.IsAsyncIterator(t)?Tt(Q(e.items,t.items)):y.False}function ex(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsBigInt(t)?y.True:y.False}function Vu(e,t){return u.IsLiteralBoolean(e)||u.IsBoolean(e)?y.True:y.False}function tx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsBoolean(t)?y.True:y.False}function rx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsConstructor(t)?e.parameters.length>t.parameters.length?y.False:e.parameters.every((n,o)=>Tt(Q(t.parameters[o],n))===y.True)?Tt(Q(e.returns,t.returns)):y.False:y.False}function nx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsDate(t)?y.True:y.False}function ox(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsFunction(t)?e.parameters.length>t.parameters.length?y.False:e.parameters.every((n,o)=>Tt(Q(t.parameters[o],n))===y.True)?Tt(Q(e.returns,t.returns)):y.False:y.False}function Ku(e,t){return u.IsLiteral(e)&&Ne.IsNumber(e.const)||u.IsNumber(e)||u.IsInteger(e)?y.True:y.False}function ix(e,t){return u.IsInteger(t)||u.IsNumber(t)?y.True:ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):y.False}function za(e,t){return t.allOf.every(n=>Q(e,n)===y.True)?y.True:y.False}function ax(e,t){return e.allOf.some(n=>Q(n,t)===y.True)?y.True:y.False}function sx(e,t){return ye(t)?be(e,t):u.IsIterator(t)?Tt(Q(e.items,t.items)):y.False}function cx(e,t){return u.IsLiteral(t)&&t.const===e.const?y.True:ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsString(t)?Hu(e,t):u.IsNumber(t)?qu(e,t):u.IsInteger(t)?Ku(e,t):u.IsBoolean(t)?Vu(e,t):y.False}function Gu(e,t){return y.False}function lx(e,t){return y.True}function Du(e){let[t,n]=[e,0];for(;u.IsNot(t);)t=t.not,n+=1;return n%2===0?t:Ye()}function px(e,t){return u.IsNot(e)?Q(Du(e),t):u.IsNot(t)?Q(e,Du(t)):lo("Invalid fallthrough for Not")}function mx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsNull(t)?y.True:y.False}function qu(e,t){return u.IsLiteralNumber(e)||u.IsNumber(e)||u.IsInteger(e)?y.True:y.False}function ux(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsInteger(t)||u.IsNumber(t)?y.True:y.False}function Xe(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function Mu(e){return Ha(e)}function Bu(e){return Xe(e,0)||Xe(e,1)&&"description"in e.properties&&u.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(u.IsString(e.properties.description.anyOf[0])&&u.IsUndefined(e.properties.description.anyOf[1])||u.IsString(e.properties.description.anyOf[1])&&u.IsUndefined(e.properties.description.anyOf[0]))}function _c(e){return Xe(e,0)}function _u(e){return Xe(e,0)}function dx(e){return Xe(e,0)}function fx(e){return Xe(e,0)}function hx(e){return Ha(e)}function gx(e){let t=De();return Xe(e,0)||Xe(e,1)&&"length"in e.properties&&Tt(Q(e.properties.length,t))===y.True}function yx(e){return Xe(e,0)}function Ha(e){let t=De();return Xe(e,0)||Xe(e,1)&&"length"in e.properties&&Tt(Q(e.properties.length,t))===y.True}function bx(e){let t=at([$t()],$t());return Xe(e,0)||Xe(e,1)&&"then"in e.properties&&Tt(Q(e.properties.then,t))===y.True}function zu(e,t){return Q(e,t)===y.False||u.IsOptional(e)&&!u.IsOptional(t)?y.False:y.True}function $e(e,t){return u.IsUnknown(e)?y.False:u.IsAny(e)?y.Union:u.IsNever(e)||u.IsLiteralString(e)&&Mu(t)||u.IsLiteralNumber(e)&&_c(t)||u.IsLiteralBoolean(e)&&_u(t)||u.IsSymbol(e)&&Bu(t)||u.IsBigInt(e)&&dx(t)||u.IsString(e)&&Mu(t)||u.IsSymbol(e)&&Bu(t)||u.IsNumber(e)&&_c(t)||u.IsInteger(e)&&_c(t)||u.IsBoolean(e)&&_u(t)||u.IsUint8Array(e)&&hx(t)||u.IsDate(e)&&fx(t)||u.IsConstructor(e)&&yx(t)||u.IsFunction(e)&&gx(t)?y.True:u.IsRecord(e)&&u.IsString(Vc(e))?t[Ue]==="Record"?y.True:y.False:u.IsRecord(e)&&u.IsNumber(Vc(e))?Xe(t,0)?y.True:y.False:y.False}function xx(e,t){return ye(t)?be(e,t):u.IsRecord(t)?Lt(e,t):u.IsObject(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!u.IsOptional(t.properties[n]))return y.False;if(u.IsOptional(t.properties[n]))return y.True;if(zu(e.properties[n],t.properties[n])===y.False)return y.False}return y.True})():y.False}function Ox(e,t){return ye(t)?be(e,t):u.IsObject(t)&&bx(t)?y.True:u.IsPromise(t)?Tt(Q(e.item,t.item)):y.False}function Vc(e){return ur in e.patternProperties?De():dr in e.patternProperties?Pe():lo("Unknown record key pattern")}function Kc(e){return ur in e.patternProperties?e.patternProperties[ur]:dr in e.patternProperties?e.patternProperties[dr]:lo("Unable to get record value schema")}function Lt(e,t){let[n,o]=[Vc(t),Kc(t)];return u.IsLiteralString(e)&&u.IsNumber(n)&&Tt(Q(e,o))===y.True?y.True:u.IsUint8Array(e)&&u.IsNumber(n)||u.IsString(e)&&u.IsNumber(n)||u.IsArray(e)&&u.IsNumber(n)?Q(e,o):u.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(zu(o,e.properties[i])===y.False)return y.False;return y.True})():y.False}function Sx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Q(Kc(e),Kc(t)):y.False}function Ix(e,t){let n=u.IsRegExp(e)?Pe():e,o=u.IsRegExp(t)?Pe():t;return Q(n,o)}function Hu(e,t){return u.IsLiteral(e)&&Ne.IsString(e.const)||u.IsString(e)?y.True:y.False}function wx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsString(t)?y.True:y.False}function Cx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsSymbol(t)?y.True:y.False}function Px(e,t){return u.IsTemplateLiteral(e)?Q(Zr(e),t):u.IsTemplateLiteral(t)?Q(e,Zr(t)):lo("Invalid fallthrough for TemplateLiteral")}function Tx(e,t){return u.IsArray(t)&&e.items!==void 0&&e.items.every(n=>Q(n,t.items)===y.True)}function Lx(e,t){return u.IsNever(e)?y.True:u.IsUnknown(e)?y.False:u.IsAny(e)?y.Union:y.False}function Ax(e,t){return ye(t)?be(e,t):u.IsObject(t)&&Ha(t)||u.IsArray(t)&&Tx(e,t)?y.True:u.IsTuple(t)?Ne.IsUndefined(e.items)&&!Ne.IsUndefined(t.items)||!Ne.IsUndefined(e.items)&&Ne.IsUndefined(t.items)?y.False:Ne.IsUndefined(e.items)&&!Ne.IsUndefined(t.items)||e.items.every((n,o)=>Q(n,t.items[o])===y.True)?y.True:y.False:y.False}function Nx(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsUint8Array(t)?y.True:y.False}function Ex(e,t){return ye(t)?be(e,t):u.IsObject(t)?$e(e,t):u.IsRecord(t)?Lt(e,t):u.IsVoid(t)?vx(e,t):u.IsUndefined(t)?y.True:y.False}function qc(e,t){return t.anyOf.some(n=>Q(e,n)===y.True)?y.True:y.False}function Rx(e,t){return e.anyOf.every(n=>Q(n,t)===y.True)?y.True:y.False}function Wu(e,t){return y.True}function Fx(e,t){return u.IsNever(t)?Gu(e,t):u.IsIntersect(t)?za(e,t):u.IsUnion(t)?qc(e,t):u.IsAny(t)?Gc(e,t):u.IsString(t)?Hu(e,t):u.IsNumber(t)?qu(e,t):u.IsInteger(t)?Ku(e,t):u.IsBoolean(t)?Vu(e,t):u.IsArray(t)?Xb(e,t):u.IsTuple(t)?Lx(e,t):u.IsObject(t)?$e(e,t):u.IsUnknown(t)?y.True:y.False}function vx(e,t){return u.IsUndefined(e)||u.IsUndefined(e)?y.True:y.False}function $x(e,t){return u.IsIntersect(t)?za(e,t):u.IsUnion(t)?qc(e,t):u.IsUnknown(t)?Wu(e,t):u.IsAny(t)?Gc(e,t):u.IsObject(t)?$e(e,t):u.IsVoid(t)?y.True:y.False}function Q(e,t){return u.IsTemplateLiteral(e)||u.IsTemplateLiteral(t)?Px(e,t):u.IsRegExp(e)||u.IsRegExp(t)?Ix(e,t):u.IsNot(e)||u.IsNot(t)?px(e,t):u.IsAny(e)?Yb(e,t):u.IsArray(e)?Zb(e,t):u.IsBigInt(e)?ex(e,t):u.IsBoolean(e)?tx(e,t):u.IsAsyncIterator(e)?Qb(e,t):u.IsConstructor(e)?rx(e,t):u.IsDate(e)?nx(e,t):u.IsFunction(e)?ox(e,t):u.IsInteger(e)?ix(e,t):u.IsIntersect(e)?ax(e,t):u.IsIterator(e)?sx(e,t):u.IsLiteral(e)?cx(e,t):u.IsNever(e)?lx(e,t):u.IsNull(e)?mx(e,t):u.IsNumber(e)?ux(e,t):u.IsObject(e)?xx(e,t):u.IsRecord(e)?Sx(e,t):u.IsString(e)?wx(e,t):u.IsSymbol(e)?Cx(e,t):u.IsTuple(e)?Ax(e,t):u.IsPromise(e)?Ox(e,t):u.IsUint8Array(e)?Nx(e,t):u.IsUndefined(e)?Ex(e,t):u.IsUnion(e)?Rx(e,t):u.IsUnknown(e)?Fx(e,t):u.IsVoid(e)?$x(e,t):lo(`Unknown left type operand \'${e[g]}\'`)}function Ir(e,t){return Q(e,t)}function jx(e,t,n,o,i){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=wr(e[s],t,n,o,ne(i));return a}function Ux(e,t,n,o,i){return jx(e.properties,t,n,o,i)}function zc(e,t,n,o,i){let a=Ux(e,t,n,o,i);return G(a)}function kx(e,t,n,o){let i=Ir(e,t);return i===y.Union?_([n,o]):i===y.True?n:o}function wr(e,t,n,o,i){return ae(e)?zc(e,t,n,o,i):He(e)?h(Hc(e,t,n,o,i)):h(kx(e,t,n,o),i)}function Dx(e,t,n,o,i){return{[e]:wr(v(e),t,n,o,ne(i))}}function Mx(e,t,n,o,i){return e.reduce((a,s)=>({...a,...Dx(s,t,n,o,i)}),{})}function Bx(e,t,n,o,i){return Mx(e.keys,t,n,o,i)}function Hc(e,t,n,o,i){let a=Bx(e,t,n,o,i);return G(a)}function _x(e){return e.allOf.every(t=>Qr(t))}function Vx(e){return e.anyOf.some(t=>Qr(t))}function Kx(e){return!Qr(e.not)}function Qr(e){return e[g]==="Intersect"?_x(e):e[g]==="Union"?Vx(e):e[g]==="Not"?Kx(e):e[g]==="Undefined"}function Wc(e,t){return Cr(Zr(e),t)}function Gx(e,t){let n=e.filter(o=>Ir(o,t)===y.False);return n.length===1?n[0]:_(n)}function Cr(e,t,n={}){return We(e)?h(Wc(e,t),n):ae(e)?h(Jc(e,t),n):h(B(e)?Gx(e.anyOf,t):Ir(e,t)!==y.False?R():e,n)}function qx(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Cr(e[o],t);return n}function zx(e,t){return qx(e.properties,t)}function Jc(e,t){let n=zx(e,t);return G(n)}function Yc(e,t){return Pr(Zr(e),t)}function Hx(e,t){let n=e.filter(o=>Ir(o,t)!==y.False);return n.length===1?n[0]:_(n)}function Pr(e,t,n){return We(e)?h(Yc(e,t),n):ae(e)?h(Xc(e,t),n):h(B(e)?Hx(e.anyOf,t):Ir(e,t)!==y.False?e:R(),n)}function Wx(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Pr(e[o],t);return n}function Jx(e,t){return Wx(e.properties,t)}function Xc(e,t){let n=Jx(e,t);return G(n)}function gi(e,t){return xt(e)?h(e.returns,t):R(t)}function Mn(e){return Re(Oe(e))}function Bn(e,t,n){return h({[g]:"Record",type:"object",patternProperties:{[e]:t}},n)}function Zc(e,t,n){let o={};for(let i of e)o[i]=t;return V(o,{...n,[Ue]:"Record"})}function Yx(e,t,n){return ai(e)?Zc(Me(e),t,n):Bn(e.pattern,t,n)}function Xx(e,t,n){return Zc(Me(_(e)),t,n)}function Zx(e,t,n){return Zc([e.toString()],t,n)}function Qx(e,t,n){return Bn(e.source,t,n)}function eO(e,t,n){let o=he(e.pattern)?dr:e.pattern;return Bn(o,t,n)}function tO(e,t,n){return Bn(dr,t,n)}function rO(e,t,n){return Bn(Tc,t,n)}function nO(e,t,n){return V({true:t,false:t},n)}function oO(e,t,n){return Bn(ur,t,n)}function iO(e,t,n){return Bn(ur,t,n)}function _n(e,t,n={}){return B(e)?Xx(e.anyOf,t,n):We(e)?Yx(e,t,n):Ee(e)?Zx(e.const,t,n):Xt(e)?nO(e,t,n):St(e)?oO(e,t,n):It(e)?iO(e,t,n):ja(e)?Qx(e,t,n):Zt(e)?eO(e,t,n):va(e)?tO(e,t,n):pr(e)?rO(e,t,n):R(n)}function yi(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function Qc(e){let t=yi(e);return t===dr?Pe():t===ur?De():Pe({pattern:t})}function bi(e){return e.patternProperties[yi(e)]}function aO(e,t){return t.parameters=po(e,t.parameters),t.returns=kt(e,t.returns),t}function sO(e,t){return t.parameters=po(e,t.parameters),t.returns=kt(e,t.returns),t}function cO(e,t){return t.allOf=po(e,t.allOf),t}function lO(e,t){return t.anyOf=po(e,t.anyOf),t}function pO(e,t){return he(t.items)||(t.items=po(e,t.items)),t}function mO(e,t){return t.items=kt(e,t.items),t}function uO(e,t){return t.items=kt(e,t.items),t}function dO(e,t){return t.items=kt(e,t.items),t}function fO(e,t){return t.item=kt(e,t.item),t}function hO(e,t){let n=xO(e,t.properties);return{...t,...V(n)}}function gO(e,t){let n=kt(e,Qc(t)),o=kt(e,bi(t)),i=_n(n,o);return{...t,...i}}function yO(e,t){return t.index in e?e[t.index]:Ye()}function bO(e,t){let n=Tn(t),o=ke(t),i=kt(e,t);return n&&o?Mn(i):n&&!o?Re(i):!n&&o?Oe(i):i}function xO(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:bO(e,t[o])}),{})}function po(e,t){return t.map(n=>kt(e,n))}function kt(e,t){return xt(t)?aO(e,t):Ot(t)?sO(e,t):le(t)?cO(e,t):B(t)?lO(e,t):Je(t)?pO(e,t):yt(t)?mO(e,t):zr(t)?uO(e,t):Wr(t)?dO(e,t):Jr(t)?fO(e,t):de(t)?hO(e,t):Yr(t)?gO(e,t):$a(t)?yO(e,t):t}function xi(e,t){return kt(t,qr(e))}function Oi(e){return h({[g]:"Integer",type:"integer"},e)}function OO(e,t,n){return{[e]:At(v(e),t,ne(n))}}function SO(e,t,n){return e.reduce((i,a)=>({...i,...OO(a,t,n)}),{})}function IO(e,t,n){return SO(e.keys,t,n)}function el(e,t,n){let o=IO(e,t,n);return G(o)}function wO(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}function CO(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}function PO(e){return e.toUpperCase()}function TO(e){return e.toLowerCase()}function LO(e,t,n){let o=An(e.pattern);if(!Xr(o))return{...e,pattern:Ju(e.pattern,t)};let s=[...so(o)].map(p=>v(p)),c=Yu(s,t),l=_(c);return Rn([l],n)}function Ju(e,t){return typeof e=="string"?t==="Uncapitalize"?wO(e):t==="Capitalize"?CO(e):t==="Uppercase"?PO(e):t==="Lowercase"?TO(e):e:e.toString()}function Yu(e,t){return e.map(n=>At(n,t))}function At(e,t,n={}){return He(e)?el(e,t,n):We(e)?LO(e,t,n):B(e)?_(Yu(e.anyOf,t),n):Ee(e)?v(Ju(e.const,t),n):h(e,n)}function Si(e,t={}){return At(e,"Capitalize",t)}function Ii(e,t={}){return At(e,"Lowercase",t)}function wi(e,t={}){return At(e,"Uncapitalize",t)}function Ci(e,t={}){return At(e,"Uppercase",t)}function AO(e,t,n){let o={};for(let i of globalThis.Object.getOwnPropertyNames(e))o[i]=Dt(e[i],t,ne(n));return o}function NO(e,t,n){return AO(e.properties,t,n)}function tl(e,t,n){let o=NO(e,t,n);return G(o)}function EO(e,t){return e.map(n=>rl(n,t))}function RO(e,t){return e.map(n=>rl(n,t))}function FO(e,t){let{[t]:n,...o}=e;return o}function vO(e,t){return t.reduce((n,o)=>FO(n,o),e)}function $O(e,t){let n=ue(e,[se,"$id","required","properties"]),o=vO(e.properties,t);return V(o,n)}function jO(e){let t=e.reduce((n,o)=>Qo(o)?[...n,v(o)]:n,[]);return _(t)}function rl(e,t){return le(e)?Se(EO(e.allOf,t)):B(e)?_(RO(e.anyOf,t)):de(e)?$O(e,t):V({})}function Dt(e,t,n){let o=fe(t)?jO(t):t,i=ce(t)?Me(t):t,a=me(e),s=me(t);return ae(e)?tl(e,i,n):He(t)?nl(e,t,n):a&&s?re("Omit",[e,o],n):!a&&s?re("Omit",[e,o],n):a&&!s?re("Omit",[e,o],n):h({...rl(e,i),...n})}function UO(e,t,n){return{[t]:Dt(e,[t],ne(n))}}function kO(e,t,n){return t.reduce((o,i)=>({...o,...UO(e,i,n)}),{})}function DO(e,t,n){return kO(e,t.keys,n)}function nl(e,t,n){let o=DO(e,t,n);return G(o)}function MO(e,t,n){let o={};for(let i of globalThis.Object.getOwnPropertyNames(e))o[i]=Mt(e[i],t,ne(n));return o}function BO(e,t,n){return MO(e.properties,t,n)}function ol(e,t,n){let o=BO(e,t,n);return G(o)}function _O(e,t){return e.map(n=>il(n,t))}function VO(e,t){return e.map(n=>il(n,t))}function KO(e,t){let n={};for(let o of t)o in e&&(n[o]=e[o]);return n}function GO(e,t){let n=ue(e,[se,"$id","required","properties"]),o=KO(e.properties,t);return V(o,n)}function qO(e){let t=e.reduce((n,o)=>Qo(o)?[...n,v(o)]:n,[]);return _(t)}function il(e,t){return le(e)?Se(_O(e.allOf,t)):B(e)?_(VO(e.anyOf,t)):de(e)?GO(e,t):V({})}function Mt(e,t,n){let o=fe(t)?qO(t):t,i=ce(t)?Me(t):t,a=me(e),s=me(t);return ae(e)?ol(e,i,n):He(t)?al(e,t,n):a&&s?re("Pick",[e,o],n):!a&&s?re("Pick",[e,o],n):a&&!s?re("Pick",[e,o],n):h({...il(e,i),...n})}function zO(e,t,n){return{[t]:Mt(e,[t],ne(n))}}function HO(e,t,n){return t.reduce((o,i)=>({...o,...zO(e,i,n)}),{})}function WO(e,t,n){return HO(e,t.keys,n)}function al(e,t,n){let o=WO(e,t,n);return G(o)}function JO(e,t){return re("Partial",[re(e,t)])}function YO(e){return re("Partial",[st(e)])}function XO(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Oe(e[n]);return t}function ZO(e){let t=ue(e,[se,"$id","required","properties"]),n=XO(e.properties);return V(n,t)}function Xu(e){return e.map(t=>Zu(t))}function Zu(e){return bt(e)?JO(e.target,e.parameters):me(e)?YO(e.$ref):le(e)?Se(Xu(e.allOf)):B(e)?_(Xu(e.anyOf)):de(e)?ZO(e):Hr(e)||Xt(e)||St(e)||Ee(e)||ro(e)||It(e)||Zt(e)||no(e)||Qt(e)?e:V({})}function Tr(e,t){return ae(e)?sl(e,t):h({...Zu(e),...t})}function QO(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Tr(e[o],ne(t));return n}function eS(e,t){return QO(e.properties,t)}function sl(e,t){let n=eS(e,t);return G(n)}function tS(e,t){return re("Required",[re(e,t)])}function rS(e){return re("Required",[st(e)])}function nS(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ue(e[n],[we]);return t}function oS(e){let t=ue(e,[se,"$id","required","properties"]),n=nS(e.properties);return V(n,t)}function Qu(e){return e.map(t=>ed(t))}function ed(e){return bt(e)?tS(e.target,e.parameters):me(e)?rS(e.$ref):le(e)?Se(Qu(e.allOf)):B(e)?_(Qu(e.anyOf)):de(e)?oS(e):Hr(e)||Xt(e)||St(e)||Ee(e)||ro(e)||It(e)||Zt(e)||no(e)||Qt(e)?e:V({})}function Lr(e,t){return ae(e)?cl(e,t):h({...ed(e),...t})}function iS(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Lr(e[o],t);return n}function aS(e,t){return iS(e.properties,t)}function cl(e,t){let n=aS(e,t);return G(n)}function sS(e,t){return t.map(n=>me(n)?ll(e,n.$ref):ct(e,n))}function ll(e,t){return t in e?me(e[t])?ll(e,e[t].$ref):ct(e,e[t]):R()}function cS(e){return Or(e[0])}function lS(e){return Ut(e[0],e[1])}function pS(e){return Sr(e[0])}function mS(e){return Tr(e[0])}function uS(e){return Dt(e[0],e[1])}function dS(e){return Mt(e[0],e[1])}function fS(e){return Lr(e[0])}function hS(e,t,n){let o=sS(e,n);return t==="Awaited"?cS(o):t==="Index"?lS(o):t==="KeyOf"?pS(o):t==="Partial"?mS(o):t==="Omit"?uS(o):t==="Pick"?dS(o):t==="Required"?fS(o):R()}function gS(e,t){return fr(ct(e,t))}function yS(e,t){return hr(ct(e,t))}function bS(e,t,n){return gr(Pi(e,t),ct(e,n))}function xS(e,t,n){return at(Pi(e,t),ct(e,n))}function OS(e,t){return Se(Pi(e,t))}function SS(e,t){return xr(ct(e,t))}function IS(e,t){return V(globalThis.Object.keys(t).reduce((n,o)=>({...n,[o]:ct(e,t[o])}),{}))}function wS(e,t){let[n,o]=[ct(e,bi(t)),yi(t)],i=qr(t);return i.patternProperties[o]=n,i}function CS(e,t){return me(t)?{...ll(e,t.$ref),[se]:t[se]}:t}function PS(e,t){return Be(Pi(e,t))}function TS(e,t){return _(Pi(e,t))}function Pi(e,t){return t.map(n=>ct(e,n))}function ct(e,t){return ke(t)?h(ct(e,ue(t,[we])),t):Tn(t)?h(ct(e,ue(t,[gt])),t):z(t)?h(CS(e,t),t):yt(t)?h(gS(e,t.items),t):zr(t)?h(yS(e,t.items),t):bt(t)?h(hS(e,t.target,t.parameters)):xt(t)?h(bS(e,t.parameters,t.returns),t):Ot(t)?h(xS(e,t.parameters,t.returns),t):le(t)?h(OS(e,t.allOf),t):Wr(t)?h(SS(e,t.items),t):de(t)?h(IS(e,t.properties),t):Yr(t)?h(wS(e,t)):Je(t)?h(PS(e,t.items||[]),t):B(t)?h(TS(e,t.anyOf),t):t}function LS(e,t){return t in e?ct(e,e[t]):R()}function td(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:LS(e,n)}),{})}var Wa=class{constructor(t){let n=td(t),o=this.WithIdentifiers(n);this.$defs=o}Import(t,n){let o={...this.$defs,[t]:h(this.$defs[t],n)};return h({[g]:"Import",$defs:o,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:{...t[o],$id:o}}),{})}};function Ti(e){return new Wa(e)}function Li(e,t){return h({[g]:"Not",not:e},t)}function Ai(e,t){return Ot(e)?Be(e.parameters,t):R()}var AS=0;function Ni(e,t={}){he(t.$id)&&(t.$id=`T${AS++}`);let n=qr(e({[g]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,h({[Ue]:"Recursive",...n},t)}function Ei(e,t){let n=ee(e)?new globalThis.RegExp(e):e;return h({[g]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}function NS(e){return le(e)?e.allOf:B(e)?e.anyOf:Je(e)?e.items??[]:[]}function Ri(e){return NS(e)}function Fi(e,t){return Ot(e)?h(e.returns,t):R(t)}var Ja=class{constructor(t){this.schema=t}Decode(t){return new Ya(this.schema,t)}},Ya=class{constructor(t,n){this.schema=t,this.decode=n}EncodeTransform(t,n){let a={Encode:s=>n[se].Encode(t(s)),Decode:s=>this.decode(n[se].Decode(s))};return{...n,[se]:a}}EncodeSchema(t,n){let o={Decode:this.decode,Encode:t};return{...n,[se]:o}}Encode(t){return z(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function vi(e){return new Ja(e)}function $i(e={}){return h({[g]:e[g]??"Unsafe"},e)}function ji(e){return h({[g]:"Void",type:"void"},e)}var mo=class{ReadonlyOptional(t){return Mn(t)}Readonly(t,n){return Re(t,n??!0)}Optional(t,n){return Oe(t,n??!0)}Any(t){return $t(t)}Array(t,n){return fr(t,n)}Boolean(t){return En(t)}Capitalize(t,n){return Si(t,n)}Composite(t,n){return ui(t,n)}Const(t,n){return di(t,n)}Enum(t,n){return hi(t,n)}Exclude(t,n,o){return Cr(t,n,o)}Extends(t,n,o,i,a){return wr(t,n,o,i,a)}Extract(t,n,o){return Pr(t,n,o)}Index(t,n,o){return Ut(t,n,o)}Integer(t){return Oi(t)}Intersect(t,n){return Se(t,n)}KeyOf(t,n){return Sr(t,n)}Literal(t,n){return v(t,n)}Lowercase(t,n){return Ii(t,n)}Mapped(t,n,o){return li(t,n,o)}Module(t){return Ti(t)}Never(t){return R(t)}Not(t,n){return Li(t,n)}Null(t){return jn(t)}Number(t){return De(t)}Object(t,n){return V(t,n)}Omit(t,n,o){return Dt(t,n,o)}Partial(t,n){return Tr(t,n)}Pick(t,n,o){return Mt(t,n,o)}Record(t,n,o){return _n(t,n,o)}Recursive(t,n){return Ni(t,n)}Ref(...t){return st(t[0],t[1])}Required(t,n){return Lr(t,n)}Rest(t){return Ri(t)}String(t){return Pe(t)}TemplateLiteral(t,n){return Rn(t,n)}Transform(t){return vi(t)}Tuple(t,n){return Be(t,n)}Uncapitalize(t,n){return wi(t,n)}Union(t,n){return _(t,n)}Unknown(t){return Ye(t)}Unsafe(t){return $i(t)}Uppercase(t,n){return Ci(t,n)}};var pl={};Ge(pl,{Any:()=>$t,Argument:()=>ri,Array:()=>fr,AsyncIterator:()=>hr,Awaited:()=>Or,BigInt:()=>br,Boolean:()=>En,Capitalize:()=>Si,Composite:()=>ui,Const:()=>di,Constructor:()=>gr,ConstructorParameters:()=>fi,Date:()=>$n,Enum:()=>hi,Exclude:()=>Cr,Extends:()=>wr,Extract:()=>Pr,Function:()=>at,Index:()=>Ut,InstanceType:()=>gi,Instantiate:()=>xi,Integer:()=>Oi,Intersect:()=>Se,Iterator:()=>xr,KeyOf:()=>Sr,Literal:()=>v,Lowercase:()=>Ii,Mapped:()=>li,Module:()=>Ti,Never:()=>R,Not:()=>Li,Null:()=>jn,Number:()=>De,Object:()=>V,Omit:()=>Dt,Optional:()=>Oe,Parameters:()=>Ai,Partial:()=>Tr,Pick:()=>Mt,Promise:()=>Fn,Readonly:()=>Re,ReadonlyOptional:()=>Mn,Record:()=>_n,Recursive:()=>Ni,Ref:()=>st,RegExp:()=>Ei,Required:()=>Lr,Rest:()=>Ri,ReturnType:()=>Fi,String:()=>Pe,Symbol:()=>Un,TemplateLiteral:()=>Rn,Transform:()=>vi,Tuple:()=>Be,Uint8Array:()=>Dn,Uncapitalize:()=>wi,Undefined:()=>kn,Union:()=>_,Unknown:()=>Ye,Unsafe:()=>$i,Uppercase:()=>Ci,Void:()=>ji});var Xa=class extends mo{Argument(t){return ri(t)}AsyncIterator(t,n){return hr(t,n)}Awaited(t,n){return Or(t,n)}BigInt(t){return br(t)}ConstructorParameters(t,n){return fi(t,n)}Constructor(t,n,o){return gr(t,n,o)}Date(t={}){return $n(t)}Function(t,n,o){return at(t,n,o)}InstanceType(t,n){return gi(t,n)}Instantiate(t,n){return xi(t,n)}Iterator(t,n){return xr(t,n)}Parameters(t,n){return Ai(t,n)}Promise(t,n){return Fn(t,n)}RegExp(t,n){return Ei(t,n)}ReturnType(t,n){return Fi(t,n)}Symbol(t){return Un(t)}Undefined(t){return kn(t)}Uint8Array(t){return Dn(t)}Void(t){return ji(t)}};var r=pl;var Tl={};Ge(Tl,{Assert:()=>Ui,AssertError:()=>ts,Cast:()=>ho,Check:()=>F,Clean:()=>Di,Clone:()=>q,Convert:()=>_i,Create:()=>Nt,Decode:()=>gl,Default:()=>zi,Delete:()=>xd,Diff:()=>xl,Edit:()=>bl,Encode:()=>Sl,Equal:()=>rn,HasPropertyKey:()=>T,HasTransform:()=>tn,Hash:()=>Vn,Insert:()=>yd,IsArray:()=>L,IsAsyncIterator:()=>Wo,IsBigInt:()=>ht,IsBigInt64Array:()=>Vg,IsBigUint64Array:()=>Kg,IsBoolean:()=>Ft,IsDate:()=>ve,IsFloat32Array:()=>Bg,IsFloat64Array:()=>_g,IsFunction:()=>Jt,IsInstanceObject:()=>Fg,IsInt16Array:()=>Ug,IsInt32Array:()=>Dg,IsInt8Array:()=>$g,IsInteger:()=>Xo,IsIterator:()=>Jo,IsMap:()=>Oc,IsNull:()=>Wt,IsNumber:()=>ie,IsObject:()=>E,IsPromise:()=>Yo,IsRegExp:()=>vg,IsSet:()=>Sc,IsStandardObject:()=>Fa,IsString:()=>Y,IsSymbol:()=>Yt,IsTypedArray:()=>it,IsUint16Array:()=>kg,IsUint32Array:()=>Mg,IsUint8Array:()=>Pn,IsUint8ClampedArray:()=>jg,IsUndefined:()=>oe,IsValueType:()=>ze,Mutate:()=>wl,Parse:()=>Pl,ParseDefault:()=>Cl,ParseError:()=>Yi,ParseRegistry:()=>ps,Patch:()=>Ol,TransformDecode:()=>Ki,TransformDecodeCheckError:()=>Vi,TransformDecodeError:()=>ns,TransformEncode:()=>qi,TransformEncodeCheckError:()=>Gi,TransformEncodeError:()=>os,Update:()=>bd,Value:()=>P,ValueCastError:()=>ki,ValueCheckUnknownTypeError:()=>Qa,ValueCreateError:()=>Ze,ValueDiffError:()=>Wi,ValueErrorIterator:()=>er,ValueErrorType:()=>f,ValueHashError:()=>Za,ValueMutateError:()=>Ji,ValuePointer:()=>Et});function ES(e){switch(e.errorType){case f.ArrayContains:return"Expected array to contain at least one matching value";case f.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case f.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case f.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case f.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case f.ArrayUniqueItems:return"Expected array elements to be unique";case f.Array:return"Expected array";case f.AsyncIterator:return"Expected AsyncIterator";case f.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case f.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case f.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case f.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case f.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case f.BigInt:return"Expected bigint";case f.Boolean:return"Expected boolean";case f.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case f.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case f.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case f.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case f.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case f.Date:return"Expected Date";case f.Function:return"Expected function";case f.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case f.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case f.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case f.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case f.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case f.Integer:return"Expected integer";case f.IntersectUnevaluatedProperties:return"Unexpected property";case f.Intersect:return"Expected all values to match";case f.Iterator:return"Expected Iterator";case f.Literal:return`Expected ${typeof e.schema.const=="string"?`\'${e.schema.const}\'`:e.schema.const}`;case f.Never:return"Never";case f.Not:return"Value should not match";case f.Null:return"Expected null";case f.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case f.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case f.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case f.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case f.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case f.Number:return"Expected number";case f.Object:return"Expected object";case f.ObjectAdditionalProperties:return"Unexpected property";case f.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case f.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case f.ObjectRequiredProperty:return"Expected required property";case f.Promise:return"Expected Promise";case f.RegExp:return"Expected string to match regular expression";case f.StringFormatUnknown:return`Unknown format \'${e.schema.format}\'`;case f.StringFormat:return`Expected string to match \'${e.schema.format}\' format`;case f.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case f.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case f.StringPattern:return`Expected string to match \'${e.schema.pattern}\'`;case f.String:return"Expected string";case f.Symbol:return"Expected symbol";case f.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case f.Tuple:return"Expected tuple";case f.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case f.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case f.Uint8Array:return"Expected Uint8Array";case f.Undefined:return"Expected undefined";case f.Union:return"Expected union value";case f.Void:return"Expected void";case f.Kind:return`Expected kind \'${e.schema[g]}\'`;default:return"Unknown error type"}}var RS=ES;function rd(){return RS}var ul=class extends N{constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function FS(e,t){let n=t.find(o=>o.$id===e.$ref);if(n===void 0)throw new ul(e);return J(n,t)}function Te(e,t){return!Y(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function J(e,t){return e[g]==="This"||e[g]==="Ref"?FS(e,t):e}var Za=class extends N{constructor(t){super("Unable to hash value"),this.value=t}},lt;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(lt||(lt={}));var uo=BigInt("14695981039346656037"),[vS,$S]=[BigInt("1099511628211"),BigInt("18446744073709551616")],jS=Array.from({length:256}).map((e,t)=>BigInt(t)),nd=new Float64Array(1),od=new DataView(nd.buffer),id=new Uint8Array(nd.buffer);function*US(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function kS(e){je(lt.Array);for(let t of e)fo(t)}function DS(e){je(lt.Boolean),je(e?1:0)}function MS(e){je(lt.BigInt),od.setBigInt64(0,e);for(let t of id)je(t)}function BS(e){je(lt.Date),fo(e.getTime())}function _S(e){je(lt.Null)}function VS(e){je(lt.Number),od.setFloat64(0,e);for(let t of id)je(t)}function KS(e){je(lt.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())fo(t),fo(e[t])}function GS(e){je(lt.String);for(let t=0;t<e.length;t++)for(let n of US(e.charCodeAt(t)))je(n)}function qS(e){je(lt.Symbol),fo(e.description)}function zS(e){je(lt.Uint8Array);for(let t=0;t<e.length;t++)je(e[t])}function HS(e){return je(lt.Undefined)}function fo(e){if(L(e))return kS(e);if(Ft(e))return DS(e);if(ht(e))return MS(e);if(ve(e))return BS(e);if(Wt(e))return _S(e);if(ie(e))return VS(e);if(E(e))return KS(e);if(Y(e))return GS(e);if(Yt(e))return qS(e);if(Pn(e))return zS(e);if(oe(e))return HS(e);throw new Za(e)}function je(e){uo=uo^jS[e],uo=uo*vS%$S}function Vn(e){return uo=BigInt("14695981039346656037"),fo(e),uo}var Qa=class extends N{constructor(t){super("Unknown type"),this.schema=t}};function WS(e){return e[g]==="Any"||e[g]==="Unknown"}function k(e){return e!==void 0}function JS(e,t,n){return!0}function YS(e,t,n){return!0}function XS(e,t,n){if(!L(n)||k(e.minItems)&&!(n.length>=e.minItems)||k(e.maxItems)&&!(n.length<=e.maxItems)||!n.every(a=>Le(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let s of n){let c=Vn(s);if(a.has(c))return!1;a.add(c)}return!0}())return!1;if(!(k(e.contains)||ie(e.minContains)||ie(e.maxContains)))return!0;let o=k(e.contains)?e.contains:R(),i=n.reduce((a,s)=>Le(o,t,s)?a+1:a,0);return!(i===0||ie(e.minContains)&&i<e.minContains||ie(e.maxContains)&&i>e.maxContains)}function ZS(e,t,n){return Wo(n)}function QS(e,t,n){return!(!ht(n)||k(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||k(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||k(e.maximum)&&!(n<=e.maximum)||k(e.minimum)&&!(n>=e.minimum)||k(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function eI(e,t,n){return Ft(n)}function tI(e,t,n){return Le(e.returns,t,n.prototype)}function rI(e,t,n){return!(!ve(n)||k(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||k(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||k(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||k(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||k(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function nI(e,t,n){return Jt(n)}function oI(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Le(i,[...t,...o],n)}function iI(e,t,n){return!(!Xo(n)||k(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||k(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||k(e.maximum)&&!(n<=e.maximum)||k(e.minimum)&&!(n>=e.minimum)||k(e.multipleOf)&&n%e.multipleOf!==0)}function aI(e,t,n){let o=e.allOf.every(i=>Le(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(vn(e)),a=Object.getOwnPropertyNames(n).every(s=>i.test(s));return o&&a}else if(ce(e.unevaluatedProperties)){let i=new RegExp(vn(e)),a=Object.getOwnPropertyNames(n).every(s=>i.test(s)||Le(e.unevaluatedProperties,t,n[s]));return o&&a}else return o}function sI(e,t,n){return Jo(n)}function cI(e,t,n){return n===e.const}function lI(e,t,n){return!1}function pI(e,t,n){return!Le(e.not,t,n)}function mI(e,t,n){return Wt(n)}function uI(e,t,n){return!(!ge.IsNumberLike(n)||k(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||k(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||k(e.minimum)&&!(n>=e.minimum)||k(e.maximum)&&!(n<=e.maximum)||k(e.multipleOf)&&n%e.multipleOf!==0)}function dI(e,t,n){if(!ge.IsObjectLike(n)||k(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||k(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let a=e.properties[i];if(e.required&&e.required.includes(i)){if(!Le(a,t,n[i])||(Qr(a)||WS(a))&&!(i in n))return!1}else if(ge.IsExactOptionalProperty(n,i)&&!Le(a,t,n[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return e.required&&e.required.length===o.length&&i.length===o.length?!0:i.every(a=>o.includes(a))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(a=>o.includes(a)||Le(e.additionalProperties,t,n[a])):!0}function fI(e,t,n){return Yo(n)}function hI(e,t,n){if(!ge.IsRecordLike(n)||k(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||k(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[o,i]=Object.entries(e.patternProperties)[0],a=new RegExp(o),s=Object.entries(n).every(([p,m])=>a.test(p)?Le(i,t,m):!0),c=typeof e.additionalProperties=="object"?Object.entries(n).every(([p,m])=>a.test(p)?!0:Le(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(p=>a.test(p)):!0;return s&&c&&l}function gI(e,t,n){return Le(J(e,t),t,n)}function yI(e,t,n){let o=new RegExp(e.source,e.flags);return k(e.minLength)&&!(n.length>=e.minLength)||k(e.maxLength)&&!(n.length<=e.maxLength)?!1:o.test(n)}function bI(e,t,n){return!Y(n)||k(e.minLength)&&!(n.length>=e.minLength)||k(e.maxLength)&&!(n.length<=e.maxLength)||k(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:k(e.format)?wt.Has(e.format)?wt.Get(e.format)(n):!1:!0}function xI(e,t,n){return Yt(n)}function OI(e,t,n){return Y(n)&&new RegExp(e.pattern).test(n)}function SI(e,t,n){return Le(J(e,t),t,n)}function II(e,t,n){if(!L(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let o=0;o<e.items.length;o++)if(!Le(e.items[o],t,n[o]))return!1;return!0}function wI(e,t,n){return oe(n)}function CI(e,t,n){return e.anyOf.some(o=>Le(o,t,n))}function PI(e,t,n){return!(!Pn(n)||k(e.maxByteLength)&&!(n.length<=e.maxByteLength)||k(e.minByteLength)&&!(n.length>=e.minByteLength))}function TI(e,t,n){return!0}function LI(e,t,n){return ge.IsVoidLike(n)}function AI(e,t,n){return Ct.Has(e[g])?Ct.Get(e[g])(e,n):!1}function Le(e,t,n){let o=k(e.$id)?Te(e,t):t,i=e;switch(i[g]){case"Any":return JS(i,o,n);case"Argument":return YS(i,o,n);case"Array":return XS(i,o,n);case"AsyncIterator":return ZS(i,o,n);case"BigInt":return QS(i,o,n);case"Boolean":return eI(i,o,n);case"Constructor":return tI(i,o,n);case"Date":return rI(i,o,n);case"Function":return nI(i,o,n);case"Import":return oI(i,o,n);case"Integer":return iI(i,o,n);case"Intersect":return aI(i,o,n);case"Iterator":return sI(i,o,n);case"Literal":return cI(i,o,n);case"Never":return lI(i,o,n);case"Not":return pI(i,o,n);case"Null":return mI(i,o,n);case"Number":return uI(i,o,n);case"Object":return dI(i,o,n);case"Promise":return fI(i,o,n);case"Record":return hI(i,o,n);case"Ref":return gI(i,o,n);case"RegExp":return yI(i,o,n);case"String":return bI(i,o,n);case"Symbol":return xI(i,o,n);case"TemplateLiteral":return OI(i,o,n);case"This":return SI(i,o,n);case"Tuple":return II(i,o,n);case"Undefined":return wI(i,o,n);case"Union":return CI(i,o,n);case"Uint8Array":return PI(i,o,n);case"Unknown":return TI(i,o,n);case"Void":return LI(i,o,n);default:if(!Ct.Has(i[g]))throw new Qa(i);return AI(i,o,n)}}function F(...e){return e.length===3?Le(e[0],e[1],e[2]):Le(e[0],[],e[1])}var f;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(f||(f={}));var dl=class extends N{constructor(t){super("Unknown type"),this.schema=t}};function Ar(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function D(e){return e!==void 0}var er=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};function S(e,t,n,o,i=[]){return{type:e,schema:t,path:n,value:o,message:rd()({errorType:e,path:n,schema:t,value:o,errors:i}),errors:i}}function*NI(e,t,n,o){}function*EI(e,t,n,o){}function*RI(e,t,n,o){if(!L(o))return yield S(f.Array,e,n,o);D(e.minItems)&&!(o.length>=e.minItems)&&(yield S(f.ArrayMinItems,e,n,o)),D(e.maxItems)&&!(o.length<=e.maxItems)&&(yield S(f.ArrayMaxItems,e,n,o));for(let s=0;s<o.length;s++)yield*Ae(e.items,t,`${n}/${s}`,o[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let c of o){let l=Vn(c);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield S(f.ArrayUniqueItems,e,n,o)),!(D(e.contains)||D(e.minContains)||D(e.maxContains)))return;let i=D(e.contains)?e.contains:R(),a=o.reduce((s,c,l)=>Ae(i,t,`${n}${l}`,c).next().done===!0?s+1:s,0);a===0&&(yield S(f.ArrayContains,e,n,o)),ie(e.minContains)&&a<e.minContains&&(yield S(f.ArrayMinContains,e,n,o)),ie(e.maxContains)&&a>e.maxContains&&(yield S(f.ArrayMaxContains,e,n,o))}function*FI(e,t,n,o){Wo(o)||(yield S(f.AsyncIterator,e,n,o))}function*vI(e,t,n,o){if(!ht(o))return yield S(f.BigInt,e,n,o);D(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield S(f.BigIntExclusiveMaximum,e,n,o)),D(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield S(f.BigIntExclusiveMinimum,e,n,o)),D(e.maximum)&&!(o<=e.maximum)&&(yield S(f.BigIntMaximum,e,n,o)),D(e.minimum)&&!(o>=e.minimum)&&(yield S(f.BigIntMinimum,e,n,o)),D(e.multipleOf)&&o%e.multipleOf!==BigInt(0)&&(yield S(f.BigIntMultipleOf,e,n,o))}function*$I(e,t,n,o){Ft(o)||(yield S(f.Boolean,e,n,o))}function*jI(e,t,n,o){yield*Ae(e.returns,t,n,o.prototype)}function*UI(e,t,n,o){if(!ve(o))return yield S(f.Date,e,n,o);D(e.exclusiveMaximumTimestamp)&&!(o.getTime()<e.exclusiveMaximumTimestamp)&&(yield S(f.DateExclusiveMaximumTimestamp,e,n,o)),D(e.exclusiveMinimumTimestamp)&&!(o.getTime()>e.exclusiveMinimumTimestamp)&&(yield S(f.DateExclusiveMinimumTimestamp,e,n,o)),D(e.maximumTimestamp)&&!(o.getTime()<=e.maximumTimestamp)&&(yield S(f.DateMaximumTimestamp,e,n,o)),D(e.minimumTimestamp)&&!(o.getTime()>=e.minimumTimestamp)&&(yield S(f.DateMinimumTimestamp,e,n,o)),D(e.multipleOfTimestamp)&&o.getTime()%e.multipleOfTimestamp!==0&&(yield S(f.DateMultipleOfTimestamp,e,n,o))}function*kI(e,t,n,o){Jt(o)||(yield S(f.Function,e,n,o))}function*DI(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Ae(a,[...t,...i],n,o)}function*MI(e,t,n,o){if(!Xo(o))return yield S(f.Integer,e,n,o);D(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield S(f.IntegerExclusiveMaximum,e,n,o)),D(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield S(f.IntegerExclusiveMinimum,e,n,o)),D(e.maximum)&&!(o<=e.maximum)&&(yield S(f.IntegerMaximum,e,n,o)),D(e.minimum)&&!(o>=e.minimum)&&(yield S(f.IntegerMinimum,e,n,o)),D(e.multipleOf)&&o%e.multipleOf!==0&&(yield S(f.IntegerMultipleOf,e,n,o))}function*BI(e,t,n,o){let i=!1;for(let a of e.allOf)for(let s of Ae(a,t,n,o))i=!0,yield s;if(i)return yield S(f.Intersect,e,n,o);if(e.unevaluatedProperties===!1){let a=new RegExp(vn(e));for(let s of Object.getOwnPropertyNames(o))a.test(s)||(yield S(f.IntersectUnevaluatedProperties,e,`${n}/${s}`,o))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(vn(e));for(let s of Object.getOwnPropertyNames(o))if(!a.test(s)){let c=Ae(e.unevaluatedProperties,t,`${n}/${s}`,o[s]).next();c.done||(yield c.value)}}}function*_I(e,t,n,o){Jo(o)||(yield S(f.Iterator,e,n,o))}function*VI(e,t,n,o){o!==e.const&&(yield S(f.Literal,e,n,o))}function*KI(e,t,n,o){yield S(f.Never,e,n,o)}function*GI(e,t,n,o){Ae(e.not,t,n,o).next().done===!0&&(yield S(f.Not,e,n,o))}function*qI(e,t,n,o){Wt(o)||(yield S(f.Null,e,n,o))}function*zI(e,t,n,o){if(!ge.IsNumberLike(o))return yield S(f.Number,e,n,o);D(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield S(f.NumberExclusiveMaximum,e,n,o)),D(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield S(f.NumberExclusiveMinimum,e,n,o)),D(e.maximum)&&!(o<=e.maximum)&&(yield S(f.NumberMaximum,e,n,o)),D(e.minimum)&&!(o>=e.minimum)&&(yield S(f.NumberMinimum,e,n,o)),D(e.multipleOf)&&o%e.multipleOf!==0&&(yield S(f.NumberMultipleOf,e,n,o))}function*HI(e,t,n,o){if(!ge.IsObjectLike(o))return yield S(f.Object,e,n,o);D(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield S(f.ObjectMinProperties,e,n,o)),D(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield S(f.ObjectMaxProperties,e,n,o));let i=Array.isArray(e.required)?e.required:[],a=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(o);for(let c of i)s.includes(c)||(yield S(f.ObjectRequiredProperty,e.properties[c],`${n}/${Ar(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield S(f.ObjectAdditionalProperties,e,`${n}/${Ar(c)}`,o[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Ae(e.additionalProperties,t,`${n}/${Ar(c)}`,o[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Ae(l,t,`${n}/${Ar(c)}`,o[c]),Qr(e)&&!(c in o)&&(yield S(f.ObjectRequiredProperty,l,`${n}/${Ar(c)}`,void 0))):ge.IsExactOptionalProperty(o,c)&&(yield*Ae(l,t,`${n}/${Ar(c)}`,o[c]))}}function*WI(e,t,n,o){Yo(o)||(yield S(f.Promise,e,n,o))}function*JI(e,t,n,o){if(!ge.IsRecordLike(o))return yield S(f.Object,e,n,o);D(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield S(f.ObjectMinProperties,e,n,o)),D(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield S(f.ObjectMaxProperties,e,n,o));let[i,a]=Object.entries(e.patternProperties)[0],s=new RegExp(i);for(let[c,l]of Object.entries(o))s.test(c)&&(yield*Ae(a,t,`${n}/${Ar(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(o))s.test(c)||(yield*Ae(e.additionalProperties,t,`${n}/${Ar(c)}`,l));if(e.additionalProperties===!1){for(let[c,l]of Object.entries(o))if(!s.test(c))return yield S(f.ObjectAdditionalProperties,e,`${n}/${Ar(c)}`,l)}}function*YI(e,t,n,o){yield*Ae(J(e,t),t,n,o)}function*XI(e,t,n,o){if(!Y(o))return yield S(f.String,e,n,o);if(D(e.minLength)&&!(o.length>=e.minLength)&&(yield S(f.StringMinLength,e,n,o)),D(e.maxLength)&&!(o.length<=e.maxLength)&&(yield S(f.StringMaxLength,e,n,o)),!new RegExp(e.source,e.flags).test(o))return yield S(f.RegExp,e,n,o)}function*ZI(e,t,n,o){if(!Y(o))return yield S(f.String,e,n,o);D(e.minLength)&&!(o.length>=e.minLength)&&(yield S(f.StringMinLength,e,n,o)),D(e.maxLength)&&!(o.length<=e.maxLength)&&(yield S(f.StringMaxLength,e,n,o)),Y(e.pattern)&&(new RegExp(e.pattern).test(o)||(yield S(f.StringPattern,e,n,o))),Y(e.format)&&(wt.Has(e.format)?wt.Get(e.format)(o)||(yield S(f.StringFormat,e,n,o)):yield S(f.StringFormatUnknown,e,n,o))}function*QI(e,t,n,o){Yt(o)||(yield S(f.Symbol,e,n,o))}function*e0(e,t,n,o){if(!Y(o))return yield S(f.String,e,n,o);new RegExp(e.pattern).test(o)||(yield S(f.StringPattern,e,n,o))}function*t0(e,t,n,o){yield*Ae(J(e,t),t,n,o)}function*r0(e,t,n,o){if(!L(o))return yield S(f.Tuple,e,n,o);if(e.items===void 0&&o.length!==0)return yield S(f.TupleLength,e,n,o);if(o.length!==e.maxItems)return yield S(f.TupleLength,e,n,o);if(e.items)for(let i=0;i<e.items.length;i++)yield*Ae(e.items[i],t,`${n}/${i}`,o[i])}function*n0(e,t,n,o){oe(o)||(yield S(f.Undefined,e,n,o))}function*o0(e,t,n,o){if(F(e,t,o))return;let i=e.anyOf.map(a=>new er(Ae(a,t,n,o)));yield S(f.Union,e,n,o,i)}function*i0(e,t,n,o){if(!Pn(o))return yield S(f.Uint8Array,e,n,o);D(e.maxByteLength)&&!(o.length<=e.maxByteLength)&&(yield S(f.Uint8ArrayMaxByteLength,e,n,o)),D(e.minByteLength)&&!(o.length>=e.minByteLength)&&(yield S(f.Uint8ArrayMinByteLength,e,n,o))}function*a0(e,t,n,o){}function*s0(e,t,n,o){ge.IsVoidLike(o)||(yield S(f.Void,e,n,o))}function*c0(e,t,n,o){Ct.Get(e[g])(e,o)||(yield S(f.Kind,e,n,o))}function*Ae(e,t,n,o){let i=D(e.$id)?[...t,e]:t,a=e;switch(a[g]){case"Any":return yield*NI(a,i,n,o);case"Argument":return yield*EI(a,i,n,o);case"Array":return yield*RI(a,i,n,o);case"AsyncIterator":return yield*FI(a,i,n,o);case"BigInt":return yield*vI(a,i,n,o);case"Boolean":return yield*$I(a,i,n,o);case"Constructor":return yield*jI(a,i,n,o);case"Date":return yield*UI(a,i,n,o);case"Function":return yield*kI(a,i,n,o);case"Import":return yield*DI(a,i,n,o);case"Integer":return yield*MI(a,i,n,o);case"Intersect":return yield*BI(a,i,n,o);case"Iterator":return yield*_I(a,i,n,o);case"Literal":return yield*VI(a,i,n,o);case"Never":return yield*KI(a,i,n,o);case"Not":return yield*GI(a,i,n,o);case"Null":return yield*qI(a,i,n,o);case"Number":return yield*zI(a,i,n,o);case"Object":return yield*HI(a,i,n,o);case"Promise":return yield*WI(a,i,n,o);case"Record":return yield*JI(a,i,n,o);case"Ref":return yield*YI(a,i,n,o);case"RegExp":return yield*XI(a,i,n,o);case"String":return yield*ZI(a,i,n,o);case"Symbol":return yield*QI(a,i,n,o);case"TemplateLiteral":return yield*e0(a,i,n,o);case"This":return yield*t0(a,i,n,o);case"Tuple":return yield*r0(a,i,n,o);case"Undefined":return yield*n0(a,i,n,o);case"Union":return yield*o0(a,i,n,o);case"Uint8Array":return yield*i0(a,i,n,o);case"Unknown":return yield*a0(a,i,n,o);case"Void":return yield*s0(a,i,n,o);default:if(!Ct.Has(a[g]))throw new dl(e);return yield*c0(a,i,n,o)}}function en(...e){let t=e.length===3?Ae(e[0],e[1],"",e[2]):Ae(e[0],[],"",e[1]);return new er(t)}var l0=function(e,t,n,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},sd=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},fl,es,cd,ts=class extends N{constructor(t){let n=t.First();super(n===void 0?"Invalid Value":n.message),fl.add(this),es.set(this,void 0),l0(this,es,t,"f"),this.error=n}Errors(){return new er(sd(this,fl,"m",cd).call(this))}};es=new WeakMap,fl=new WeakSet,cd=function*(){this.error&&(yield this.error),yield*sd(this,es,"f")};function ad(e,t,n){if(!F(e,t,n))throw new ts(en(e,t,n))}function Ui(...e){return e.length===3?ad(e[0],e[1],e[2]):ad(e[0],[],e[1])}function p0(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=q(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=q(e[n]);return t}function m0(e){return e.map(t=>q(t))}function u0(e){return e.slice()}function d0(e){return new Map(q([...e.entries()]))}function f0(e){return new Set(q([...e.entries()]))}function h0(e){return new Date(e.toISOString())}function q(e){if(L(e))return m0(e);if(ve(e))return h0(e);if(it(e))return u0(e);if(Oc(e))return d0(e);if(Sc(e))return f0(e);if(E(e))return p0(e);if(ze(e))return e;throw new Error("ValueClone: Unable to clone value")}var Ze=class extends N{constructor(t,n){super(n),this.schema=t}};function H(e){return Jt(e)?e():q(e)}function g0(e,t){return T(e,"default")?H(e.default):{}}function y0(e,t){return{}}function b0(e,t){if(e.uniqueItems===!0&&!T(e,"default"))throw new Ze(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!T(e,"default"))throw new Ze(e,"Array with the contains constraint requires a default value");return"default"in e?H(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(n=>pt(e.items,t)):[]}function x0(e,t){return T(e,"default")?H(e.default):async function*(){}()}function O0(e,t){return T(e,"default")?H(e.default):BigInt(0)}function S0(e,t){return T(e,"default")?H(e.default):!1}function I0(e,t){if(T(e,"default"))return H(e.default);{let n=pt(e.returns,t);return typeof n=="object"&&!Array.isArray(n)?class{constructor(){for(let[o,i]of Object.entries(n)){let a=this;a[o]=i}}}:class{}}}function w0(e,t){return T(e,"default")?H(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function C0(e,t){return T(e,"default")?H(e.default):()=>pt(e.returns,t)}function P0(e,t){let n=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return pt(o,[...t,...n])}function T0(e,t){return T(e,"default")?H(e.default):e.minimum!==void 0?e.minimum:0}function L0(e,t){if(T(e,"default"))return H(e.default);{let n=e.allOf.reduce((o,i)=>{let a=pt(i,t);return typeof a=="object"?{...o,...a}:a},{});if(!F(e,t,n))throw new Ze(e,"Intersect produced invalid value. Consider using a default value.");return n}}function A0(e,t){return T(e,"default")?H(e.default):function*(){}()}function N0(e,t){return T(e,"default")?H(e.default):e.const}function E0(e,t){if(T(e,"default"))return H(e.default);throw new Ze(e,"Never types cannot be created. Consider using a default value.")}function R0(e,t){if(T(e,"default"))return H(e.default);throw new Ze(e,"Not types must have a default value")}function F0(e,t){return T(e,"default")?H(e.default):null}function v0(e,t){return T(e,"default")?H(e.default):e.minimum!==void 0?e.minimum:0}function $0(e,t){if(T(e,"default"))return H(e.default);{let n=new Set(e.required),o={};for(let[i,a]of Object.entries(e.properties))n.has(i)&&(o[i]=pt(a,t));return o}}function j0(e,t){return T(e,"default")?H(e.default):Promise.resolve(pt(e.item,t))}function U0(e,t){return T(e,"default")?H(e.default):{}}function k0(e,t){return T(e,"default")?H(e.default):pt(J(e,t),t)}function D0(e,t){if(T(e,"default"))return H(e.default);throw new Ze(e,"RegExp types cannot be created. Consider using a default value.")}function M0(e,t){if(e.pattern!==void 0){if(T(e,"default"))return H(e.default);throw new Ze(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(T(e,"default"))return H(e.default);throw new Ze(e,"String types with formats must specify a default value")}else return T(e,"default")?H(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function B0(e,t){return T(e,"default")?H(e.default):"value"in e?Symbol.for(e.value):Symbol()}function _0(e,t){if(T(e,"default"))return H(e.default);if(!ai(e))throw new Ze(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Nn(e)[0]}function V0(e,t){if(ld++>Y0)throw new Ze(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return T(e,"default")?H(e.default):pt(J(e,t),t)}function K0(e,t){return T(e,"default")?H(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((n,o)=>pt(e.items[o],t))}function G0(e,t){if(T(e,"default"))return H(e.default)}function q0(e,t){if(T(e,"default"))return H(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return pt(e.anyOf[0],t)}function z0(e,t){return T(e,"default")?H(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function H0(e,t){return T(e,"default")?H(e.default):{}}function W0(e,t){if(T(e,"default"))return H(e.default)}function J0(e,t){if(T(e,"default"))return H(e.default);throw new Error("User defined types must specify a default value")}function pt(e,t){let n=Te(e,t),o=e;switch(o[g]){case"Any":return g0(o,n);case"Argument":return y0(o,n);case"Array":return b0(o,n);case"AsyncIterator":return x0(o,n);case"BigInt":return O0(o,n);case"Boolean":return S0(o,n);case"Constructor":return I0(o,n);case"Date":return w0(o,n);case"Function":return C0(o,n);case"Import":return P0(o,n);case"Integer":return T0(o,n);case"Intersect":return L0(o,n);case"Iterator":return A0(o,n);case"Literal":return N0(o,n);case"Never":return E0(o,n);case"Not":return R0(o,n);case"Null":return F0(o,n);case"Number":return v0(o,n);case"Object":return $0(o,n);case"Promise":return j0(o,n);case"Record":return U0(o,n);case"Ref":return k0(o,n);case"RegExp":return D0(o,n);case"String":return M0(o,n);case"Symbol":return B0(o,n);case"TemplateLiteral":return _0(o,n);case"This":return V0(o,n);case"Tuple":return K0(o,n);case"Undefined":return G0(o,n);case"Union":return q0(o,n);case"Uint8Array":return z0(o,n);case"Unknown":return H0(o,n);case"Void":return W0(o,n);default:if(!Ct.Has(o[g]))throw new Ze(o,"Unknown type");return J0(o,n)}}var Y0=512,ld=0;function Nt(...e){return ld=0,e.length===2?pt(e[0],e[1]):pt(e[0],[])}var ki=class extends N{constructor(t,n){super(n),this.schema=t}};function pd(e,t,n){if(e[g]==="Object"&&typeof n=="object"&&!Wt(n)){let o=e,i=Object.getOwnPropertyNames(n),a=Object.entries(o.properties),[s,c]=[1/a.length,a.length];return a.reduce((l,[p,m])=>{let d=m[g]==="Literal"&&m.const===n[p]?c:0,b=F(m,t,n[p])?s:0,I=i.includes(p)?s:0;return l+(d+b+I)},0)}else if(e[g]==="Union"){let i=e.anyOf.map(a=>J(a,t)).map(a=>pd(a,t,n));return Math.max(...i)}else return F(e,t,n)?1:0}function X0(e,t,n){let o=e.anyOf.map(s=>J(s,t)),[i,a]=[o[0],0];for(let s of o){let c=pd(s,t,n);c>a&&(i=s,a=c)}return i}function Z0(e,t,n){if("default"in e)return typeof n=="function"?e.default:q(e.default);{let o=X0(e,t,n);return ho(o,t,n)}}function Q0(e,t,n){return F(e,t,n)?q(n):Nt(e,t)}function ew(e,t,n){return F(e,t,n)?n:Nt(e,t)}function tw(e,t,n){if(F(e,t,n))return q(n);let o=L(n)?q(n):Nt(e,t),i=ie(e.minItems)&&o.length<e.minItems?[...o,...Array.from({length:e.minItems-o.length},()=>null)]:o,s=(ie(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(l=>Bt(e.items,t,l));if(e.uniqueItems!==!0)return s;let c=[...new Set(s)];if(!F(e,t,c))throw new ki(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function rw(e,t,n){if(F(e,t,n))return Nt(e,t);let o=new Set(e.returns.required||[]),i=function(){};for(let[a,s]of Object.entries(e.returns.properties))!o.has(a)&&n.prototype[a]===void 0||(i.prototype[a]=Bt(s,t,n.prototype[a]));return i}function nw(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Bt(i,[...t,...o],n)}function md(e,t){return E(e)&&!E(t)||!E(e)&&E(t)?e:!E(e)||!E(t)?t:globalThis.Object.getOwnPropertyNames(e).reduce((n,o)=>{let i=o in t?md(e[o],t[o]):e[o];return{...n,[o]:i}},{})}function ow(e,t,n){if(F(e,t,n))return n;let o=Nt(e,t),i=md(o,n);return F(e,t,i)?i:o}function iw(e,t,n){throw new ki(e,"Never types cannot be cast")}function aw(e,t,n){if(F(e,t,n))return n;if(n===null||typeof n!="object")return Nt(e,t);let o=new Set(e.required||[]),i={};for(let[a,s]of Object.entries(e.properties))!o.has(a)&&n[a]===void 0||(i[a]=Bt(s,t,n[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(n))a.includes(s)||(i[s]=Bt(e.additionalProperties,t,n[s]))}return i}function sw(e,t,n){if(F(e,t,n))return q(n);if(n===null||typeof n!="object"||Array.isArray(n)||n instanceof Date)return Nt(e,t);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o],a={};for(let[s,c]of Object.entries(n))a[s]=Bt(i,t,c);return a}function cw(e,t,n){return Bt(J(e,t),t,n)}function lw(e,t,n){return Bt(J(e,t),t,n)}function pw(e,t,n){return F(e,t,n)?q(n):L(n)?e.items===void 0?[]:e.items.map((o,i)=>Bt(o,t,n[i])):Nt(e,t)}function mw(e,t,n){return F(e,t,n)?q(n):Z0(e,t,n)}function Bt(e,t,n){let o=Y(e.$id)?Te(e,t):t,i=e;switch(e[g]){case"Array":return tw(i,o,n);case"Constructor":return rw(i,o,n);case"Import":return nw(i,o,n);case"Intersect":return ow(i,o,n);case"Never":return iw(i,o,n);case"Object":return aw(i,o,n);case"Record":return sw(i,o,n);case"Ref":return cw(i,o,n);case"This":return lw(i,o,n);case"Tuple":return pw(i,o,n);case"Union":return mw(i,o,n);case"Date":case"Symbol":case"Uint8Array":return Q0(e,t,n);default:return ew(i,o,n)}}function ho(...e){return e.length===3?Bt(e[0],e[1],e[2]):Bt(e[0],[],e[1])}function uw(e){return mr(e)&&e[g]!=="Unsafe"}function dw(e,t,n){return L(n)?n.map(o=>Qe(e.items,t,o)):n}function fw(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Qe(i,[...t,...o],n)}function hw(e,t,n){let o=e.unevaluatedProperties,a=e.allOf.map(c=>Qe(c,t,q(n))).reduce((c,l)=>E(l)?{...c,...l}:l,{});if(!E(n)||!E(a)||!mr(o))return a;let s=_e(e);for(let c of Object.getOwnPropertyNames(n))s.includes(c)||F(o,t,n[c])&&(a[c]=Qe(o,t,n[c]));return a}function gw(e,t,n){if(!E(n)||L(n))return n;let o=e.additionalProperties;for(let i of Object.getOwnPropertyNames(n)){if(T(e.properties,i)){n[i]=Qe(e.properties[i],t,n[i]);continue}if(mr(o)&&F(o,t,n[i])){n[i]=Qe(o,t,n[i]);continue}delete n[i]}return n}function yw(e,t,n){if(!E(n))return n;let o=e.additionalProperties,i=Object.getOwnPropertyNames(n),[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of i){if(c.test(l)){n[l]=Qe(s,t,n[l]);continue}if(mr(o)&&F(o,t,n[l])){n[l]=Qe(o,t,n[l]);continue}delete n[l]}return n}function bw(e,t,n){return Qe(J(e,t),t,n)}function xw(e,t,n){return Qe(J(e,t),t,n)}function Ow(e,t,n){if(!L(n))return n;if(oe(e.items))return[];let o=Math.min(n.length,e.items.length);for(let i=0;i<o;i++)n[i]=Qe(e.items[i],t,n[i]);return n.length>o?n.slice(0,o):n}function Sw(e,t,n){for(let o of e.anyOf)if(uw(o)&&F(o,t,n))return Qe(o,t,n);return n}function Qe(e,t,n){let o=Y(e.$id)?Te(e,t):t,i=e;switch(i[g]){case"Array":return dw(i,o,n);case"Import":return fw(i,o,n);case"Intersect":return hw(i,o,n);case"Object":return gw(i,o,n);case"Record":return yw(i,o,n);case"Ref":return bw(i,o,n);case"This":return xw(i,o,n);case"Tuple":return Ow(i,o,n);case"Union":return Sw(i,o,n);default:return n}}function Di(...e){return e.length===3?Qe(e[0],e[1],e[2]):Qe(e[0],[],e[1])}function rs(e){return Y(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function Iw(e){return ht(e)||Ft(e)||ie(e)}function Mi(e){return e===!0||ie(e)&&e===1||ht(e)&&e===BigInt("1")||Y(e)&&(e.toLowerCase()==="true"||e==="1")}function Bi(e){return e===!1||ie(e)&&(e===0||Object.is(e,-0))||ht(e)&&e===BigInt("0")||Y(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function ww(e){return Y(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function Cw(e){return Y(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function Pw(e){return Y(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function Tw(e){return Y(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function Lw(e){return Y(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function Aw(e,t){let n=dd(e);return n===t?n:e}function Nw(e,t){let n=fd(e);return n===t?n:e}function Ew(e,t){let n=ud(e);return n===t?n:e}function Rw(e,t){return Y(e.const)?Aw(t,e.const):ie(e.const)?Nw(t,e.const):Ft(e.const)?Ew(t,e.const):t}function ud(e){return Mi(e)?!0:Bi(e)?!1:e}function Fw(e){let t=n=>n.split(".")[0];return rs(e)?BigInt(t(e)):ie(e)?BigInt(Math.trunc(e)):Bi(e)?BigInt(0):Mi(e)?BigInt(1):e}function dd(e){return Yt(e)&&e.description!==void 0?e.description.toString():Iw(e)?e.toString():e}function fd(e){return rs(e)?parseFloat(e):Mi(e)?1:Bi(e)?0:e}function vw(e){return rs(e)?parseInt(e):ie(e)?Math.trunc(e):Mi(e)?1:Bi(e)?0:e}function $w(e){return Y(e)&&e.toLowerCase()==="null"?null:e}function jw(e){return Y(e)&&e==="undefined"?void 0:e}function Uw(e){return ve(e)?e:ie(e)?new Date(e):Mi(e)?new Date(1):Bi(e)?new Date(0):rs(e)?new Date(parseInt(e)):Cw(e)?new Date(`1970-01-01T${e}.000Z`):ww(e)?new Date(`1970-01-01T${e}`):Tw(e)?new Date(`${e}.000Z`):Pw(e)?new Date(e):Lw(e)?new Date(`${e}T00:00:00.000Z`):e}function kw(e,t,n){return(L(n)?n:[n]).map(i=>_t(e.items,t,i))}function Dw(e,t,n){return Fw(n)}function Mw(e,t,n){return ud(n)}function Bw(e,t,n){return Uw(n)}function _w(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return _t(i,[...t,...o],n)}function Vw(e,t,n){return vw(n)}function Kw(e,t,n){return e.allOf.reduce((o,i)=>_t(i,t,o),n)}function Gw(e,t,n){return Rw(e,n)}function qw(e,t,n){return $w(n)}function zw(e,t,n){return fd(n)}function Hw(e,t,n){if(!E(n))return n;for(let o of Object.getOwnPropertyNames(e.properties))T(n,o)&&(n[o]=_t(e.properties[o],t,n[o]));return n}function Ww(e,t,n){if(!E(n))return n;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[i];for(let[s,c]of Object.entries(n))n[s]=_t(a,t,c);return n}function Jw(e,t,n){return _t(J(e,t),t,n)}function Yw(e,t,n){return dd(n)}function Xw(e,t,n){return Y(n)||ie(n)?Symbol(n):n}function Zw(e,t,n){return _t(J(e,t),t,n)}function Qw(e,t,n){return L(n)&&!oe(e.items)?n.map((i,a)=>a<e.items.length?_t(e.items[a],t,i):i):n}function eC(e,t,n){return jw(n)}function tC(e,t,n){for(let o of e.anyOf)if(F(o,t,n))return n;for(let o of e.anyOf){let i=_t(o,t,q(n));if(F(o,t,i))return i}return n}function _t(e,t,n){let o=Te(e,t),i=e;switch(e[g]){case"Array":return kw(i,o,n);case"BigInt":return Dw(i,o,n);case"Boolean":return Mw(i,o,n);case"Date":return Bw(i,o,n);case"Import":return _w(i,o,n);case"Integer":return Vw(i,o,n);case"Intersect":return Kw(i,o,n);case"Literal":return Gw(i,o,n);case"Null":return qw(i,o,n);case"Number":return zw(i,o,n);case"Object":return Hw(i,o,n);case"Record":return Ww(i,o,n);case"Ref":return Jw(i,o,n);case"String":return Yw(i,o,n);case"Symbol":return Xw(i,o,n);case"This":return Zw(i,o,n);case"Tuple":return Qw(i,o,n);case"Undefined":return eC(i,o,n);case"Union":return tC(i,o,n);default:return n}}function _i(...e){return e.length===3?_t(e[0],e[1],e[2]):_t(e[0],[],e[1])}var Vi=class extends N{constructor(t,n,o){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=n,this.error=o}},ns=class extends N{constructor(t,n,o,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=n,this.value=o,this.error=i}};function pe(e,t,n){try{return z(e)?e[se].Decode(n):n}catch(o){throw new ns(e,t,n,o)}}function rC(e,t,n,o){return L(o)?pe(e,n,o.map((i,a)=>Vt(e.items,t,`${n}/${a}`,i))):pe(e,n,o)}function nC(e,t,n,o){if(!E(o)||ze(o))return pe(e,n,o);let i=mi(e),a=i.map(m=>m[0]),s={...o};for(let[m,d]of i)m in s&&(s[m]=Vt(d,t,`${n}/${m}`,s[m]));if(!z(e.unevaluatedProperties))return pe(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=pe(l,`${n}/${m}`,p[m]));return pe(e,n,p)}function oC(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Vt(a,[...t,...i],n,o);return pe(e,n,s)}function iC(e,t,n,o){return pe(e,n,Vt(e.not,t,n,o))}function aC(e,t,n,o){if(!E(o))return pe(e,n,o);let i=_e(e),a={...o};for(let p of i)T(a,p)&&(oe(a[p])&&(!Qt(e.properties[p])||ge.IsExactOptionalProperty(a,p))||(a[p]=Vt(e.properties[p],t,`${n}/${p}`,a[p])));if(!ce(e.additionalProperties))return pe(e,n,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)i.includes(p)||(l[p]=pe(c,`${n}/${p}`,l[p]));return pe(e,n,l)}function sC(e,t,n,o){if(!E(o))return pe(e,n,o);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),s={...o};for(let m of Object.getOwnPropertyNames(o))a.test(m)&&(s[m]=Vt(e.patternProperties[i],t,`${n}/${m}`,s[m]));if(!ce(e.additionalProperties))return pe(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=pe(l,`${n}/${m}`,p[m]));return pe(e,n,p)}function cC(e,t,n,o){let i=J(e,t);return pe(e,n,Vt(i,t,n,o))}function lC(e,t,n,o){let i=J(e,t);return pe(e,n,Vt(i,t,n,o))}function pC(e,t,n,o){return L(o)&&L(e.items)?pe(e,n,e.items.map((i,a)=>Vt(i,t,`${n}/${a}`,o[a]))):pe(e,n,o)}function mC(e,t,n,o){for(let i of e.anyOf){if(!F(i,t,o))continue;let a=Vt(i,t,n,o);return pe(e,n,a)}return pe(e,n,o)}function Vt(e,t,n,o){let i=Te(e,t),a=e;switch(e[g]){case"Array":return rC(a,i,n,o);case"Import":return oC(a,i,n,o);case"Intersect":return nC(a,i,n,o);case"Not":return iC(a,i,n,o);case"Object":return aC(a,i,n,o);case"Record":return sC(a,i,n,o);case"Ref":return cC(a,i,n,o);case"Symbol":return pe(a,n,o);case"This":return lC(a,i,n,o);case"Tuple":return pC(a,i,n,o);case"Union":return mC(a,i,n,o);default:return pe(a,n,o)}}function Ki(e,t,n){return Vt(e,t,"",n)}var Gi=class extends N{constructor(t,n,o){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=o}},os=class extends N{constructor(t,n,o,i){super(`${i instanceof Error?i.message:"Unknown error"}`),this.schema=t,this.path=n,this.value=o,this.error=i}};function Fe(e,t,n){try{return z(e)?e[se].Encode(n):n}catch(o){throw new os(e,t,n,o)}}function uC(e,t,n,o){let i=Fe(e,n,o);return L(i)?i.map((a,s)=>Kt(e.items,t,`${n}/${s}`,a)):i}function dC(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Fe(e,n,o);return Kt(a,[...t,...i],n,s)}function fC(e,t,n,o){let i=Fe(e,n,o);if(!E(o)||ze(o))return i;let a=mi(e),s=a.map(d=>d[0]),c={...i};for(let[d,b]of a)d in c&&(c[d]=Kt(b,t,`${n}/${d}`,c[d]));if(!z(e.unevaluatedProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.unevaluatedProperties,m={...c};for(let d of l)s.includes(d)||(m[d]=Fe(p,`${n}/${d}`,m[d]));return m}function hC(e,t,n,o){return Fe(e.not,n,Fe(e,n,o))}function gC(e,t,n,o){let i=Fe(e,n,o);if(!E(i))return i;let a=_e(e),s={...i};for(let m of a)T(s,m)&&(oe(s[m])&&(!Qt(e.properties[m])||ge.IsExactOptionalProperty(s,m))||(s[m]=Kt(e.properties[m],t,`${n}/${m}`,s[m])));if(!ce(e.additionalProperties))return s;let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=Fe(l,`${n}/${m}`,p[m]));return p}function yC(e,t,n,o){let i=Fe(e,n,o);if(!E(o))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(a),c={...i};for(let d of Object.getOwnPropertyNames(o))s.test(d)&&(c[d]=Kt(e.patternProperties[a],t,`${n}/${d}`,c[d]));if(!ce(e.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.additionalProperties,m={...c};for(let d of l)s.test(d)||(m[d]=Fe(p,`${n}/${d}`,m[d]));return m}function bC(e,t,n,o){let i=J(e,t),a=Kt(i,t,n,o);return Fe(e,n,a)}function xC(e,t,n,o){let i=J(e,t),a=Kt(i,t,n,o);return Fe(e,n,a)}function OC(e,t,n,o){let i=Fe(e,n,o);return L(e.items)?e.items.map((a,s)=>Kt(a,t,`${n}/${s}`,i[s])):[]}function SC(e,t,n,o){for(let i of e.anyOf){if(!F(i,t,o))continue;let a=Kt(i,t,n,o);return Fe(e,n,a)}for(let i of e.anyOf){let a=Kt(i,t,n,o);if(F(e,t,a))return Fe(e,n,a)}return Fe(e,n,o)}function Kt(e,t,n,o){let i=Te(e,t),a=e;switch(e[g]){case"Array":return uC(a,i,n,o);case"Import":return dC(a,i,n,o);case"Intersect":return fC(a,i,n,o);case"Not":return hC(a,i,n,o);case"Object":return gC(a,i,n,o);case"Record":return yC(a,i,n,o);case"Ref":return bC(a,i,n,o);case"This":return xC(a,i,n,o);case"Tuple":return OC(a,i,n,o);case"Union":return SC(a,i,n,o);default:return Fe(a,n,o)}}function qi(e,t,n){return Kt(e,t,"",n)}function IC(e,t){return z(e)||Ie(e.items,t)}function wC(e,t){return z(e)||Ie(e.items,t)}function CC(e,t){return z(e)||Ie(e.returns,t)||e.parameters.some(n=>Ie(n,t))}function PC(e,t){return z(e)||Ie(e.returns,t)||e.parameters.some(n=>Ie(n,t))}function TC(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(n=>Ie(n,t))}function LC(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,a)=>[...i,e.$defs[a]],[]),o=e.$defs[e.$ref];return z(e)||Ie(o,[...n,...t])}function AC(e,t){return z(e)||Ie(e.items,t)}function NC(e,t){return z(e)||Ie(e.not,t)}function EC(e,t){return z(e)||Object.values(e.properties).some(n=>Ie(n,t))||ce(e.additionalProperties)&&Ie(e.additionalProperties,t)}function RC(e,t){return z(e)||Ie(e.item,t)}function FC(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n];return z(e)||Ie(o,t)||ce(e.additionalProperties)&&z(e.additionalProperties)}function vC(e,t){return z(e)?!0:Ie(J(e,t),t)}function $C(e,t){return z(e)?!0:Ie(J(e,t),t)}function jC(e,t){return z(e)||!oe(e.items)&&e.items.some(n=>Ie(n,t))}function UC(e,t){return z(e)||e.anyOf.some(n=>Ie(n,t))}function Ie(e,t){let n=Te(e,t),o=e;if(e.$id&&hl.has(e.$id))return!1;switch(e.$id&&hl.add(e.$id),e[g]){case"Array":return IC(o,n);case"AsyncIterator":return wC(o,n);case"Constructor":return CC(o,n);case"Function":return PC(o,n);case"Import":return LC(o,n);case"Intersect":return TC(o,n);case"Iterator":return AC(o,n);case"Not":return NC(o,n);case"Object":return EC(o,n);case"Promise":return RC(o,n);case"Record":return FC(o,n);case"Ref":return vC(o,n);case"This":return $C(o,n);case"Tuple":return jC(o,n);case"Union":return UC(o,n);default:return z(e)}}var hl=new Set;function tn(e,t){return hl.clear(),Ie(e,t)}function gl(...e){let[t,n,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!F(t,n,o))throw new Vi(t,o,en(t,n,o).First());return tn(t,n)?Ki(t,n,o):o}function Nr(e,t){let n=T(e,"default")?e.default:void 0,o=Jt(n)?n():q(n);return oe(t)?o:E(t)&&E(o)?Object.assign(o,t):t}function yl(e){return mr(e)&&"default"in e}function kC(e,t,n){if(L(n)){for(let i=0;i<n.length;i++)n[i]=Ve(e.items,t,n[i]);return n}let o=Nr(e,n);if(!L(o))return o;for(let i=0;i<o.length;i++)o[i]=Ve(e.items,t,o[i]);return o}function DC(e,t,n){return ve(n)?n:Nr(e,n)}function MC(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Ve(i,[...t,...o],n)}function BC(e,t,n){let o=Nr(e,n);return e.allOf.reduce((i,a)=>{let s=Ve(a,t,o);return E(s)?{...i,...s}:s},{})}function _C(e,t,n){let o=Nr(e,n);if(!E(o))return o;let i=Object.getOwnPropertyNames(e.properties);for(let a of i){let s=Ve(e.properties[a],t,o[a]);oe(s)||(o[a]=Ve(e.properties[a],t,o[a]))}if(!yl(e.additionalProperties))return o;for(let a of Object.getOwnPropertyNames(o))i.includes(a)||(o[a]=Ve(e.additionalProperties,t,o[a]));return o}function VC(e,t,n){let o=Nr(e,n);if(!E(o))return o;let i=e.additionalProperties,[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of Object.getOwnPropertyNames(o))c.test(l)&&yl(s)&&(o[l]=Ve(s,t,o[l]));if(!yl(i))return o;for(let l of Object.getOwnPropertyNames(o))c.test(l)||(o[l]=Ve(i,t,o[l]));return o}function KC(e,t,n){return Ve(J(e,t),t,Nr(e,n))}function GC(e,t,n){return Ve(J(e,t),t,n)}function qC(e,t,n){let o=Nr(e,n);if(!L(o)||oe(e.items))return o;let[i,a]=[e.items,Math.max(e.items.length,o.length)];for(let s=0;s<a;s++)s<i.length&&(o[s]=Ve(i[s],t,o[s]));return o}function zC(e,t,n){let o=Nr(e,n);for(let i of e.anyOf){let a=Ve(i,t,q(o));if(F(i,t,a))return a}return o}function Ve(e,t,n){let o=Te(e,t),i=e;switch(i[g]){case"Array":return kC(i,o,n);case"Date":return DC(i,o,n);case"Import":return MC(i,o,n);case"Intersect":return BC(i,o,n);case"Object":return _C(i,o,n);case"Record":return VC(i,o,n);case"Ref":return KC(i,o,n);case"This":return GC(i,o,n);case"Tuple":return qC(i,o,n);case"Union":return zC(i,o,n);default:return Nr(i,n)}}function zi(...e){return e.length===3?Ve(e[0],e[1],e[2]):Ve(e[0],[],e[1])}var Et={};Ge(Et,{Delete:()=>WC,Format:()=>Hi,Get:()=>YC,Has:()=>JC,Set:()=>HC,ValuePointerRootDeleteError:()=>as,ValuePointerRootSetError:()=>is});var is=class extends N{constructor(t,n,o){super("Cannot set root value"),this.value=t,this.path=n,this.update=o}},as=class extends N{constructor(t,n){super("Cannot delete root value"),this.value=t,this.path=n}};function hd(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Hi(e){if(e==="")return;let[t,n]=[0,0];for(let o=0;o<e.length;o++)e.charAt(o)==="/"?(o===0||(n=o,yield hd(e.slice(t,n))),t=o+1):n=o;yield hd(e.slice(t))}function HC(e,t,n){if(t==="")throw new is(e,t,n);let[o,i,a]=[null,e,""];for(let s of Hi(t))i[s]===void 0&&(i[s]={}),o=i,i=i[s],a=s;o[a]=n}function WC(e,t){if(t==="")throw new as(e,t);let[n,o,i]=[null,e,""];for(let a of Hi(t)){if(o[a]===void 0||o[a]===null)return;n=o,o=o[a],i=a}if(Array.isArray(n)){let a=parseInt(i);n.splice(a,1)}else delete n[i]}function JC(e,t){if(t==="")return!0;let[n,o,i]=[null,e,""];for(let a of Hi(t)){if(o[a]===void 0)return!1;n=o,o=o[a],i=a}return Object.getOwnPropertyNames(n).includes(i)}function YC(e,t){if(t==="")return e;let n=e;for(let o of Hi(t)){if(n[o]===void 0)return;n=n[o]}return n}function XC(e,t){if(!E(t))return!1;let n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],o=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return n.length!==o.length?!1:n.every(i=>rn(e[i],t[i]))}function ZC(e,t){return ve(t)&&e.getTime()===t.getTime()}function QC(e,t){return!L(t)||e.length!==t.length?!1:e.every((n,o)=>rn(n,t[o]))}function eP(e,t){return!it(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((n,o)=>rn(n,t[o]))}function tP(e,t){return e===t}function rn(e,t){if(ve(e))return ZC(e,t);if(it(e))return eP(e,t);if(L(e))return QC(e,t);if(E(e))return XC(e,t);if(ze(e))return tP(e,t);throw new Error("ValueEquals: Unable to compare value")}var yd=V({type:v("insert"),path:Pe(),value:Ye()}),bd=V({type:v("update"),path:Pe(),value:Ye()}),xd=V({type:v("delete"),path:Pe()}),bl=_([yd,bd,xd]),Wi=class extends N{constructor(t,n){super(n),this.value=t}};function ss(e,t){return{type:"update",path:e,value:t}}function Od(e,t){return{type:"insert",path:e,value:t}}function Sd(e){return{type:"delete",path:e}}function gd(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new Wi(e,"Cannot diff objects with symbols")}function*rP(e,t,n){if(gd(t),gd(n),!Fa(n))return yield ss(e,n);let o=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(n);for(let a of i)T(t,a)||(yield Od(`${e}/${a}`,n[a]));for(let a of o)T(n,a)&&(rn(t,n)||(yield*cs(`${e}/${a}`,t[a],n[a])));for(let a of o)T(n,a)||(yield Sd(`${e}/${a}`))}function*nP(e,t,n){if(!L(n))return yield ss(e,n);for(let o=0;o<Math.min(t.length,n.length);o++)yield*cs(`${e}/${o}`,t[o],n[o]);for(let o=0;o<n.length;o++)o<t.length||(yield Od(`${e}/${o}`,n[o]));for(let o=t.length-1;o>=0;o--)o<n.length||(yield Sd(`${e}/${o}`))}function*oP(e,t,n){if(!it(n)||t.length!==n.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(n).constructor.name)return yield ss(e,n);for(let o=0;o<Math.min(t.length,n.length);o++)yield*cs(`${e}/${o}`,t[o],n[o])}function*iP(e,t,n){t!==n&&(yield ss(e,n))}function*cs(e,t,n){if(Fa(t))return yield*rP(e,t,n);if(L(t))return yield*nP(e,t,n);if(it(t))return yield*oP(e,t,n);if(ze(t))return yield*iP(e,t,n);throw new Wi(t,"Unable to diff value")}function xl(e,t){return[...cs("",e,t)]}function aP(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function sP(e){return e.length===0}function Ol(e,t){if(aP(t))return q(t[0].value);if(sP(t))return q(e);let n=q(e);for(let o of t)switch(o.type){case"insert":{Et.Set(n,o.path,o.value);break}case"update":{Et.Set(n,o.path,o.value);break}case"delete":{Et.Delete(n,o.path);break}}return n}function Sl(...e){let[t,n,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=tn(t,n)?qi(t,n,o):o;if(!F(t,n,i))throw new Gi(t,i,en(t,n,i).First());return i}function ls(e){return E(e)&&!L(e)}var Ji=class extends N{constructor(t){super(t)}};function cP(e,t,n,o){if(!ls(n))Et.Set(e,t,q(o));else{let i=Object.getOwnPropertyNames(n),a=Object.getOwnPropertyNames(o);for(let s of i)a.includes(s)||delete n[s];for(let s of a)i.includes(s)||(n[s]=null);for(let s of a)Il(e,`${t}/${s}`,n[s],o[s])}}function lP(e,t,n,o){if(!L(n))Et.Set(e,t,q(o));else{for(let i=0;i<o.length;i++)Il(e,`${t}/${i}`,n[i],o[i]);n.splice(o.length)}}function pP(e,t,n,o){if(it(n)&&n.length===o.length)for(let i=0;i<n.length;i++)n[i]=o[i];else Et.Set(e,t,q(o))}function mP(e,t,n,o){n!==o&&Et.Set(e,t,o)}function Il(e,t,n,o){if(L(o))return lP(e,t,n,o);if(it(o))return pP(e,t,n,o);if(ls(o))return cP(e,t,n,o);if(ze(o))return mP(e,t,n,o)}function Id(e){return it(e)||ze(e)}function uP(e,t){return ls(e)&&L(t)||L(e)&&ls(t)}function wl(e,t){if(Id(e)||Id(t))throw new Ji("Only object and array types can be mutated at the root level");if(uP(e,t))throw new Ji("Cannot assign due type mismatch of assignable values");Il(e,"",e,t)}var Yi=class extends N{constructor(t){super(t)}},ps;(function(e){let t=new Map([["Assert",(a,s,c)=>(Ui(a,s,c),c)],["Cast",(a,s,c)=>ho(a,s,c)],["Clean",(a,s,c)=>Di(a,s,c)],["Clone",(a,s,c)=>q(c)],["Convert",(a,s,c)=>_i(a,s,c)],["Decode",(a,s,c)=>tn(a,s)?Ki(a,s,c):c],["Default",(a,s,c)=>zi(a,s,c)],["Encode",(a,s,c)=>tn(a,s)?qi(a,s,c):c]]);function n(a){t.delete(a)}e.Delete=n;function o(a,s){t.set(a,s)}e.Set=o;function i(a){return t.get(a)}e.Get=i})(ps||(ps={}));var Cl=["Clone","Clean","Default","Convert","Assert","Decode"];function dP(e,t,n,o){return e.reduce((i,a)=>{let s=ps.Get(a);if(oe(s))throw new Yi(`Unable to find Parse operation \'${a}\'`);return s(t,n,i)},o)}function Pl(...e){let[t,n,o,i]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?L(e[0])?[e[0],e[1],[],e[2]]:[Cl,e[0],e[1],e[2]]:e.length===2?[Cl,e[0],[],e[1]]:(()=>{throw new Yi("Invalid Arguments")})();return dP(t,n,o,i)}var P={};Ge(P,{Assert:()=>Ui,Cast:()=>ho,Check:()=>F,Clean:()=>Di,Clone:()=>q,Convert:()=>_i,Create:()=>Nt,Decode:()=>gl,Default:()=>zi,Diff:()=>xl,Edit:()=>bl,Encode:()=>Sl,Equal:()=>rn,Errors:()=>en,Hash:()=>Vn,Mutate:()=>wl,Parse:()=>Pl,Patch:()=>Ol,ValueErrorIterator:()=>er});var Kl={};Ge(Kl,{ComponentValidationError:()=>Wn,DEFAULT_CHART_THEME_COLORS:()=>ET,DEFAULT_ERROR_CONFIG:()=>nn,DEFAULT_VISUAL_DPI:()=>na,DuplicateComponentError:()=>xo,ERROR_EMOJIS:()=>Gn,FONT_URL_ALLOWLIST:()=>El,FeatureRequirementCollector:()=>kd,FontFamilyNameSchema:()=>or,FontRegistry:()=>IT,FontRegistryEntrySchema:()=>jl,FontRegistrySchema:()=>ir,FontSourceSchema:()=>$l,MAX_RASTERIZE_BATCH_SLIDES:()=>QP,MAX_RASTERIZE_FONTS:()=>XP,MAX_RASTERIZE_FONT_BYTES:()=>ZP,MAX_VISUAL_DPI:()=>ia,MIN_VISUAL_DPI:()=>oa,POPULAR_GOOGLE_FONTS:()=>Xd,RENDERER_DEPENDENCY_MISSING:()=>Os,RendererRegistry:()=>Md,SAFE_FONTS:()=>bs,UPSTREAM_OVERRIDES:()=>Zd,UnknownPreservedComponentError:()=>fs,UnsupportedRendererFeatureError:()=>Ul,WEIGHT_LABELS:()=>Jd,applyExportMode:()=>NT,applyFontSubstitution:()=>Vl,assertNever:()=>Fd,assertRendererSupports:()=>Dd,buildDefaultSubstitutionMap:()=>ef,calculatePosition:()=>go,clampVisualDpi:()=>YP,clearComponentNamesCache:()=>Zi,collectFontNamesFromDocx:()=>eT,collectFontNamesFromPptx:()=>tT,compareSemver:()=>zn,convertToJsonSchema:()=>Oo,createComponent:()=>bo,createComponentSchema:()=>So,createComponentSchemaObject:()=>ys,createErrorConfig:()=>nr,createJsonParseError:()=>qn,createVersion:()=>yo,defaultSubstituteFor:()=>Qd,detectFontFormat:()=>Er,diagnoseUnsupportedFeatures:()=>Dl,documentFontRegistry:()=>nT,exportSchemaToFile:()=>Io,extractStandardComponentNames:()=>Kn,fetchGoogleFontSources:()=>Yd,fixSchemaReferences:()=>ln,formatErrorMessage:()=>tr,formatErrorSummary:()=>Fr,getLiteralValue:()=>mt,getObjectSchemaPropertyNames:()=>rr,getSchemaMetadata:()=>Qi,getUpstreamOverride:()=>TT,getValidationSummary:()=>gs,groupErrorsByPath:()=>ea,isAllowedFontUrl:()=>us,isLiteralSchema:()=>Rr,isObjectSchema:()=>Rt,isSafeFont:()=>Jn,isUnionSchema:()=>Xi,isValidSemver:()=>sn,isValidationSuccess:()=>hs,latestVersion:()=>et,mergeFontRegistries:()=>iT,mergeWithDefaults:()=>RT,parseSemver:()=>an,partitionDiagnostics:()=>Ud,rendererError:()=>kl,rendererWarning:()=>jd,resolveComponentVersion:()=>Hn,restructureNameDiscriminatedUnions:()=>ta,rewriteFontFamilyName:()=>Al,synthesizeFamilyName:()=>cT,themeFontRegistry:()=>oT,transformValueError:()=>on,transformValueErrors:()=>Ke,unionBranches:()=>Ed,validateCustomComponentProps:()=>cn,validateFontReferences:()=>sT});var fP=new Set([1,4,6,16]),hP=2981146554;function wd(e){let t=0,n=e.length,o=n-n%4;for(let i=0;i<o;i+=4)t=t+e.readUInt32BE(i)>>>0;if(o<n){let i=0,a=n-o;a>=1&&(i|=e[o]<<24),a>=2&&(i|=e[o+1]<<16),a>=3&&(i|=e[o+2]<<8),t=t+i>>>0}return t>>>0}function gP(e,t){if(e.platformID===1)return Buffer.from(t,"ascii");let n=Buffer.alloc(t.length*2);for(let o=0;o<t.length;o+=1)n.writeUInt16BE(t.charCodeAt(o),o*2);return n}function yP(e){let t=e.length,n=6+t*12,o=0;for(let s of e)o+=s.bytes.length;let i=Buffer.alloc(n+o);i.writeUInt16BE(0,0),i.writeUInt16BE(t,2),i.writeUInt16BE(n,4);let a=0;for(let s=0;s<t;s+=1){let c=e[s],l=6+s*12;i.writeUInt16BE(c.platformID,l),i.writeUInt16BE(c.encodingID,l+2),i.writeUInt16BE(c.languageID,l+4),i.writeUInt16BE(c.nameID,l+6),i.writeUInt16BE(c.bytes.length,l+8),i.writeUInt16BE(a,l+10),c.bytes.copy(i,n+a),a+=c.bytes.length}return i}function bP(e,t){if(e.length<12)return e;let n=e.readUInt32BE(0);if(!(n===65536||n===1330926671||n===1953658213||n===1954115633))return e;let i=e.readUInt16BE(4);if(i===0||e.length<12+i*16)return e;let a=[];for(let O=0;O<i;O+=1){let M=12+O*16,W=e.toString("ascii",M,M+4),nt=e.readUInt32BE(M+4),ot=e.readUInt32BE(M+8),cr=e.readUInt32BE(M+12);if(ot+cr>e.length)return e;a.push({tag:W,checksum:nt,offset:0,originalOffset:ot,data:e.slice(ot,ot+cr)})}let s=a.findIndex(O=>O.tag==="name");if(s===-1)return e;let c=a[s].data;if(c.length<6||c.readUInt16BE(0)!==0)return e;let l=c.readUInt16BE(2),p=c.readUInt16BE(4);if(c.length<6+l*12)return e;let m=[];for(let O=0;O<l;O+=1){let M=6+O*12,W=c.readUInt16BE(M),nt=c.readUInt16BE(M+2),ot=c.readUInt16BE(M+4),cr=c.readUInt16BE(M+6),xe=c.readUInt16BE(M+8),Gr=c.readUInt16BE(M+10),Aa=c.slice(p+Gr,p+Gr+xe);m.push({platformID:W,encodingID:nt,languageID:ot,nameID:cr,bytes:Aa})}let d=[];for(let O of m){let M=t(O);M.action!=="drop"&&(M.action==="set"&&(O.bytes=gP(O,M.value)),d.push(O))}m.length=0,m.push(...d);let b=yP(m);a[s]={...a[s],data:b,checksum:wd(b)},a.sort((O,M)=>O.originalOffset-M.originalOffset);let I=12+a.length*16;for(let O of a)I=I+3&-4,O.offset=I,I+=O.data.length;let w=I+3&-4,C=Buffer.alloc(w);e.copy(C,0,0,12),C.writeUInt16BE(a.length,4);let x=[...a].sort((O,M)=>O.tag<M.tag?-1:O.tag>M.tag?1:0);for(let O=0;O<x.length;O+=1){let M=x[O],W=12+O*16;C.write(M.tag,W,4,"ascii"),C.writeUInt32BE(M.checksum,W+4),C.writeUInt32BE(M.offset,W+8),C.writeUInt32BE(M.data.length,W+12)}for(let O of a)O.data.copy(C,O.offset);let K=a.find(O=>O.tag==="head");if(K&&K.data.length>=12){C.writeUInt32BE(0,K.offset+8);let O=wd(C),M=hP-O>>>0;C.writeUInt32BE(M,K.offset+8)}return C}function xP(e,t){if(e.length<12)return null;let n=e.readUInt16BE(4);for(let o=0;o<n;o+=1){let i=12+o*16;if(i+16>e.length)return null;if(e.toString("ascii",i,i+4)===t)return{offset:e.readUInt32BE(i+8),length:e.readUInt32BE(i+12)}}return null}function ms(e,t){let n=xP(e,"name");if(!n)return[];let o=n.offset;if(o+6>e.length)return[];let i=Math.min(o+n.length,e.length),a=e.readUInt16BE(o+2),s=o+e.readUInt16BE(o+4),c=Math.min(s,i),l=[];for(let p=0;p<a;p+=1){let m=o+6+p*12;if(m+12>c)break;let d=e.readUInt16BE(m),b=e.readUInt16BE(m+6);if(t&&!t.has(b))continue;let I=e.readUInt16BE(m+8),w=e.readUInt16BE(m+10),C=s+w;if(C+I>i)continue;let x=e.slice(C,C+I),K;if(d===1)K=x.toString("ascii");else{let O=Buffer.from(x);O.length%2===0&&O.swap16(),K=O.toString("utf16le")}l.push({platformID:d,nameID:b,value:K})}return l}function Ll(e){let t=[];for(let n of ms(e,OP)){let o=n.value.trim();o.length>0&&!t.includes(o)&&t.push(o)}return t}var OP=new Set([1,16]);function SP(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function Al(e,t,n){let o=n&&n!=="Regular"?n:"",i=o?`${t} ${o}`:t,a=/[[\\](){}<>/%]/g,s=/^[\\x00-\\x7f]*$/.test(i),c=p=>p.replace(/\\s+/g,"").replace(a,"").replace(/[^\\x21-\\x7e]/g,""),l=o?`${c(t)}-${c(o)}`:c(t);return bP(e,p=>fP.has(p.nameID)?p.platformID===1&&!s?{action:"drop"}:p.nameID===6?{action:"set",value:l}:p.nameID===4?{action:"set",value:i}:{action:"set",value:t}:{action:"keep"})}var IP={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Nl(e,t){let n=IP[e];return n?{typographic:t?`${n} Italic`:n,legacy:SP(e>=600,t)}:null}var El=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function us(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:El.includes(t.hostname.toLowerCase())}function Er(e){if(e.length<4)return"unknown";let t=e[0],n=e[1],o=e[2],i=e[3];return t===0&&n===1&&o===0&&i===0||t===116&&n===114&&o===117&&i===101||t===116&&n===121&&o===112&&i===49?"ttf":t===79&&n===84&&o===84&&i===79?"otf":t===119&&n===79&&o===70&&i===70?"woff":t===119&&n===79&&o===70&&i===50?"woff2":e.length>=36&&e[34]===76&&e[35]===80?"eot":t===128&&n===1||e.length>=14&&e.slice(0,14).toString("ascii")==="%!PS-AdobeFont"?"pfb":"unknown"}var ds=new Map;function Xi(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function Rt(e){return e.type==="object"&&"properties"in e}function Rr(e){return"const"in e}function rr(e){return Rt(e)?Object.keys(e.properties):[]}function mt(e){if(Rr(e))return e.const}function Kn(e){if(ds.has(e))return ds.get(e);let t=[];if("anyOf"in e&&Array.isArray(e.anyOf)){for(let n of e.anyOf)if(Rt(n)){let o=n.properties?.name;if(o&&Rr(o)){let i=mt(o);typeof i=="string"&&t.push(i)}}}else if(Rt(e)){let n=e.properties?.name??e.properties?.type;if(n&&Rr(n)){let o=mt(n);typeof o=="string"&&t.push(o)}}return ds.set(e,t),t}function Zi(){ds.clear()}function Qi(e){let t={};return"type"in e&&(t.type=String(e.type)),Rt(e)&&(t.properties=rr(e)),Rr(e)&&(t.literal=mt(e)),t}function Cd(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function wP(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Cd()}var nn={includeEmojis:!Cd(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:wP()};function nr(e){return{...nn,...e}}var Gn={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function tr(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function CP(e,t){let n=String(e.type||""),o=e.path||"root";return n==="62"||n==="union"?PP(e):e.message?.includes("additionalProperties")?TP(e):e.message?.includes("Required property")?LP(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?AP(e):n==="literal"?NP(e):n==="pattern"||n==="RegExp"?EP(e):`At ${o}: ${e.message}`}function PP(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n)return`Invalid component configuration for \'${n.name}\'. Check that all required fields are present.`;if("children"in n&&Array.isArray(n.children))return"Document is missing required \'name\' field."}return"Invalid document structure. Check required fields."}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function TP(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let o=e.schema;if(o&&Rt(o)){let i=rr(o),s=Object.keys(n).filter(c=>!i.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${i.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function LP(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function AP(e){let t=e.path||"root",n=String(e.type),o=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${n} but got ${o}`}function NP(e){let t=e.path||"root",n=e.schema?JSON.stringify(mt(e.schema)):"specific value",o=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${o}`}function EP(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:`Value at ${t} doesn\'t match the required pattern`}function on(e,t,n){let o=nr(n),i=CP(e,o),a={path:e.path||"root",message:tr(i||e.message,o),code:String(e.type||"validation_error"),value:e.value};if(o.includeSuggestions){let s=RP(e,o);s&&(a.suggestion=tr(s,o))}if(t&&e.path){let s=go(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function Ke(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,o=[],i=new Set;for(let a of e){if(o.length>=n)break;let s=`${a.path}:${a.type}`;i.has(s)||(i.add(s),o.push(on(a,t?.jsonString,void 0)))}return o}function go(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let i=`"${n[n.length-1]}"`,a=e.indexOf(i);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function RP(e,t){let{type:n,path:o}=e,i=String(n);if(i==="62"||i==="union")return o==="root"||o==="/"?\'Ensure the document has proper structure with a root "name" field\':o?.includes("/children/")?\'Check that the component has a valid "name" and all required fields\':"Review the structure and ensure all required fields are present with correct types";if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(i==="string")return o?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(i==="number")return"Provide a numeric value";if(i==="boolean")return"Use true or false (without quotes)";if(i==="array")return"Provide an array of values using square brackets []";if(i==="object")return"Provide an object with key-value pairs using curly braces {}";if(i==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(mt(e.schema)):"specific value"}`}function Fr(e){if(e.length===0)return"No errors";if(e.length===1)return e[0].message;let t=e.slice(0,3).map(n=>`${n.path}: ${n.message}`).join(", ");return e.length>3?`${t} and ${e.length-3} more...`:t}function ea(e){let t=new Map;for(let n of e){let o=n.path||"root",i=t.get(o)||[];i.push(n),t.set(o,i)}return t}function qn(e,t){let n=e.message.match(/position (\\d+)/),o=n?parseInt(n[1],10):0,i=1,a=1;if(o>0){let s=t.substring(0,o).split(`\n`);i=s.length,a=s[s.length-1].length+1}return{path:"root",message:`JSON Parse Error: ${e.message}`,code:"json_parse_error",line:i,column:a,suggestion:"Check for missing commas, quotes, or brackets"}}var Pd=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function sn(e){return Pd.test(e)}function an(e){let t=e.match(Pd);if(!t)throw new Error(`Invalid semver: "${e}". Expected format: major.minor.patch`);return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function zn(e,t){let n=an(e),o=an(t);return n.major-o.major||n.minor-o.minor||n.patch-o.patch}function et(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,n)=>zn(n,t)>0?n:t)}function yo(e){return e}function bo(e){if(!e.name)throw new Error("Component name is required");if(!e.versions||typeof e.versions!="object")throw new Error(`Component "${e.name}" requires a versions map`);let t=Object.keys(e.versions);if(t.length===0)throw new Error(`Component "${e.name}" must have at least one version`);for(let n of t){if(!sn(n))throw new Error(`Component "${e.name}": invalid semver key "${n}". Expected format: major.minor.patch`);let o=e.versions[n];if(!o.propsSchema)throw new Error(`Component "${e.name}" version "${n}" requires a propsSchema`);if(!o.render||typeof o.render!="function")throw new Error(`Component "${e.name}" version "${n}" requires a render function`)}return e}function Hn(e,t,n){let o=Object.keys(t);if(n){let a=t[n];if(!a)throw new Error(`Component "${e}" does not have version "${n}". Available versions: ${o.join(", ")}`);return a}let i=et(o);return t[i]}var xo=class Td extends Error{constructor(n){super(`Cannot register component "${n}": a component with this name is already registered. Component names must be unique within a document generator.`);$(this,"componentName");$(this,"code","DUPLICATE_COMPONENT");this.name="DuplicateComponentError",this.componentName=n,Error.captureStackTrace&&Error.captureStackTrace(this,Td)}},fs=class Ld extends Error{constructor(n,o){let i=n.map(s=>`"${s}"`).join(", "),a=o.length?o.map(s=>`"${s}"`).join(", "):"(none)";super(`preserveCustomComponents lists unregistered component name(s): ${i}. Registered components: ${a}.`);$(this,"unknownNames");$(this,"registeredNames");$(this,"code","UNKNOWN_PRESERVED_COMPONENT");this.name="UnknownPreservedComponentError",this.unknownNames=[...n],this.registeredNames=[...o],Error.captureStackTrace&&Error.captureStackTrace(this,Ld)}},Wn=class extends Error{constructor(t,n){let o=n!==void 0?`\nProps: ${JSON.stringify(n,null,2)}`:"",i=`Document validation failed:\n${t.map(a=>` ${a.path}: ${a.message}`).join(`\n`)}${o}`;super(i);$(this,"errors");$(this,"props");this.name="ComponentValidationError",this.errors=t,this.props=n}};function Rl(e,t,n){try{let o=P.Clone(t);if(n?.applyDefaults&&(o=P.Default(e,o)),n?.clean&&(o=P.Clean(e,o)),!P.Check(e,o)){let i=[...P.Errors(e,o)];return{valid:!1,errors:Ke(i,{jsonString:n?.jsonString,maxErrors:n?.maxErrors||100})}}return{valid:!0,data:o}}catch(o){return{valid:!1,errors:[{path:"root",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}]}}}function cn(e,t,n){let o=n?.componentName??"custom";try{let i=Rl(e,t,{...n,clean:n?.clean??!0,applyDefaults:n?.applyDefaults??!0});return{...i,success:i.valid,data:i.data,componentName:o,isCustomComponent:!0}}catch(i){return{valid:!1,success:!1,errors:[{path:"props",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}],componentName:o,isCustomComponent:!0}}}function hs(e){return e.valid===!0&&e.data!==void 0}function gs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Fr(e.errors)}function Nd(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e.properties?.name;return typeof t?.const=="string"?t.const:void 0}function FP(e){return typeof e.properties?.version?.const=="string"}function vP(e){return Array.isArray(e.required)&&e.required.includes("name")}function $P(e){let t=new Map;for(let n of e){let o=Nd(n),i=t.get(o);i?i.push(n):t.set(o,[n])}return t}function jP(e,t){let n=t.find(o=>!FP(o)&&typeof o.description=="string")??t.find(o=>typeof o.description=="string");return{const:e,type:"string",...n?{description:n.description}:{}}}function ta(e){let t=new WeakSet;function n(o){if(typeof o!="object"||o===null||t.has(o))return;if(t.add(o),Array.isArray(o)){o.forEach(n);return}let i=o,a=i.anyOf,c=Array.isArray(a)&&a.length>=2&&a.every(l=>Nd(l)!==void 0&&vP(l))&&i.properties===void 0&&i.allOf===void 0&&i.if===void 0&&i.required===void 0&&i.additionalProperties===void 0&&(i.type===void 0||i.type==="object")?$P(a):void 0;c&&c.size>=2&&(i.type="object",i.required=["name"],i.properties={name:{anyOf:[...c.entries()].map(([l,p])=>jP(l,p))}},i.allOf=[...c.entries()].map(([l,p])=>({if:{properties:{name:{const:l}},required:["name"]},then:p.length===1?p[0]:{anyOf:p}})),delete i.anyOf);for(let l of Object.values(i))n(l)}n(e)}function Ed(e){if(typeof e!="object"||e===null)return[];let t=e;return Array.isArray(t.anyOf)?t.anyOf.filter(n=>typeof n=="object"&&n!==null):Array.isArray(t.allOf)?t.allOf.flatMap(n=>{let o=n?.then;if(typeof o!="object"||o===null)return[];let i=o.anyOf;return Array.isArray(i)?i.filter(a=>typeof a=="object"&&a!==null):[o]}):[]}function vl(e,t,n){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(o=>{typeof o=="object"&&o!==null&&vl(o,t,n)});return}e.$ref===t&&(e.$ref=n);for(let o of Object.values(e))typeof o=="object"&&o!==null&&vl(o,t,n)}}function ln(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),o=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},i=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let d=p;if(d.type==="array"&&d.items&&Object.keys(d.items).length===0&&n.has(t)&&(d.items={$ref:`#/definitions/${t}`}),d.type==="array"&&d.items&&typeof d.items=="object"&&"$ref"in d.items&&i(d.items.$ref)){let b=d.items.$ref,I=o(b);d.items=I?{$ref:I}:{}}if(i(d.$ref)){let b=o(d.$ref);b?d.$ref=b:delete d.$ref}if(l==="$id"&&i(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function Oo(e,t={}){let{$schema:n="http://json-schema.org/draft-07/schema#",$id:o,title:i,description:a,definitions:s={}}=t,c=JSON.parse(JSON.stringify(e));if(c.$id&&typeof c.$id=="string"&&/^T\\d+$/.test(c.$id)){let d=c.$id;delete c.$id,vl(c,d,"#")}let l={...s};function p(d,b=""){if(!(typeof d!="object"||d===null)){for(let[I,w]of Object.entries(d))if(w&&typeof w=="object"){let C=w;if(C.$id&&typeof C.$id=="string"){let x=C.$id;if(b!==`definitions.${x}`){let{$id:K,...O}=C;l[x]=O,d[I]={$ref:`#/definitions/${x}`},p(O,`definitions.${x}`);continue}}p(w,b?`${b}.${I}`:I)}}}p(c);let m={$schema:n};return o&&(m.$id=o),Object.assign(m,c),m.$schema=n,o&&(m.$id=o),i!==void 0&&(m.title=i),a!==void 0&&(m.description=a),Object.keys(l).length>0&&(m.definitions=l),ln(m),ta(m),m}function So(e,t,n,o,i="ComponentDefinition"){let a={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};return n.includes(e)&&(a.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${i}`}},o&&(a.definitions={[i]:JSON.parse(JSON.stringify(o))})),ln(a,i),a.additionalProperties=!1,a}async function Io(e,t,n={}){let{prettyPrint:o=!0}=n,i=o?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>Am(Fl(),1))).writeFile(t,i,"utf-8")}function ys(e,t){let n={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(n.$schema=r.Optional(r.String({format:"uri"}))),n.props=e.propsSchema,e.hasChildren&&t&&(n.children=r.Optional(r.Array(t))),r.Object(n,{additionalProperties:!1})}var bs=["Arial","Calibri","Cambria","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","Helvetica","Helvetica Neue","Menlo","Monaco"];function Jn(e){let t=e.toLowerCase();return bs.some(n=>n.toLowerCase()===t)}var or=r.String({description:"Font family name. Prefer a SAFE_FONTS entry (Arial, Calibri, Cambria, Consolas, Courier New, Georgia, Segoe UI, Tahoma, Times New Roman, Trebuchet MS, Verdana, Helvetica, Helvetica Neue, Menlo, Monaco) for zero-setup rendering. For any other font, register it in props.fontRegistry[] and reference it here by family. Unregistered non-safe names render with a host fallback.",examples:["Arial","Calibri","Georgia","Inter","Roboto"]}),ra=r.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),xs=r.Boolean({description:"Whether this source is italic. Default false."}),UP=r.Object({kind:r.Literal("safe"),family:r.String({description:"A SAFE_FONTS name \\u2014 installed with Office."})},{additionalProperties:!1,description:"Office-installed font \\u2014 no embedding"}),kP=r.Object({kind:r.Literal("google"),family:r.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:r.Optional(r.Array(ra,{description:"Weights to fetch. Default [400, 700]."})),italics:r.Optional(r.Boolean({description:"Include italic variants. Default false."}))},{additionalProperties:!1,description:"Google Fonts \\u2014 auto-fetched and embedded"}),DP=r.Object({kind:r.Literal("file"),path:r.String({description:"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file."}),weight:r.Optional(ra),italic:r.Optional(xs)},{additionalProperties:!1,description:"Local font file to embed"}),MP=r.Object({kind:r.Literal("url"),url:r.String({description:"HTTPS URL of a TTF or OTF file."}),weight:r.Optional(ra),italic:r.Optional(xs)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),BP=r.Object({kind:r.Literal("variable"),url:r.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:ra,italic:r.Optional(xs),axes:r.Optional(r.Record(r.String(),r.Number(),{description:"Additional axis pin values (e.g. `{ ital: 1, opsz: 14 }`) merged on top of the derived `wght` pin. Uncommon \\u2014 the `weight` field is usually enough."}))},{additionalProperties:!1,description:"Variable-font instancer. The fetcher pins `wght` to `weight` (plus any `axes` overrides) and emits a clean static TTF, bypassing upstream distributions that collapse multiple static weights onto the same glyph geometry."}),_P=r.Object({kind:r.Literal("data"),data:r.String({description:"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size."}),weight:r.Optional(ra),italic:r.Optional(xs)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),$l=r.Union([UP,kP,DP,_P,MP,BP],{description:\'A single font variant source. Use kind:"safe" for installed fonts, kind:"google" for Google Fonts, kind:"file" for local files, kind:"data" for base64, kind:"url" for direct HTTPS TTF/OTF URLs, kind:"variable" to instance a variable TTF at a specific weight.\'}),VP=r.Union([r.Literal("sans"),r.Literal("serif"),r.Literal("mono"),r.Literal("display"),r.Literal("handwriting")],{description:"Broad category used for fallback selection"}),jl=r.Object({id:r.String({description:\'Registry key. By convention, match the display family name ("Inter", "Roboto Slab").\'}),family:r.String({description:"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id."}),category:r.Optional(VP),sources:r.Array($l,{minItems:1,description:"One or more weight/style variants. List at least a regular (weight 400, italic false)."})},{additionalProperties:!1,description:"A font registered for this document. Referenced by family from font.family, fontFace, and theme.fonts.*."}),ir=r.Array(jl,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."});function Fd(e,t){let n=KP(e);throw new Error(t?`Unhandled variant in ${t}: ${n}`:`Unhandled variant: ${n}`)}function KP(e){if(e===null||typeof e!="object")return String(e);let t=e.kind,n=e.type;if(typeof t=="string")return`kind="${t}"`;if(typeof n=="string")return`type="${n}"`;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}var Ul=class vd extends Error{constructor(n){let{format:o,rendererId:i,diagnostics:a}=n,s=Rd(a.map(l=>l.feature)),c=Rd(a.map(l=>l.path));super(qP(o,i,a,s));$(this,"code","UNSUPPORTED_RENDERER_FEATURE");$(this,"format");$(this,"rendererId");$(this,"features");$(this,"paths");$(this,"diagnostics");this.name="UnsupportedRendererFeatureError",this.format=o,this.rendererId=i,this.features=s,this.paths=c,this.diagnostics=[...a],Error.captureStackTrace&&Error.captureStackTrace(this,vd)}},GP=class $d extends Error{constructor(n,o,i){let a=i.map(s=>`"${s}"`).join(", ");super(`Unknown ${n} renderer "${o}". Available renderers: ${a}.`);$(this,"code","UNKNOWN_RENDERER");$(this,"format");$(this,"rendererId");$(this,"availableIds");this.name="UnknownRendererError",this.format=n,this.rendererId=o,this.availableIds=[...i],Error.captureStackTrace&&Error.captureStackTrace(this,$d)}};function Rd(e){return[...new Set(e)]}function qP(e,t,n,o){let i=o.map(s=>`"${s}"`).join(", "),a=n.map(s=>` - ${s.feature} at ${s.path}: ${s.message}`);return`The "${t}" ${e} renderer does not support ${o.length} required feature(s): ${i}.\n${a.join(`\n`)}`}function kl(e,t,n){return{feature:e,path:t,severity:"error",message:n}}function jd(e,t,n){return{feature:e,path:t,severity:"warning",message:n}}function Ud(e){let t=[],n=[];for(let o of e)o.severity==="error"?t.push(o):n.push(o);return{errors:t,warnings:n}}var kd=class{constructor(){$(this,"requirements",[]);$(this,"seen",new Set)}require(e,t,n){let o=`${e}\\0${t}`;this.seen.has(o)||(this.seen.add(o),this.requirements.push(n===void 0?{feature:e,path:t}:{feature:e,path:t,detail:n}))}list(){return this.requirements}features(){return[...new Set(this.requirements.map(e=>e.feature))]}isEmpty(){return this.requirements.length===0}};function Dl(e,t,n){let o=[];for(let i of e)t.has(i.feature)||o.push(kl(i.feature,i.path,zP(i,n)));return o}function zP(e,t){let n=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${n} (${e.detail})`:n}function Dd(e,t){let n=Dl(e,t.capabilities,t.id);if(n.length!==0)throw new Ul({format:t.format,rendererId:t.id,diagnostics:n})}var Md=class{constructor(e,t){$(this,"renderers",new Map);$(this,"statusCache");this.format=e,this.defaultId=t}register(e,t){this.renderers.set(e,t),this.statusCache=void 0}ids(){return[...this.renderers.keys()]}getDefaultId(){return this.defaultId}has(e){return this.renderers.has(e)}async resolve(e){let t=e??this.defaultId,n=this.renderers.get(t);if(!n)throw new GP(this.format,t,this.ids());try{return await n()}catch(o){throw HP(o,this.format,t)}}statuses(){return this.statusCache??(this.statusCache=this.probeStatuses()),this.statusCache}async probeStatuses(){return Promise.all(this.ids().map(async e=>{let t={id:e,default:e===this.defaultId};try{return await this.resolve(e),{...t,available:!0}}catch(n){let i=n instanceof Error&&n.name===Os&&n instanceof Error?n.packageName:void 0;return{...t,available:!1,reason:n instanceof Error?n.message:String(n),...i?{installHint:`pnpm add ${i}`}:{}}}}))}};function HP(e,t,n){let o=e instanceof Error?e.message:String(e);if(!/Cannot find (?:module|package)|ERR_MODULE_NOT_FOUND|Failed to resolve/i.test(o))return e instanceof Error?e:new Error(o);let a=WP(o),s=a??`the "${n}" backend`,c=new Error(`The "${n}" ${t} renderer requires ${s}, which is not installed. Install it with: pnpm add ${s}\nOriginal error: ${o}`);return c.name=Os,a&&(c.packageName=a),c}var Os="RendererDependencyMissingError";function WP(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var JP="Sheet1";var hG=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${JP}" sheetId="1" r:id="rId1"/></sheets></workbook>`;var na=200,oa=36,ia=600;function YP(e){return typeof e!="number"||!Number.isFinite(e)?na:Math.min(ia,Math.max(oa,Math.round(e)))}var XP=32,ZP=8*1024*1024,QP=32,qd=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),zd=new Set(["heading","body","mono","light"]),Hd=new Set(["fontRegistry"]);function _l(e,t,n){if(e!=null){if(typeof e=="string"){if(n&&(qd.has(n)||zd.has(n))){let o=e.trim();o.length>0&&t.add(o)}return}if(Array.isArray(e)){for(let o of e)_l(o,t,n);return}if(typeof e=="object"){let o=e.fonts;if(n==="theme"&&o&&typeof o=="object"){for(let[i,a]of Object.entries(o))if(typeof a=="string"){let s=a.trim();s.length>0&&t.add(s)}else if(a&&typeof a=="object"){let s=a.family;typeof s=="string"&&s.trim().length>0&&t.add(s.trim())}}for(let[i,a]of Object.entries(e))Hd.has(i)||_l(a,t,i)}}}function wo(e){let t=new Set;return _l(e,t),t}var eT=wo,tT=wo;function rT(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id=="string"&&typeof t.family=="string"&&Array.isArray(t.sources)}function Wd(e,t){if(!e||typeof e!="object")return[];let n=e[t];return Array.isArray(n)?n.filter(rT):[]}function nT(e){return!e||typeof e!="object"?[]:Wd(e.props,"fontRegistry")}function oT(e){return Wd(e,"fontRegistry")}function iT(...e){let t=[];for(let n of e)for(let o of n??[]){let i=o.family.toLowerCase(),a=o.id.toLowerCase();for(let s=t.length-1;s>=0;s--)t[s].family.toLowerCase()===i&&t[s].id.toLowerCase()===a&&t.splice(s,1);t.push(o)}return t}function aT(e){let t=new Set;for(let n of e??[])t.add(n.family.toLowerCase()),t.add(n.id.toLowerCase());return t}function sT(e){let t=aT(e.registeredEntries),n=[],o=[],i=[];for(let a of e.referencedNames){if(Jn(a)||t.has(a.toLowerCase())){n.push(a);continue}o.push(a),i.push({code:"FONT_UNRESOLVED",family:a,message:`Font "${a}" is not a SAFE_FONTS entry and is not registered via fonts.extraEntries. It will render with a host fallback on machines lacking the font. Safe fonts: ${bs.join(", ")}.`})}return{resolved:n,unresolved:o,warnings:i}}var Jd={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function cT(e,t,n){if(t==null)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===400)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===700)return{family:e,bold:!0,italic:n,nonCanonicalWeight:!1};let o=Jd[t];if(!o)return{family:e,bold:t>=600,italic:n,nonCanonicalWeight:!0};let i=n?` ${o} Italic`:` ${o}`;return{family:`${e}${i}`,bold:!1,italic:!1,nonCanonicalWeight:!1}}var Ss=5*1024*1024;function lT(e){let t=e.data.trim(),n;if(t.startsWith("data:")){let s=t.indexOf(",");if(s<0)throw new Error("Invalid data URL: no payload separator");if(!t.slice(5,s).includes(";base64"))throw new Error("Data URL must be base64-encoded");n=t.slice(s+1)}else n=t;if(Math.floor(n.length*3/4)>Ss)throw new Error(`Font data payload exceeds ${Ss} byte limit`);let i=Buffer.from(n,"base64");if(i.length===0)throw new Error("Decoded font buffer is empty");if(i.length>Ss)throw new Error(`Font data payload exceeds ${Ss} byte limit`);let a=Er(i);if(a==="unknown")throw new Error("Decoded font buffer is not a recognized font (expected TTF/OTF/WOFF/WOFF2)");return{data:i,weight:e.weight??400,italic:e.italic??!1,format:a}}var pT="Mozilla/4.0";async function Bd(e,t){let n=new AbortController,o=setTimeout(()=>n.abort(),t.timeoutMs??5e3);try{return await(t.fetcher??fetch)(e,{headers:t.headers,signal:n.signal})}finally{clearTimeout(o)}}function mT(e,t,n){let o=encodeURIComponent(e).replace(/%20/g,"+"),i=[...t].sort((s,c)=>s-c);if(n){let s=i.flatMap(c=>[`0,${c}`,`1,${c}`]).join(";");return`https://fonts.googleapis.com/css2?family=${o}:ital,wght@${s}&display=swap`}let a=i.join(";");return`https://fonts.googleapis.com/css2?family=${o}:wght@${a}&display=swap`}function uT(e){let t=[],n=/@font-face\\s*\\{([^}]*)\\}/g,o;for(;(o=n.exec(e))!==null;){let i=o[1],a=i.match(/src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/[^)]+\\.ttf)\\)/);if(!a)continue;let s=i.match(/font-weight:\\s*(\\d+)/),c=i.match(/font-style:\\s*italic/);t.push({weight:s?parseInt(s[1],10):400,italic:!!c,ttfUrl:a[1]})}return t}function _d(e,t,n){return`google|${e}|${t}|${n?"i":"r"}`}async function Yd(e){let t=e.weights?.length?e.weights:[400,700],n=e.italics??!1,o=[],i=[],a=[];for(let m of t)a.push({weight:m,italic:!1}),n&&a.push({weight:m,italic:!0});let s=[];for(let m of a){let d=_d(e.family,m.weight,m.italic),b=e.memoryCache?.get(d);if(b){i.push({data:b,weight:m.weight,italic:m.italic,format:Er(b)});continue}let I=await e.diskCache?.get(d);if(I){e.memoryCache?.set(d,I),i.push({data:I,weight:m.weight,italic:m.italic,format:Er(I)});continue}s.push(m)}if(s.length===0)return{sources:i,warnings:o};let c=s.some(m=>m.italic),l=mT(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await Bd(l,{headers:{"User-Agent":pT},timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!m.ok)return o.push(`Google Fonts CSS fetch for "${e.family}" returned ${m.status}`),{sources:i,warnings:o};let d=await m.text();p=uT(d)}catch(m){return o.push(`Google Fonts CSS fetch for "${e.family}" failed: ${m.message}`),{sources:i,warnings:o}}for(let m of s){let d=p.find(b=>b.weight===m.weight&&b.italic===m.italic);if(!d){o.push(`Google Fonts "${e.family}" missing weight ${m.weight}${m.italic?" italic":""}`);continue}try{let b=await Bd(d.ttfUrl,{timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!b.ok){o.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} returned ${b.status}`);continue}let I=await b.arrayBuffer(),w=Buffer.from(I),C=_d(e.family,m.weight,m.italic);e.memoryCache?.set(C,w),await e.diskCache?.set(C,w),i.push({data:w,weight:m.weight,italic:m.italic,format:Er(w)})}catch(b){o.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${b.message}`)}}return{sources:i,warnings:o}}function dT(e,t,n){return`url|${e}|${t}|${n?"i":"r"}`}async function fT(e){if(!us(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=dT(e.url,e.weight,e.italic),n=e.memoryCache?.get(t);if(n)return{source:{data:n,weight:e.weight,italic:e.italic,format:Er(n)},warnings:[]};let o=await e.diskCache?.get(t);if(o)return e.memoryCache?.set(t,o),{source:{data:o,weight:e.weight,italic:e.italic,format:Er(o)},warnings:[]};let i=new AbortController,a=setTimeout(()=>i.abort(),e.fetchTimeoutMs??1e4);try{let s=e.fetcher??fetch,c=await s(e.url,{signal:i.signal,redirect:"manual"}),l=0;for(;c.status>=300&&c.status<400&&c.status!==304;){let I=c.headers.get("location");if(!I)return{warnings:[`URL font fetch "${e.url}" ${c.status} with no Location header`]};let w=new URL(I,e.url).toString();if(!us(w))return{warnings:[`URL font fetch "${e.url}" redirected to disallowed host: ${w}`]};if(++l>3)return{warnings:[`URL font fetch "${e.url}" too many redirects`]};c=await s(w,{signal:i.signal,redirect:"manual"})}if(!c.ok)return{warnings:[`URL font fetch "${e.url}" returned ${c.status}`]};let p=await c.arrayBuffer(),m=Buffer.from(p),d=Er(m);if(d==="unknown"||m.length<512)return{warnings:[`URL font fetch "${e.url}" returned ${m.length} bytes of ${d} \\u2014 not a TTF/OTF. Skipping.`]};let b=m;return e.memoryCache?.set(t,b),await e.diskCache?.set(t,b),{source:{data:b,weight:e.weight,italic:e.italic,format:d},warnings:[]}}catch(s){return{warnings:[`URL font fetch "${e.url}" failed: ${s.message}`]}}finally{clearTimeout(a)}}var Vd=12,Kd=16;function hT(e,t){if(e.length<Vd)return null;let n=e.readUInt32BE(0);if(n!==65536&&n!==1330926671)return null;let o=e.readUInt16BE(4);for(let i=0;i<o;i++){let a=Vd+i*Kd;if(a+Kd>e.length)return null;if(e.toString("ascii",a,a+4)===t)return{off:e.readUInt32BE(a+8),len:e.readUInt32BE(a+12)}}return null}function gT(e){let t=hT(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function yT(e,t,n,o){let i=[],a=gT(e);a!=null&&a!==t&&i.push({code:"WEIGHT_CLASS_MISMATCH",message:`Font "${o}" weight ${t}: OS/2.usWeightClass reports ${a}. Likely a defective redistribution \\u2014 consider adding an upstream override.`});let s=Ll(e);s.length>0&&!s.includes(o.trim())&&i.push({code:"FAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name table declares ${s.map(d=>`"${d}"`).join(" / ")}, not "${o}". Referencing runs will not resolve this face.`});let c=Nl(t,n);if(!c)return i;let l=c.typographic,p=c.legacy,m=ms(e,new Set([2,17]));for(let d of m)d.nameID===17&&d.value!==l&&i.push({code:"SUBFAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name record (platform ${d.platformID}) nameID 17 = "${d.value}", expected "${l}".`}),d.nameID===2&&d.value!==p&&i.push({code:"LEGACY_SUBFAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name record (platform ${d.platformID}) nameID 2 = "${d.value}", expected "${p}".`});return i}var bT=new Set([65536,1330926671,1953658213,1954115633]),Ml=12,Gd=16;function xT(e,t,n,o){let i=`Font "${o}" weight ${t}${n?" italic":""}`,a=b=>({code:"FONT_UNREADABLE",message:`${i}: ${b} The face will not resolve; text referencing it renders in a fallback.`});if(e.length<Ml)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!bT.has(s))return a(`sfnt version 0x${s.toString(16).padStart(8,"0")} is neither TrueType nor OpenType.`);let c=e.readUInt16BE(4);if(c===0)return a("its table directory is empty.");let l=Ml+c*Gd;if(l>e.length)return a(`its directory claims ${c} tables (${l} bytes) but the file is ${e.length} bytes \\u2014 truncated.`);let p=new Set;for(let b=0;b<c;b+=1){let I=Ml+b*Gd,w=e.toString("ascii",I,I+4),C=e.readUInt32BE(I+8),x=e.readUInt32BE(I+12);if(C+x>e.length)return a(`its "${w}" table runs to byte ${C+x} but the file is ${e.length} bytes \\u2014 truncated.`);p.add(w)}for(let b of["name","head"])if(!p.has(b))return a(`it has no "${b}" table.`);let m=p.has("glyf")&&p.has("loca"),d=p.has("CFF ")||p.has("CFF2");return!m&&!d?a(\'it carries no glyph outlines (neither "glyf" + "loca" nor "CFF ").\'):ms(e).length===0?a(\'its "name" table carries no readable records.\'):null}var OT=class{constructor(e={}){$(this,"store",new Map);$(this,"bytes",0);$(this,"maxBytes");this.maxBytes=e.maxBytes??20*1024*1024}get(e){let t=this.store.get(e);if(t)return this.store.delete(e),this.store.set(e,t),t}set(e,t){let n=this.store.get(e);for(n&&(this.bytes-=n.byteLength),this.store.set(e,t),this.bytes+=t.byteLength;this.bytes>this.maxBytes&&this.store.size>0;){let o=this.store.keys().next().value;if(!o)break;let i=this.store.get(o);this.store.delete(o),i&&(this.bytes-=i.byteLength)}}size(){return this.store.size}};function ST(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let n=Ll(e.data);if(n.length===0||n.includes(t))return e;let o=Nl(e.weight,e.italic)?.legacy;return{...e,data:Al(e.data,t,o)}}var IT=class{constructor(e={}){$(this,"index");$(this,"cache");$(this,"opts");$(this,"memoryCache");$(this,"diskCache");$(this,"fileLoader");$(this,"variableLoader");this.opts=e.opts??{},this.index=new Map,this.cache=new Map,this.memoryCache=new OT,this.diskCache=e.diskCache,this.fileLoader=e.fileLoader,this.variableLoader=e.variableLoader;for(let t of this.opts.extraEntries??[])this.addEntry(t)}addEntry(e){this.index.set(e.family.toLowerCase(),e),this.index.set(e.id.toLowerCase(),e)}async resolveMany(e){let t=[];for(let n of e)t.push(await this.resolve(n));return t}async resolve(e){let t=e.toLowerCase(),n=this.cache.get(t);if(n)return n;let o=this.index.get(t),i;return o?i=await this.materializeEntry(o):Jn(e)?i={family:e,sources:[],warnings:[]}:i={family:e,sources:[],warnings:[`Font "${e}" is not registered and not in SAFE_FONTS; will rely on host fallback.`]},this.cache.set(t,i),i}async materializeEntry(e){let t=[],n=[];for(let o of e.sources)try{let i=await this.materializeSource(o,n);for(let a of i){let s=a.format==="ttf"||a.format==="otf",c=s?xT(a.data,a.weight,a.italic,e.family):null;if(c){n.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=ST(a,e.family);if(s)for(let p of yT(l.data,l.weight,l.italic,e.family))n.push(`[FONT_METADATA_DEFECT:${p.code}] ${p.message}`);t.push(l)}}catch(i){n.push(`Font "${e.family}" source (${o.kind}) failed: ${i.message}`)}return{family:e.family,sources:t,warnings:n}}async materializeSource(e,t){switch(e.kind){case"safe":return[];case"file":return this.fileLoader?[await this.fileLoader({path:e.path,weight:e.weight,italic:e.italic,baseDir:this.opts.baseDir})]:(t.push(`kind:"file" source for "${e.path}" requires a fileLoader (Node-only); skipping.`),[]);case"data":return[lT({data:e.data,weight:e.weight,italic:e.italic})];case"google":{let n=this.opts.googleFonts;if(n?.enabled===!1)return t.push(`Google Fonts fetch disabled \\u2014 skipping "${e.family}".`),[];let{sources:o,warnings:i}=await Yd({family:e.family,weights:e.weights??[400,700],italics:e.italics??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return t.push(...i),o}case"url":{let n=this.opts.googleFonts,{source:o,warnings:i}=await fT({url:e.url,weight:e.weight??400,italic:e.italic??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return i&&t.push(...i),o?[o]:[]}case"variable":{if(!this.variableLoader)return t.push(`kind:"variable" source for "${e.url}" requires a variableLoader (Node-only); skipping.`),[];let n=this.opts.googleFonts,{source:o,warnings:i}=await this.variableLoader({url:e.url,weight:e.weight,italic:e.italic??!1,axes:e.axes,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return i&&t.push(...i),o?[o]:[]}default:throw new Error(`Unknown font source kind: ${e.kind}`)}}},Xd=[{family:"Inter",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!1},{family:"Roboto",category:"sans",weights:[100,300,400,500,700,900],hasItalic:!0},{family:"Open Sans",category:"sans",weights:[300,400,500,600,700,800],hasItalic:!0},{family:"Lato",category:"sans",weights:[100,300,400,700,900],hasItalic:!0},{family:"Montserrat",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Poppins",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Work Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Nunito",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Rubik",category:"sans",weights:[300,400,500,600,700,800,900],hasItalic:!0},{family:"Source Sans 3",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Manrope",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!1},{family:"Plus Jakarta Sans",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!0},{family:"IBM Plex Sans",category:"sans",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Archivo",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Geist",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Grotesk",category:"sans",weights:[300,400,500,600,700],hasItalic:!1},{family:"Playfair Display",category:"serif",weights:[400,500,600,700,800,900],hasItalic:!0},{family:"Merriweather",category:"serif",weights:[300,400,700,900],hasItalic:!0},{family:"Lora",category:"serif",weights:[400,500,600,700],hasItalic:!0},{family:"Source Serif 4",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Serif Display",category:"serif",weights:[400],hasItalic:!0},{family:"Crimson Pro",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Cormorant Garamond",category:"serif",weights:[300,400,500,600,700],hasItalic:!0},{family:"JetBrains Mono",category:"mono",weights:[100,200,300,400,500,600,700,800],hasItalic:!0},{family:"Fira Code",category:"mono",weights:[300,400,500,600,700],hasItalic:!1},{family:"IBM Plex Mono",category:"mono",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Source Code Pro",category:"mono",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Mono",category:"mono",weights:[400,700],hasItalic:!0},{family:"Geist Mono",category:"mono",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Bebas Neue",category:"display",weights:[400],hasItalic:!1},{family:"Abril Fatface",category:"display",weights:[400],hasItalic:!1},{family:"Archivo Black",category:"display",weights:[400],hasItalic:!1},{family:"Oswald",category:"display",weights:[200,300,400,500,600,700],hasItalic:!1},{family:"Caveat",category:"handwriting",weights:[400,500,600,700],hasItalic:!1},{family:"Pacifico",category:"handwriting",weights:[400],hasItalic:!1}],wT="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",CT="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function PT(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(o=>({kind:"variable",url:wT,weight:o,italic:!1})),n=e.map(o=>({kind:"variable",url:CT,weight:o,italic:!0}));return[...t,...n]}var Zd={inter:{reason:"Google\'s static Inter Thin/ExtraLight both carry usWeightClass=250 and near-identical glyph outlines (xAvgCharWidth differs by 1.8%); instancing the upstream variable font per weight produces properly distinct statics.",variants:PT()}};function TT(e){return Zd[e.toLowerCase()]}function Vl(e,t){let n=new Map,o=ws(e,t,n),i=[];for(let[a,s]of n)i.push({from:a,to:s});return{doc:o,substitutions:i}}function ws(e,t,n,o){if(e==null)return e;if(typeof e=="string")return o&&(qd.has(o)||zd.has(o))?Bl(e,t,n):e;if(Array.isArray(e))return e.map(i=>ws(i,t,n,o));if(typeof e=="object"){let i={};for(let[a,s]of Object.entries(e)){if(Hd.has(a)){i[a]=s;continue}if(o==="theme"&&a==="fonts"&&s&&typeof s=="object"){let c={};for(let[l,p]of Object.entries(s))if(typeof p=="string")c[l]=Bl(p,t,n);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:Bl(m,t,n)}:ws(p,t,n,l)}else c[l]=p;i[a]=c;continue}i[a]=ws(s,t,n,a)}return i}return e}function Bl(e,t,n){let o=e.trim();if(o.length===0||Jn(o))return e;let i=o.toLowerCase();for(let[a,s]of Object.entries(t))if(a.toLowerCase()===i)return n.set(o,s),s;return e}var LT={Inter:"Calibri",Roboto:"Calibri","Open Sans":"Calibri",Lato:"Calibri","Source Sans 3":"Calibri","Source Sans Pro":"Calibri","IBM Plex Sans":"Calibri",Archivo:"Calibri",Geist:"Calibri","Space Grotesk":"Calibri","Work Sans":"Calibri",Manrope:"Calibri",Nunito:"Calibri","Nunito Sans":"Calibri",Poppins:"Calibri",Montserrat:"Calibri","Playfair Display":"Georgia",Merriweather:"Georgia","Source Serif 4":"Cambria","Source Serif Pro":"Cambria","IBM Plex Serif":"Cambria","Crimson Pro":"Cambria",Lora:"Georgia","PT Serif":"Georgia","Cormorant Garamond":"Cambria","JetBrains Mono":"Consolas","Fira Code":"Consolas","IBM Plex Mono":"Consolas","Source Code Pro":"Consolas","Roboto Mono":"Consolas","Geist Mono":"Consolas"},AT={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function Qd(e){let t=e.trim();for(let[o,i]of Object.entries(LT))if(o.toLowerCase()===t.toLowerCase())return i;let n=Xd.find(o=>o.family.toLowerCase()===t.toLowerCase());if(n){let o=AT[n.category];if(o)return o}return"Calibri"}function ef(e){let t={};for(let n of e){let o=n.trim();o.length!==0&&(Jn(o)||t[o]||(t[o]=Qd(o)))}return t}function NT(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...wo(e.doc),...wo(e.theme)])].filter(b=>!Jn(b.trim())),d=m.length>0?[{code:"FONT_MODE_CUSTOM",message:`Export mode "custom": non-safe font references (${m.join(", ")}) kept as-is. Recipients need these fonts installed locally; Word falls back to a generic substitute otherwise.`}]:[];return{doc:e.doc,theme:e.theme,warnings:d}}let n=new Set([...wo(e.doc),...wo(e.theme)]),i={...ef(n),...e.fonts?.substitution??{}},a=Vl(e.doc,i),s=Vl(e.theme,i),c=new Map;for(let p of a.substitutions)c.set(p.from,p.to);for(let p of s.substitutions)c.set(p.from,p.to);let l=[];if(c.size>0){let p=[...c].map(([m,d])=>`${m} \\u2192 ${d}`).join(", ");l.push({code:"FONT_MODE_SUBSTITUTED",message:`Export mode "substitute": rewrote non-safe families to safe equivalents \\u2014 ${p}. No fonts embedded; document renders identically on every machine.`})}return{doc:a.doc,theme:s.doc,warnings:l}}var ET=["primary","secondary","accent","accent4","accent5","accent6"];function Is(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function tf(e,t){let n={...e};return Is(e)&&Is(t)&&Object.keys(t).forEach(o=>{Is(t[o])?!(o in e)||!Is(e[o])?n[o]=t[o]:n[o]=tf(e[o],t[o]):n[o]=t[o]}),n}function RT(e,t){return tf(t,e)}var Gl={};Ge(Gl,{ComponentValidationError:()=>Wn,DuplicateComponentError:()=>xo,UnknownPreservedComponentError:()=>fs,createComponent:()=>bo,createVersion:()=>yo,getValidationSummary:()=>gs,isValidationSuccess:()=>hs,resolveComponentVersion:()=>Hn,validateAgainstSchema:()=>Rl,validateCustomComponentProps:()=>cn});var tm={};Ge(tm,{AlignmentSchema:()=>vr,BASE_SCHEMA_METADATA:()=>Ah,BaseComponentPropsSchema:()=>sf,BorderSchema:()=>of,COMPONENT_METADATA:()=>Lh,ChartPropsSchema:()=>Lp,ColumnsPropsSchema:()=>_r,CommentReplySchema:()=>gp,CommentSchema:()=>Eo,ComponentDefinitionSchema:()=>rt,CustomComponentDefinitionSchema:()=>sr,DEFAULT_DOCX_RENDERER_ID:()=>da,DEFAULT_ERROR_CONFIG:()=>nn,DOCX_RENDERER_IDS:()=>Qn,DividerPropsSchema:()=>Pp,ERROR_EMOJIS:()=>Gn,ERROR_TEMPLATES:()=>eh,EndnotesSchema:()=>bp,FootnotesSchema:()=>yp,GenerateDocumentRequestSchema:()=>bh,GenerateDocumentResponseSchema:()=>Oh,HeadingLevelSchema:()=>Ps,HeadingPropsSchema:()=>jr,HighchartsPropsSchema:()=>Tp,ImagePropsSchema:()=>kr,IndentSchema:()=>mn,JSON_SCHEMA_URLS:()=>wh,JsonComponentDefinitionSchema:()=>Ih,JsonDocumentParser:()=>Qp,JsonParsingError:()=>Mo,JsonValidationError:()=>Bo,JustifiedAlignmentSchema:()=>sa,LineSpacingSchema:()=>ca,ListMarkerFontSchema:()=>Sp,ListPropsSchema:()=>Vr,MarginsSchema:()=>nf,NATIVE_RENDER_MODE:()=>Us,NATIVE_VISUAL_ELEMENT_NAMES:()=>yf,NativeVisualCanvasSchema:()=>ap,NativeVisualElementSchema:()=>ip,NativeVisualImagePropsSchema:()=>op,NativeVisualShapePropsSchema:()=>np,NativeVisualTextPropsSchema:()=>rp,NoteSchema:()=>Ms,NumberingSchema:()=>af,ParagraphIndentSchema:()=>la,ParagraphPropsSchema:()=>Ur,ReportPropsSchema:()=>Kr,RevisionMarkSchema:()=>hp,RevisionSchema:()=>No,RevisionSegmentSchema:()=>fp,SHARED_DOCX_VERSION:()=>JA,STANDARD_COMPONENTS:()=>Dh,STANDARD_COMPONENTS_REGISTRY:()=>tt,STANDARD_COMPONENTS_SET:()=>$A,SectionPropsSchema:()=>Br,SpacingSchema:()=>ut,StandardComponentDefinitionSchema:()=>Ks,StatisticPropsSchema:()=>Dr,THEME_SCHEMA_METADATA:()=>Nh,TabStopLeaderSchema:()=>Jl,TabStopSchema:()=>Yl,TabStopTypeSchema:()=>Wl,TabStopsSchema:()=>Ts,TablePropsSchema:()=>Mr,TextBoxPropsSchema:()=>wp,TextSpaceAfterComponentSchema:()=>Np,TextSpaceAfterPropsSchema:()=>Ap,ThemeConfigSchema:()=>Fo,TocPropsSchema:()=>Cp,ValidateDocumentRequestSchema:()=>xh,ValidateDocumentResponseSchema:()=>Sh,VisualCanvasBackgroundSchema:()=>sp,VisualCanvasSchema:()=>cp,VisualNativePropsSchema:()=>pp,VisualPropsSchema:()=>js,VisualRasterPropsSchema:()=>lp,calculatePosition:()=>go,clearComponentNamesCache:()=>Zi,collectDocxRendererErrors:()=>Ds,collectIndentConflicts:()=>Up,collectNoteRevisionConflicts:()=>kp,collectTextBoxShapeConflicts:()=>Dp,compareSemver:()=>zn,componentValidator:()=>Uo,comprehensiveValidateDocument:()=>Bp,convertDocxToJsonSchema:()=>Ch,convertToJsonSchema:()=>Oo,createComponentSchema:()=>So,createComponentValidator:()=>Xs,createDocumentValidator:()=>zs,createDocxComponentSchema:()=>Ph,createErrorConfig:()=>nr,createJsonParseError:()=>qn,createJsonValidator:()=>qf,createMinimalTheme:()=>$f,createThemeValidator:()=>Ys,createValidatedComponent:()=>FA,createValidator:()=>Gf,deepValidateDocument:()=>Mp,diffDocuments:()=>bA,diffWords:()=>ic,documentValidator:()=>jo,docxComponentDefinitionName:()=>fa,exportDocxSchemaToFile:()=>Th,exportSchemaToFile:()=>Io,extractStandardComponentNames:()=>Kn,fixDocxSchemaReferences:()=>Zs,fixSchemaReferences:()=>ln,formatErrorMessage:()=>tr,formatErrorReport:()=>Sa,formatErrorSummary:()=>Fr,formatValidationError:()=>AA,formatValidationErrorStrings:()=>NA,formatValidationErrors:()=>SA,generateUnifiedDocumentSchema:()=>Df,getAllStandardComponentNames:()=>jf,getErrorSummary:()=>kh,getLiteralValue:()=>mt,getObjectSchemaPropertyNames:()=>rr,getSchemaMetadata:()=>Qi,getStandardComponent:()=>ha,getThemeName:()=>nh,getValidationContext:()=>LA,getValidationErrors:()=>CA,getValidationSummary:()=>Hf,groupErrorsByPath:()=>ea,hasCriticalErrors:()=>Ia,isColumnsComponent:()=>kA,isColumnsProps:()=>ph,isCustomComponentProps:()=>hh,isHeadingComponent:()=>DA,isHeadingProps:()=>ch,isHighchartsComponent:()=>zA,isImageComponent:()=>BA,isImageProps:()=>mh,isListComponent:()=>GA,isListProps:()=>fh,isLiteralSchema:()=>Rr,isNativeVisualProps:()=>xf,isObjectSchema:()=>Rt,isParagraphComponent:()=>MA,isParagraphProps:()=>lh,isReportComponent:()=>jA,isReportProps:()=>ah,isSectionComponent:()=>UA,isSectionProps:()=>sh,isStandardComponentName:()=>Do,isStatisticComponent:()=>VA,isStatisticProps:()=>uh,isTableComponent:()=>KA,isTableProps:()=>dh,isTextBoxComponent:()=>_A,isTextSpaceAfterComponent:()=>WA,isThemeConfig:()=>oh,isTocComponent:()=>qA,isUnionSchema:()=>Xi,isValidComponent:()=>vA,isValidDocument:()=>Yf,isValidSemver:()=>sn,isValidTheme:()=>rh,isValidThemeConfig:()=>vf,isValidThemeJson:()=>rh,isValidationSuccess:()=>zf,isVisualComponent:()=>HA,latestVersion:()=>et,parseJsonComponent:()=>xA,parseJsonWithLineNumbers:()=>OA,parseSemver:()=>an,safeValidateComponentDefinition:()=>wA,safeValidateComponentProps:()=>IA,sharedCreateComponentSchemaObject:()=>ys,strictComponentValidator:()=>Ws,strictDocumentValidator:()=>ga,strictThemeValidator:()=>Hs,stripMarkdown:()=>xa,themeValidator:()=>ya,transformAndValidate:()=>RA,transformDocxValueError:()=>$p,transformDocxValueErrors:()=>jp,transformValueError:()=>on,transformValueErrors:()=>Ke,validate:()=>gh,validateAgainstSchema:()=>dt,validateBatch:()=>Vf,validateComponent:()=>cc,validateComponentDefinition:()=>em,validateComponentProps:()=>ko,validateComponents:()=>EA,validateCustomComponentProps:()=>Gp,validateDocument:()=>Gs,validateDocumentWithSchema:()=>Qf,validateJson:()=>$o,validateJsonComponent:()=>qs,validateJsonComponentDoc:()=>Zf,validateJsonDocument:()=>qs,validateStrict:()=>yh,validateTheme:()=>Js,validateThemeJson:()=>_p,validateThemeWithEnhancement:()=>Vp,validateWithEnhancement:()=>Kf});var A=r.String({pattern:"^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix (e.g. "#000000") or theme color name\'}),ql=r.String({pattern:"^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix, theme color name, or "transparent"\'}),zl=r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'BCP-47 language tag for spell/grammar checking (e.g. "en-US", "fr-FR", "de-DE")\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]}),Hl=r.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),aa=r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.",examples:[["Wiseair","json-to-office","pptx"]]}),Cs=r.Object({size:r.Optional(r.Number({minimum:8,maximum:120})),color:r.Optional(A),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Any integer accepted; renderer picks the closest embedded variant via CSS font-matching. `bold: true` is shorthand for `fontWeight: 700`; if both are set, `fontWeight` wins."})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),lineSpacing:r.Optional(r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead."}))},{additionalProperties:!1})),spacing:r.Optional(r.Object({before:r.Optional(r.Number({minimum:0})),after:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),characterSpacing:r.Optional(r.Object({type:r.Union([r.Literal("condensed"),r.Literal("expanded")]),value:r.Number()},{additionalProperties:!1})),scale:r.Optional(r.Number({minimum:1,maximum:600,description:"Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115)."}))},{additionalProperties:!1}),pn=r.Object({family:or,...Cs.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var vr=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Text alignment options"}),sa=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Text alignment options including justify"}),Ps=r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)],{description:"Heading level (1-6)"}),ut=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before element in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after element in points"}))},{description:"Spacing configuration",additionalProperties:!1}),rf=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before list in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after list in points"})),item:r.Optional(r.Number({minimum:0,description:"Spacing between list items in points"}))},{description:"List spacing configuration with item spacing",additionalProperties:!1}),nf=r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0}))},{description:"Margin configuration",additionalProperties:!1}),of=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(A)},{description:"Border configuration",additionalProperties:!1}),ca=r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. `exactly` has no floor of its own \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so a box smaller than the text it holds is accepted here and clips it."}))},{description:"Line spacing configuration",additionalProperties:!1}),mn=r.Object({left:r.Optional(r.Number({minimum:0,description:"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in points \\u2014 how far the marker sits left of the text. Omit for the 18pt default."}))},{description:"Indentation configuration, in points",additionalProperties:!1}),la=r.Object({left:r.Optional(r.Number({description:"Left indentation in twips (1/20 of a point)"})),right:r.Optional(r.Number({description:"Right indentation in twips (1/20 of a point)"})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine."})),firstLine:r.Optional(r.Number({minimum:0,description:"First-line indent in twips: only the first line is indented. Mutually exclusive with hanging."}))},{description:"Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.",additionalProperties:!1}),Wl=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("decimal"),r.Literal("bar")],{description:"Tab stop alignment type"}),Jl=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("underscore"),r.Literal("middleDot"),r.Literal("none")],{description:"Leader character filling the space before the tab stop"}),Yl=r.Object({type:Wl,position:r.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:r.Optional(Jl)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1}),Ts=r.Array(Yl,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),FT=r.Union([r.Literal("character"),r.Literal("column"),r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Horizontal position relative to"}),vT=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("paragraph"),r.Literal("line"),r.Literal("text")],{description:"Vertical position relative to"}),$T=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Horizontal alignment"}),jT=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Vertical alignment"}),UT=r.Union([r.Literal("none"),r.Literal("square"),r.Literal("topAndBottom"),r.Literal("around"),r.Literal("tight"),r.Literal("through")],{description:"Text wrapping type"}),kT=r.Union([r.Literal("bothSides"),r.Literal("left"),r.Literal("right"),r.Literal("largest")],{description:"Text wrapping side"}),Yn=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(FT),align:r.Optional($T),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(vT),align:r.Optional(jT),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:UT,side:r.Optional(kT),margins:r.Optional(r.Object({top:r.Optional(r.Union([r.Number({description:"Top margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Top margin as percentage of page height"})])),bottom:r.Optional(r.Union([r.Number({description:"Bottom margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Bottom margin as percentage of page height"})])),left:r.Optional(r.Union([r.Number({description:"Left margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Left margin as percentage of page width"})])),right:r.Optional(r.Union([r.Number({description:"Right margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Right margin as percentage of page width"})]))},{description:"Distance from text margins",additionalProperties:!1}))},{description:"Text wrapping configuration",additionalProperties:!1})),allowOverlap:r.Optional(r.Boolean({description:"Allow element to overlap with other elements"})),behindDocument:r.Optional(r.Boolean({description:"Place element behind document text"})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),layoutInCell:r.Optional(r.Boolean({description:"Layout element within table cell"})),zIndex:r.Optional(r.Number({minimum:0,description:"Z-order for overlapping elements (must be non-negative)"})),rotation:r.Optional(r.Number({description:"Rotation angle in degrees"})),visibility:r.Optional(r.Union([r.Literal("hidden"),r.Literal("inherit")],{description:"Visibility of the floating element"}))},{description:"Floating element properties",additionalProperties:!1}),af=r.Object({start:r.Optional(r.Number({minimum:1})),style:r.Optional(r.Union([r.Literal("decimal"),r.Literal("lowerLetter"),r.Literal("upperLetter"),r.Literal("lowerRoman"),r.Literal("upperRoman")])),separator:r.Optional(r.String())},{description:"Numbering configuration for lists",additionalProperties:!1}),DT={},sf=r.Object(DT,{description:"Base component props",additionalProperties:!0});var MT=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),As=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],Ns=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],ar=r.Union([MT,...As.map(e=>r.Literal(e)),...Ns.map(e=>r.Literal(e))],{description:"Hex color or semantic theme color name"}),Po=["title","subtitle","heading1","heading2","heading3","body","caption"],pa=r.Union(Po.map(e=>r.Literal(e)),{description:"Predefined style name"}),ma=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Horizontal alignment options"}),Xn=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical alignment options"}),To=r.Object({type:r.Optional(r.Union([r.Literal("outer"),r.Literal("inner")],{description:"Shadow type"})),color:r.Optional(ar),blur:r.Optional(r.Number({description:"Shadow blur radius in points"})),offset:r.Optional(r.Number({description:"Shadow offset in points"})),angle:r.Optional(r.Number({description:"Shadow angle in degrees"})),opacity:r.Optional(r.Number({minimum:0,maximum:1,description:"Shadow opacity (0-1)"}))},{description:"Shadow configuration",additionalProperties:!1}),un=r.Object({column:r.Number({minimum:0,description:"Starting column (0-indexed)"}),row:r.Number({minimum:0,description:"Starting row (0-indexed)"}),columnSpan:r.Optional(r.Number({minimum:1,description:"Number of columns to span (default: 1)"})),rowSpan:r.Optional(r.Number({minimum:1,description:"Number of rows to span (default: 1)"}))},{additionalProperties:!1,description:"Grid-based positioning"}),Es=r.Object({text:r.String({description:"Run text content"}),color:r.Optional(r.String({description:"Run color (hex without # or semantic theme name)"})),bold:r.Optional(r.Boolean({description:"Bold run"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Overrides `bold` when set \\u2014 renderer picks the closest embedded variant via CSS font-matching."})),italic:r.Optional(r.Boolean({description:"Italic run"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough run"})),fontSize:r.Optional(r.Number({minimum:1,description:"Run font size in points"})),fontFace:r.Optional(r.String({description:"Run font family"})),superscript:r.Optional(r.Boolean({description:"Render run as superscript"})),subscript:r.Optional(r.Boolean({description:"Render run as subscript"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"})),breakLine:r.Optional(r.Boolean({description:"Insert line break after this run"}))},{description:"A styled text run. Run options override component-level defaults.",additionalProperties:!1}),dn=r.Object({text:r.Optional(r.String({description:"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two."})),runs:r.Optional(r.Array(Es,{minItems:1,description:"Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` \\u2014 set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position\\u2026) still apply to the whole block."})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fontSize:r.Optional(r.Number({minimum:1,description:"Font size in points"})),fontFace:r.Optional(or),color:r.Optional(r.String({description:\'Text color (hex without #, e.g., "FF0000")\'})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough text"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Language tag (BCP-47, e.g. "en-US", "fr-FR") for spell-checking this text. Overrides the presentation default.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),align:r.Optional(ma),valign:r.Optional(Xn),breakLine:r.Optional(r.Boolean({description:"Add line break after text"})),bullet:r.Optional(r.Union([r.Boolean({description:"Enable default bullet"}),r.Object({type:r.Optional(r.Union([r.Literal("bullet"),r.Literal("number")])),style:r.Optional(r.String({description:"Bullet character or style"})),startAt:r.Optional(r.Number({description:"Starting number for numbered lists"}))},{additionalProperties:!1})])),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{description:"Margins as [top, right, bottom, left] in points",minItems:4,maxItems:4})])),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),shadow:r.Optional(To),fill:r.Optional(r.Object({color:r.String({description:"Fill color (hex without #)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"}))},{additionalProperties:!1})),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),lineSpacing:r.Optional(r.Number({description:"Line spacing in points"})),lineSpacingMultiple:r.Optional(r.Number({minimum:.1,maximum:10,description:"Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing."})),charSpacing:r.Optional(r.Number({description:"Character spacing in points (positive = wider, negative = tighter)"})),paraSpaceBefore:r.Optional(r.Number({description:"Space before paragraph in points"})),paraSpaceAfter:r.Optional(r.Number({description:"Space after paragraph in points"})),grid:r.Optional(un),style:r.Optional(pa)},{description:"Text component props",additionalProperties:!1}),fn=r.Object({path:r.Optional(r.String({description:"Image file path or URL (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:"Base64-encoded image data in data URI format (mutually exclusive with path and svg)"})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.\'})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"Image sizing strategy"}),w:r.Optional(r.Number({description:"Target width in inches"})),h:r.Optional(r.Number({description:"Target height in inches"}))},{description:"Image sizing options",additionalProperties:!1})),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),rounding:r.Optional(r.Boolean({description:"Apply rounded corners to image"})),shadow:r.Optional(To),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),grid:r.Optional(un)},{description:"PPTX image component props",additionalProperties:!1}),Lo=r.Union([r.Literal("rect"),r.Literal("roundRect"),r.Literal("ellipse"),r.Literal("triangle"),r.Literal("diamond"),r.Literal("pentagon"),r.Literal("hexagon"),r.Literal("star5"),r.Literal("star6"),r.Literal("line"),r.Literal("arc"),r.Literal("pie"),r.Literal("blockArc"),r.Literal("chord"),r.Literal("arrow"),r.Literal("chevron"),r.Literal("cloud"),r.Literal("heart"),r.Literal("lightning")],{description:"Shape type"}),lf=r.Object({text:r.String(),fontSize:r.Optional(r.Number({minimum:1})),fontFace:r.Optional(r.String()),color:r.Optional(r.String({description:"Segment color (hex without # or semantic name)"})),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),breakLine:r.Optional(r.Boolean({description:"Insert line break after this segment"})),spaceBefore:r.Optional(r.Number({minimum:0,description:"Space before paragraph in points"})),spaceAfter:r.Optional(r.Number({minimum:0,description:"Space after paragraph in points"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"}))},{additionalProperties:!1}),Rs=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],Fs=r.Object({color:r.String({description:"Stop color (hex without # or semantic theme name)"}),pos:r.Number({minimum:0,maximum:100,description:"Stop position along the gradient (0-100)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Stop transparency (0-100)"}))},{additionalProperties:!1,description:"Gradient color stop"}),Ao=r.Object({type:r.Union([r.Literal("linear"),r.Literal("radial")],{description:"Gradient type"}),angle:r.Optional(r.Number({minimum:0,maximum:360,description:"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0."})),stops:r.Array(Fs,{minItems:2,description:"Gradient color stops (at least 2)"}),focus:r.Optional(r.Union([r.Literal("center"),r.Literal("topLeft"),r.Literal("topRight"),r.Literal("bottomLeft"),r.Literal("bottomRight")],{description:\'Focus point for radial gradients (default: "center")\'}))},{additionalProperties:!1,description:"Gradient fill configuration"}),vs=r.Object({preset:r.Union(Rs.map(e=>r.Literal(e)),{description:"OOXML pattern preset name (a:pattFill prst value)"}),foreground:r.String({description:"Pattern foreground color (hex without # or semantic name)"}),background:r.String({description:"Pattern background color (hex without # or semantic name)"})},{additionalProperties:!1,description:"Pattern fill configuration"}),hn=r.Object({type:Lo,x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fill:r.Optional(r.Object({color:r.Optional(r.String({description:"Fill color (hex without #)"})),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"})),gradient:r.Optional(Ao),pattern:r.Optional(vs)},{additionalProperties:!1})),line:r.Optional(r.Object({color:r.Optional(r.String({description:"Line color (hex without #)"})),width:r.Optional(r.Number({minimum:0,description:"Line width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")]))},{additionalProperties:!1})),text:r.Optional(r.Union([r.String({description:"Plain text"}),r.Array(lf,{description:"Rich text segments with per-segment formatting"})],{description:"Text content inside the shape"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size for shape text"})),fontFace:r.Optional(r.String({description:"Font family for shape text"})),fontColor:r.Optional(r.String({description:"Font color for shape text (hex without #)"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points for shape text"})),bold:r.Optional(r.Boolean({description:"Bold shape text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-shape weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic shape text"})),align:r.Optional(ma),valign:r.Optional(Xn),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),angleRange:r.Optional(r.Array(r.Number(),{minItems:2,maxItems:2,description:"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"})),flipH:r.Optional(r.Boolean({description:"Flip shape horizontally"})),flipV:r.Optional(r.Boolean({description:"Flip shape vertically"})),shadow:r.Optional(To),rectRadius:r.Optional(r.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:r.Optional(un),style:r.Optional(pa)},{description:"Shape component props",additionalProperties:!1}),BT=r.Union([r.String({description:"Simple text cell"}),r.Object({text:r.String({description:"Cell text content"}),color:r.Optional(r.String({description:"Text color (hex without #)"})),fill:r.Optional(r.String({description:"Cell background color (hex without #)"})),fontSize:r.Optional(r.Number({description:"Font size in points"})),fontFace:r.Optional(r.String({description:"Font family"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),align:r.Optional(ma),valign:r.Optional(Xn),colspan:r.Optional(r.Number({minimum:1,description:"Column span"})),rowspan:r.Optional(r.Number({minimum:1,description:"Row span"})),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})]))},{additionalProperties:!1})]),gn=r.Object({rows:r.Array(r.Array(BT,{description:"Row of cells"}),{description:"Table rows (array of arrays)",minItems:1}),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),colW:r.Optional(r.Union([r.Number({description:"Uniform column width in inches"}),r.Array(r.Number(),{description:"Individual column widths in inches"})])),rowH:r.Optional(r.Union([r.Number({description:"Uniform row height in inches"}),r.Array(r.Number(),{description:"Individual row heights in inches"})])),border:r.Optional(r.Object({type:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")])),pt:r.Optional(r.Number({minimum:0,description:"Border width in points"})),color:r.Optional(r.String({description:"Border color (hex without #)"}))},{additionalProperties:!1})),fill:r.Optional(r.String({description:"Table background color (hex without #)"})),fontSize:r.Optional(r.Number({minimum:1,description:"Default font size for all cells"})),fontFace:r.Optional(r.String({description:"Default font family for all cells"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Default weight for all cells (100\\u2013900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out."})),color:r.Optional(r.String({description:"Default text color for all cells (hex without #)"})),align:r.Optional(ma),valign:r.Optional(Xn),headerRow:r.Optional(r.Boolean({description:"Style the first row as a header \\u2014 bold, on the theme\'s secondary background. Cells that state their own `bold`, `fill` or `color` keep it. Unlike the DOCX table, which declares its headers structurally, a PPTX table is rows of cells and the first one is a header only because you say so."})),autoPage:r.Optional(r.Boolean({description:"Auto-paginate table across multiple slides when content overflows"})),autoPageRepeatHeader:r.Optional(r.Boolean({description:"Repeat first row as header on each auto-paged slide"})),margin:r.Optional(r.Union([r.Number({description:"Cell margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})])),borderRadius:r.Optional(r.Number({minimum:0,description:"Rounded corner radius in inches. Renders a roundRect shape behind the table."})),grid:r.Optional(un)},{description:"PPTX table component props",additionalProperties:!1}),yn=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),grid:r.Optional(un)},{description:"PPTX Highcharts component props",additionalProperties:!1}),Ls=(e,t)=>r.Union([r.Number({description:e}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),_T=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("bar3D"),r.Literal("bubble"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),VT=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."})),sizes:r.Optional(r.Array(r.Number(),{description:"Bubble sizes (bubble charts only)"}))},{additionalProperties:!1}),cf=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")],{description:"Grid line style"})),size:r.Optional(r.Number({minimum:0,description:"Grid line width (points)"})),color:r.Optional(r.String({description:"Grid line color (hex or semantic)"}))},{additionalProperties:!1,description:"Axis grid line styling"}),bn=r.Object({type:_T,data:r.Array(VT,{description:"Chart data series",minItems:1}),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),showTitle:r.Optional(r.Boolean({description:"Show chart title"})),showValue:r.Optional(r.Boolean({description:"Show data values"})),showPercent:r.Optional(r.Boolean({description:"Show percentages (pie/doughnut)"})),showLabel:r.Optional(r.Boolean({description:"Show category labels on data points"})),showSerName:r.Optional(r.Boolean({description:"Show series name on data points"})),title:r.Optional(r.String({description:"Chart title text"})),titleFontSize:r.Optional(r.Number({description:"Title font size (points)"})),titleColor:r.Optional(r.String({description:"Title color (hex or semantic)"})),titleFontFace:r.Optional(r.String({description:"Title font face"})),titleFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to theme palette."})),dataBorder:r.Optional(r.Object({pt:r.Number({minimum:0,description:"Border width (points)"}),color:r.String({description:"Border color (hex or semantic)"})},{additionalProperties:!1,description:"Outline on data elements (bars, slices, areas)"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),legendFontSize:r.Optional(r.Number({description:"Legend font size"})),legendFontFace:r.Optional(r.String({description:"Legend font face"})),legendFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Legend weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns)."})),legendColor:r.Optional(r.String({description:"Legend text color"})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),catAxisHidden:r.Optional(r.Boolean({description:"Hide category axis"})),catAxisLabelRotate:r.Optional(r.Number({description:"Category axis label rotation (degrees)"})),catAxisLabelFontSize:r.Optional(r.Number({description:"Category axis label font size"})),catAxisLabelColor:r.Optional(r.String({description:"Category axis label color (hex or semantic)"})),catAxisLabelFontFace:r.Optional(r.String({description:"Category axis label font face"})),catAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),catGridLine:r.Optional(cf),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),valAxisHidden:r.Optional(r.Boolean({description:"Hide value axis"})),valAxisMinVal:r.Optional(r.Number({description:"Value axis minimum"})),valAxisMaxVal:r.Optional(r.Number({description:"Value axis maximum"})),valAxisLabelFormatCode:r.Optional(r.String({description:\'Value axis label format (e.g. "$0.00", "#%")\'})),valAxisMajorUnit:r.Optional(r.Number({description:"Value axis major unit / tick interval"})),valAxisLabelColor:r.Optional(r.String({description:"Value axis label color (hex or semantic)"})),valAxisLabelFontFace:r.Optional(r.String({description:"Value axis label font face"})),valAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),valAxisLabelFontSize:r.Optional(r.Number({description:"Value axis label font size"})),valGridLine:r.Optional(cf),catAxisLineShow:r.Optional(r.Boolean({description:"Show the category axis line"})),valAxisLineShow:r.Optional(r.Boolean({description:"Show the value axis line"})),barDir:r.Optional(r.Union([r.Literal("bar"),r.Literal("col")],{description:\'Bar direction: "bar" (horizontal) or "col" (vertical, default)\'})),barGrouping:r.Optional(r.Union([r.Literal("clustered"),r.Literal("stacked"),r.Literal("percentStacked")],{description:"Bar grouping style"})),barGapWidthPct:r.Optional(r.Number({minimum:0,maximum:500,description:"Bar gap width (0-500%)"})),barOverlapPct:r.Optional(r.Number({minimum:-100,maximum:100,description:"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."})),lineSmooth:r.Optional(r.Boolean({description:"Smooth lines"})),lineDataSymbol:r.Optional(r.Union([r.Literal("circle"),r.Literal("dash"),r.Literal("diamond"),r.Literal("dot"),r.Literal("none"),r.Literal("square"),r.Literal("triangle")],{description:"Line data point marker symbol"})),lineSize:r.Optional(r.Number({description:"Line width (points)"})),lineDataSymbolSize:r.Optional(r.Number({minimum:2,maximum:72,description:"Line data point marker size (points)"})),firstSliceAng:r.Optional(r.Number({minimum:0,maximum:359,description:"Angle of first slice (degrees)"})),holeSize:r.Optional(r.Number({minimum:10,maximum:90,description:"Doughnut hole size (%)"})),radarStyle:r.Optional(r.Union([r.Literal("standard"),r.Literal("marker"),r.Literal("filled")],{description:"Radar chart style"})),dataLabelColor:r.Optional(r.String({description:"Data label text color"})),dataLabelFontSize:r.Optional(r.Number({description:"Data label font size"})),dataLabelFontFace:r.Optional(r.String({description:"Data label font face"})),dataLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:\'Data label weight (100\\u2013900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family ("Inter" at 300 \\u2192 "Inter Light") \\u2014 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.\'})),dataLabelFontBold:r.Optional(r.Boolean({description:"Bold data labels"})),dataLabelPosition:r.Optional(r.Union([r.Literal("b"),r.Literal("bestFit"),r.Literal("ctr"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("inEnd"),r.Literal("outEnd")],{description:"Data label position"})),x:r.Optional(Ls("X position in inches","X as percentage")),y:r.Optional(Ls("Y position in inches","Y as percentage")),w:r.Optional(Ls("Width in inches","Width as percentage")),h:r.Optional(Ls("Height in inches","Height as percentage")),grid:r.Optional(un)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function Zn(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var $r=[{name:"text",propsSchema:dn,hasChildren:!1,category:"content",propsRequired:!0,description:"Text element - displays text with formatting, positioning and styling options. Prefer the named `style` values (title, heading1, body\\u2026) and theme color tokens over raw fontSize/hex \\u2014 a theme swap must restyle the deck without editing every node."},{name:"image",propsSchema:fn,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:hn,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:gn,hasChildren:!1,category:"content",description:"Table element, declared ROW-MAJOR: `props.rows[][]`, an array of rows, each an array of cells, with no structural header \\u2014 `headerRow: true` styles the first row as one. Note the DOCX `table` is the other way round \\u2014 columns each carrying their own header and cells \\u2014 so a table cannot be moved between the formats unchanged."},{name:"highcharts",propsSchema:yn,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:bn,hasChildren:!1,category:"content",description:"Native PowerPoint chart - editable, scalable, no external server needed. Always set series colors (theme-derived, one accent per series) \\u2014 the auto-palette reads as default Office."}];function Co(e){return r.Object({name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:Zn(e)?e.propsSchema:r.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var ua=r.Union([Co($r[0]),Co($r[1]),Co($r[2]),Co($r[3]),Co($r[4]),Co($r[5])],{$id:"PptxSlideContent",discriminator:{propertyName:"name"},description:"A single PPTX slide content element (text, image, shape, table, highcharts, or chart)."});var xn=r.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex colour ("#0F172A" or "0F172A") or a docx theme colour name (e.g. "primary")\'}),KT="^-?\\\\d+(\\\\.\\\\d+)?%$",GT="^\\\\d+(\\\\.\\\\d+)?%$",pf=r.Union([r.Number({description:"Inches from the canvas origin"}),r.String({pattern:KT,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),mf=r.Union([r.Number({minimum:0,description:"Size in inches"}),r.String({pattern:GT,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),tp={x:r.Optional(pf),y:r.Optional(pf),w:r.Optional(mf),h:r.Optional(mf),rotate:r.Optional(r.Number({description:"Clockwise rotation in degrees"}))},uf=r.Union([r.Boolean({description:"Single underline in the text colour"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")],{description:\'Underline style (default "sng")\'})),color:r.Optional(xn)},{additionalProperties:!1})],{description:"Underline: true for a single line, or a style/colour object"}),$s={fontFace:r.Optional(r.String({description:"Font family name"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size in points"})),bold:r.Optional(r.Boolean()),italic:r.Optional(r.Boolean())},qT=r.Object({text:r.String({description:"Run text"}),color:r.Optional(xn),...$s,underline:r.Optional(uf),strike:r.Optional(r.Boolean({description:"Strikethrough"})),breakLine:r.Optional(r.Boolean({description:"Start a new line after this run"}))},{additionalProperties:!1,description:"A formatted run inside a native visual text element"}),zT=r.Object({text:r.String({description:"Segment text"}),color:r.Optional(xn),...$s,breakLine:r.Optional(r.Boolean({description:"Start a new line after this segment"}))},{additionalProperties:!1,description:"A formatted segment of a native visual shape\\u2019s text"}),df=r.Object({color:r.Optional(xn),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency, 0 (opaque) to 100 (invisible)"}))},{additionalProperties:!1,description:"Solid fill. Omit the whole property for no fill; gradients and patterns are raster-only."}),HT=r.Object({color:r.Optional(xn),width:r.Optional(r.Number({minimum:0,description:"Outline width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")],{description:\'Outline dash pattern (default "solid")\'}))},{additionalProperties:!1,description:"Shape outline"}),ff=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),hf=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),gf=r.Union([r.Number({minimum:0,description:"Inset on every side, in points"}),r.Array(r.Number({minimum:0}),{minItems:4,maxItems:4,description:"Insets as [top, right, bottom, left], in points"})],{description:"Text insets in points"}),rp=r.Object({text:r.Optional(r.String({description:"Plain text content"})),runs:r.Optional(r.Array(qT,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...tp,color:r.Optional(xn),...$s,underline:r.Optional(uf),strike:r.Optional(r.Boolean({description:"Strikethrough"})),align:r.Optional(ff),valign:r.Optional(hf),margin:r.Optional(gf),fill:r.Optional(df)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),np=r.Object({type:Lo,...tp,fill:r.Optional(df),line:r.Optional(HT),text:r.Optional(r.Union([r.String(),r.Array(zT,{minItems:1})],{description:"Text drawn inside the shape"})),...$s,fontColor:r.Optional(xn),align:r.Optional(ff),valign:r.Optional(hf),margin:r.Optional(gf),flipH:r.Optional(r.Boolean({description:"Mirror horizontally"})),flipV:r.Optional(r.Boolean({description:"Mirror vertically"}))},{additionalProperties:!1,description:"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group"}),op=r.Object({path:r.Optional(r.String({description:"File path or http(s) URL"})),base64:r.Optional(r.String({description:"Base64 data URI"})),svg:r.Optional(r.String({description:"Raw SVG markup"})),...tp,sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"How the image fills its box"}),w:r.Optional(r.Number({minimum:0,description:\'Box width in inches; overrides the element\\u2019s own "w"\'})),h:r.Optional(r.Number({minimum:0,description:\'Box height in inches; overrides the element\\u2019s own "h"\'}))},{additionalProperties:!1,description:\'How the image fills its box. "w"/"h" state the box itself, taking precedence over the element\\u2019s "w"/"h", as they do in raster mode.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"}))},{additionalProperties:!1,description:"Native visual image element \\u2014 becomes a native picture inside the drawing group"}),yf=["text","shape","image"];function Xl(e,t,n){return r.Object({name:r.Literal(e),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this element is filtered out and not drawn. Defaults to true."})),props:t},{additionalProperties:!1,description:n})}var ip=r.Union([Xl("text",rp,"Text element - a native Word text box drawn on the visual canvas."),Xl("shape",np,"Shape element - a native preset-geometry shape, optionally holding text."),Xl("image",op,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),ap=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches"}),height:r.Number({minimum:.1,description:"Canvas height in inches"}),background:r.Optional(r.Object({color:r.Optional(xn),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1,description:"Canvas background. A colour becomes the bottom-most rectangle; an image becomes the bottom-most picture."}))},{additionalProperties:!1,description:"Drawing canvas for a native visual"}),sp=r.Object({color:r.Optional(r.String({description:\'Background color (hex like "#FFFFFF" or a theme color name)\'})),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1}),cp=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches (pptx slideWidth)"}),height:r.Number({minimum:.1,description:"Canvas height in inches (pptx slideHeight)"}),theme:r.Optional(r.String({description:"pptx theme name applied to the slide"})),background:r.Optional(sp)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),bf={width:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered width as percentage (e.g. "90%")\'})],{description:"Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size."})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered height as percentage (e.g. "90%")\'})])),alignment:r.Optional(vr),caption:r.Optional(r.String({description:"Caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(ut),floating:r.Optional(Yn),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},lp=r.Object({renderMode:r.Optional(r.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:cp,elements:r.Optional(r.Array(ua,{description:"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches"})),dpi:r.Optional(r.Number({minimum:oa,maximum:ia,default:na,description:`Raster resolution in DPI (default ${na}, range ${oa}-${ia}). Higher = sharper + larger.`})),serverUrl:r.Optional(r.String({description:"Rasterization service URL override (default from services.pptx)"})),...bf},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),pp=r.Object({renderMode:r.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:ap,elements:r.Optional(r.Array(ip,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...bf},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),js=r.Union([lp,pp],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Us="native";function xf(e){return!!e&&e.renderMode===Us}var Qn=["docxjs","office-open"],da="docxjs",WT=new Set(["text","shape","image"]);function fa(e){return`ComponentDefinition_${e}`}function ks(e,t,n){let o=ep(t);return Ql(o,fa(n)),e==="visual"&&n!=="office-open"?YT(o)??o:(n==="office-open"&&Zl(o),o)}function Ds(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??da;if(!Qn.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "docxjs" or "office-open".`,code:"invalid_value"}];let o=[],i=n==="office-open",a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s;if(i){let p=l.comment;if(p&&typeof p=="object"&&!Array.isArray(p)){let m=p;for(let d of["replies","resolved"])m[d]!==void 0&&o.push({path:`${c}/comment/${d}`,message:\'The "office-open" renderer does not support comment threads.\',code:"unsupported_renderer_feature"})}}l.name==="visual"&&JT(l,`${c}`,i,o),l.name==="chart"&&!i&&o.push({path:`${c}/name`,message:`Only the "office-open" renderer draws a native chart. Set the document\'s "renderer" to "office-open", or use "highcharts" to render one as an image.`,code:"unsupported_renderer_feature"});for(let[p,m]of Object.entries(l))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),o}function JT(e,t,n,o){let i=e.props;if(!i||typeof i!="object"||Array.isArray(i))return;let a=i;if(a.renderMode!==Us)return;if(!n){o.push({path:`${t}/props/renderMode`,message:`Only the "office-open" renderer draws a native visual. Set the document\'s "renderer" to "office-open", or drop "renderMode" to rasterize.`,code:"unsupported_renderer_feature"});return}let s=a.elements;Array.isArray(s)&&s.forEach((c,l)=>{if(!c||typeof c!="object"||Array.isArray(c))return;let p=c.name;typeof p!="string"||WT.has(p)||o.push({path:`${t}/props/elements/${l}/name`,message:`A native visual cannot draw "${p}". Native mode holds "text", "shape" and "image"; use renderMode "raster" for anything else.`,code:"unsupported_renderer_feature"})})}function YT(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Zl(e){if(Array.isArray(e)){e.forEach(Zl);return}if(!e||typeof e!="object")return;let t=e,n=t.properties;if(n?.text&&n?.author&&(n.replies||n.resolved)&&typeof t.description=="string"&&t.description.includes("Word review comment")){delete n.replies,delete n.resolved;let o=t.required;o&&(t.required=o.filter(i=>i!=="replies"&&i!=="resolved"))}for(let o of Reflect.ownKeys(t))Zl(t[o])}function Ql(e,t){if(Array.isArray(e)){e.forEach(o=>Ql(o,t));return}if(!e||typeof e!="object")return;let n=e;n.type==="array"&&n.items&&typeof n.items=="object"&&Object.keys(n.items).length===0&&(n.items={$ref:t});for(let o of Reflect.ownKeys(n))Ql(n[o],t)}function ep(e){if(Array.isArray(e))return e.map(ep);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=ep(e[n]);return t}var fp=r.Object({type:r.Union([r.Literal("equal"),r.Literal("insert"),r.Literal("delete")],{description:"Segment kind: \'equal\' renders as normal text, \'insert\' as a tracked insertion, \'delete\' as a tracked deletion"}),text:r.String({description:"Literal text of this segment (rendered without markdown)"})},{description:"A contiguous run of text sharing one revision state",additionalProperties:!1}),No=r.Object({author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"})),segments:r.Array(fp,{minItems:1,description:"Ordered text segments; concatenating equal+insert segments yields the new text, equal+delete the old text"})},{description:"Tracked-change data: renders the component text as native Word revisions (accept/reject in Word)",additionalProperties:!1}),hp=r.Object({type:r.Union([r.Literal("insert"),r.Literal("delete")],{description:"Whether the element was inserted or deleted"}),author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},{description:"Structural tracked change: the element itself was inserted or deleted",additionalProperties:!1}),Sf={text:r.String({minLength:1,description:"Comment body. Newlines split it into separate paragraphs in the comment pane."}),author:r.Optional(r.String({description:\'Comment author shown in Word (default: "json-to-office")\'})),initials:r.Optional(r.String({description:"Author initials shown on the comment bubble (derived from the author when omitted)"})),date:r.Optional(r.String({format:"date-time",description:"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},gp=r.Object(Sf,{description:"A reply within a comment thread",additionalProperties:!1}),Eo=r.Object({...Sf,replies:r.Optional(r.Array(gp,{minItems:1,description:"Replies, in order. They anchor to the same text and Word shows them as one thread."})),resolved:r.Optional(r.Boolean({description:"Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply."}))},{description:"A Word review comment anchored to this component\'s text",additionalProperties:!1}),jr=r.Object({text:r.String({description:"Heading text (required)"}),level:r.Optional(Ps),font:r.Optional(r.Partial(pn)),language:r.Optional(zl),noProof:r.Optional(Hl),noProofWords:r.Optional(aa),alignment:r.Optional(sa),spacing:r.Optional(ut),indent:r.Optional(la),lineSpacing:r.Optional(r.Union([r.Number({minimum:0}),ca],{description:"A bare number is a multiple of single spacing. Takes precedence over `font.lineSpacing`. An `exactly` box smaller than the heading it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE."})),pageBreak:r.Optional(r.Boolean({description:"Insert page break before heading"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before heading"})),numbering:r.Optional(r.Boolean({description:"Number this heading with the document\'s multilevel heading numbering (1., 1.1., 1.1.1.). Set globally via componentDefaults.heading.numbering; false opts a single heading out."})),keepNext:r.Optional(r.Boolean({description:"Keep heading with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of heading together on same page"})),revision:r.Optional(No),comment:r.Optional(Eo)},{description:"Heading component props",additionalProperties:!1}),Ms=r.Object({id:r.String({minLength:1,pattern:"^[^\\\\]\\\\s]+$",description:\'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".\'}),text:r.String({minLength:1,description:"Note body. Newlines split it into separate paragraphs where the note is placed."})},{description:"A note body bound to an inline `[^id]` marker",additionalProperties:!1}),yp=r.Array(Ms,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),bp=r.Array(Ms,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),XT=r.Union([r.Literal("around"),r.Literal("none"),r.Literal("notBeside"),r.Literal("through"),r.Literal("tight"),r.Literal("auto")],{description:"Frame text wrapping type"}),Of=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Frame anchor type"}),ZT=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Frame horizontal alignment"}),QT=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Frame vertical alignment"}),eL=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(Of),align:r.Optional(ZT),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(Of),align:r.Optional(QT),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:XT},{description:"Text wrapping configuration",additionalProperties:!1})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),width:r.Optional(r.Number({minimum:1,description:"Frame width in twips (DXA units)"})),height:r.Optional(r.Number({minimum:1,description:"Frame height in twips (DXA units)"}))},{description:"Floating text frame properties",additionalProperties:!1}),tL=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Paragraph text alignment"}),Ur=r.Object({text:r.String({description:"Text content (required)"}),font:r.Optional(r.Partial(pn)),themeStyle:r.Optional(r.String()),language:r.Optional(zl),noProof:r.Optional(Hl),noProofWords:r.Optional(aa),boldColor:r.Optional(A),spacing:r.Optional(ut),alignment:r.Optional(tL),indent:r.Optional(la),tabStops:r.Optional(Ts),pageBreak:r.Optional(r.Boolean({description:"Insert page break before paragraph"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before paragraph"})),floating:r.Optional(eL),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"})),id:r.Optional(r.String({description:"Unique identifier for internal linking (bookmark anchor)"})),revision:r.Optional(No),comment:r.Optional(Eo),footnotes:r.Optional(yp),endnotes:r.Optional(bp)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),kr=r.Object({path:r.Optional(r.String({description:"Image source URL or file path (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:\'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)\'})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Renders as a vector image (Word 2016+); intrinsic size taken from the SVG viewBox/width/height when width/height omitted.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)\'})],{description:\'Image width in pixels (number) or as percentage string (e.g., "90%")\',default:"100%"})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)\'})],{description:\'Image height in pixels (number) or as percentage string (e.g., "90%")\'})),widthRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for width percentages: content (page width minus margins) or page (full page width)",default:"content"})),heightRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for height percentages: content (page height minus margins) or page (full page height)",default:"content"})),alignment:r.Optional(vr),caption:r.Optional(r.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:r.Optional(ut),floating:r.Optional(Yn),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:"Image component props",additionalProperties:!1}),Dr=r.Object({number:r.String({description:"Statistic number/value (required)"}),description:r.String({description:"Statistic description (required)"}),unit:r.Optional(r.String({description:"Unit of measurement"})),format:r.Optional(r.String({description:"Number format pattern"})),trend:r.Optional(r.Union([r.Literal("up"),r.Literal("down"),r.Literal("neutral")])),trendValue:r.Optional(r.Union([r.String(),r.Number()])),alignment:r.Optional(vr),spacing:r.Optional(ut),size:r.Optional(r.Union([r.Literal("small"),r.Literal("medium"),r.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),rL=r.Recursive(e=>r.Union([r.String(),r.Object({name:r.String(),props:r.Object({},{additionalProperties:!0}),children:r.Optional(r.Array(e))},{additionalProperties:!1})])),If=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),wf=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical cell alignment"}),Cf=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:0,description:"Font size in points"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Boolean({description:"Underlined text"})),lineSpacing:r.Optional(r.Object({...ca.properties},{description:"Line spacing of the cell\'s paragraph. Overrides the theme\'s tableCell style; `exactly` gives dense, fixed-height rows.",additionalProperties:!1}))},{additionalProperties:!1}),up=r.Union([r.String({description:"Border color for all sides (hex without #)"}),r.Object({bottom:r.Optional(r.String({description:"Bottom border color (hex without #)"})),top:r.Optional(r.String({description:"Top border color (hex without #)"})),right:r.Optional(r.String({description:"Right border color (hex without #)"})),left:r.Optional(r.String({description:"Left border color (hex without #)"}))},{additionalProperties:!1})]),dp=r.Union([r.Number({minimum:0,description:"Border size for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom border size in points"})),top:r.Optional(r.Number({minimum:0,description:"Top border size in points"})),right:r.Optional(r.Number({minimum:0,description:"Right border size in points"})),left:r.Optional(r.Number({minimum:0,description:"Left border size in points"}))},{additionalProperties:!1})]),nL=r.Union([r.Boolean({description:"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border"}),r.Object({bottom:r.Optional(r.Boolean({description:"Hide bottom border"})),top:r.Optional(r.Boolean({description:"Hide top border"})),right:r.Optional(r.Boolean({description:"Hide right border"})),left:r.Optional(r.Boolean({description:"Hide left border"})),insideHorizontal:r.Optional(r.Boolean({description:"Hide horizontal borders between rows"})),insideVertical:r.Optional(r.Boolean({description:"Hide vertical borders between columns"}))},{description:"Selectively hide specific borders",additionalProperties:!1})]),Pf=r.Union([r.Number({minimum:0,description:"Padding for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom padding in points"})),top:r.Optional(r.Number({minimum:0,description:"Top padding in points"})),right:r.Optional(r.Number({minimum:0,description:"Right padding in points"})),left:r.Optional(r.Number({minimum:0,description:"Left padding in points"}))},{additionalProperties:!1})]),mp=r.Object({color:r.Optional(A),backgroundColor:r.Optional(ql),horizontalAlignment:r.Optional(If),verticalAlignment:r.Optional(wf),font:r.Optional(Cf),borderColor:r.Optional(up),borderSize:r.Optional(dp),padding:r.Optional(Pf),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function xp(e){let t=r.Union([r.String(),e]),n={color:r.Optional(A),backgroundColor:r.Optional(ql),horizontalAlignment:r.Optional(If),verticalAlignment:r.Optional(wf),font:r.Optional(Cf),borderColor:r.Optional(up),borderSize:r.Optional(dp),padding:r.Optional(Pf),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"})),comment:r.Optional(Eo),revision:r.Optional(No)},o=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),i=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),a=r.Object({width:r.Optional(r.Union([r.Number({minimum:0,description:"Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns."}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "40%")\'})])),cellDefaults:r.Optional(mp),header:r.Optional(o),cells:r.Optional(r.Array(i))},{additionalProperties:!1});return r.Object({borderColor:r.Optional(up),borderSize:r.Optional(dp),hideBorders:r.Optional(nL),cellDefaults:r.Optional(mp),headerCellDefaults:r.Optional(mp),width:r.Optional(r.Number({minimum:0,maximum:100,description:"Table width in percentage (0-100)"})),columns:r.Array(a,{description:"Table columns with headers and cells",minItems:1}),rows:r.Optional(r.Array(r.Object({revision:r.Optional(hp),cantSplit:r.Optional(r.Boolean({description:"Keep this row on one page"})),tableHeader:r.Optional(r.Boolean({description:"Repeat this row as a header on each page"}))},{additionalProperties:!1}),{description:"Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here."})),keepInOnePage:r.Optional(r.Boolean({description:"Keep table rows together on the same page by setting keepNext on all paragraphs"})),keepNext:r.Optional(r.Boolean({description:"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."})),repeatHeaderOnPageBreak:r.Optional(r.Boolean({description:"Repeat the header row on each page when the table spans multiple pages. Defaults to true.",default:!0}))},{description:"Table component props with column-based structure",additionalProperties:!1})}var Mr=xp(rL),Op=e=>r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this section, shown in editors and outlines. Never rendered \\u2014 add a heading child for a visible title."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the document."})),header:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section header components"}),r.Literal("linkToPrevious",{description:"Link header to previous section"})])),footer:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section footer components"}),r.Literal("linkToPrevious",{description:"Link footer to previous section"})])),pageBreak:r.Optional(r.Boolean({description:"Insert page break before section",default:!0})),spacing:r.Optional(ut),page:r.Optional(r.Object({size:r.Optional(r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})})])),margins:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),header:r.Optional(r.Number({minimum:0})),footer:r.Optional(r.Number({minimum:0})),gutter:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1}))},{description:"Page configuration override for this section (overrides theme page settings)",additionalProperties:!1}))},{description:"Section component props",additionalProperties:!1}),Br=Op(),oL=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Column width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "30%")\'}),r.Literal("auto",{description:"Auto width: consume remaining space after fixed widths and gaps"})])),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Gap after this column in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Gap after this column as percentage of available width (e.g., "5%")\'})]))},{additionalProperties:!1}),_r=r.Object({columns:r.Union([r.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),r.Array(oL,{minItems:1,description:"List of columns in order; width and gap can be points, percentages, or auto width"})]),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Default gap applied after each column except the last (points)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Default gap applied after each column except the last as percentage of available width (e.g., "5%")\'})]))},{description:"Columns component props",additionalProperties:!1}),Tf=r.Union([r.Literal("decimal"),r.Literal("upperRoman"),r.Literal("lowerRoman"),r.Literal("upperLetter"),r.Literal("lowerLetter"),r.Literal("bullet"),r.Literal("ordinal"),r.Literal("cardinalText"),r.Literal("ordinalText"),r.Literal("hex"),r.Literal("chicago"),r.Literal("ideographDigital"),r.Literal("japaneseCounting"),r.Literal("aiueo"),r.Literal("iroha"),r.Literal("decimalFullWidth"),r.Literal("decimalHalfWidth"),r.Literal("japaneseLegal"),r.Literal("japaneseDigitalTenThousand"),r.Literal("decimalEnclosedCircle"),r.Literal("decimalFullWidth2"),r.Literal("aiueoFullWidth"),r.Literal("irohaFullWidth"),r.Literal("decimalZero"),r.Literal("ganada"),r.Literal("chosung"),r.Literal("decimalEnclosedFullstop"),r.Literal("decimalEnclosedParen"),r.Literal("decimalEnclosedCircleChinese"),r.Literal("ideographEnclosedCircle"),r.Literal("ideographTraditional"),r.Literal("ideographZodiac"),r.Literal("ideographZodiacTraditional"),r.Literal("taiwaneseCounting"),r.Literal("ideographLegalTraditional"),r.Literal("taiwaneseCountingThousand"),r.Literal("taiwaneseDigital"),r.Literal("chineseCounting"),r.Literal("chineseLegalSimplified"),r.Literal("chineseCountingThousand"),r.Literal("koreanDigital"),r.Literal("koreanCounting"),r.Literal("koreanLegal"),r.Literal("koreanDigital2"),r.Literal("vietnameseCounting"),r.Literal("russianLower"),r.Literal("russianUpper"),r.Literal("none"),r.Literal("numberInDash"),r.Literal("hebrew1"),r.Literal("hebrew2"),r.Literal("arabicAlpha"),r.Literal("arabicAbjad"),r.Literal("hindiVowels"),r.Literal("hindiConsonants"),r.Literal("hindiNumbers"),r.Literal("hindiCounting"),r.Literal("thaiLetters"),r.Literal("thaiNumbers"),r.Literal("thaiCounting")],{description:"Number or bullet format for list levels"}),Sp=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:1,description:"Marker size in points"})),color:r.Optional(A),bold:r.Optional(r.Boolean({description:"Bold marker"})),italic:r.Optional(r.Boolean({description:"Italic marker"})),underline:r.Optional(r.Boolean({description:"Underlined marker"}))},{description:"Styling for the number/bullet glyph only. The list text is unaffected.",additionalProperties:!1}),iL=r.Object({level:r.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:r.Optional(Tf),text:r.Optional(r.String({description:\'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)\'})),alignment:r.Optional(r.Union([r.Literal("start"),r.Literal("end"),r.Literal("left"),r.Literal("right"),r.Literal("center")],{description:"Alignment of the numbering/bullet"})),indent:r.Optional(mn),start:r.Optional(r.Number({minimum:1,description:"Starting number for this level (default: 1)"})),font:r.Optional(Sp)},{description:"Configuration for a single list level",additionalProperties:!1}),Vr=r.Object({items:r.Array(r.Union([r.String(),r.Object({text:r.String(),level:r.Optional(r.Number({minimum:0,maximum:8,description:"Nesting level for this item"})),id:r.Optional(r.String({description:"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])"})),revision:r.Optional(No)},{additionalProperties:!1})]),{description:"List items (required)",minItems:1}),reference:r.Optional(r.String({description:"Unique reference ID for this numbering configuration (auto-generated if not provided)"})),levels:r.Optional(r.Array(iL,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:r.Optional(r.Union([Tf,r.Literal("numbered"),r.Literal("none")],{description:"Format for level 0 (simplified option when levels not specified)"})),bullet:r.Optional(r.String({description:"Custom bullet character (simplified option when levels not specified)"})),start:r.Optional(r.Number({minimum:1,description:"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."})),spacing:r.Optional(rf),alignment:r.Optional(sa),indent:r.Optional(r.Union([r.Number({minimum:0}),mn])),comment:r.Optional(Eo)},{description:"List component props",additionalProperties:!1}),Ip=["revision","comment","footnotes","endnotes"],aL=r.Partial(r.Omit(jr,Ip)),sL=r.Partial(r.Omit(Ur,Ip)),cL=r.Partial(kr),lL=r.Partial(Dr),pL=r.Partial(r.Omit(Mr,["rows"])),mL=r.Partial(Br),uL=r.Partial(_r),dL=r.Partial(r.Omit(Vr,Ip)),Bs=r.Object({heading:r.Optional(aL),paragraph:r.Optional(sL),image:r.Optional(cL),statistic:r.Optional(lL),table:r.Optional(pL),section:r.Optional(mL),columns:r.Optional(uL),list:r.Optional(dL)},{additionalProperties:!0});var fL=r.Object({top:r.Number({minimum:0}),bottom:r.Number({minimum:0}),left:r.Number({minimum:0}),right:r.Number({minimum:0}),header:r.Number({minimum:0}),footer:r.Number({minimum:0}),gutter:r.Number({minimum:0})},{additionalProperties:!1,description:"Document margin configuration"}),C4=r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),hL=r.Object({size:r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1})],{description:"Standard page size or custom dimensions"}),margins:fL},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),Lf=r.Object({heading:pn,body:pn,mono:pn,light:pn},{additionalProperties:!1,description:"Font definitions for different text types"}),gL=r.Union([r.Literal("single"),r.Literal("dashDotStroked"),r.Literal("dashed"),r.Literal("dashSmallGap"),r.Literal("dotDash"),r.Literal("dotDotDash"),r.Literal("dotted"),r.Literal("double"),r.Literal("doubleWave"),r.Literal("inset"),r.Literal("nil"),r.Literal("none"),r.Literal("outset"),r.Literal("thick"),r.Literal("thickThinLargeGap"),r.Literal("thickThinMediumGap"),r.Literal("thickThinSmallGap"),r.Literal("thinThickLargeGap"),r.Literal("thinThickMediumGap"),r.Literal("thinThickSmallGap"),r.Literal("thinThickThinLargeGap"),r.Literal("thinThickThinMediumGap"),r.Literal("thinThickThinSmallGap"),r.Literal("threeDEmboss"),r.Literal("threeDEngrave"),r.Literal("triple"),r.Literal("wave")],{description:"Paragraph border style"}),Af={style:gL,size:r.Number({minimum:0,description:"Width in eighths of a point (docx sz)"}),color:A,space:r.Optional(r.Number({minimum:0,description:"Space between text and border in points"}))},_s=r.Object(Af,{additionalProperties:!1,description:"Paragraph border side definition"}),yL=r.Object(Af,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),Nf=r.Object({top:r.Optional(_s),bottom:r.Optional(_s),left:r.Optional(_s),right:r.Optional(_s),between:r.Optional(yL)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),Ef=r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),Gt=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...Cs.properties,alignment:Ef,priority:r.Optional(r.Number()),baseStyle:r.Optional(r.String()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(Nf),indent:r.Optional(mn)},{additionalProperties:!1}),bL=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("middleDot"),r.Literal("none"),r.Literal("underscore")],{description:"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore"}),xL=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("bar"),r.Literal("clear"),r.Literal("decimal"),r.Literal("end"),r.Literal("num"),r.Literal("start")],{description:"Tab stop alignment type"}),OL=r.Object({type:xL,position:r.Union([r.Number({description:"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin"}),r.Literal("max",{description:"Use maximum position (TabStopPosition.MAX = 9026 twips)"})]),leader:r.Optional(bL)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),Ro=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...Cs.properties,alignment:Ef,tabStops:r.Optional(r.Array(OL,{description:"Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.",default:[{type:"right",position:"max",leader:"none"}]})),priority:r.Optional(r.Number()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(Nf),indent:r.Optional(mn)},{additionalProperties:!1}),Rf=r.Object({normal:r.Optional(Gt),heading1:r.Optional(Gt),heading2:r.Optional(Gt),heading3:r.Optional(Gt),heading4:r.Optional(Gt),heading5:r.Optional(Gt),heading6:r.Optional(Gt),title:r.Optional(Gt),subtitle:r.Optional(Gt),TOC1:r.Optional(Ro),TOC2:r.Optional(Ro),TOC3:r.Optional(Ro),TOC4:r.Optional(Ro),TOC5:r.Optional(Ro),TOC6:r.Optional(Ro)},{additionalProperties:Gt,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),P4=r.Object({level:r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)]),...Gt.properties},{additionalProperties:!1}),SL=r.Object({primary:A,secondary:A,accent:A,text:A,background:A,border:A,textPrimary:A,textSecondary:A,textMuted:A,borderPrimary:A,borderSecondary:A,backgroundPrimary:A,backgroundSecondary:A,accent4:r.Optional(A),accent5:r.Optional(A),accent6:r.Optional(A)},{additionalProperties:!1}),Ff=r.Object({colors:r.Optional(r.Partial(SL)),fonts:r.Optional(r.Partial(Lf)),styles:r.Optional(Rf)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),Fo=r.Object({$schema:r.Optional(r.String()),name:r.String(),displayName:r.String(),description:r.String(),version:r.String(),colors:r.Object({primary:A,secondary:A,accent:A,text:A,background:A,border:A,textPrimary:A,textSecondary:A,textMuted:A,borderPrimary:A,borderSecondary:A,backgroundPrimary:A,backgroundSecondary:A,accent4:r.Optional(A),accent5:r.Optional(A),accent6:r.Optional(A)},{additionalProperties:!1}),fonts:Lf,fontRegistry:r.Optional(ir),page:hL,styles:r.Optional(Rf),componentDefaults:r.Optional(Bs),noProofWords:r.Optional(r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive)."}))},{additionalProperties:!1,description:"Theme configuration"});function vf(e){return P.Check(Fo,e)}function $f(e="minimal-theme"){return{name:e,displayName:e.split(/[-_\\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")||e,description:"A minimal theme with basic styling",version:"1.0.0",colors:{primary:"#2563EB",secondary:"#64748B",accent:"#F8FAFC",text:"#334155",background:"#FFFFFF",border:"#E2E8F0",textPrimary:"#334155",textSecondary:"#64748B",textMuted:"#94A3B8",borderPrimary:"#CBD5E1",borderSecondary:"#E2E8F0",backgroundPrimary:"#FFFFFF",backgroundSecondary:"#F8FAFC"},fonts:{heading:{family:"Arial",size:14},body:{family:"Arial",size:11},mono:{family:"Courier New",size:10},light:{family:"Arial",size:10}},page:{size:"A4",margins:{top:1440,bottom:1440,left:1440,right:1440,header:720,footer:720,gutter:0}},styles:{normal:{font:"body",size:11,color:"#334155",alignment:"left",lineSpacing:{type:"multiple",value:1.15},spacing:{after:8}}}}}var IL=e=>r.Object({theme:r.Optional(r.String({description:\'Theme name to apply (default: "minimal")\',examples:["minimal","devportal","vermilion"],default:"minimal"})),themeOverrides:r.Optional(Ff),fontRegistry:r.Optional(ir),componentDefaults:r.Optional(Bs),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:`Default document language (BCP-47 tag, e.g. "en-US"). Sets Word\'s default proofing/spell-check language; individual components can override it locally.`,examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),noProofWords:r.Optional(aa),trackRevisions:r.Optional(r.Boolean({description:"Open the document in track-changes mode: Word marks any further edits as revisions. Set automatically on redline documents produced by the diff engine"})),metadata:r.Optional(r.Object({title:r.Optional(r.String({description:"Document title",examples:["Annual Report 2024","Technical Documentation"]})),subtitle:r.Optional(r.String({description:"Document subtitle"})),description:r.Optional(r.String()),author:r.Optional(r.String()),company:r.Optional(r.String({description:"Company name, written to docProps/custom.xml (Word has no core-property slot for it)"})),date:r.Optional(r.String({description:"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)"})),version:r.Optional(r.String({description:"Document version, written to docProps/custom.xml",examples:["1.0","2024.3"]})),tags:r.Optional(r.Array(r.String()))},{description:"Document metadata (title, author, company, version, etc.). Package timestamps (dcterms:created/modified) are not part of this object: they come from the `generatedAt` generation option so repeated builds stay byte-identical.",additionalProperties:!1}))},{description:"Report component props",additionalProperties:!1}),Kr=IL(),wp=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Text box width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box width as percentage (e.g., "50%") relative to content width\'})],{description:\'Text box width in pixels (number) or as percentage string (e.g., "50%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Text box height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box height as percentage (e.g., "50%") relative to content height\'})],{description:\'Text box height in pixels (number) or as percentage string (e.g., "50%")\'})),renderAs:r.Optional(r.Union([r.Literal("table"),r.Literal("shape")],{description:"Rendering strategy. \'table\' (default): borderless one-cell table \\u2014 height auto-fits content, per-side borders and percentage widths resolve in Word. \'shape\': native Word text box (WPS shape) \\u2014 real wrap modes and z-order, but requires explicit width and height (no autofit), a single uniform border, and eagerly-resolved percentage sizes."})),floating:r.Optional(Yn),style:r.Optional(r.Object({padding:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),border:r.Optional(r.Object({top:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(A)},{additionalProperties:!1})),right:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(A)},{additionalProperties:!1})),bottom:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(A)},{additionalProperties:!1})),left:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(A)},{additionalProperties:!1}))},{additionalProperties:!1})),shading:r.Optional(r.Object({fill:r.Optional(A)},{additionalProperties:!1}))},{additionalProperties:!1}))},{additionalProperties:!1,allOf:[{if:{properties:{renderAs:{const:"shape"}},required:["renderAs"]},then:{required:["width","height"],properties:{style:{properties:{border:{properties:Object.fromEntries(["top","right","bottom","left"].map(e=>[e,{properties:{style:{enum:["solid","none"]}}}]))}}}}}}]}),wL=r.Union([r.Literal("numeric"),r.Literal("bullet"),r.Literal("none")],{description:"TOC numbering style \\u2014 accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation"}),CL=r.Union([r.Literal("document"),r.Literal("section")],{description:"TOC scope: document-wide or section-only"}),PL=r.Object({styleId:r.String({description:"Custom style ID matching a key in theme.styles"}),level:r.Number({minimum:1,maximum:6,description:"TOC level (1-6) to assign to this style"})},{description:"Mapping of custom style to TOC level",additionalProperties:!1}),k4=r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify at least one of "from" or "to".\',additionalProperties:!1}),Cp=r.Object({pageBreak:r.Optional(r.Boolean({description:"Insert page break before TOC block"})),depth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify "from", "to", or both. Defaults: from=1, to=3\',additionalProperties:!1,default:{to:3}})),pageNumbersDepth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to show page numbers. Specify "from", "to", or both. When specified, page numbers are hidden for entries outside this range.\',additionalProperties:!1})),numberingStyle:r.Optional(wL),title:r.Optional(r.String({description:"TOC heading title"})),includePageNumbers:r.Optional(r.Boolean({default:!0,description:"Show page numbers next to entries"})),numberSeparator:r.Optional(r.Boolean({default:!0,description:\'Use tab separator between entry and page number. True applies "\\\\t" (default), false applies " "\'})),scope:r.Optional(r.Union([CL,r.Literal("auto")],{default:"auto",description:\'TOC scope: "document" for entire document, "section" for parent section only, "auto" for automatic detection (section if inside section, otherwise document)\'})),styles:r.Optional(r.Array(PL,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),Pp=r.Object({thickness:r.Optional(r.Number({minimum:.25,maximum:12,description:"Line weight in points (default 1). OOXML measures a border in eighths of a point and Word stops at 12pt, so this is the whole usable range."})),color:r.Optional(A),style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double")],{description:\'Line style (default "solid"). `double` draws two lines and is measured per line, so it reads about twice as tall as its thickness.\'})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Divider width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Divider width as a percentage of the text measure (e.g. "40%")\'})],{description:"How far the line runs (default: the full text measure). A percentage or a point width is turned into paragraph indents, resolved against the theme page \\u2014 so a partial divider inside a column or a re-margined section is measured against the page, while the default full-measure divider is exact everywhere."})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:\'Which end of the measure a partial divider sits at (default "left"). Ignored at full width.\'})),spacing:r.Optional(ut)},{description:"Horizontal divider \\u2014 a thin line across the measure, drawn as a Word paragraph border so it stays editable in Word.",additionalProperties:!1}),Tp=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to content width\'})],{description:\'Rendered image width in pixels (number) or as percentage string (e.g., "90%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to content height\'})],{description:\'Rendered image height in pixels (number) or as percentage string (e.g., "90%")\'}))}),TL=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("column"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),LL=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."}))},{additionalProperties:!1}),Lp=r.Object({type:TL,data:r.Array(LL,{description:"Chart data series",minItems:1}),title:r.Optional(r.String({description:"Chart title text"})),showTitle:r.Optional(r.Boolean({description:"Show the chart title. Defaults to true when `title` is set."})),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to the theme palette."})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),width:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart width in inches. Defaults to the content width."})),height:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart height in inches. Defaults to 3."})),alignment:r.Optional(vr),caption:r.Optional(r.String({description:"Chart caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(ut),floating:r.Optional(Yn),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\',additionalProperties:!1}),tt=[{name:"docx",propsSchema:Kr,hasChildren:!0,allowedChildren:["section"],category:"container",description:"Main document container - defines the overall document structure. Required as the root component.",special:{hasSchemaField:!0}},{name:"section",propsSchema:Br,createPropsSchema:Op,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:["heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],category:"container",description:"Section container - groups related content with optional title. Use for organizing document structure."},{name:"columns",propsSchema:_r,hasChildren:!0,allowedChildren:["heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","text-box"],category:"layout",description:"Multi-column layout - arranges content in 2-4 columns. Great for side-by-side content."},{name:"text-box",propsSchema:wp,hasChildren:!0,allowedChildren:["heading","paragraph","image","divider"],category:"layout",description:"Floating text container - allows positioning text anywhere on the page with absolute or relative positioning."},{name:"heading",propsSchema:jr,hasChildren:!1,category:"content",description:"Heading text - supports levels 1-6 for document hierarchy. Level 1 is largest. Never skip a level going down (1 \\u2192 3): the gap breaks the document outline."},{name:"paragraph",propsSchema:Ur,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:kr,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:Dr,hasChildren:!1,category:"content",description:"Statistic display - shows a number with description. Perfect for KPIs and metrics."},{name:"table",propsSchema:Mr,createPropsSchema:xp,embeddedComponents:[{path:["columns","*","header","content"],arity:"component",reportStructure:!1},{path:["columns","*","cells","*","content"],arity:"component",reportStructure:!1}],hasChildren:!1,category:"content",description:"Data table, declared COLUMN-MAJOR: `props.columns[]`, each with its own `header` and its own `cells[]` running down the column. Note the PPTX `table` is the other way round \\u2014 rows of cells \\u2014 so a table cannot be moved between the formats unchanged. Fixed column widths are points and must fit the page; leave some columns unsized so they share the leftover space."},{name:"list",propsSchema:Vr,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:Cp,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:Pp,hasChildren:!1,category:"content",description:"Horizontal divider - a thin line across the measure, for separating sections. Drawn as a Word paragraph border, so it stays a real Word object. Use this rather than collapsing a paragraph\'s line spacing to fake one."},{name:"highcharts",propsSchema:Tp,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:Lp,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:js,hasChildren:!1,category:"content",description:\'Free-canvas graphic for infographics, diagrams and layered compositions the document flow cannot express. Rasterized from a pptx slide by default; renderMode "native" draws it as an editable Word drawing group (renderer "office-open").\'}];function ha(e){return tt.find(t=>t.name===e)}function jf(){return tt.map(e=>e.name)}function Uf(){return tt.filter(e=>e.hasChildren)}function AL(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function vo(e,t,n,o){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion."}))};e.special?.hasSchemaField&&(i.$schema=r.Optional(r.String({format:"uri"})),i.renderer=o?o.requireDiscriminator?r.Literal(o.renderer,{description:"Renderer backend for this document"}):r.Optional(r.Literal(o.renderer,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})):r.Optional(r.Union(Qn.map(c=>r.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&n?e.createPropsSchema(n):e.propsSchema,s=o?ks(e.name,a,o.renderer):a;return i.props=AL(s)?s:r.Optional(s),e.hasChildren&&t&&(i.children=e.special?.hasSchemaField?r.Array(t):r.Optional(r.Array(t))),r.Object(i,{additionalProperties:!1,description:e.description})}function kf(e){return tt.map(t=>vo(t,e))}function Vs(e,t=[],n){let o=p=>!n||!p.renderers||p.renderers.includes(n.renderer),i=new Map;for(let p of tt)o(p)&&(p.hasChildren||i.set(p.name,vo(p,void 0,e,n)));let a=tt.filter(p=>p.hasChildren&&o(p)),s=new Map,c=[...a];for(;c.length>0;){let p=c.length;for(let m=c.length-1;m>=0;m--){let d=c[m];if(!d.allowedChildren){s.set(d.name,vo(d,e,e,n)),c.splice(m,1);continue}if(!d.allowedChildren.filter(x=>a.some(K=>K.name===x)).every(x=>s.has(x)))continue;let w=[...d.allowedChildren.map(x=>s.get(x)??i.get(x)).filter(x=>x!==void 0),...t],C=w.length===1?w[0]:r.Union(w);s.set(d.name,vo(d,C,e,n)),c.splice(m,1)}if(c.length===p)throw new Error(`Circular allowedChildren among: ${c.map(m=>m.name).join(", ")}`)}let l=new Map([...s,...i]);return{schemas:[...l.values()],byName:l}}function Df(e={}){return r.Union(Qn.map(t=>NL(e,t,t!==da)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function NL(e,t,n){let{includeStandardComponents:o=!0,customComponents:i=[],title:a="JSON Report Definition",description:s="JSON report definition with TypeBox schemas"}=e,c=[],l=[],p=fa(t),m=r.Recursive(b=>{let I=[];for(let O of i)if(O.versionedProps&&O.versionedProps.length>0){let M=O.versionedProps,W=et(M.map(xe=>xe.version));for(let xe of M){let Gr=xe.description||O.description,Aa={name:r.Literal(O.name),id:r.Optional(r.String()),version:Gr?r.Literal(xe.version,{description:Gr}):r.Literal(xe.version),props:xe.propsSchema};xe.hasChildren&&(Aa.children=r.Optional(r.Array(b)));let yg=xe.description?`${O.name} v${xe.version} \\u2014 ${xe.description}`:O.description?`${O.name} v${xe.version} \\u2014 ${O.description}`:`${O.name} v${xe.version}`;I.push(r.Object(Aa,{additionalProperties:!1,description:yg}))}let nt=M.find(xe=>xe.version===W),ot={name:r.Literal(O.name),id:r.Optional(r.String()),props:nt.propsSchema};nt.hasChildren&&(ot.children=r.Optional(r.Array(b)));let cr=nt.description?`${O.name} (latest: v${W}) \\u2014 ${nt.description}`:O.description?`${O.name} (latest: v${W}) \\u2014 ${O.description}`:`${O.name} (latest: v${W})`;I.push(r.Object(ot,{additionalProperties:!1,description:cr}))}else{let M=!!O.hasChildren,W={name:r.Literal(O.name),id:r.Optional(r.String()),props:O.propsSchema};M&&(W.children=r.Optional(r.Array(b))),I.push(r.Object(W,{additionalProperties:!1,...O.description?{description:O.description}:{}}))}let{schemas:w,byName:C}=o?Vs(b,I,{renderer:t,requireDiscriminator:n}):{schemas:[],byName:new Map};c=["section",...ha("section")?.allowedChildren??[]].map(O=>C.get(O)).filter(O=>O!==void 0),l=I;let K=[...w,...I];if(K.length===0)return r.Any();if(K.length===1)return K[0];{let O=i.length>0?"Component definition with discriminated union including custom components":"Component definition with discriminated union";return r.Union(K,{discriminator:{propertyName:"name"},description:O})}},{$id:p}),d=ha("docx");if(!d)throw new Error("Docx root component not found in registry");if(c.length===0)throw new Error("Root child schemas not found in narrowed standard schemas");return r.Object({name:r.Literal("docx"),id:r.Optional(r.String()),$schema:r.Optional(r.String({format:"uri"})),renderer:n?r.Literal(t,{description:"Renderer backend for this document"}):r.Optional(r.Literal(t,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})),props:r.Optional(ks(d.name,d.propsSchema,t)),children:r.Array(r.Union([...c,...l],{discriminator:{propertyName:"name"}}))},{additionalProperties:!1,title:a,description:s,definitions:{[p]:m}})}var Ks=r.Union([...kf(r.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),rt=r.Recursive(e=>r.Union([...Vs(e).schemas],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"}));var Ap=r.Object({content:r.String({description:"Text content (required)"}),spaceAfter:r.Optional(r.Number({minimum:0,description:"Spacing after text in points"})),fontSize:r.Optional(r.Number({minimum:1})),fontFamily:r.Optional(r.String()),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),color:r.Optional(r.String({pattern:"^#[0-9A-Fa-f]{6}$"})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")]))}),Np=r.Object({name:r.Literal("text-space-after"),id:r.Optional(r.String()),props:Ap}),sr=Np;function EL(e,t){let n=String(e.type||""),o=e.path||"root";return n==="62"||n==="union"?RL(e):e.message?.includes("additionalProperties")?FL(e):e.message?.includes("Required property")?vL(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?$L(e):n==="literal"?jL(e):n==="pattern"||n==="RegExp"?UL(e):`At ${o}: ${e.message}`}function RL(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n){let i=n.name;return i==="docx"?"Document structure appears valid but contains invalid component configurations. Check each component for errors.":`Unknown document name \'${i}\'. Expected \'docx\'.`}let o=n;if("children"in n&&Array.isArray(o.children))return`Document is missing required \'name\' field. Add "name": "docx" at the root level.`;if("name"in n||"styles"in n)return"This appears to be a theme configuration. Use --type theme or ensure proper document structure."}return\'Invalid document structure. Expected a document with name="docx" or a theme configuration.\'}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function FL(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let o=e.schema;if(o&&Rt(o)){let i=rr(o),s=Object.keys(n).filter(c=>!i.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${i.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function vL(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory for this configuration.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function $L(e){let t=e.path||"root",n=String(e.type),o=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${n} but got ${o}`}function jL(e){let t=e.path||"root",n=e.schema?JSON.stringify(mt(e.schema)):"specific value",o=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${o}`}function UL(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:t.includes("phone")?`Invalid phone number format at ${t}`:`Value at ${t} doesn\'t match the required pattern`}function $p(e,t,n){let o=nr(n),i=EL(e,o),a={path:e.path||"root",message:tr(i||e.message,o),code:String(e.type||"validation_error"),value:e.value};if(o.includeSuggestions){let s=DL(e,o);s&&(a.suggestion=tr(s,o))}if(t&&e.path){let s=kL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function jp(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,o=[],i=new Set;for(let a of e){if(o.length>=n)break;let s=`${a.path}:${a.type}`;i.has(s)||(i.add(s),o.push($p(a,t?.jsonString,void 0)))}return o}function kL(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let i=`"${n[n.length-1]}"`,a=e.indexOf(i);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function DL(e,t){let{type:n,path:o,value:i}=e,a=String(n);if(a==="62"||a==="union"){if(o==="root"||o==="/"){if(i&&typeof i=="object"){if(!("name"in i)){let s=\'Add a "name" field with value "docx" for documents\';return t.includeEmojis?`${Gn.FIX} ${s}`:s}if("props"in i&&typeof i.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${rr(Kr).join(", ")}`}return\'Ensure the document has proper structure: { "name": "docx", "props": {...}, "children": [...] }\'}return o?.includes("/children/")?\'Check that the component has a valid "name" and all required fields for that component type\':"Review the structure and ensure all required fields are present with correct types"}if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields. Check documentation for allowed properties.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(a==="string")return o?.includes("alignment")?"Use one of: left, center, right, justify":o?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(a==="number")return o?.includes("fontSize")||o?.includes("size")?"Use a number in points (e.g., 12, 14, 16)":o?.includes("margin")||o?.includes("padding")?"Use a number for spacing in points":"Provide a numeric value";if(a==="boolean")return"Use true or false (without quotes)";if(a==="array")return o?.includes("children")?\'Provide an array of component objects, each with a "name" field\':"Provide an array/list of values using square brackets []";if(a==="object")return"Provide an object with key-value pairs using curly braces {}";if(a==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(mt(e.schema)):"specific value"}`;if(a==="pattern"||a==="RegExp")return o?.includes("email")?"Use valid email format: user@example.com":o?.includes("url")?"Use valid URL format: https://example.com":o?.includes("date")?"Use ISO date format: YYYY-MM-DD":"Ensure the value matches the required format";if(o?.includes("name")||o?.includes("type"))return"Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual"}var ML=Object.fromEntries([...tt.map(e=>[e.name,e.propsSchema]),["custom",sr]]),BL=new Map(tt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),Ep=new Set(tt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),_L=new Map(tt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),VL={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function Bf(e,t,n,o){let i=typeof e.name=="string"?_L.get(e.name):void 0;if(i)for(let a of Object.keys(e)){if(!i.has(a)){if(n.allowUnknownFields)continue;o.push({path:`${t}/${a}`,message:`Unknown key "${a}" on component "${e.name}". Allowed keys: ${[...i].join(", ")}.`,code:"unknown_key"});continue}let s=VL[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Key "${a}" on component "${e.name}" must be a ${s}.`,code:"invalid_type"})}}var KL=["path","base64","svg"];function GL(e){if(!e||typeof e!="object")return[];let t=e;return KL.filter(n=>{let o=t[n];return typeof o=="string"&&o.trim().length>0})}function qL(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="image"){let a=GL(o.props);a.length>1&&t.push({path:`${i}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}var zL=new Set(["paragraph","heading"]);function Up(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(zL.has(o.name)){let a=o.props?.indent;a&&typeof a=="object"&&a.hanging!==void 0&&a.firstLine!==void 0&&t.push({path:`${i}/props/indent`,message:\'Indent accepts either "hanging" or "firstLine", not both. Use exactly one of the two.\',code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function kp(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,c)=>n(s,`${i}/${c}`));return}if(!o||typeof o!="object")return;let a=[];if(o.name==="paragraph"&&o.props?.revision)for(let s of["footnotes","endnotes"])a.push({notes:o.props[s],path:`${i}/props/${s}`});if(o.revision&&o.content?.name==="paragraph")for(let s of["footnotes","endnotes"])a.push({notes:o.content.props?.[s],path:`${i}/content/props/${s}`});for(let{notes:s,path:c}of a)if(Array.isArray(s)&&s.length>0){let l=c.endsWith("endnotes")?"endnotes":"footnotes";t.push({path:c,message:`"revision" and "${l}" cannot apply to the same text. Tracked-change text renders literally, so note markers inside it are not resolved and the note bodies would be dropped. Move the notes to text without a revision.`,code:"mutually_exclusive"})}for(let s of Object.keys(o))n(o[s],`${i}/${s}`)};return n(e,""),t}var HL=new Set(["dashed","dotted","double"]);function Dp(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="text-box"&&o.props?.renderAs==="shape"){let a=["width","height"].filter(c=>o.props[c]===void 0);a.length>0&&t.push({path:`${i}/props/${a[0]}`,message:`A text-box with renderAs "shape" requires ${a.join(" and ")}: a shape has no autofit, so its size cannot be derived from its content. Give it an explicit size, or use renderAs "table", which grows to fit.`,code:"required"});let s=o.props.style?.border;if(s&&typeof s=="object")for(let c of["top","right","bottom","left"]){let l=s[c]?.style;typeof l=="string"&&HL.has(l)&&t.push({path:`${i}/props/style/border/${c}/style`,message:`A text-box with renderAs "shape" cannot draw a "${l}" border: a shape outline carries no dash pattern. Use "solid", or use renderAs "table", which draws every border style.`,code:"unsupported_value"})}}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function Mp(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Document must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Ep.has(e.name)){let o=[...Ep].map(i=>`"${i}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}if(Bf(e,"",t,n),Ep.has(e.name)&&"props"in e){let o=Fp(e.name,e.props,"/props",t);n.push(...o)}return e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),_f(e,"",t,n),n}function _f(e,t,n,o){if(!e||typeof e!="object")return;let i=(s,c,l)=>{if(!s||typeof s!="object"){l&&o.push({path:c,message:"Component must be an object",code:"invalid_type"});return}if(typeof s.name!="string"||s.name.length===0){l&&o.push({path:`${c}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}n.knownCustomNames?.has(s.name)||(Bf(s,c,n,o),"props"in s?o.push(...Fp(s.name,s.props,`${c}/props`,n)):s.name!=="custom"&&o.push(...Fp(s.name,{},`${c}/props`,n)),_f(s,c,n,o))},a=typeof e.name=="string"?BL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)Rp(e.props,s.path,`${t}/props`,(c,l)=>{s.arity==="component-array"?Array.isArray(c)&&c.forEach((p,m)=>i(p,`${l}/${m}`,s.reportStructure)):c&&typeof c=="object"&&!Array.isArray(c)&&i(c,l,s.reportStructure)});Array.isArray(e.children)?e.children.forEach((s,c)=>i(s,`${t}/children/${c}`,!0)):e.children!=null&&t!==""&&o.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function Rp(e,t,n,o){if(t.length===0){o(e,n);return}if(!e||typeof e!="object")return;let[i,...a]=t;if(i==="*"){if(!Array.isArray(e))return;e.forEach((s,c)=>Rp(s,a,`${n}/${c}`,o));return}Rp(e[i],a,`${n}/${i}`,o)}function Fp(e,t,n,o={}){let i=[],a=ML[e];if(!a)return i.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),i;let s=WL(a,t),c=o.allowUnknownFields?P.Clean(s,P.Clone(t)):t;if(!P.Check(s,c)){let l=[...P.Errors(s,c)];jp(l,{maxErrors:100}).forEach(m=>{let d=m.path==="root"?n:`${n}${m.path.startsWith("/")?m.path:"/"+m.path}`;i.push({...m,path:d})})}return i}function WL(e,t){let n=e.anyOf;if(!Array.isArray(n)||n.length===0)return e;let o=n.filter(c=>JL(c,t));if(o.length===1)return o[0];let i=o.length>1?o:n,a=i[0],s=Number.POSITIVE_INFINITY;for(let c of i){let l=[...P.Errors(c,t)].length;l<s&&(s=l,a=c)}return a}function JL(e,t){let n=e.properties;if(!n)return!1;let o=new Set(e.required??[]),i=t??{};for(let[a,s]of Object.entries(n)){let c=s.const;if(c===void 0)continue;if(!(i[a]!==void 0)){if(o.has(a))return!1;continue}if(i[a]!==c)return!1}return!0}function Bp(e,t=[],n={}){let o=Mp(e,n),i=t.filter(a=>!YL(a));return XL([...i,...o])}function YL(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function XL(e){let t=new Set,n=[];for(let o of e){let i=`${o.path}:${o.message}`;t.has(i)||(t.add(i),n.push(o))}return n}function dt(e,t,n){try{if(!P.Check(e,t)){let i=[...P.Errors(e,t)];return{valid:!1,errors:Ke(i,{jsonString:n?.jsonString,maxErrors:n?.maxErrors||100})}}let o=t;return n?.clean&&(o=P.Clean(e,P.Clone(o))),n?.applyDefaults&&(o=P.Default(e,o)),{valid:!0,data:o}}catch(o){return{valid:!1,errors:[{path:"root",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}]}}}function $o(e,t,n){if(typeof t=="string"){if(!t.trim())return{valid:!1,errors:[{path:"root",message:"Input must be a non-empty string",code:"empty_input"}],isJsonError:!0};let i;try{i=JSON.parse(t)}catch(s){return s instanceof Error?{valid:!1,errors:[qn(s,t)],isJsonError:!0}:{valid:!1,errors:[{path:"root",message:"Failed to parse JSON",code:"json_parse_error"}],isJsonError:!0}}return{...dt(e,i,{...n,jsonString:t,calculatePosition:!0}),parsed:i,isJsonError:!1}}return{...dt(e,t,n),parsed:t,isJsonError:!1}}function Vf(e,t,n){let o=[],i=[],a=!1;for(let s=0;s<t.length;s++){let c=dt(e,t[s],n);if(c.valid&&c.data)o.push(c.data);else if(a=!0,c.errors){let l=c.errors.map(p=>({...p,path:`[${s}]${p.path?"/"+p.path:""}`}));i.push(...l)}if(n?.maxErrors&&i.length>=n.maxErrors)break}return a?{valid:!1,errors:i.slice(0,n?.maxErrors)}:{valid:!0,data:o}}function Kf(e,t,n,o){let i=dt(e,t,o);return!i.valid&&i.errors&&(i.errors=n(i.errors)),i}function Gf(e,t){return(n,o)=>dt(e,n,{...t,...o})}function qf(e,t){return(n,o)=>$o(e,n,{...t,...o})}function zf(e){return e.valid===!0&&e.data!==void 0}function Hf(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Fr(e.errors)}var ZL=rt,QL=[{why:"image source mutual-exclusivity",collect:qL},{why:"indent hanging/firstLine mutual-exclusivity",collect:Up},{why:"notes on a revised paragraph",collect:kp},{why:"a text box asking for a shape rendering a shape cannot give it",collect:Dp},{why:"renderer profile compatibility",collect:Ds}];function Wf(e){return QL.flatMap(({collect:t})=>t(e))}function vp(e,t){if(Array.isArray(e))return e.some(o=>vp(o,t));if(!e||typeof e!="object")return!1;let n=e;return typeof n.name=="string"&&t.has(n.name)?!0:Object.values(n).some(o=>vp(o,t))}var Mf;function eA(){return Mf??(Mf=r.Recursive(e=>r.Union(tt.map(t=>vo(t,e,e))))),Mf}function tA(e,t,n){return n?.allowUnknownFields===!0||n?.knownCustomNames!==void 0&&n.knownCustomNames.size>0&&vp(e,n.knownCustomNames)||P.Check(eA(),e)?{valid:!0,errors:[]}:{valid:!1,errors:[...t.length>0?t:[{path:"root",message:"Document does not match the \'docx\' document schema.",code:"invalid_document"}],{path:"root",message:\'The document was rejected by the whole-document schema, but deep validation could not localize the fault. Common causes: an unknown key next to "name", "props" or "children" on some component, or a value at a position the schema does not declare.\',code:"unlocalized_schema_error"}]}}function Jf(e,t,n){let o=Bp(e,t,{allowUnknownFields:n?.allowUnknownFields,knownCustomNames:n?.knownCustomNames});return o.length===0?tA(e,t,n):{valid:!1,errors:o}}function Gs(e,t){let n=dt(rt,e,t),o=n.errors||[],i=n.valid;!n.valid&&e&&({valid:i,errors:o}=Jf(e,n.errors||[],t));let a=Wf(e);a.length>0&&(o=[...o,...a],i=!1);let s=n.data??(i?e:void 0),c={...n,valid:i,documentType:"docx",errors:o,data:s};if(i){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Xf(m.name));c.hasCustomComponents=p}}return c}function qs(e,t){let n=$o(ZL,e,t),o=n.errors||[],i=n.valid;!n.valid&&n.parsed&&({valid:i,errors:o}=Jf(n.parsed,n.errors||[],t));let a=Wf(n.parsed);a.length>0&&(o=[...o,...a],i=!1);let s=n.data??(i?n.parsed:void 0),c={...n,valid:i,documentType:"docx",errors:o,data:s};if(i){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Xf(m.name));c.hasCustomComponents=p}}return c}function Yf(e){return e.valid===!0&&e.data!==void 0}function rA(){return Kn(Ks)}function Xf(e){return rA().includes(e)}function zs(e){return{validate:(t,n)=>Gs(t,{...e,...n}),validateJson:(t,n)=>qs(t,{...e,...n})}}var jo=zs({clean:!0,applyDefaults:!0,maxErrors:100}),ga=zs({clean:!1,applyDefaults:!1,maxErrors:100}),Zf=qs,Qf=Gs;function nA(){return{includeEmojis:!th(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:oA()}}var x6=nA(),eh={UNION_NO_MATCH:"Value doesn\'t match any of the expected formats",TYPE_MISMATCH:"Expected {expected} but got {actual}",MISSING_REQUIRED:"Missing required field \'{field}\'",UNKNOWN_PROPERTY:"Unknown property \'{property}\'",INVALID_FORMAT:"Invalid {type} format",PATTERN_MISMATCH:"Value doesn\'t match the required pattern"};function th(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.CONTINUOUS_INTEGRATION||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.TRAVIS||process.env.JENKINS_URL)}function oA(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!th()}function Js(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let n=dt(Fo,e,t),o={...n};if(n.valid&&n.data){let i=n.data;i.name&&(o.themeName=i.name)}return o}function _p(e,t){let n=$o(Fo,e,t),o={...n};if(n.valid&&n.data){let i=n.data;typeof i=="object"&&!i.$schema&&(i.$schema="./json-schemas/theme.schema.json"),i.name&&(o.themeName=i.name)}return o}function Vp(e,t){let n=Js(e,t);return!n.valid&&n.errors&&(n.errors=n.errors.map(o=>(o.path.includes("colors")&&!o.suggestion&&(o.suggestion="Colors must be valid hex, rgb, or named colors"),o.path.includes("fonts")&&!o.suggestion&&(o.suggestion="Fonts must include size and family properties"),o.path.includes("headings")&&!o.suggestion&&(o.suggestion="Headings must be an array of 6 style definitions"),o))),n}function rh(e){return e.valid===!0&&e.data!==void 0}function Ys(e){return{validate:(t,n)=>Js(t,{...e,...n}),validateJson:(t,n)=>_p(t,{...e,...n}),validateWithEnhancement:(t,n)=>Vp(t,{...e,...n})}}var ya=Ys({clean:!0,applyDefaults:!0}),Hs=Ys({clean:!1,applyDefaults:!1,maxErrors:10});function nh(e){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&"name"in e){let t=e;if(typeof t.name=="string")return t.name}}function oh(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var ih={report:Kr,section:Br,heading:jr,paragraph:Ur,columns:_r,image:kr,statistic:Dr,table:Mr,list:Vr,custom:sr};function ko(e,t,n){let o=ih[e];if(!o){let a=dt(sr,t,n);return{...a,success:a.valid,componentName:e,isCustomComponent:!0}}let i=dt(o,t,n);return{...i,success:i.valid,componentName:e,isCustomComponent:e==="custom"}}function Kp(e,t){let n=dt(rt,e,t),o={...n};if(n.valid&&n.data){let i=n.data;o.componentName=i.name,o.isCustomComponent=!Do(i.name)}return o}function Gp(e,t,n){return cn(e,t,n)}function Do(e){return e in ih}function ah(e){return P.Check(Kr,e)}function sh(e){return P.Check(Br,e)}function ch(e){return P.Check(jr,e)}function lh(e){return P.Check(Ur,e)}function ph(e){return P.Check(_r,e)}function mh(e){return P.Check(kr,e)}function uh(e){return P.Check(Dr,e)}function dh(e){return P.Check(Mr,e)}function fh(e){return P.Check(Vr,e)}function hh(e){return P.Check(sr,e)}function Xs(e){return{validate:(t,n,o)=>Do(t)?ko(t,n,{...e,...o}):ko("custom",n,{...e,...o}),validateDefinition:(t,n)=>Kp(t,{...e,...n}),validateCustom:(t,n,o)=>Gp(t,n,{...e,...o})}}var Uo=Xs({clean:!0,applyDefaults:!0}),Ws=Xs({clean:!1,applyDefaults:!1,maxErrors:10}),gh={document:e=>jo.validate(e),jsonDocument:e=>jo.validateJson(e),theme:e=>ya.validate(e),jsonTheme:e=>ya.validateJson(e),component:(e,t)=>Uo.validate(e,t),componentDefinition:e=>Uo.validateDefinition(e),components:e=>e.map(t=>Uo.validate(t.name,t.props)),isDocument:e=>jo.validate(e).valid,isTheme:e=>ya.validate(e).valid,isComponent:(e,t)=>Uo.validate(e,t).valid},yh={document:e=>ga.validate(e),jsonDocument:e=>ga.validateJson(e),theme:e=>Hs.validate(e),jsonTheme:e=>Hs.validateJson(e),component:(e,t)=>Ws.validate(e,t),componentDefinition:e=>Ws.validateDefinition(e)};var bh=r.Object({definition:rt,format:r.Optional(r.Union([r.Literal("docx"),r.Literal("pdf"),r.Literal("html")])),options:r.Optional(r.Object({includeMetadata:r.Optional(r.Boolean()),includeComments:r.Optional(r.Boolean({deprecated:!0,description:"Deprecated and ignored. Comments are authored per component via the `comment` prop."})),trackChanges:r.Optional(r.Boolean())},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation request"}),xh=r.Object({definition:r.Unknown(),strict:r.Optional(r.Boolean())},{additionalProperties:!1,description:"Document validation request"}),Oh=r.Object({success:r.Boolean(),documentId:r.Optional(r.String()),downloadUrl:r.Optional(r.String()),error:r.Optional(r.String()),metadata:r.Optional(r.Object({pageCount:r.Optional(r.Number()),wordCount:r.Optional(r.Number()),generatedAt:r.Optional(r.String({format:"date-time"}))},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation response"}),Sh=r.Object({valid:r.Boolean(),errors:r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})),warnings:r.Optional(r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})))},{additionalProperties:!1,description:"Document validation response"});var Ih=rt,wh={report:"./json-schemas/components/report.schema.json",section:"./json-schemas/components/section.schema.json",columns:"./json-schemas/components/columns.schema.json",heading:"./json-schemas/components/heading.schema.json",paragraph:"./json-schemas/components/paragraph.schema.json",image:"./json-schemas/components/image.schema.json",statistic:"./json-schemas/components/statistic.schema.json",table:"./json-schemas/components/table.schema.json",header:"./json-schemas/components/header.schema.json",footer:"./json-schemas/components/footer.schema.json",list:"./json-schemas/components/list.schema.json",alignment:"./json-schemas/base/alignment.schema.json",baseComponent:"./json-schemas/base/base-component.schema.json",border:"./json-schemas/base/border.schema.json",spacing:"./json-schemas/base/spacing.schema.json",margins:"./json-schemas/base/margins.schema.json",index:"./json-schemas/index.schema.json"};function Zs(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),o=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},i=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let d=p;if(d.type==="array"&&d.items&&Object.keys(d.items).length===0&&n.has(t)&&(d.items={$ref:`#/definitions/${t}`}),d.type==="array"&&d.items&&typeof d.items=="object"&&"$ref"in d.items&&i(d.items.$ref)){let b=o(d.items.$ref);d.items=b?{$ref:b}:{}}if(i(d.$ref)){let b=o(d.$ref);b?d.$ref=b:delete d.$ref}if(l==="$id"&&i(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function Ch(e,t={}){let{$schema:n="http://json-schema.org/draft-07/schema#",$id:o,title:i,description:a,definitions:s={}}=t,c=JSON.parse(JSON.stringify(e)),l={...s};function p(d,b=""){if(!(typeof d!="object"||d===null)){for(let[I,w]of Object.entries(d))if(w&&typeof w=="object"){let C=w;if(C.$id&&typeof C.$id=="string"){let x=C.$id;if(b!==`definitions.${x}`){let{$id:K,...O}=C;l[x]=O,d[I]={$ref:`#/definitions/${x}`},p(O,`definitions.${x}`);continue}}p(w,b?`${b}.${I}`:I)}}}p(c);let m={$schema:n};return o&&(m.$id=o),Object.assign(m,c),i!==void 0&&(m.title=i),a!==void 0&&(m.description=a),Object.keys(l).length>0&&(m.definitions=l),Zs(m),ta(m),m}function Ph(e,t,n,o="ComponentDefinition"){let i={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};if(Uf().map(s=>s.name).includes(e)&&(i.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${o}`}},n&&(i.definitions={[o]:JSON.parse(JSON.stringify(n))})),t.enhanceForRichContent&&e==="table"){let s=i;s.definitions||(s.definitions={}),n&&(s.definitions[o]=JSON.parse(JSON.stringify(n)));let l=i.properties.props;if(l?.properties&&typeof l.properties=="object"&&l.properties!==null){let m=l.properties.rows;if(m?.items&&typeof m.items=="object"&&m.items!==null){let b=m.items.items;if(b?.anyOf&&Array.isArray(b.anyOf)){let I=`#/definitions/${o}`;b.anyOf.some(C=>C.$ref===I)||b.anyOf.push({description:"Rich content cell with component (e.g., image, paragraph)",$ref:I})}}}}return Zs(i,o),i.additionalProperties=!1,i}async function Th(e,t,n={}){let{prettyPrint:o=!0}=n,i=o?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>Am(Fl(),1))).writeFile(t,i,"utf-8")}var Lh={report:{title:"Report Component",description:"Top-level report container component with document-wide settings"},section:{title:"Section Component",description:"Section container for organizing document content"},columns:{title:"Columns Component",description:"Multi-column layout container"},heading:{title:"Heading Component",description:"Heading text with configurable levels and styling"},paragraph:{title:"Paragraph Component",description:"Rich paragraph text content with formatting options"},"text-box":{title:"Text Box Component",description:"Inline or floating container that groups text and image components with shared positioning"},image:{title:"Image Component",description:"Image content with positioning and sizing options"},statistic:{title:"Statistic Component",description:"Statistical display with value and label"},table:{title:"Table Component",description:"Tabular data display with headers and rows",enhanceForRichContent:!0},list:{title:"List Component",description:"Ordered or unordered list with nested items"},highcharts:{title:"Highcharts Component",description:"Charts powered by Highcharts (line, bar, pie, heatmap, etc.) with rich configuration"},visual:{title:"Visual Component",description:\'Free-canvas graphic: a rasterized pptx slide, or a native Word drawing group with renderMode "native"\'}},Ah={alignment:{title:"Alignment",description:"Text alignment options"},"base-component":{title:"Base Component Props",description:"Common props for all components"},border:{title:"Border",description:"Border styling configuration"},spacing:{title:"Spacing",description:"Spacing configuration for before and after elements"},margins:{title:"Margins",description:"Margin configuration for all sides"},indent:{title:"Indent",description:"Indentation configuration"},"line-spacing":{title:"Line Spacing",description:"Line height and spacing configuration"},"heading-level":{title:"Heading Level",description:"Heading level from 1 to 6"},numbering:{title:"Numbering",description:"Numbering configuration for ordered lists"},"justified-alignment":{title:"Justified Alignment",description:"Justified text alignment options"}},Nh={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};var iA=1e6;function Eh(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function Qs(e){let t=[];for(let n of e){if(!n.text)continue;let o=t[t.length-1];o&&o.type===n.type?o.text+=n.text:t.push({...n})}return t}function aA(e){let t=[];for(let i=0;i<e.length;i++){let a=e[i];if(a.type==="equal"&&/^\\s+$/.test(a.text)){let s=t[t.length-1],c=e[i+1];if(s&&s.type!=="equal"&&c&&c.type!=="equal"){t.push({type:"delete",text:a.text},{type:"insert",text:a.text});continue}}t.push({...a})}let n=[],o=0;for(;o<t.length;){if(t[o].type==="equal"){n.push(t[o]),o++;continue}let i="",a="";for(;o<t.length&&t[o].type!=="equal";)t[o].type==="delete"?i+=t[o].text:a+=t[o].text,o++;i&&n.push({type:"delete",text:i}),a&&n.push({type:"insert",text:a})}return Qs(n)}function ic(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let n=Eh(e),o=Eh(t);if(n.length===0)return Qs([{type:"insert",text:t}]);if(o.length===0)return Qs([{type:"delete",text:e}]);if(n.length*o.length>iA)return Qs([{type:"delete",text:e},{type:"insert",text:t}]);let i=n.length,a=o.length,s=Array.from({length:i+1},()=>new Int32Array(a+1));for(let m=i-1;m>=0;m--)for(let d=a-1;d>=0;d--)s[m][d]=n[m]===o[d]?s[m+1][d+1]+1:Math.max(s[m+1][d],s[m][d+1]);let c=[],l=0,p=0;for(;l<i&&p<a;)n[l]===o[p]?(c.push({type:"equal",text:n[l]}),l++,p++):s[l+1][p]>=s[l][p+1]?(c.push({type:"delete",text:n[l]}),l++):(c.push({type:"insert",text:o[p]}),p++);for(;l<i;)c.push({type:"delete",text:n[l]}),l++;for(;p<a;)c.push({type:"insert",text:o[p]}),p++;return aA(c)}function xa(e){return e.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g,"$1").replace(/(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,(t,n,o,i,a,s,c)=>o??a??c??"")}var Yp=new Set(["paragraph","heading"]);function qt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function On(e,t){return{...e.author&&{author:e.author},...e.date&&{date:e.date},segments:t}}function ba(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function ec(e){return xa(ba(e))}var sA=/\\{[^}]+\\}/;function tc(e){return e.enabled!==!1}function wa(e,t,n,o){e.some(i=>i.type!=="equal"&&sA.test(i.text))&&o.summary.untracked.push({path:t,kind:"modified",component:n,detail:"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline"})}function Sn(e,...t){let n={...e||{}};for(let o of t)delete n[o];return n}var cA=4e6;function Xp(e,t,n){let o=e.map(n),i=t.map(n),a=0;for(;a<e.length&&a<t.length&&o[a]===i[a];)a++;let s=e.length,c=t.length;for(;s>a&&c>a&&o[s-1]===i[c-1];)s--,c--;let l=[];for(let x=0;x<a;x++)l.push({op:"equal",oldItem:e[x],newItem:t[x]});let p=[];for(let x=0;x<e.length-s;x++)p.push({op:"equal",oldItem:e[s+x],newItem:t[c+x]});let m=s-a,d=c-a,b=[];if(m*d>cA){for(let x=0;x<m;x++)b.push({op:"delete",oldItem:e[a+x]});for(let x=0;x<d;x++)b.push({op:"insert",newItem:t[a+x]});return[...l,...b,...p]}let I=Array.from({length:m+1},()=>new Int32Array(d+1));for(let x=m-1;x>=0;x--)for(let K=d-1;K>=0;K--)I[x][K]=o[a+x]===i[a+K]?I[x+1][K+1]+1:Math.max(I[x+1][K],I[x][K+1]);let w=0,C=0;for(;w<m&&C<d;)o[a+w]===i[a+C]?(b.push({op:"equal",oldItem:e[a+w],newItem:t[a+C]}),w++,C++):I[w+1][C]>=I[w][C+1]?(b.push({op:"delete",oldItem:e[a+w]}),w++):(b.push({op:"insert",newItem:t[a+C]}),C++);for(;w<m;)b.push({op:"delete",oldItem:e[a+w++]});for(;C<d;)b.push({op:"insert",newItem:t[a+C++]});return[...l,...b,...p]}function Zp(e,t,n){let o=new Array(e.length).fill(!1),i=new Array(t.length).fill(-1),a=0;for(let p=0;p<t.length;p++)for(let m=a;m<e.length;m++)if(!o[m]&&n(e[m],t[p])){o[m]=!0,i[p]=m,a=m+1;break}let s=[],c=[],l=0;for(let p=0;p<t.length;p++){let m=i[p];if(m>=0){for(;l<m;)o[l]||s.push({kind:"deleted",oldItem:e[l]}),l++;l=m+1,s.push({kind:"paired",oldItem:e[m],newItem:t[p]}),c.push({oldItem:e[m],newItem:t[p]})}else s.push({kind:"inserted",newItem:t[p]})}for(let p=l;p<e.length;p++)o[p]||s.push({kind:"deleted",oldItem:e[p]});return{pairs:c,plan:s}}function lA(e,t,n,o){let i=ec(e),a=ec(t),s=!qt(Sn(e.props,"text","revision","comment"),Sn(t.props,"text","revision","comment"));if(s&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"formatting/props changed (not expressible as a tracked change); new version rendered"}),i===a)return ba(e)!==ba(t)?o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or link target changed (markdown-only); new version rendered without a tracked change"}):s||o.summary.unchangedBlocks++,t;o.summary.tracked.modified++;let c=ic(i,a);return wa(c,n,t.name,o),(ba(e)!==i||ba(t)!==a)&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or links flattened to plain text in the redline (revision segments render literally)"}),{...t,props:{...ac(t,n,o),text:a,revision:On(o,c)}}}function ac(e,t,n){let o={...e.props??{}},i=["footnotes","endnotes"].filter(a=>{let s=o[a];return Array.isArray(s)&&s.length>0});if(i.length===0)return o;for(let a of i)delete o[a];return n.summary.untracked.push({path:t,kind:"modified",component:e.name,detail:`${i.join(" and ")} dropped from a tracked-change paragraph (note markers do not resolve inside revision text); the note bodies are not in the redline`}),o}function pA(e,t,n){n.summary.tracked.inserted++;let o=ec(e),i=[{type:"insert",text:o}];return wa(i,t,e.name,n),{...e,props:{...ac(e,t,n),text:o,revision:On(n,i)}}}function mA(e,t,n){n.summary.tracked.deleted++;let i=[{type:"delete",text:ec(e)}];return wa(i,t,e.name,n),{...e,props:{...ac(e,t,n),text:"",revision:On(n,i)}}}function qp(e){return(e.props?.items||[]).map(n=>{let o=typeof n=="string"?n:n.text,i=typeof n=="string"?0:n.level||0;return{raw:o,text:xa(o.normalize("NFC")),level:i}})}function uA(e,t,n,o){let i=!qt(Sn(e.props,"items"),Sn(t.props,"items"));i&&o.summary.untracked.push({path:n,kind:"modified",component:"list",detail:"list configuration changed (format/levels/spacing); new version rendered"});let a=qp(e),s=qp(t),c=b=>b.map(I=>({text:I.text,level:I.level}));if(qt(c(a),c(s)))return qt(a.map(b=>b.raw),s.map(b=>b.raw))?i||o.summary.unchangedBlocks++:o.summary.untracked.push({path:n,kind:"modified",component:"list",detail:"inline formatting or link target changed in list items (markdown-only); new version rendered without a tracked change"}),t;let l=Xp(a,s,b=>`${b.level}:${b.text}`),p=[],m=!1,d=0;for(;d<l.length;){let b=l[d];if(b.op==="equal"){p.push({text:b.newItem.raw,level:b.newItem.level}),d++;continue}let I=[],w=[];for(;d<l.length&&l[d].op!=="equal";){let x=l[d];x.op==="delete"?I.push(x.oldItem):x.op==="insert"&&w.push(x.newItem),d++}let{plan:C}=Zp(I,w,(x,K)=>x.level===K.level);for(let x of C)if(m=!0,x.kind==="paired"){let K=ic(x.oldItem.text,x.newItem.text);wa(K,n,"list",o),p.push({text:x.newItem.text,level:x.newItem.level,revision:On(o,K)})}else x.kind==="inserted"?p.push({text:x.newItem.text,level:x.newItem.level,revision:On(o,[{type:"insert",text:x.newItem.text}])}):p.push({text:"",level:x.oldItem.level,revision:On(o,[{type:"delete",text:x.oldItem.text}])})}return m&&o.summary.tracked.modified++,{...t,props:{...t.props,items:p}}}function Fh(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let o=qp(e).map(i=>({text:t==="insert"?i.text:"",level:i.level,revision:On(n,[{type:t,text:i.text}])}));return{...e,props:{...e.props,items:o}}}function zp(e){if(!e)return"";let t=e.content;if(typeof t=="string")return xa(t.normalize("NFC"));if(t&&typeof t=="object"){let o=t.props?.text;if(typeof o=="string")return xa(o.normalize("NFC"))}return""}function Hp(e){if(!e)return"";let t=e.content;if(typeof t=="string")return t.normalize("NFC");if(t&&typeof t=="object"){let n=t.props?.text;if(typeof n=="string")return n.normalize("NFC")}return""}function Rh(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function Wp(e){let t=e.props?.columns??[],n=t.reduce((i,a)=>Math.max(i,a.cells?.length??0),0),o=e.props?.rows??[];return Array.from({length:n},(i,a)=>{let s=t.map(c=>c.cells?.[a]);return{cells:s,key:s.map(zp).join("\\0"),rawKey:s.map(Hp).join("\\0"),rowProps:o[a]}})}function vh(e,t,n){let o=e.props?.columns??[],i=t.map((a,s)=>({...a.rowProps??{},...n[s]}));return{...e,props:{...e.props,columns:o.map((a,s)=>({...a,cells:t.map(c=>c.cells[s]??{content:""})})),...i.some(a=>Object.keys(a).length>0)&&{rows:i}}}}function rc(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function dA(e,t,n,o,i,a){let s=ic(n,o);wa(s,i,"table",a),(Hp(t)!==n||Hp(e)!==o)&&a.summary.untracked.push({path:i,kind:"modified",component:"table",detail:"inline formatting or links flattened to plain text in a table cell (revision segments render literally)"});let c=e??{content:""};return{...c,content:fA(c.content,o,i,a),revision:On(a,s)}}function fA(e,t,n,o){if(!e||typeof e!="object")return t;let i=e;return{...i,props:{...ac(i,n,o),text:t}}}function hA(e,t,n,o){let i=Wp(e),a=Wp(t),s=e.props?.columns??[],c=t.props?.columns??[];if(s.length!==c.length)return o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table column count changed (columns are not expressible as a tracked change); new version rendered"}),t;let l=!qt(Sn(e.props,"columns","rows"),Sn(t.props,"columns","rows"));l&&o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table configuration changed (borders/widths/defaults); new version rendered"});let p=!qt(s.map(x=>x.header),c.map(x=>x.header));if(p&&o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table header row changed (headers are not row content); new version rendered"}),qt(i.map(x=>x.key),a.map(x=>x.key)))return qt(i.map(x=>x.rawKey),a.map(x=>x.rawKey))?!l&&!p&&qt(i,a)&&o.summary.unchangedBlocks++:o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"inline formatting or link target changed in table cells (markdown-only); new version rendered without a tracked change"}),t;let m=Xp(i,a,x=>x.key),d=[],b=[],I=!1,w=(x,K)=>{d.push(x),b.push(K)},C=0;for(;C<m.length;){let x=m[C];if(x.op==="equal"){w(x.newItem,{}),C++;continue}let K=[],O=[];for(;C<m.length&&m[C].op!=="equal";){let W=m[C];W.op==="delete"?K.push(W.oldItem):W.op==="insert"&&O.push(W.newItem),C++}let{plan:M}=Zp(K,O,(W,nt)=>W.cells.length===nt.cells.length&&W.cells.every(Rh)&&nt.cells.every(Rh));for(let W of M)if(I=!0,W.kind==="paired"){let nt=W.newItem.cells.map((ot,cr)=>{let xe=zp(W.oldItem.cells[cr]),Gr=zp(ot);return xe===Gr?ot??{content:""}:dA(ot,W.oldItem.cells[cr],xe,Gr,n,o)});w({...W.newItem,cells:nt},{})}else W.kind==="inserted"?(o.summary.tracked.inserted++,w(W.newItem,{revision:Jp(o,"insert")})):(o.summary.tracked.deleted++,w(W.oldItem,{revision:Jp(o,"delete")}))}return I&&o.summary.tracked.modified++,vh(t,d,b)}function $h(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let o=Wp(e);return vh(e,o,o.map(()=>({revision:Jp(n,t)})))}function Jp(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function nc(e){return Array.isArray(e.children)}function gA(e,t){return e.name===t.name}function yA(e,t,n,o){let i=tc(e),a=tc(t);return!i&&!a?(o.summary.unchangedBlocks++,t):!i&&a?jh(t,n,o):i&&!a?Uh(e,n,o)??t:Yp.has(t.name)?lA(e,t,n,o):t.name==="list"?uA(e,t,n,o):t.name==="table"&&rc(e)&&rc(t)?hA(e,t,n,o):nc(t)||nc(e)?(!qt(e.props,t.props)&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:sc(e.children||[],t.children||[],`${n}/children`,o)}):(o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:`"${t.name}" changed (no native tracked-change support); new version rendered`}),t)}function jh(e,t,n){return tc(e)?Yp.has(e.name)?pA(e,t,n):e.name==="list"?Fh(e,"insert",n):e.name==="table"&&rc(e)?$h(e,"insert",n):nc(e)?(typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" title rendered without insertion mark (titles are props, not text blocks)`}),{...e,children:sc([],e.children||[],`${t}/children`,n)}):(n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" added (rendered, but not marked as a tracked insertion)`}),e):e}function Uh(e,t,n){if(!tc(e))return null;if(Yp.has(e.name))return mA(e,t,n);if(e.name==="list")return Fh(e,"delete",n);if(e.name==="table"&&rc(e))return $h(e,"delete",n);if(nc(e)){typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" title still rendered without deletion mark (titles are props, not text blocks)`});let o=sc(e.children||[],[],`${t}/children`,n);return{...e,children:o}}return n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" removed (dropped from the redline; Word cannot mark it as a tracked deletion)`}),null}function sc(e,t,n,o){let i=Xp(e,t,l=>JSON.stringify(l)),a=[],s=0,c=0;for(;s<i.length;){let l=i[s];if(l.op==="equal"){o.summary.unchangedBlocks++,a.push(l.newItem),s++,c++;continue}let p=[],m=[];for(;s<i.length&&i[s].op!=="equal";){let b=i[s];b.op==="delete"?p.push(b.oldItem):b.op==="insert"&&m.push(b.newItem),s++}let{plan:d}=Zp(p,m,gA);for(let b of d)if(b.kind==="paired")a.push(yA(b.oldItem,b.newItem,`${n}/${c}`,o)),c++;else if(b.kind==="inserted")a.push(jh(b.newItem,`${n}/${c}`,o)),c++;else{let I=Uh(b.oldItem,`${n}/${c}`,o);I&&a.push(I)}}return a}function bA(e,t,n={}){if(!e||e.name!=="docx")throw new Error(\'Old document: top-level component must be "docx"\');if(!t||t.name!=="docx")throw new Error(\'New document: top-level component must be "docx"\');let o={tracked:{modified:0,inserted:0,deleted:0},untracked:[],unchangedBlocks:0,notes:[]},i={author:n.author,date:n.date,summary:o};!qt(Sn(e.props,"trackRevisions"),Sn(t.props,"trackRevisions"))&&o.untracked.push({path:"/props",kind:"modified",component:"docx",detail:"document props changed (theme/metadata/defaults); new version used"});let s=sc(e.children||[],t.children||[],"/children",i);return o.tracked.deleted>0&&o.notes.push(`${o.tracked.deleted} fully deleted block(s): accepting all changes leaves an empty paragraph behind (OOXML paragraph-mark deletion is not supported by the renderer)`),{document:{...t,props:{...t.props,trackRevisions:!0},children:s},summary:o}}wt.Set("uri",e=>{try{return new URL(e),!0}catch{return e.includes(".json")||e.includes("/")||e.includes("\\\\")?!0:/^https?:\\/\\/.+/.test(e)}});wt.Set("date-time",e=>/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/.test(e)&&!isNaN(Date.parse(e)));var Qp=class{constructor(){$(this,"schema",rt)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(n){throw new Mo("Invalid JSON syntax",this.extractJSONSyntaxError(n,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new Bo(\'Invalid document structure: Document must be a docx component with name="docx"\',[{path:"name",message:\'Document must be a docx component with name="docx"\',code:"INVALID_STRUCTURE"}]);if(!P.Check(this.schema,t)){let n=[...P.Errors(this.schema,t)];throw new Bo("JSON validation failed",this.formatTypeBoxErrors(n,typeof e=="string"?e:JSON.stringify(e,null,2)))}return t}validate(e){try{return this.parse(e),{valid:!0,errors:[],warnings:[]}}catch(t){return t instanceof Mo||t instanceof Bo?{valid:!1,errors:t.validationErrors,warnings:[]}:{valid:!1,errors:[{path:"",message:t instanceof Error?t.message:"Unknown validation error",code:"UNEXPECTED_ERROR"}],warnings:[]}}}parseWithLineNumbers(e){let t=e.split(`\n`);try{return this.parse(e)}catch(n){if(n instanceof Mo||n instanceof Bo){let o=n.validationErrors.map(i=>({...i,...this.findLineNumber(i.path,e,t)}));throw n instanceof Mo?new Mo(n.message,o):new Bo(n.message,o)}throw n}}extractJSONSyntaxError(e,t){let n=e.message,o=n.match(/position\\s+(\\d+)/i)||n.match(/at\\s+(\\d+)/i)||n.match(/character\\s+(\\d+)/i),i=0,a=0;if(o){let s=parseInt(o[1],10),c=t.substring(0,s).split(`\n`);i=c.length,a=c[c.length-1].length+1}return[{path:"",message:`JSON syntax error: ${n}`,code:"JSON_SYNTAX_ERROR",line:i||void 0,column:a||void 0,suggestions:["Check for missing commas, brackets, or quotes","Validate JSON syntax using a JSON validator","Ensure all strings are properly quoted"]}]}formatTypeBoxErrors(e,t){return e.map(n=>{let o=n.path||"",i=this.findLineNumber(o,t);return{path:o,message:this.formatTypeBoxErrorMessage(n),code:this.getErrorCode(n),line:i.line,column:i.column,suggestions:this.generateSuggestions(n)}})}formatTypeBoxErrorMessage(e){let t=e.path?`at "${e.path}"`:"",n=e.message;return n.includes("Expected")?`${n} ${t}`:n.includes("Required property")?`${n} ${t}`:n.includes("Unexpected property")?`${n} ${t}`:n.includes("minimum")?`Value is too small ${t}. ${n}`:n.includes("maximum")?`Value is too big ${t}. ${n}`:`${n} ${t}`}getErrorCode(e){let t=String(e.type||"VALIDATION_ERROR").toUpperCase(),n=e.path?e.path.replace(/\\//g,"_").toUpperCase():"";return n?`${t}_${n}`:t}generateSuggestions(e){let t=[],n=e.message;if(n.includes("Expected string"))t.push("Ensure the value is wrapped in quotes");else if(n.includes("Expected number"))t.push("Remove quotes around numeric values");else if(n.includes("Expected array"))t.push("Use square brackets [] for arrays");else if(n.includes("Expected object"))t.push("Use curly braces {} for objects");else if(n.includes("Expected literal")){let o=n.match(/Expected literal (.+)/);o&&t.push(`Use the exact value: ${o[1]}`)}else if(n.includes("Unexpected property"))t.push("Remove unknown properties or check spelling"),t.push("Refer to the JSON schema documentation for valid properties");else if(n.includes("Expected union")){t.push("Check that the value matches one of the allowed formats");let o=e.path??"";(/\\/children\\/\\d+$/.test(o)||o.endsWith("/name"))&&t.push("Verify the component name is spelled correctly")}else if(n.includes("minimum")){let o=n.match(/minimum.*?(\\d+)/);o&&(n.includes("Array")?t.push(`Array must have at least ${o[1]} items`):t.push(`Value must be at least ${o[1]}`))}else n.includes("format")&&n.includes("uri")&&t.push("Ensure the URL is valid and starts with http:// or https://");return t.length===0&&(t.push("Check the JSON schema documentation for valid values"),t.push("Verify the property name and value format")),t}findLineNumber(e,t,n){if(!e)return{};let o=n||t.split(`\n`),i=e.split(".");for(let a=0;a<o.length;a++){let s=o[a],c=i[i.length-1];if(s.includes(`"${c}"`)){let l=s.indexOf(`"${c}"`)+1;return{line:a+1,column:l}}}return{}}},Mo=class extends Error{constructor(t,n){super(t);$(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=n}},Bo=class extends Error{constructor(t,n){super(t);$(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=n}};function xA(e){return new Qp().parse(e)}function OA(e){return new Qp().parseWithLineNumbers(e)}function SA(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;let n=t.path?`${t.path}: `:"",o=t.message||"Validation error";return`${n}${o}`}):[]}function IA(e,t){let n=Do(e)?e:"custom",o=ko(n,t);return o.valid?{success:!0,data:o.data}:{success:!1,error:o.errors||[]}}function wA(e){let t=Kp(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function CA(e,t){let n=t&&Do(t)?t:"custom",o=ko(n,e);return o.valid?[]:(o.errors||[]).map(i=>i.path?`${i.path}: ${i.message}`:i.message)}function PA(e){let t=e.path||"root",n=e.message,o,i,a,s;if(n.includes("Expected")){let c=n.match(/Expected (.+) but received (.+)/);c&&(i=c[1],a=c[2],o=TA(i,a))}if(n.includes("Required property")){let c=n.match(/Required property \'(.+)\'/);c&&(n=`Missing required field: ${c[1]}`,o=`Add the required field: ${c[1]}`)}if(n.includes("Unexpected property")){let c=n.match(/Unexpected property \'(.+)\'/);c&&(n=`Unknown property: ${c[1]}`,o=`Remove the unknown property: ${c[1]}`)}if(n.includes("Expected union")&&(n="Value does not match any of the expected types",o="Check the documentation for valid format options"),n.includes("Expected literal")){let c=n.match(/Expected literal (.+)/);c&&(i=c[1],n=`Expected value: ${i}`,o=`Use the exact value: ${i}`)}if(n.includes("String length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`String must be at least ${c[1]} characters long`,o=`Add more characters to meet the minimum length of ${c[1]}`):l&&(n=`String must be at most ${l[1]} characters long`,o=`Reduce to ${l[1]} characters or less`)}if(n.includes("Expected number")){let c=n.match(/minimum value of ([\\d.]+)/),l=n.match(/maximum value of ([\\d.]+)/);c?(n=`Number must be greater than or equal to ${c[1]}`,o=`Use a value of ${c[1]} or higher`):l&&(n=`Number must be less than or equal to ${l[1]}`,o=`Use a value of ${l[1]} or lower`)}if(n.includes("Array length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`Array must have at least ${c[1]} items`,o=`Add more items to meet the minimum of ${c[1]}`):l&&(n=`Array must have at most ${l[1]} items`,o=`Remove items to meet the maximum of ${l[1]}`)}return n.includes("format")&&(n.includes("email")?(n="Invalid email address format",o="Use a valid email format like user@example.com"):n.includes("uri")||n.includes("url")?(n="Invalid URL format",o="Use a valid URL format like https://example.com"):n.includes("date-time")&&(n="Invalid date-time format",o="Use ISO 8601 format like 2024-01-01T00:00:00Z")),n.includes("pattern")&&(n="String does not match the required pattern",o="Check the format requirements for this field"),{path:t,message:n,code:String(e.type||"validation_error"),suggestion:o,expected:i,received:a,options:s}}function TA(e,t){if(e==="number"&&t==="string")return"Remove quotes or convert the string to a number";if(e==="string"&&t==="number")return"Add quotes or convert the number to a string";if(e==="boolean")return"Use true or false (without quotes)";if(e==="array"&&t==="object")return"Use square brackets [] for arrays instead of curly braces {}";if(e==="object"&&t==="array")return"Use curly braces {} for objects instead of square brackets []";if(t==="null"||t==="undefined")return`Provide a valid ${e} value or mark the field as optional`}function In(e){return e.map(PA)}function Oa(e){return In(e).map(t=>{let n=`${t.path}: ${t.message}`;return t.suggestion&&(n+=` (Suggestion: ${t.suggestion})`),n})}function kh(e){let t=new Map;for(let n of In(e)){let o=t.get(n.path)||[];o.push(n),t.set(n.path,o)}return t}function Sa(e){let t=In(e),n=kh(e),o=`Validation failed with ${t.length} error${t.length>1?"s":""}:\n\n`;for(let[i,a]of n){o+=`\\u{1F4CD} ${i}:\n`;for(let s of a)o+=` \\u274C ${s.message}\n`,s.suggestion&&(o+=` \\u{1F4A1} ${s.suggestion}\n`),s.expected&&s.received&&(o+=` \\u{1F4CB} Expected: ${s.expected}, Received: ${s.received}\n`),s.options&&(o+=` \\u{1F4CB} Valid options: ${s.options.join(", ")}\n`);o+=`\n`}return o}function Ia(e){return e.some(t=>!!(t.message.includes("Required property")||t.path.includes("name")&&t.message.includes("Expected literal")||t.message.includes("Expected union")||t.message.includes("Never")))}function LA(e){if(!e||e==="root")return"document root";let t=e.split(".");if(t.includes("children")){let n=t.indexOf("children");if(t.length>n+1)return`component at index ${t[n+1]}`}return t.includes("props")?"props section":t.includes("theme")?"theme configuration":t.join(" > ")}var AA=In,NA=Oa,oc={report:Kr,section:Br,heading:jr,paragraph:Ur,columns:_r,image:kr,statistic:Dr,table:Mr,list:Vr};function cc(e,t,n){let o=oc[e];if(!o){if(P.Check(sr,t))return{success:!0,data:t};let s=[...P.Errors(sr,t)];return{success:!1,errors:In(s),errorStrings:Oa(s),report:n?.includeReport?Sa(s):void 0,hasCriticalErrors:n?.checkCritical?Ia(s):void 0}}if(P.Check(o,t))return{success:!0,data:t};let i=[...P.Errors(o,t)];return{success:!1,errors:In(i),errorStrings:Oa(i),report:n?.includeReport?Sa(i):void 0,hasCriticalErrors:n?.checkCritical?Ia(i):void 0}}function em(e,t){let n=t?.maxDepth??10,o=t?.currentDepth??0;if(o>n)return{success:!1,errors:[{path:"children",message:`Maximum nesting depth (${n}) exceeded`,code:"custom",suggestion:"Reduce the nesting level of components"}],errorStrings:[`Maximum nesting depth (${n}) exceeded`],hasCriticalErrors:!0};if(P.Check(rt,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=em(s.children[l],{...t,currentDepth:o+1});if(!p.success){let m=p.errors?.map(d=>({...d,path:`children[${l}].${d.path}`}));return{success:!1,errors:m,errorStrings:m?.map(d=>`${d.path}: ${d.message}`),report:t?.includeReport?`Validation failed in nested component at index ${l}:\n${p.report}`:void 0,hasCriticalErrors:p.hasCriticalErrors}}p.warnings&&c.push(...p.warnings.map(m=>`children[${l}]: ${m}`))}return{success:!0,data:e,warnings:c.length>0?c:void 0}}let i=[...P.Errors(rt,e)];return{success:!1,errors:In(i),errorStrings:Oa(i),report:t?.includeReport?Sa(i):void 0,hasCriticalErrors:t?.checkCritical?Ia(i):void 0}}function EA(e,t){let n=[],o=0;for(let{name:s,props:c}of e){let l=s in oc?cc(s,c,t):em(c,t);if(n.push(l),l.hasCriticalErrors&&o++,!l.success&&t?.stopOnFirst)break}let i=n.filter(s=>s.success).length,a=n.length-i;return{success:a===0,results:n,summary:{total:n.length,valid:i,invalid:a,criticalErrors:o}}}function RA(e,t,n){try{let o=n?n(t):t;return cc(e,o,{includeReport:!0,checkCritical:!0})}catch(o){return{success:!1,errors:[{path:"root",message:`Transformation failed: ${o instanceof Error?o.message:String(o)}`,code:"custom"}],errorStrings:[`Transformation failed: ${o instanceof Error?o.message:String(o)}`],hasCriticalErrors:!0}}}function FA(e,t){let n=oc[e];if(!n)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(oc).join(", ")}`}],errorStrings:[`Unknown component name: ${e}`],hasCriticalErrors:!0};if(P.Check(n,t))return{success:!0,data:t};let o=[...P.Errors(n,t)];return{success:!1,errors:In(o),errorStrings:Oa(o),report:Sa(o),hasCriticalErrors:Ia(o)}}function vA(e,t){return cc(e,t).success}var Dh=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual"],$A=new Set(Dh);function jA(e){return e.name==="docx"}function UA(e){return e.name==="section"}function kA(e){return e.name==="columns"}function DA(e){return e.name==="heading"}function MA(e){return e.name==="paragraph"}function BA(e){return e.name==="image"}function _A(e){return e.name==="text-box"}function VA(e){return e.name==="statistic"}function KA(e){return e.name==="table"}function GA(e){return e.name==="list"}function qA(e){return e.name==="toc"}function zA(e){return e.name==="highcharts"}function HA(e){return e.name==="visual"}function WA(e){return e.name==="text-space-after"}var JA="1.0.0";var Sm={};Ge(Sm,{ChartComponentDefaultsSchema:()=>lm,ColorValueSchema:()=>ar,DEFAULT_ERROR_CONFIG:()=>nn,DEFAULT_PPTX_RENDERER_ID:()=>Ca,GradientFillSchema:()=>Ao,GradientStopSchema:()=>Fs,HighchartsComponentDefaultsSchema:()=>cm,ImageComponentDefaultsSchema:()=>im,PATTERN_FILL_PRESETS:()=>Rs,PPTX_BASE_SCHEMA_METADATA:()=>Zh,PPTX_COMPONENT_METADATA:()=>Xh,PPTX_JSON_SCHEMA_URLS:()=>Yh,PPTX_RENDERER_IDS:()=>eo,PPTX_SHARED_VERSION:()=>dN,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>ft,PatternFillSchema:()=>vs,PositionSchema:()=>Vh,PptxChartPropsSchema:()=>bn,PptxComponentDefaultsSchema:()=>_o,PptxComponentDefinitionSchema:()=>dc,PptxHighchartsPropsSchema:()=>yn,PptxImagePropsSchema:()=>fn,PptxJsonComponentDefinitionSchema:()=>Jh,PptxSlideContentSchema:()=>ua,PptxStandardComponentDefinitionSchema:()=>Wh,PptxTablePropsSchema:()=>gn,PresentationPropsSchema:()=>dm,SEMANTIC_COLOR_ALIASES:()=>Ns,SEMANTIC_COLOR_NAMES:()=>As,STYLE_NAMES:()=>Po,ShadowSchema:()=>To,ShapeComponentDefaultsSchema:()=>am,ShapePropsSchema:()=>hn,ShapeTypeSchema:()=>Lo,SlideBackgroundSchema:()=>pc,SlidePropsSchema:()=>fm,StyleNameSchema:()=>pa,TableComponentDefaultsSchema:()=>sm,TextComponentDefaultsSchema:()=>om,TextPropsSchema:()=>dn,TextRunSchema:()=>Es,TextStyleSchema:()=>mm,ThemeConfigSchema:()=>Vo,TransitionSchema:()=>um,VerticalAlignmentSchema:()=>Xn,collectImageSourceConflicts:()=>tg,collectPptxRendererErrors:()=>nm,collectTextContentConflicts:()=>rg,compareSemver:()=>zn,comprehensiveValidatePresentation:()=>ag,convertToJsonSchema:()=>Oo,createAllPptxComponentSchemas:()=>mc,createComponentSchema:()=>So,createErrorConfig:()=>nr,createPptxComponentSchemaObject:()=>qo,deepValidatePresentation:()=>ig,exportSchemaToFile:()=>Io,fixSchemaReferences:()=>ln,generateUnifiedDocumentSchema:()=>Qh,getAllPptxComponentNames:()=>Kh,getPptxComponentsByCategory:()=>Gh,getPptxContainerComponents:()=>qh,getPptxContentComponents:()=>zh,getPptxStandardComponent:()=>to,isPptxStandardComponent:()=>Hh,isValidSemver:()=>sn,isValidThemeConfig:()=>_h,latestVersion:()=>et,parseSemver:()=>an,pptxComponentRequiresProps:()=>Zn,presentImageSources:()=>eg,transformValueError:()=>on,transformValueErrors:()=>Ke,validate:()=>mN,validateJsonPptxTheme:()=>Om,validateJsonPresentationDocument:()=>xm,validatePptxTheme:()=>Ta,validatePresentationDocument:()=>Pa,validateStrict:()=>uN});var eo=["pptxgenjs","office-open"],Ca="pptxgenjs";function Mh(e,t,n){let o=rm(t),i=lc(o);if(n==="pptxgenjs")return e==="slide"&&delete i?.transition,o;switch(e){case"pptx":delete i?.templates;break;case"slide":delete i?.template;break;case"image":for(let a of["svg","sizing","rotate","rounding","hyperlink"])delete i?.[a];break;case"shape":delete i?.flipV;break;case"table":for(let a of["autoPage","autoPageRepeatHeader","margin","borderRadius"])delete i?.[a];YA(o);break}return Bh(o),o}function nm(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??Ca;if(!eo.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "pptxgenjs" or "office-open".`,code:"invalid_value"}];let o=[],i=(s,c)=>{o.push({path:s,message:`The "${n}" renderer does not support ${c}.`,code:"unsupported_renderer_feature"})},a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s.props;if(n==="pptxgenjs")s.name==="slide"&&l?.transition!==void 0&&i(`${c}/props/transition`,"slide transitions");else{if(s.name==="pptx"&&l?.templates!==void 0&&i(`${c}/props/templates`,"masters/templates"),s.name==="slide"&&(l?.template!==void 0&&i(`${c}/props/template`,"masters/templates"),l?.placeholders!==void 0&&i(`${c}/props/placeholders`,"placeholders")),s.name==="chart"&&l?.type==="bubble"&&i(`${c}/props/type`,"bubble charts"),s.name==="image"){let p={svg:"SVG images",sizing:"image cropping",rotate:"image transforms",rounding:"image rounding",hyperlink:"element hyperlinks"};for(let[m,d]of Object.entries(p))l?.[m]!==void 0&&i(`${c}/props/${m}`,d)}if(s.name==="shape"&&l?.flipV!==void 0&&i(`${c}/props/flipV`,"vertical flipping"),s.name==="table"){let p={autoPage:"table auto-pagination",autoPageRepeatHeader:"table auto-pagination",margin:"table insets",borderRadius:"rounded table corners"};for(let[m,d]of Object.entries(p))l?.[m]!==void 0&&i(`${c}/props/${m}`,d);Array.isArray(l?.rows)&&l.rows.forEach((m,d)=>{Array.isArray(m)&&m.forEach((b,I)=>{if(!(!b||typeof b!="object"))for(let[w,C]of[["colspan","merged table cells"],["rowspan","merged table cells"],["margin","table insets"]])b[w]!==void 0&&i(`${c}/props/rows/${d}/${I}/${w}`,C)})})}}for(let[p,m]of Object.entries(s))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),o}function YA(e){let o=lc(e)?.rows?.items?.items?.anyOf;if(Array.isArray(o))for(let i of o){let a=lc(i);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,Bh(i))}}function lc(e){if(!(!e||typeof e!="object"))return e.properties}function Bh(e){let t=lc(e),n=e.required;if(!t||!n)return;let o=n.filter(i=>i in t);o.length>0?e.required=o:delete e.required}function rm(e){if(Array.isArray(e))return e.map(rm);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=rm(e[n]);return t}var om=r.Partial(dn),im=r.Partial(fn),am=r.Partial(hn),sm=r.Partial(gn),cm=r.Partial(yn),lm=r.Partial(bn),_o=r.Object({text:r.Optional(om),image:r.Optional(im),shape:r.Optional(am),table:r.Optional(sm),highcharts:r.Optional(cm),chart:r.Optional(lm)},{additionalProperties:!0});var XA=r.Union([r.Number({description:"Margin in inches (all sides)"}),r.Object({top:r.Number({description:"Top margin in inches"}),right:r.Number({description:"Right margin in inches"}),bottom:r.Number({description:"Bottom margin in inches"}),left:r.Number({description:"Left margin in inches"})},{additionalProperties:!1})],{description:"Slide margins in inches"}),ZA=r.Union([r.Number({description:"Gutter in inches (both axes)"}),r.Object({column:r.Number({description:"Column gutter in inches"}),row:r.Number({description:"Row gutter in inches"})},{additionalProperties:!1})],{description:"Gaps between grid tracks in inches"}),pm=r.Object({columns:r.Optional(r.Number({minimum:1,description:"Number of columns (default: 12)"})),rows:r.Optional(r.Number({minimum:1,description:"Number of rows (default: 6)"})),margin:r.Optional(XA),gutter:r.Optional(ZA)},{additionalProperties:!1,description:"Grid layout configuration"}),zt=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),mm=r.Object({fontSize:r.Optional(r.Number()),fontFace:r.Optional(or),fontColor:r.Optional(ar),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),align:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),lineSpacing:r.Optional(r.Number()),charSpacing:r.Optional(r.Number()),paraSpaceAfter:r.Optional(r.Number())},{additionalProperties:!1,description:"Text style preset"}),Vo=r.Object({name:r.String({description:"Theme name"}),colors:r.Object({primary:zt,secondary:zt,accent:zt,background:zt,text:zt,text2:r.Optional(zt),background2:r.Optional(zt),accent4:r.Optional(zt),accent5:r.Optional(zt),accent6:r.Optional(zt)},{additionalProperties:!1,description:"Theme color palette (10-slot scheme)"}),fonts:r.Object({heading:or,body:or},{additionalProperties:!1,description:"Font families"}),fontRegistry:r.Optional(ir),defaults:r.Object({fontSize:r.Number({description:"Default font size in points"}),fontColor:zt},{additionalProperties:!1,description:"Default text styling"}),styles:r.Optional(r.Partial(r.Object(Object.fromEntries(Po.map(e=>[e,mm]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:r.Optional(_o)},{additionalProperties:!1,description:"Presentation theme configuration"});function _h(e){return typeof e=="object"&&e!==null}var Vh=r.Object({x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'X position as percentage (e.g., "10%")\'})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Y position as percentage (e.g., "10%")\'})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Width as percentage (e.g., "80%")\'})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Height as percentage (e.g., "20%")\'})]))},{description:"Position and size in inches or percentages",additionalProperties:!1}),pc=r.Object({color:r.Optional(ar),gradient:r.Optional(Ao),image:r.Optional(r.Object({path:r.Optional(r.String({description:"Image file path or URL"})),base64:r.Optional(r.String({description:"Base64-encoded image data"}))},{description:"Background image",additionalProperties:!1}))},{description:"Slide background configuration",additionalProperties:!1}),um=r.Object({type:r.Optional(r.Union([r.Literal("fade"),r.Literal("push"),r.Literal("wipe"),r.Literal("zoom"),r.Literal("none")],{description:"Transition effect type"})),speed:r.Optional(r.Union([r.Literal("slow"),r.Literal("medium"),r.Literal("fast")],{description:"Transition speed"}))},{description:"Slide transition configuration",additionalProperties:!1}),wn=r.Union([r.Number({description:"Position/size in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Position/size as percentage of slide dimension (e.g., "50%")\'})]);function Ko(e,t){return r.Object({name:r.Literal(e),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:t},{additionalProperties:!1})}var QA=r.Union([Ko("text",dn),Ko("image",fn),Ko("shape",hn),Ko("table",gn),Ko("chart",bn),Ko("highcharts",yn)],{discriminator:{propertyName:"name"},description:"Fixed component on a template slide (same format as slide children)"});function Go(e,t){return r.Object({name:r.Literal(e),props:r.Partial(t,{description:"Default props inherited by the component placed in this placeholder"})},{additionalProperties:!1})}var eN=r.Union([Go("text",dn),Go("image",fn),Go("shape",hn),Go("table",gn),Go("chart",bn),Go("highcharts",yn)],{discriminator:{propertyName:"name"},description:"Partial component stub \\u2014 styling defaults only"}),tN=r.Object({name:r.String({description:"Unique placeholder name"}),x:r.Optional(wn),y:r.Optional(wn),w:r.Optional(wn),h:r.Optional(wn),grid:r.Optional(un),defaults:r.Optional(eN)},{additionalProperties:!1,description:"Placeholder on a template slide \\u2014 defaults is a component stub whose props are inherited by the actual component"}),rN=r.Object({name:r.String({description:"Unique template slide name"}),background:r.Optional(pc),margin:r.Optional(r.Union([r.Number({description:"Margin in inches (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4,description:"Margin [top, right, bottom, left] in inches"})])),slideNumber:r.Optional(r.Object({x:wn,y:wn,w:r.Optional(wn),h:r.Optional(wn),color:r.Optional(ar),fontSize:r.Optional(r.Number({description:"Slide number font size in points"}))},{additionalProperties:!1,description:"Slide number position and styling"})),objects:r.Optional(r.Array(QA,{description:"Fixed components (logos, footers, decorations) \\u2014 same { name, props } format as slide children"})),placeholders:r.Optional(r.Array(tN,{description:"Placeholder regions for slide content"})),grid:r.Optional(pm)},{additionalProperties:!1,description:"Template slide definition (reusable slide template)"}),dm=r.Object({title:r.Optional(r.String({description:"Presentation title metadata"})),author:r.Optional(r.String({description:"Presentation author metadata"})),subject:r.Optional(r.String({description:"Presentation subject metadata"})),company:r.Optional(r.String({description:"Company name metadata"})),theme:r.Optional(r.Union([r.String({description:\'Theme name to apply (default: "default")\',default:"default"}),Vo],{description:\'Theme to apply: a built-in/custom theme name (default: "default"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:r.Optional(ir),slideWidth:r.Optional(r.Number({description:"Slide width in inches (default: 10)",default:10})),slideHeight:r.Optional(r.Number({description:"Slide height in inches (default: 7.5)",default:7.5})),rtlMode:r.Optional(r.Boolean({description:"Right-to-left text direction"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Default presentation language (BCP-47 tag, e.g. "en-US"). Sets the spell-check language for all text; individual text components can override it.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),pageNumberFormat:r.Optional(r.Union([r.Literal("9"),r.Literal("09")],{description:\'Format for {PAGE_NUMBER} placeholders: "9" = bare number (default), "09" = zero-padded\',default:"9"})),componentDefaults:r.Optional(_o),grid:r.Optional(pm),templates:r.Optional(r.Array(rN,{description:"Template slide definitions (reusable slide templates)"}))},{description:"Presentation container props",additionalProperties:!1}),fm=r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this slide, shown in editors and outlines. Never rendered \\u2014 slide content is unaffected."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the presentation."})),background:r.Optional(pc),transition:r.Optional(um),notes:r.Optional(r.String({description:"Speaker notes for this slide"})),layout:r.Optional(r.String({description:\'Slide layout name (e.g., "Title Slide", "Blank")\'})),hidden:r.Optional(r.Boolean({description:"Hide this slide from presentation"})),template:r.Optional(r.String({description:"Template slide name to apply"}))},{description:"Slide container props",additionalProperties:!1}),ft=[{name:"pptx",propsSchema:dm,hasChildren:!0,allowedChildren:["slide"],category:"container",propsRequired:!0,description:"Main presentation container - defines the overall presentation structure. Required as the root component. Always declare `slideWidth`/`slideHeight` (13.333 \\xD7 7.5 for 16:9) \\u2014 omitted, the renderer silently falls back to 4:3 and 16:9 content leaves a dead strip.",special:{hasSchemaField:!0}},{name:"slide",propsSchema:fm,hasChildren:!0,allowedChildren:$r.map(({name:e})=>e),hasPlaceholders:!0,category:"container",description:"Slide container - groups content elements on a single slide. One idea per slide: past roughly 40 words of body text, split the content across more slides."},...$r];function to(e){return ft.find(t=>t.name===e)}function Kh(){return ft.map(e=>e.name)}function Gh(e){return ft.filter(t=>t.category===e)}function qh(){return ft.filter(e=>e.hasChildren)}function zh(){return ft.filter(e=>!e.hasChildren)}function Hh(e){return ft.some(t=>t.name===e)}function qo(e,t,n,o){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};if(e.special?.hasSchemaField&&(i.$schema=r.Optional(r.String({format:"uri"})),i.renderer=o?o.requireDiscriminator?r.Literal(o.renderer,{description:"Renderer backend for this presentation"}):r.Optional(r.Literal(o.renderer,{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'})):r.Optional(r.Union(eo.map(a=>r.Literal(a)),{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'}))),i.props=o?Mh(e.name,e.propsSchema,o.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=r.Optional(r.Array(t))),e.hasPlaceholders&&(n??t)&&o?.renderer!=="office-open"){let a=i.props.properties??{},s=n??t;i.props=r.Object({...a,placeholders:r.Optional(r.Record(r.String(),s,{description:\'Content for named placeholders: { "title": { "name": "text", ... } }\'}))},{additionalProperties:!1,description:e.propsSchema.description})}return Zn(e)||(i.props=r.Optional(i.props)),r.Object(i,{additionalProperties:!1,description:e.description})}function mc(e){return ft.map(t=>qo(t,e))}function uc(e,t=[],n){let o=new Map;for(let c of ft)c.hasChildren||o.set(c.name,qo(c,void 0,e,n));let i=ft.filter(c=>c.hasChildren),a=new Map,s=[...i];for(;s.length>0;){let c=s.length;for(let l=s.length-1;l>=0;l--){let p=s[l];if(!p.allowedChildren){a.set(p.name,qo(p,e,e,n)),s.splice(l,1);continue}if(!p.allowedChildren.filter(w=>i.some(C=>C.name===w)).every(w=>a.has(w)))continue;let b=[...p.allowedChildren.map(w=>a.get(w)??o.get(w)).filter(w=>w!==void 0),...t],I=b.length===1?b[0]:r.Union(b);a.set(p.name,qo(p,I,I,n)),s.splice(l,1)}if(s.length===c)throw new Error(`Circular allowedChildren among: ${s.map(l=>l.name).join(", ")}`)}return[...a.values(),...o.values()]}var Wh=r.Union([...mc(r.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),dc=r.Recursive(e=>r.Union([...uc(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var Jh=dc,Yh={presentation:"./json-schemas/components/presentation.schema.json",slide:"./json-schemas/components/slide.schema.json",text:"./json-schemas/components/text.schema.json",image:"./json-schemas/components/image.schema.json",shape:"./json-schemas/components/shape.schema.json",table:"./json-schemas/components/table.schema.json",index:"./json-schemas/index.schema.json"};var Xh={presentation:{title:"Presentation Component",description:"Top-level presentation container with metadata and settings"},slide:{title:"Slide Component",description:"Slide container for organizing content elements"},text:{title:"Text Component",description:"Text element with formatting and positioning"},image:{title:"Image Component",description:"Image element with sizing and positioning"},shape:{title:"Shape Component",description:"Geometric shape with optional text and styling"},table:{title:"Table Component",description:"Tabular data display with rows and columns"}},Zh={position:{title:"Position",description:"Position and size in inches or percentages"},"slide-background":{title:"Slide Background",description:"Slide background configuration"},transition:{title:"Transition",description:"Slide transition effect configuration"},shadow:{title:"Shadow",description:"Shadow configuration for elements"}};function nN(e,t,n,o){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),version:o?r.Optional(r.Literal(t.version)):r.Literal(t.version),props:t.propsSchema};return t.hasChildren&&(i.children=r.Optional(r.Array(n))),r.Object(i,{additionalProperties:!1,description:t.description??e.name})}function Qh(e={}){let{customComponents:t=[]}=e,n=eo.map(o=>oN(t,o,o!==Ca));return r.Union(n,{description:"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs."})}function oN(e,t,n){return r.Recursive(o=>{let i=[];for(let c of e)if(c.versions.length>0){let l=et(c.versions.map(m=>m.version)),p=c.versions.map(m=>nN(c,m,o,m.version===l));i.push(p.length===1?p[0]:r.Union(p))}let s=[...uc(o,i,{renderer:t,requireDiscriminator:n}),...i];return s.length===0?r.Object({}):r.Union(s)})}var iN=["path","base64","svg"];function eg(e){if(!e||typeof e!="object")return[];let t=e;return iN.filter(n=>{let o=t[n];return typeof o=="string"&&o.trim().length>0})}function tg(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="image"){let a=eg(o.props);a.length>1&&t.push({path:`${i}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function rg(e){let t=[],n=(o,i,a)=>{if(Array.isArray(o)){o.forEach((s,c)=>n(s,`${i}/${c}`,a));return}if(!(!o||typeof o!="object")){if(o.name==="text"&&o.props&&typeof o.props=="object"){let s=typeof o.props.text=="string",c=Array.isArray(o.props.runs);s&&c?t.push({path:`${i}/props`,message:\'Text component accepts either "text" or "runs", not both. Use exactly one of the two.\',code:"mutually_exclusive"}):!s&&!c&&a!=="defaults"&&t.push({path:`${i}/props`,message:\'Text component requires content: set either "text" or "runs".\',code:"required_property"})}for(let s of Object.keys(o))n(o[s],`${i}/${s}`,s)}};return n(e,"",""),t}var aN=Object.fromEntries(ft.map(e=>[e.name,e.propsSchema])),hm=new Set(ft.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),bm=new Set(["name","id","enabled","props","children"]),sN=new Set([...bm,"version"]),ng=new Set([...bm,"$schema"]);ng.add("renderer");var cN={id:"string",enabled:"boolean",$schema:"string",version:"string"};function og(e,t,n,o,i){for(let a of Object.keys(e)){if(!n.has(a)){i.push({path:`${t}/${a}`,message:`Unknown field "${a}" on ${o}`,code:"unknown_field"});continue}let s=cN[a];s&&typeof e[a]!==s&&i.push({path:`${t}/${a}`,message:`Field "${a}" on ${o} must be a ${s}`,code:"invalid_type"})}}function ig(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Presentation must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!hm.has(e.name)){let i=[...hm].map(a=>`"${a}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}og(e,"",ng,"the root component",n);let o=to(e.name);return"props"in e?hm.has(e.name)&&n.push(...ym(e.name,e.props,"/props",t)):(!o||Zn(o))&&n.push({path:"/props",message:\'Missing required field "props"\',code:"required_property"}),e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),gm(e,"",t,n),n}function gm(e,t,n,o){if(!e||typeof e!="object")return;let i=(c,l)=>{if(!c||typeof c!="object"||Array.isArray(c)){o.push({path:l,message:"Component must be an object",code:"invalid_type"});return}if(typeof c.name!="string"||c.name.length===0){o.push({path:`${l}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}let p=n.knownCustomNames?.has(c.name)??!1;if(og(c,l,p?sN:bm,`component "${c.name}"`,o),p){"props"in c||o.push({path:`${l}/props`,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:`Add a "props" object holding the content "${c.name}" renders.`}),gm(c,l,n,o);return}let d=to(c.name),b=`${l}/props`;if("props"in c)o.push(...ym(c.name,c.props,b,n));else if(d&&Zn(d)){let I=d.propsSchema.required??[];o.push({path:b,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:I.length>0?`Add "props" carrying ${I.map(w=>`"${w}"`).join(", ")}.`:`Add a "props" object holding the content "${c.name}" renders.`})}else o.push(...ym(c.name,{},b,n));if(d&&!d.hasChildren&&c.children!=null){o.push({path:`${l}/children`,message:`Component "${c.name}" does not accept children`,code:"invalid_value"});return}gm(c,l,n,o)},a=to(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&to(c.name)&&!a.allowedChildren.includes(c.name)){let p=a.allowedChildren.map(m=>`"${m}"`).join(", ");o.push({path:`${l}/name`,message:`Component "${c.name}" is not allowed inside "${e.name}". Expected ${p}`,code:"invalid_value"})}};if(a?.hasPlaceholders&&e.props&&typeof e.props=="object"){let c=e.props.placeholders;if(c&&typeof c=="object"&&!Array.isArray(c))for(let[l,p]of Object.entries(c)){let m=`${t}/props/placeholders/${l}`;s(p,m),i(p,m)}else c!=null&&o.push({path:`${t}/props/placeholders`,message:\'Field "placeholders" must be an object mapping placeholder names to components\',code:"invalid_type"})}Array.isArray(e.children)?e.children.forEach((c,l)=>{let p=`${t}/children/${l}`;s(c,p),i(c,p)}):e.children!=null&&t!==""&&o.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function ym(e,t,n,o={}){let i=[],a=aN[e];if(!a)return i.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),i;let s=t;if(to(e)?.hasPlaceholders&&t&&typeof t=="object"&&"placeholders"in t){let c={...t};delete c.placeholders,s=c}if(o.allowUnknownFields&&(s=P.Clean(a,P.Clone(s))),!P.Check(a,s)){let c=[...P.Errors(a,s)];Ke(c,{maxErrors:100}).forEach(p=>{let m=p.path==="root"?n:`${n}${p.path.startsWith("/")?p.path:"/"+p.path}`;i.push({...p,path:m})})}return i}function ag(e,t=[],n={}){let o=ig(e,n),i=t.filter(a=>!lN(a));return pN([...i,...o])}function lN(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function pN(e){let t=new Set,n=[];for(let o of e){let i=`${o.path}:${o.message}`;t.has(i)||(t.add(i),n.push(o))}return n}function sg(e){if(typeof e!="string")return{parsed:e};try{return{parsed:JSON.parse(e)}}catch(t){return{error:{path:"root",message:`Invalid JSON: ${t?.message??String(t)}`,code:"json_parse_error"}}}}function Pa(e,t={}){let n=ag(e,[],t);n.push(...tg(e)),n.push(...rg(e)),n.push(...nm(e));let o=n.length===0;return{valid:o,errors:n,documentType:"pptx",data:o?e:void 0}}function xm(e,t={}){let{parsed:n,error:o}=sg(e);return o?{valid:!1,errors:[o],documentType:"pptx"}:Pa(n,t)}function Ta(e){if(P.Check(Vo,e))return{valid:!0,errors:[],data:e};let t=[...P.Errors(Vo,e)];return{valid:!1,errors:Ke(t,{maxErrors:100})}}function Om(e){let{parsed:t,error:n}=sg(e);return n?{valid:!1,errors:[n]}:Ta(t)}var mN={document:e=>Pa(e),jsonDocument:e=>xm(e),theme:e=>Ta(e),jsonTheme:e=>Om(e),isDocument:e=>Pa(e).valid,isTheme:e=>Ta(e).valid},uN={document:e=>Pa(e),jsonDocument:e=>xm(e),theme:e=>Ta(e),jsonTheme:e=>Om(e)},dN="1.0.0";function cg(e,t){let n={exports:{}},o=a=>{if(Object.prototype.hasOwnProperty.call(t,a))return t[a];throw new Error(`Module "${a}" is not available in the playground sandbox. Available modules: ${Object.keys(t).join(", ")}`)};return new Function("require","module","exports",e)(o,n,n.exports),n.exports}function Im(e){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.name!="string"||t.name.length===0||!t.versions||typeof t.versions!="object")return!1;let n=Object.values(t.versions);return n.length>0&&n.some(o=>!!o&&typeof o=="object"&&!!o.propsSchema&&typeof o.propsSchema=="object"&&typeof o.render=="function")}function lg(e){if(Im(e.default))return e.default;let t=Object.entries(e).filter(([n])=>n.endsWith("Component")||n.endsWith("component")||n.endsWith("Module")||n.endsWith("module"));for(let[,n]of t)if(Im(n))return n;for(let n of Object.values(e))if(Im(n))return n;return null}var fN=/^\\d+\\.\\d+\\.\\d+$/;function pg(e,t,n){let o=[];for(let[i,a]of Object.entries(e.versions)){if(!fN.test(i))throw new Error(`Component "${e.name}": invalid semver key "${i}". Expected format: major.minor.patch`);if(!a||typeof a!="object"||!a.propsSchema)throw new Error(`Component "${e.name}" version "${i}" requires a propsSchema`);if(typeof a.render!="function")throw new Error(`Component "${e.name}" version "${i}" requires a render function`);let s;try{s=JSON.parse(JSON.stringify(a.propsSchema))}catch(c){throw new Error(`Component "${e.name}" version "${i}": propsSchema is not serializable (${c instanceof Error?c.message:String(c)})`)}o.push({version:i,propsSchema:s,hasChildren:a.hasChildren===!0,...typeof a.description=="string"?{description:a.description}:{}})}if(o.length===0)throw new Error(`Component "${e.name}" must have at least one version`);return{name:e.name,format:t,versions:o,latest:et(o.map(i=>i.version)),examples:n}}function mg(e,t,n){return`import type { TSchema } from \'@sinclair/typebox\';\nimport type { ${t}, ${n} } from \'${e}\';\nimport type {\n RenderContext as SharedRenderContext,\n RenderFunction as SharedRenderFunction,\n ComponentVersion as SharedComponentVersion,\n ComponentVersionMap as SharedComponentVersionMap,\n CustomComponent as SharedCustomComponent,\n} from \'@json-to-office/shared/plugin\';\n\n/** The resolved theme handed to \\`render\\`. */\nexport type ThemeConfig = ${n};\n\nexport type RenderContext<T> = SharedRenderContext<T, ${n}>;\n\nexport type RenderFunction<\n TProps,\n TComponentDefinition = ${t},\n> = SharedRenderFunction<TProps, TComponentDefinition, ${n}>;\n\nexport type ComponentVersion<\n TComponentDefinition = ${t},\n TPropsSchema extends TSchema = TSchema,\n> = SharedComponentVersion<TComponentDefinition, TPropsSchema, ${n}>;\n\nexport type ComponentVersionMap<TComponentDefinition = ${t}> =\n SharedComponentVersionMap<TComponentDefinition, ${n}>;\n\nexport type CustomComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n> = SharedCustomComponent<TComponentDefinition, TVersions, TName>;\n\n/** Create one semver version entry with full type inference for its props. */\nexport declare function createVersion<\n TPropsSchema extends TSchema,\n TComponentDefinition = ${t},\n>(\n version: ComponentVersion<TComponentDefinition, TPropsSchema>\n): ComponentVersion<TComponentDefinition, TPropsSchema>;\n\n/** Create a custom component with semver-keyed versions. */\nexport declare function createComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n>(\n component: CustomComponent<TComponentDefinition, TVersions, TName>\n): CustomComponent<TComponentDefinition, TVersions, TName>;\n\nexport {\n resolveComponentVersion,\n ComponentValidationError,\n DuplicateComponentError,\n} from \'@json-to-office/shared/plugin\';\nexport type { ${t}, ${n} } from \'${e}\';\n`}var wm=mg("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),Cm=mg("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function fc(e,t){return JSON.stringify({name:e,version:"0.0.0-playground",types:"index.d.ts",exports:{".":{types:"./index.d.ts"},...t?{"./plugin":{types:"./plugin/index.d.ts"}}:{}}},null,2)}var az={"node_modules/@json-to-office/core-docx/package.json":fc("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":wm,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":wm,"node_modules/@json-to-office/json-to-docx/package.json":fc("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":wm,"node_modules/@json-to-office/core-pptx/package.json":fc("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":Cm,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":Cm,"node_modules/@json-to-office/json-to-pptx/package.json":fc("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":Cm},ug=["@json-to-office/core-docx","@json-to-office/core-docx/plugin","@json-to-office/json-to-docx","@json-to-office/core-pptx","@json-to-office/core-pptx/plugin","@json-to-office/json-to-pptx"];var Pm="[plugin-network-off]";var Tm=globalThis,Lm=Tm.postMessage.bind(Tm),hN={createComponent:bo,createVersion:yo,resolveComponentVersion:Hn,ComponentValidationError:Wn,DuplicateComponentError:xo},gN={"@sinclair/typebox":ml,"@sinclair/typebox/value":Tl,"@json-to-office/shared":Kl,"@json-to-office/shared/plugin":Gl,"@json-to-office/shared-docx":tm,"@json-to-office/shared-pptx":Sm,...Object.fromEntries(ug.map(e=>[e,hN]))},yN=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],bN=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function dg(e,t){let n=globalThis;for(;n&&n!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(n,e))try{delete n[e]}catch{}n=Object.getPrototypeOf(n)}try{Object.defineProperty(globalThis,e,{value:t,configurable:!1,writable:!1})}catch{}}function fg(e){let t=`${Pm} ${e} is not available: Network is off for this plugin. Turn on Network in the plugin header and list the hosts it may call.`;return new Proxy(function(){},{apply(){throw new Error(t)},construct(){throw new Error(t)},get(n,o){if(o==="name")return e;throw new Error(t)}})}function xN(e){let t=globalThis.fetch;if(typeof t!="function")return;let n=e.length>0?`This plugin may call: ${e.join(", ")}.`:"This plugin has Network on but no hosts listed, so it may call nothing.",o=async(...i)=>{try{return await t.apply(globalThis,i)}catch(a){let s=String(i[0]instanceof Request?i[0].url:i[0]);throw new Error(`${Pm} fetch("${s}") was refused. ${n} Add the host under Network in the plugin header to allow it.`,{cause:a})}};try{Object.defineProperty(globalThis,"fetch",{value:o,configurable:!1,writable:!1})}catch{}}var hg=!1;function ON(e,t){if(hg)return;hg=!0;for(let o of yN)dg(o);let n=globalThis.navigator;if(n)for(let o of["storage","locks","serviceWorker"])try{Object.defineProperty(n,o,{value:void 0})}catch{}if(!e){for(let o of bN)dg(o,fg(o));if(n)try{Object.defineProperty(n,"sendBeacon",{value:fg("navigator.sendBeacon")})}catch{}return}xN(t)}var gg=5*1024*1024,La=null;function SN(e,t){let n=t instanceof Error?t.message:String(t),o={id:e,type:"error",message:n,...t instanceof Error&&t.stack?{stack:t.stack}:{}};Lm(o)}async function IN(e){if(e.type==="load"){ON(e.allowNetwork,e.networkOrigins??[]);let t=cg(e.js,gN),n=lg(t);if(!n)throw new Error(\'No component export found. Export the result of createComponent() as the default export or under a name ending in "Component".\');La=n;let o=pg(n,e.format,e.examples),i={id:e.id,type:"loaded",metadata:o};Lm(i);return}if(e.type==="render"){if(!La)throw new Error("Plugin is not loaded");let t=Hn(La.name,La.versions,e.version),n=cn(t.propsSchema,e.props,{componentName:La.name});if(!n.valid)throw new Wn(n.errors??[],e.props);let o=[],i=(m,d)=>{o.push({message:m,...d?{context:d}:{}})},a=await t.render({props:n.data,theme:e.theme,addWarning:i,children:e.children}),s=Array.isArray(a)?a:[a],c=JSON.stringify(s);if(c.length>gg)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${gg/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:o};Lm(p);return}}Tm.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||IN(t).catch(n=>SN(t.id,n))});})();\n';export{e as default};
|
|
2
|
+
//# sourceMappingURL=_virtual_jto-sandbox-runtime-CNoAasd3.js.map
|