@json-to-office/jto 6.0.0 → 6.3.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 +1 -1
- package/dist/client/assets/{HomePage-cnVO2sFq.js → HomePage-Dzm2MeID.js} +4 -4
- package/dist/client/assets/{HomePage-cnVO2sFq.js.map → HomePage-Dzm2MeID.js.map} +1 -1
- package/dist/client/assets/{JsonEditorPage-nazV1RwE.js → JsonEditorPage-DOp1sE3p.js} +3 -3
- package/dist/client/assets/{JsonEditorPage-nazV1RwE.js.map → JsonEditorPage-DOp1sE3p.js.map} +1 -1
- package/dist/client/assets/{MonacoPluginProvider-CHlaWI7K.js → MonacoPluginProvider-Bc9nyqNY.js} +5 -5
- package/dist/client/assets/{MonacoPluginProvider-CHlaWI7K.js.map → MonacoPluginProvider-Bc9nyqNY.js.map} +1 -1
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-ToC-eF7z.js → _virtual_jto-plugin-type-libs-Pc3DyHoX.js} +106 -38
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-ToC-eF7z.js.map → _virtual_jto-plugin-type-libs-Pc3DyHoX.js.map} +1 -1
- package/dist/client/assets/_virtual_jto-sandbox-runtime-DUgi1ipv.js +2 -0
- package/dist/client/assets/_virtual_jto-sandbox-runtime-DUgi1ipv.js.map +1 -0
- package/dist/client/assets/{editor-BDFx5tyz.js → editor-BJWDd3uK.js} +2 -2
- package/dist/client/assets/{editor-BDFx5tyz.js.map → editor-BJWDd3uK.js.map} +1 -1
- package/dist/client/assets/{editor-monaco-json-Bs0Mrsdq.js → editor-monaco-json-FLZpeDZL.js} +2 -2
- package/dist/client/assets/{editor-monaco-json-Bs0Mrsdq.js.map → editor-monaco-json-FLZpeDZL.js.map} +1 -1
- package/dist/client/assets/{index-CooDRbV2.js → index-D5Xrk4Ze.js} +2 -2
- package/dist/client/assets/{index-CooDRbV2.js.map → index-D5Xrk4Ze.js.map} +1 -1
- package/dist/client/assets/{index-DJULKPqV.js → index-D6Nfjrjh.js} +13 -13
- package/dist/client/assets/index-D6Nfjrjh.js.map +1 -0
- package/dist/client/assets/{preview-1VQB3b7e.js → preview-C4ynYVMZ.js} +2 -2
- package/dist/client/assets/{preview-1VQB3b7e.js.map → preview-C4ynYVMZ.js.map} +1 -1
- package/dist/client/assets/{useQualityAnalysis-Cgw8FvPh.js → useQualityAnalysis-kUkZB_mW.js} +2 -2
- package/dist/client/assets/{useQualityAnalysis-Cgw8FvPh.js.map → useQualityAnalysis-kUkZB_mW.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/templates/client-report-blocks.docx.json +2 -2
- package/dist/client/templates/consulting-deck-blocks.pptx.json +1 -2
- package/package.json +5 -5
- package/dist/client/assets/_virtual_jto-sandbox-runtime-DhfBorPd.js +0 -2
- package/dist/client/assets/_virtual_jto-sandbox-runtime-DhfBorPd.js.map +0 -1
- package/dist/client/assets/index-DJULKPqV.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e='"use strict";(()=>{var Kb=Object.create;var ls=Object.defineProperty;var Gb=Object.getOwnPropertyDescriptor;var qb=Object.getOwnPropertyNames;var Wb=Object.getPrototypeOf,Hb=Object.prototype.hasOwnProperty;var zb=(e,t,r)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Jb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rt=(e,t)=>{for(var r in t)ls(e,r,{get:t[r],enumerable:!0})},Yb=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qb(t))!Hb.call(e,o)&&o!==r&&ls(e,o,{get:()=>t[o],enumerable:!(i=Gb(t,o))||i.enumerable});return e};var od=(e,t,r)=>(r=e!=null?Kb(Wb(e)):{},Yb(t||!e||!e.__esModule?ls(r,"default",{value:e,enumerable:!0}):r,e));var R=(e,t,r)=>zb(e,typeof t!="symbol"?t+"":t,r);var Np=Jb((v6,hh)=>{hh.exports={}});var lp={};rt(lp,{Any:()=>Xt,Argument:()=>To,Array:()=>Rr,AsyncIterator:()=>Nr,Awaited:()=>Dr,BigInt:()=>jr,Boolean:()=>Zn,Capitalize:()=>Go,Clone:()=>se,CloneRest:()=>rO,CloneType:()=>hn,Composite:()=>Fo,Const:()=>jo,Constructor:()=>kr,ConstructorParameters:()=>Uo,CreateType:()=>y,Date:()=>ni,Enum:()=>Do,Exclude:()=>Vr,ExcludeFromMappedResult:()=>Hl,ExcludeFromTemplateLiteral:()=>Wl,Extends:()=>Br,ExtendsCheck:()=>Mr,ExtendsFromMappedKey:()=>ql,ExtendsFromMappedResult:()=>Gl,ExtendsResolverError:()=>Ts,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>wn,Extract:()=>Kr,ExtractFromMappedResult:()=>Jl,ExtractFromTemplateLiteral:()=>zl,FormatRegistry:()=>Ut,FromTypes:()=>Fi,Function:()=>yt,Hint:()=>ze,Increment:()=>RO,Index:()=>Zt,IndexFromComputed:()=>$x,IndexFromMappedKey:()=>Nl,IndexFromMappedResult:()=>Ll,IndexFromPropertyKey:()=>Rl,IndexFromPropertyKeys:()=>Ni,IndexPropertyKeys:()=>Xe,InstanceType:()=>_o,Instantiate:()=>Vo,Integer:()=>Ko,Intersect:()=>Ae,IntersectEvaluated:()=>vo,Intrinsic:()=>Vt,IntrinsicFromMappedKey:()=>Ql,IsTemplateLiteralExpressionFinite:()=>Sn,IsTemplateLiteralFinite:()=>$o,Iterator:()=>Ur,JavaScriptTypeBuilder:()=>Ls,JsonTypeBuilder:()=>ji,KeyOf:()=>_r,KeyOfFromMappedResult:()=>Ul,KeyOfPattern:()=>ri,KeyOfPropertyEntries:()=>ko,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>hf,Kind:()=>g,KindGuard:()=>Yt,Literal:()=>j,Lowercase:()=>qo,Mapped:()=>Ro,MappedFunctionReturnType:()=>mf,MappedKey:()=>XO,MappedResult:()=>q,Module:()=>Jo,Never:()=>k,Not:()=>Yo,Null:()=>ii,Number:()=>Ye,Object:()=>K,Omit:()=>tr,OmitFromMappedKey:()=>tp,OmitFromMappedResult:()=>Zl,Optional:()=>Ee,OptionalFromMappedResult:()=>Fl,OptionalKind:()=>ve,Parameters:()=>Xo,Partial:()=>Gr,PartialFromMappedResult:()=>op,PatternBoolean:()=>ys,PatternBooleanExact:()=>NO,PatternNever:()=>tf,PatternNeverExact:()=>Cl,PatternNumber:()=>$i,PatternNumberExact:()=>vr,PatternString:()=>bs,PatternStringExact:()=>Lr,Pick:()=>rr,PickFromMappedKey:()=>ip,PickFromMappedResult:()=>rp,Promise:()=>ti,Readonly:()=>Me,ReadonlyFromMappedResult:()=>kl,ReadonlyKind:()=>vt,ReadonlyOptional:()=>ci,Record:()=>pi,RecordKey:()=>Xl,RecordPattern:()=>Mo,RecordValue:()=>Bo,Recursive:()=>Qo,Ref:()=>bt,RegExp:()=>Zo,Required:()=>qr,RequiredFromMappedResult:()=>ap,Rest:()=>ea,ReturnType:()=>ta,SetComplement:()=>zO,SetDistinct:()=>Tl,SetIncludes:()=>Os,SetIntersect:()=>rf,SetIntersectMany:()=>Pl,SetIsSubset:()=>WO,SetUnion:()=>HO,SetUnionMany:()=>El,String:()=>Re,Symbol:()=>oi,TModule:()=>As,TemplateLiteral:()=>ei,TemplateLiteralExpressionGenerate:()=>Ri,TemplateLiteralFiniteError:()=>xs,TemplateLiteralGenerate:()=>Qn,TemplateLiteralGenerateError:()=>Ss,TemplateLiteralParse:()=>Yn,TemplateLiteralParseExact:()=>Xn,TemplateLiteralParserError:()=>Eo,TemplateLiteralPattern:()=>ws,TemplateLiteralPatternError:()=>Is,TemplateLiteralSyntax:()=>vl,TemplateLiteralToUnion:()=>In,Transform:()=>ra,TransformDecodeBuilder:()=>$s,TransformEncodeBuilder:()=>vs,TransformKind:()=>ue,Tuple:()=>Qe,Type:()=>n,TypeBoxError:()=>v,TypeGuard:()=>d,TypeRegistry:()=>Dt,Uint8Array:()=>si,Uncapitalize:()=>Wo,Undefined:()=>ai,Union:()=>V,UnionEvaluated:()=>Qt,Unknown:()=>ct,Unsafe:()=>na,Uppercase:()=>Ho,ValueGuard:()=>De,Void:()=>ia});var De={};rt(De,{HasPropertyKey:()=>ps,IsArray:()=>Se,IsAsyncIterator:()=>dl,IsBigInt:()=>ho,IsBoolean:()=>ur,IsDate:()=>Hn,IsFunction:()=>fl,IsIterator:()=>hl,IsNull:()=>gl,IsNumber:()=>nt,IsObject:()=>ee,IsRegExp:()=>go,IsString:()=>ie,IsSymbol:()=>yl,IsUint8Array:()=>Er,IsUndefined:()=>Ie});function ps(e,t){return t in e}function dl(e){return ee(e)&&!Se(e)&&!Er(e)&&Symbol.asyncIterator in e}function Se(e){return Array.isArray(e)}function ho(e){return typeof e=="bigint"}function ur(e){return typeof e=="boolean"}function Hn(e){return e instanceof globalThis.Date}function fl(e){return typeof e=="function"}function hl(e){return ee(e)&&!Se(e)&&!Er(e)&&Symbol.iterator in e}function gl(e){return e===null}function nt(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function go(e){return e instanceof globalThis.RegExp}function ie(e){return typeof e=="string"}function yl(e){return typeof e=="symbol"}function Er(e){return e instanceof globalThis.Uint8Array}function Ie(e){return e===void 0}function Xb(e){return e.map(t=>ms(t))}function Qb(e){return new Date(e.getTime())}function Zb(e){return new Uint8Array(e)}function eO(e){return new RegExp(e.source,e.flags)}function tO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=ms(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=ms(e[r]);return t}function ms(e){return Se(e)?Xb(e):Hn(e)?Qb(e):Er(e)?Zb(e):go(e)?eO(e):ee(e)?tO(e):e}function se(e){return ms(e)}function rO(e){return e.map(t=>hn(t))}function hn(e,t){return t===void 0?se(e):se({...t,...e})}function yo(e){return L(e)&&globalThis.Symbol.asyncIterator in e}function bo(e){return L(e)&&globalThis.Symbol.iterator in e}function us(e){return L(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function nO(e){return L(e)&&!$(e)&&fr(e.constructor)&&e.constructor.name!=="Object"}function Oo(e){return e instanceof globalThis.Promise}function Ve(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function bl(e){return e instanceof globalThis.Map}function Ol(e){return e instanceof globalThis.Set}function iO(e){return e instanceof globalThis.RegExp}function gt(e){return globalThis.ArrayBuffer.isView(e)}function oO(e){return e instanceof globalThis.Int8Array}function zn(e){return e instanceof globalThis.Uint8Array}function aO(e){return e instanceof globalThis.Uint8ClampedArray}function sO(e){return e instanceof globalThis.Int16Array}function cO(e){return e instanceof globalThis.Uint16Array}function lO(e){return e instanceof globalThis.Int32Array}function pO(e){return e instanceof globalThis.Uint32Array}function mO(e){return e instanceof globalThis.Float32Array}function uO(e){return e instanceof globalThis.Float64Array}function dO(e){return e instanceof globalThis.BigInt64Array}function fO(e){return e instanceof globalThis.BigUint64Array}function E(e,t){return t in e}function L(e){return e!==null&&typeof e=="object"}function $(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function ce(e){return e===void 0}function dr(e){return e===null}function Jt(e){return typeof e=="boolean"}function le(e){return typeof e=="number"}function xo(e){return globalThis.Number.isInteger(e)}function $t(e){return typeof e=="bigint"}function Q(e){return typeof e=="string"}function fr(e){return typeof e=="function"}function hr(e){return typeof e=="symbol"}function it(e){return $t(e)||Jt(e)||dr(e)||le(e)||Q(e)||hr(e)||ce(e)}var Ce;(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 r(s){let c=L(s);return e.AllowArrayObject?c:c&&!$(s)}e.IsObjectLike=r;function i(s){return r(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=i;function o(s){return e.AllowNaN?le(s):Number.isFinite(s)}e.IsNumberLike=o;function a(s){let c=ce(s);return e.AllowNullVoid?c||s===null:c}e.IsVoidLike=a})(Ce||(Ce={}));function hO(e){return globalThis.Object.freeze(e).map(t=>So(t))}function gO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=So(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=So(e[r]);return globalThis.Object.freeze(t)}function So(e){return Se(e)?hO(e):Hn(e)?e:Er(e)?e:go(e)?e:ee(e)?gO(e):e}function y(e,t){let r=t!==void 0?{...t,...e}:e;switch(Ce.InstanceMode){case"freeze":return So(r);case"clone":return se(r);default:return r}}var v=class extends Error{constructor(t){super(t)}};var Yt={};rt(Yt,{IsAny:()=>ds,IsArgument:()=>fs,IsArray:()=>Lt,IsAsyncIterator:()=>gn,IsBigInt:()=>yn,IsBoolean:()=>gr,IsComputed:()=>Rt,IsConstructor:()=>Nt,IsDate:()=>ad,IsFunction:()=>kt,IsImport:()=>yO,IsInteger:()=>Ft,IsIntersect:()=>he,IsIterator:()=>bn,IsKind:()=>$r,IsKindOf:()=>U,IsLiteral:()=>_e,IsLiteralBoolean:()=>SO,IsLiteralNumber:()=>xO,IsLiteralString:()=>OO,IsLiteralValue:()=>Io,IsMappedKey:()=>ot,IsMappedResult:()=>pe,IsNever:()=>Ar,IsNot:()=>sd,IsNull:()=>Ei,IsNumber:()=>jt,IsObject:()=>Oe,IsOptional:()=>Je,IsPromise:()=>On,IsProperties:()=>bO,IsReadonly:()=>Jn,IsRecord:()=>xn,IsRecursive:()=>IO,IsRef:()=>ye,IsRegExp:()=>hs,IsSchema:()=>de,IsString:()=>yr,IsSymbol:()=>Ai,IsTemplateLiteral:()=>at,IsThis:()=>cd,IsTransform:()=>z,IsTuple:()=>st,IsUint8Array:()=>ld,IsUndefined:()=>br,IsUnion:()=>B,IsUnknown:()=>pd,IsUnsafe:()=>md,IsVoid:()=>ud});var ue=Symbol.for("TypeBox.Transform"),vt=Symbol.for("TypeBox.Readonly"),ve=Symbol.for("TypeBox.Optional"),ze=Symbol.for("TypeBox.Hint"),g=Symbol.for("TypeBox.Kind");function Jn(e){return ee(e)&&e[vt]==="Readonly"}function Je(e){return ee(e)&&e[ve]==="Optional"}function ds(e){return U(e,"Any")}function fs(e){return U(e,"Argument")}function Lt(e){return U(e,"Array")}function gn(e){return U(e,"AsyncIterator")}function yn(e){return U(e,"BigInt")}function gr(e){return U(e,"Boolean")}function Rt(e){return U(e,"Computed")}function Nt(e){return U(e,"Constructor")}function ad(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function yO(e){return U(e,"Import")}function Ft(e){return U(e,"Integer")}function bO(e){return ee(e)}function he(e){return U(e,"Intersect")}function bn(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function OO(e){return _e(e)&&ie(e.const)}function xO(e){return _e(e)&&nt(e.const)}function SO(e){return _e(e)&&ur(e.const)}function Io(e){return ur(e)||nt(e)||ie(e)}function _e(e){return U(e,"Literal")}function ot(e){return U(e,"MappedKey")}function pe(e){return U(e,"MappedResult")}function Ar(e){return U(e,"Never")}function sd(e){return U(e,"Not")}function Ei(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function Oe(e){return U(e,"Object")}function On(e){return U(e,"Promise")}function xn(e){return U(e,"Record")}function IO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function ye(e){return U(e,"Ref")}function hs(e){return U(e,"RegExp")}function yr(e){return U(e,"String")}function Ai(e){return U(e,"Symbol")}function at(e){return U(e,"TemplateLiteral")}function cd(e){return U(e,"This")}function z(e){return ee(e)&&ue in e}function st(e){return U(e,"Tuple")}function br(e){return U(e,"Undefined")}function B(e){return U(e,"Union")}function ld(e){return U(e,"Uint8Array")}function pd(e){return U(e,"Unknown")}function md(e){return U(e,"Unsafe")}function ud(e){return U(e,"Void")}function $r(e){return ee(e)&&g in e&&ie(e[g])}function de(e){return ds(e)||fs(e)||Lt(e)||gr(e)||yn(e)||gn(e)||Rt(e)||Nt(e)||ad(e)||kt(e)||Ft(e)||he(e)||bn(e)||_e(e)||ot(e)||pe(e)||Ar(e)||sd(e)||Ei(e)||jt(e)||Oe(e)||On(e)||xn(e)||ye(e)||hs(e)||yr(e)||Ai(e)||at(e)||cd(e)||st(e)||br(e)||B(e)||ld(e)||pd(e)||md(e)||ud(e)||$r(e)}var d={};rt(d,{IsAny:()=>gd,IsArgument:()=>yd,IsArray:()=>bd,IsAsyncIterator:()=>Od,IsBigInt:()=>xd,IsBoolean:()=>Sd,IsComputed:()=>Id,IsConstructor:()=>wd,IsDate:()=>Cd,IsFunction:()=>Td,IsImport:()=>AO,IsInteger:()=>Pd,IsIntersect:()=>Ed,IsIterator:()=>Ad,IsKind:()=>ef,IsKindOf:()=>D,IsLiteral:()=>Co,IsLiteralBoolean:()=>$O,IsLiteralNumber:()=>vd,IsLiteralString:()=>$d,IsLiteralValue:()=>Ld,IsMappedKey:()=>Rd,IsMappedResult:()=>Nd,IsNever:()=>kd,IsNot:()=>Fd,IsNull:()=>jd,IsNumber:()=>Ud,IsObject:()=>Dd,IsOptional:()=>EO,IsPromise:()=>_d,IsProperties:()=>gs,IsReadonly:()=>PO,IsRecord:()=>Md,IsRecursive:()=>vO,IsRef:()=>Bd,IsRegExp:()=>Vd,IsSchema:()=>Le,IsString:()=>Kd,IsSymbol:()=>Gd,IsTemplateLiteral:()=>qd,IsThis:()=>Wd,IsTransform:()=>Hd,IsTuple:()=>zd,IsUint8Array:()=>Yd,IsUndefined:()=>Jd,IsUnion:()=>wl,IsUnionLiteral:()=>LO,IsUnknown:()=>Xd,IsUnsafe:()=>Qd,IsVoid:()=>Zd,TypeGuardUnknownTypeError:()=>xl});var xl=class extends v{},wO=["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 dd(e){try{return new RegExp(e),!0}catch{return!1}}function Sl(e){if(!ie(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}function fd(e){return Il(e)||Le(e)}function wo(e){return Ie(e)||ho(e)}function oe(e){return Ie(e)||nt(e)}function Il(e){return Ie(e)||ur(e)}function re(e){return Ie(e)||ie(e)}function CO(e){return Ie(e)||ie(e)&&Sl(e)&&dd(e)}function TO(e){return Ie(e)||ie(e)&&Sl(e)}function hd(e){return Ie(e)||Le(e)}function PO(e){return ee(e)&&e[vt]==="Readonly"}function EO(e){return ee(e)&&e[ve]==="Optional"}function gd(e){return D(e,"Any")&&re(e.$id)}function yd(e){return D(e,"Argument")&&nt(e.index)}function bd(e){return D(e,"Array")&&e.type==="array"&&re(e.$id)&&Le(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&Il(e.uniqueItems)&&hd(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function Od(e){return D(e,"AsyncIterator")&&e.type==="AsyncIterator"&&re(e.$id)&&Le(e.items)}function xd(e){return D(e,"BigInt")&&e.type==="bigint"&&re(e.$id)&&wo(e.exclusiveMaximum)&&wo(e.exclusiveMinimum)&&wo(e.maximum)&&wo(e.minimum)&&wo(e.multipleOf)}function Sd(e){return D(e,"Boolean")&&e.type==="boolean"&&re(e.$id)}function Id(e){return D(e,"Computed")&&ie(e.target)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))}function wd(e){return D(e,"Constructor")&&e.type==="Constructor"&&re(e.$id)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))&&Le(e.returns)}function Cd(e){return D(e,"Date")&&e.type==="Date"&&re(e.$id)&&oe(e.exclusiveMaximumTimestamp)&&oe(e.exclusiveMinimumTimestamp)&&oe(e.maximumTimestamp)&&oe(e.minimumTimestamp)&&oe(e.multipleOfTimestamp)}function Td(e){return D(e,"Function")&&e.type==="Function"&&re(e.$id)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))&&Le(e.returns)}function AO(e){return D(e,"Import")&&ps(e,"$defs")&&ee(e.$defs)&&gs(e.$defs)&&ps(e,"$ref")&&ie(e.$ref)&&e.$ref in e.$defs}function Pd(e){return D(e,"Integer")&&e.type==="integer"&&re(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function gs(e){return ee(e)&&Object.entries(e).every(([t,r])=>Sl(t)&&Le(r))}function Ed(e){return D(e,"Intersect")&&!(ie(e.type)&&e.type!=="object")&&Se(e.allOf)&&e.allOf.every(t=>Le(t)&&!Hd(t))&&re(e.type)&&(Il(e.unevaluatedProperties)||hd(e.unevaluatedProperties))&&re(e.$id)}function Ad(e){return D(e,"Iterator")&&e.type==="Iterator"&&re(e.$id)&&Le(e.items)}function D(e,t){return ee(e)&&g in e&&e[g]===t}function $d(e){return Co(e)&&ie(e.const)}function vd(e){return Co(e)&&nt(e.const)}function $O(e){return Co(e)&&ur(e.const)}function Co(e){return D(e,"Literal")&&re(e.$id)&&Ld(e.const)}function Ld(e){return ur(e)||nt(e)||ie(e)}function Rd(e){return D(e,"MappedKey")&&Se(e.keys)&&e.keys.every(t=>nt(t)||ie(t))}function Nd(e){return D(e,"MappedResult")&&gs(e.properties)}function kd(e){return D(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Fd(e){return D(e,"Not")&&Le(e.not)}function jd(e){return D(e,"Null")&&e.type==="null"&&re(e.$id)}function Ud(e){return D(e,"Number")&&e.type==="number"&&re(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function Dd(e){return D(e,"Object")&&e.type==="object"&&re(e.$id)&&gs(e.properties)&&fd(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function _d(e){return D(e,"Promise")&&e.type==="Promise"&&re(e.$id)&&Le(e.item)}function Md(e){return D(e,"Record")&&e.type==="object"&&re(e.$id)&&fd(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&dd(r[0])&&ee(t.patternProperties)&&Le(t.patternProperties[r[0]])})(e)}function vO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Bd(e){return D(e,"Ref")&&re(e.$id)&&ie(e.$ref)}function Vd(e){return D(e,"RegExp")&&re(e.$id)&&ie(e.source)&&ie(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function Kd(e){return D(e,"String")&&e.type==="string"&&re(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&CO(e.pattern)&&TO(e.format)}function Gd(e){return D(e,"Symbol")&&e.type==="symbol"&&re(e.$id)}function qd(e){return D(e,"TemplateLiteral")&&e.type==="string"&&ie(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Wd(e){return D(e,"This")&&re(e.$id)&&ie(e.$ref)}function Hd(e){return ee(e)&&ue in e}function zd(e){return D(e,"Tuple")&&e.type==="array"&&re(e.$id)&&nt(e.minItems)&&nt(e.maxItems)&&e.minItems===e.maxItems&&(Ie(e.items)&&Ie(e.additionalItems)&&e.minItems===0||Se(e.items)&&e.items.every(t=>Le(t)))}function Jd(e){return D(e,"Undefined")&&e.type==="undefined"&&re(e.$id)}function LO(e){return wl(e)&&e.anyOf.every(t=>$d(t)||vd(t))}function wl(e){return D(e,"Union")&&re(e.$id)&&ee(e)&&Se(e.anyOf)&&e.anyOf.every(t=>Le(t))}function Yd(e){return D(e,"Uint8Array")&&e.type==="Uint8Array"&&re(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function Xd(e){return D(e,"Unknown")&&re(e.$id)}function Qd(e){return D(e,"Unsafe")}function Zd(e){return D(e,"Void")&&e.type==="void"&&re(e.$id)}function ef(e){return ee(e)&&g in e&&ie(e[g])&&!wO.includes(e[g])}function Le(e){return ee(e)&&(gd(e)||yd(e)||bd(e)||Sd(e)||xd(e)||Od(e)||Id(e)||wd(e)||Cd(e)||Td(e)||Pd(e)||Ed(e)||Ad(e)||Co(e)||Rd(e)||Nd(e)||kd(e)||Fd(e)||jd(e)||Ud(e)||Dd(e)||_d(e)||Md(e)||Bd(e)||Vd(e)||Kd(e)||Gd(e)||qd(e)||Wd(e)||zd(e)||Jd(e)||wl(e)||Yd(e)||Xd(e)||Qd(e)||Zd(e)||ef(e))}function RO(e){return(parseInt(e)+1).toString()}var ys="(true|false)",$i="(0|[1-9][0-9]*)",bs="(.*)",tf="(?!.*)",NO=`^${ys}$`,vr=`^${$i}$`,Lr=`^${bs}$`,Cl=`^${tf}$`;var Ut={};rt(Ut,{Clear:()=>FO,Delete:()=>jO,Entries:()=>kO,Get:()=>_O,Has:()=>UO,Set:()=>DO});var vi=new Map;function kO(){return new Map(vi)}function FO(){return vi.clear()}function jO(e){return vi.delete(e)}function UO(e){return vi.has(e)}function DO(e,t){vi.set(e,t)}function _O(e){return vi.get(e)}var Dt={};rt(Dt,{Clear:()=>BO,Delete:()=>VO,Entries:()=>MO,Get:()=>qO,Has:()=>KO,Set:()=>GO});var Li=new Map;function MO(){return new Map(Li)}function BO(){return Li.clear()}function VO(e){return Li.delete(e)}function KO(e){return Li.has(e)}function GO(e,t){Li.set(e,t)}function qO(e){return Li.get(e)}function Os(e,t){return e.includes(t)}function WO(e,t){return e.every(r=>Os(t,r))}function Tl(e){return[...new Set(e)]}function rf(e,t){return e.filter(r=>t.includes(r))}function HO(e,t){return[...e,...t]}function zO(e,t){return e.filter(r=>!t.includes(r))}function JO(e,t){return e.reduce((r,i)=>rf(r,i),t)}function Pl(e){return e.length===1?e[0]:e.length>1?JO(e.slice(1),e[0]):[]}function El(e){let t=[];for(let r of e)t.push(...r);return t}function Xt(e){return y({[g]:"Any"},e)}function Rr(e,t){return y({[g]:"Array",type:"array",items:e},t)}function To(e){return y({[g]:"Argument",index:e})}function Nr(e,t){return y({[g]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function ae(e,t,r){return y({[g]:"Computed",target:e,parameters:t},r)}function YO(e,t){let{[t]:r,...i}=e;return i}function be(e,t){return t.reduce((r,i)=>YO(r,i),e)}function k(e){return y({[g]:"Never",not:{}},e)}function XO(e){return y({[g]:"MappedKey",keys:e})}function q(e){return y({[g]:"MappedResult",properties:e})}function kr(e,t,r){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function yt(e,t,r){return y({[g]:"Function",type:"Function",parameters:e,returns:t},r)}function Po(e,t){return y({[g]:"Union",anyOf:e},t)}function QO(e){return e.some(t=>Je(t))}function nf(e){return e.map(t=>Je(t)?ZO(t):t)}function ZO(e){return be(e,[ve])}function ex(e,t){return QO(e)?Ee(Po(nf(e),t)):Po(nf(e),t)}function Qt(e,t){return e.length===1?y(e[0],t):e.length===0?k(t):ex(e,t)}function V(e,t){return e.length===0?k(t):e.length===1?y(e[0],t):Po(e,t)}var Eo=class extends v{};function tx(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Al(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Fr(e,t){return Al(e,t,"(")}function Ao(e,t){return Al(e,t,")")}function of(e,t){return Al(e,t,"|")}function rx(e){if(!(Fr(e,0)&&Ao(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Fr(e,r)&&(t+=1),Ao(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function nx(e){return e.slice(1,e.length-1)}function ix(e){let t=0;for(let r=0;r<e.length;r++)if(Fr(e,r)&&(t+=1),Ao(e,r)&&(t-=1),of(e,r)&&t===0)return!0;return!1}function ox(e){for(let t=0;t<e.length;t++)if(Fr(e,t))return!0;return!1}function ax(e){let[t,r]=[0,0],i=[];for(let a=0;a<e.length;a++)if(Fr(e,a)&&(t+=1),Ao(e,a)&&(t-=1),of(e,a)&&t===0){let s=e.slice(r,a);s.length>0&&i.push(Yn(s)),r=a+1}let o=e.slice(r);return o.length>0&&i.push(Yn(o)),i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"or",expr:i}}function sx(e){function t(o,a){if(!Fr(o,a))throw new Eo("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<o.length;c++)if(Fr(o,c)&&(s+=1),Ao(o,c)&&(s-=1),s===0)return[a,c];throw new Eo("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,a){for(let s=a;s<o.length;s++)if(Fr(o,s))return[a,s];return[a,o.length]}let i=[];for(let o=0;o<e.length;o++)if(Fr(e,o)){let[a,s]=t(e,o),c=e.slice(a,s+1);i.push(Yn(c)),o=s}else{let[a,s]=r(e,o),c=e.slice(a,s);c.length>0&&i.push(Yn(c)),o=s-1}return i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"and",expr:i}}function Yn(e){return rx(e)?Yn(nx(e)):ix(e)?ax(e):ox(e)?sx(e):{type:"const",const:tx(e)}}function Xn(e){return Yn(e.slice(1,e.length-1))}var xs=class extends v{};function cx(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 lx(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 px(e){return e.type==="const"&&e.const===".*"}function Sn(e){return cx(e)||px(e)?!1:lx(e)?!0:e.type==="and"?e.expr.every(t=>Sn(t)):e.type==="or"?e.expr.every(t=>Sn(t)):e.type==="const"?!0:(()=>{throw new xs("Unknown expression type")})()}function $o(e){let t=Xn(e.pattern);return Sn(t)}var Ss=class extends v{};function*af(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of af(e.slice(1)))yield`${t}${r}`}function*mx(e){return yield*af(e.expr.map(t=>[...Ri(t)]))}function*ux(e){for(let t of e.expr)yield*Ri(t)}function*dx(e){return yield e.const}function*Ri(e){return e.type==="and"?yield*mx(e):e.type==="or"?yield*ux(e):e.type==="const"?yield*dx(e):(()=>{throw new Ss("Unknown expression")})()}function Qn(e){let t=Xn(e.pattern);return Sn(t)?[...Ri(t)]:[]}function j(e,t){return y({[g]:"Literal",const:e,type:typeof e},t)}function Zn(e){return y({[g]:"Boolean",type:"boolean"},e)}function jr(e){return y({[g]:"BigInt",type:"bigint"},e)}function Ye(e){return y({[g]:"Number",type:"number"},e)}function Re(e){return y({[g]:"String",type:"string"},e)}function*fx(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield Zn():t==="number"?yield Ye():t==="bigint"?yield jr():t==="string"?yield Re():yield(()=>{let r=t.split("|").map(i=>j(i.trim()));return r.length===0?k():r.length===1?r[0]:Qt(r)})()}function*hx(e){if(e[1]!=="{"){let t=j("$"),r=$l(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=fx(e.slice(2,t)),i=$l(e.slice(t+1));return yield*[...r,...i]}yield j(e)}function*$l(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=j(e.slice(0,t)),i=hx(e.slice(t));return yield*[r,...i]}yield j(e)}function vl(e){return[...$l(e)]}var Is=class extends v{};function gx(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function sf(e,t){return at(e)?e.pattern.slice(1,e.pattern.length-1):B(e)?`(${e.anyOf.map(r=>sf(r,t)).join("|")})`:jt(e)?`${t}${$i}`:Ft(e)?`${t}${$i}`:yn(e)?`${t}${$i}`:yr(e)?`${t}${bs}`:_e(e)?`${t}${gx(e.const.toString())}`:gr(e)?`${t}${ys}`:(()=>{throw new Is(`Unexpected Kind \'${e[g]}\'`)})()}function ws(e){return`^${e.map(t=>sf(t,"")).join("")}$`}function In(e){let r=Qn(e).map(i=>j(i));return Qt(r)}function ei(e,t){let r=ie(e)?ws(vl(e)):ws(e);return y({[g]:"TemplateLiteral",type:"string",pattern:r},t)}function yx(e){return Qn(e).map(r=>r.toString())}function bx(e){let t=[];for(let r of e)t.push(...Xe(r));return t}function Ox(e){return[e.toString()]}function Xe(e){return[...new Set(at(e)?yx(e):B(e)?bx(e.anyOf):_e(e)?Ox(e.const):jt(e)?["[number]"]:Ft(e)?["[number]"]:[])]}function xx(e,t,r){let i={};for(let o of Object.getOwnPropertyNames(t))i[o]=Zt(e,Xe(t[o]),r);return i}function Sx(e,t,r){return xx(e,t.properties,r)}function Ll(e,t,r){let i=Sx(e,t,r);return q(i)}function lf(e,t){return e.map(r=>Rl(r,t))}function Ix(e){return e.filter(t=>!Ar(t))}function wx(e,t){return vo(Ix(lf(e,t)))}function Cx(e){return e.some(t=>Ar(t))?[]:e}function Tx(e,t){return Qt(Cx(lf(e,t)))}function Px(e,t){return t in e?e[t]:t==="[number]"?Qt(e):k()}function Ex(e,t){return t==="[number]"?e:k()}function Ax(e,t){return t in e?e[t]:k()}function Rl(e,t){return he(e)?wx(e.allOf,t):B(e)?Tx(e.anyOf,t):st(e)?Px(e.items??[],t):Lt(e)?Ex(e.items,t):Oe(e)?Ax(e.properties,t):k()}function Ni(e,t){return t.map(r=>Rl(e,r))}function cf(e,t){return Qt(Ni(e,t))}function $x(e,t){return ae("Index",[e,t])}function Zt(e,t,r){if(ye(e)||ye(t)){let i="Index types using Ref parameters require both Type and Key to be of TSchema";if(!de(e)||!de(t))throw new v(i);return ae("Index",[e,t])}return pe(t)?Ll(e,t,r):ot(t)?Nl(e,t,r):y(de(t)?cf(e,Xe(t)):cf(e,t),r)}function vx(e,t,r){return{[t]:Zt(e,[t],se(r))}}function Lx(e,t,r){return t.reduce((i,o)=>({...i,...vx(e,o,r)}),{})}function Rx(e,t,r){return Lx(e,t.keys,r)}function Nl(e,t,r){let i=Rx(e,t,r);return q(i)}function Ur(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function Nx(e){let t=[];for(let r in e)Je(e[r])||t.push(r);return t}function kx(e,t){let r=Nx(e),i=r.length>0?{[g]:"Object",type:"object",properties:e,required:r}:{[g]:"Object",type:"object",properties:e};return y(i,t)}var K=kx;function ti(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function Fx(e){return y(be(e,[vt]))}function jx(e){return y({...e,[vt]:"Readonly"})}function Ux(e,t){return t===!1?Fx(e):jx(e)}function Me(e,t){let r=t??!0;return pe(e)?kl(e,r):Ux(e,r)}function Dx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Me(e[i],t);return r}function _x(e,t){return Dx(e.properties,t)}function kl(e,t){let r=_x(e,t);return q(r)}function Qe(e,t){return y(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 pf(e,t){return e in t?_t(e,t[e]):q(t)}function Mx(e){return{[e]:j(e)}}function Bx(e){let t={};for(let r of e)t[r]=j(r);return t}function Vx(e,t){return Os(t,e)?Mx(e):Bx(t)}function Kx(e,t){let r=Vx(e,t);return pf(e,r)}function Lo(e,t){return t.map(r=>_t(e,r))}function Gx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=_t(e,t[i]);return r}function _t(e,t){let r={...t};return Je(t)?Ee(_t(e,be(t,[ve]))):Jn(t)?Me(_t(e,be(t,[vt]))):pe(t)?pf(e,t.properties):ot(t)?Kx(e,t.keys):Nt(t)?kr(Lo(e,t.parameters),_t(e,t.returns),r):kt(t)?yt(Lo(e,t.parameters),_t(e,t.returns),r):gn(t)?Nr(_t(e,t.items),r):bn(t)?Ur(_t(e,t.items),r):he(t)?Ae(Lo(e,t.allOf),r):B(t)?V(Lo(e,t.anyOf),r):st(t)?Qe(Lo(e,t.items??[]),r):Oe(t)?K(Gx(e,t.properties),r):Lt(t)?Rr(_t(e,t.items),r):On(t)?ti(_t(e,t.item),r):t}function mf(e,t){let r={};for(let i of e)r[i]=_t(i,t);return r}function Ro(e,t,r){let i=de(e)?Xe(e):e,o=t({[g]:"MappedKey",keys:i}),a=mf(i,o);return K(a,r)}function qx(e){return y(be(e,[ve]))}function Wx(e){return y({...e,[ve]:"Optional"})}function Hx(e,t){return t===!1?qx(e):Wx(e)}function Ee(e,t){let r=t??!0;return pe(e)?Fl(e,r):Hx(e,r)}function zx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Ee(e[i],t);return r}function Jx(e,t){return zx(e.properties,t)}function Fl(e,t){let r=Jx(e,t);return q(r)}function No(e,t={}){let r=e.every(o=>Oe(o)),i=de(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return y(t.unevaluatedProperties===!1||de(t.unevaluatedProperties)||r?{...i,[g]:"Intersect",type:"object",allOf:e}:{...i,[g]:"Intersect",allOf:e},t)}function Yx(e){return e.every(t=>Je(t))}function Xx(e){return be(e,[ve])}function uf(e){return e.map(t=>Je(t)?Xx(t):t)}function Qx(e,t){return Yx(e)?Ee(No(uf(e),t)):No(uf(e),t)}function vo(e,t={}){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(r=>z(r)))throw new Error("Cannot intersect transform types");return Qx(e,t)}function Ae(e,t){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(r=>z(r)))throw new Error("Cannot intersect transform types");return No(e,t)}function bt(...e){let[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new v("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},r)}function Zx(e,t){return ae("Awaited",[ae(e,t)])}function eS(e){return ae("Awaited",[bt(e)])}function tS(e){return Ae(df(e))}function rS(e){return V(df(e))}function nS(e){return Dr(e)}function df(e){return e.map(t=>Dr(t))}function Dr(e,t){return y(Rt(e)?Zx(e.target,e.parameters):he(e)?tS(e.allOf):B(e)?rS(e.anyOf):On(e)?nS(e.item):ye(e)?eS(e.$ref):e,t)}function ff(e){let t=[];for(let r of e)t.push(Ze(r));return t}function iS(e){let t=ff(e);return El(t)}function oS(e){let t=ff(e);return Pl(t)}function aS(e){return e.map((t,r)=>r.toString())}function sS(e){return["[number]"]}function cS(e){return globalThis.Object.getOwnPropertyNames(e)}function lS(e){return jl?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Ze(e){return he(e)?iS(e.allOf):B(e)?oS(e.anyOf):st(e)?aS(e.items??[]):Lt(e)?sS(e.items):Oe(e)?cS(e.properties):xn(e)?lS(e.patternProperties):[]}var jl=!1;function ri(e){jl=!0;let t=Ze(e);return jl=!1,`^(${t.map(i=>`(${i})`).join("|")})$`}function pS(e,t){return ae("KeyOf",[ae(e,t)])}function mS(e){return ae("KeyOf",[bt(e)])}function uS(e,t){let r=Ze(e),i=hf(r),o=Qt(i);return y(o,t)}function hf(e){return e.map(t=>t==="[number]"?Ye():j(t))}function _r(e,t){return Rt(e)?pS(e.target,e.parameters):ye(e)?mS(e.$ref):pe(e)?Ul(e,t):uS(e,t)}function dS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=_r(e[i],se(t));return r}function fS(e,t){return dS(e.properties,t)}function Ul(e,t){let r=fS(e,t);return q(r)}function ko(e){let t=Ze(e),r=Ni(e,t);return t.map((i,o)=>[t[o],r[o]])}function hS(e){let t=[];for(let r of e)t.push(...Ze(r));return Tl(t)}function gS(e){return e.filter(t=>!Ar(t))}function yS(e,t){let r=[];for(let i of e)r.push(...Ni(i,[t]));return gS(r)}function bS(e,t){let r={};for(let i of t)r[i]=vo(yS(e,i));return r}function Fo(e,t){let r=hS(e),i=bS(e,r);return K(i,t)}function ni(e){return y({[g]:"Date",type:"Date"},e)}function ii(e){return y({[g]:"Null",type:"null"},e)}function oi(e){return y({[g]:"Symbol",type:"symbol"},e)}function ai(e){return y({[g]:"Undefined",type:"undefined"},e)}function si(e){return y({[g]:"Uint8Array",type:"Uint8Array"},e)}function ct(e){return y({[g]:"Unknown"},e)}function OS(e){return e.map(t=>Dl(t,!1))}function xS(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Me(Dl(e[r],!1));return t}function Cs(e,t){return t===!0?e:Me(e)}function Dl(e,t){return dl(e)?Cs(Xt(),t):hl(e)?Cs(Xt(),t):Se(e)?Me(Qe(OS(e))):Er(e)?si():Hn(e)?ni():ee(e)?Cs(K(xS(e)),t):fl(e)?Cs(yt([],ct()),t):Ie(e)?ai():gl(e)?ii():yl(e)?oi():ho(e)?jr():nt(e)?j(e):ur(e)?j(e):ie(e)?j(e):K({})}function jo(e,t){return y(Dl(e,!0),t)}function Uo(e,t){return Nt(e)?Qe(e.parameters,t):k(t)}function Do(e,t){if(Ie(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),o=[...new Set(r)].map(a=>j(a));return V(o,{...t,[ze]:"Enum"})}var Ts=class extends v{},b;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(b||(b={}));function Mt(e){return e===b.False?e:b.True}function ki(e){throw new Ts(e)}function Te(e){return d.IsNever(e)||d.IsIntersect(e)||d.IsUnion(e)||d.IsUnknown(e)||d.IsAny(e)}function Pe(e,t){return d.IsNever(t)?If(e,t):d.IsIntersect(t)?Ps(e,t):d.IsUnion(t)?Kl(e,t):d.IsUnknown(t)?Pf(e,t):d.IsAny(t)?Vl(e,t):ki("StructuralRight")}function Vl(e,t){return b.True}function SS(e,t){return d.IsIntersect(t)?Ps(e,t):d.IsUnion(t)&&t.anyOf.some(r=>d.IsAny(r)||d.IsUnknown(r))?b.True:d.IsUnion(t)?b.Union:d.IsUnknown(t)||d.IsAny(t)?b.True:b.Union}function IS(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function wS(e,t){return d.IsObject(t)&&Es(t)?b.True:Te(t)?Pe(e,t):d.IsArray(t)?Mt(ne(e.items,t.items)):b.False}function CS(e,t){return Te(t)?Pe(e,t):d.IsAsyncIterator(t)?Mt(ne(e.items,t.items)):b.False}function TS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsBigInt(t)?b.True:b.False}function xf(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function PS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsBoolean(t)?b.True:b.False}function ES(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsConstructor(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((r,i)=>Mt(ne(t.parameters[i],r))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function AS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsDate(t)?b.True:b.False}function $S(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsFunction(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((r,i)=>Mt(ne(t.parameters[i],r))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function Sf(e,t){return d.IsLiteral(e)&&De.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function vS(e,t){return d.IsInteger(t)||d.IsNumber(t)?b.True:Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):b.False}function Ps(e,t){return t.allOf.every(r=>ne(e,r)===b.True)?b.True:b.False}function LS(e,t){return e.allOf.some(r=>ne(r,t)===b.True)?b.True:b.False}function RS(e,t){return Te(t)?Pe(e,t):d.IsIterator(t)?Mt(ne(e.items,t.items)):b.False}function NS(e,t){return d.IsLiteral(t)&&t.const===e.const?b.True:Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?Tf(e,t):d.IsNumber(t)?wf(e,t):d.IsInteger(t)?Sf(e,t):d.IsBoolean(t)?xf(e,t):b.False}function If(e,t){return b.False}function kS(e,t){return b.True}function gf(e){let[t,r]=[e,0];for(;d.IsNot(t);)t=t.not,r+=1;return r%2===0?t:ct()}function FS(e,t){return d.IsNot(e)?ne(gf(e),t):d.IsNot(t)?ne(e,gf(t)):ki("Invalid fallthrough for Not")}function jS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsNull(t)?b.True:b.False}function wf(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function US(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsInteger(t)||d.IsNumber(t)?b.True:b.False}function lt(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function yf(e){return Es(e)}function bf(e){return lt(e,0)||lt(e,1)&&"description"in e.properties&&d.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(d.IsString(e.properties.description.anyOf[0])&&d.IsUndefined(e.properties.description.anyOf[1])||d.IsString(e.properties.description.anyOf[1])&&d.IsUndefined(e.properties.description.anyOf[0]))}function _l(e){return lt(e,0)}function Of(e){return lt(e,0)}function DS(e){return lt(e,0)}function _S(e){return lt(e,0)}function MS(e){return Es(e)}function BS(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function VS(e){return lt(e,0)}function Es(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function KS(e){let t=yt([Xt()],Xt());return lt(e,0)||lt(e,1)&&"then"in e.properties&&Mt(ne(e.properties.then,t))===b.True}function Cf(e,t){return ne(e,t)===b.False||d.IsOptional(e)&&!d.IsOptional(t)?b.False:b.True}function Ke(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)||d.IsLiteralString(e)&&yf(t)||d.IsLiteralNumber(e)&&_l(t)||d.IsLiteralBoolean(e)&&Of(t)||d.IsSymbol(e)&&bf(t)||d.IsBigInt(e)&&DS(t)||d.IsString(e)&&yf(t)||d.IsSymbol(e)&&bf(t)||d.IsNumber(e)&&_l(t)||d.IsInteger(e)&&_l(t)||d.IsBoolean(e)&&Of(t)||d.IsUint8Array(e)&&MS(t)||d.IsDate(e)&&_S(t)||d.IsConstructor(e)&&VS(t)||d.IsFunction(e)&&BS(t)?b.True:d.IsRecord(e)&&d.IsString(Ml(e))?t[ze]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Ml(e))?lt(t,0)?b.True:b.False:b.False}function GS(e,t){return Te(t)?Pe(e,t):d.IsRecord(t)?Bt(e,t):d.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!d.IsOptional(t.properties[r]))return b.False;if(d.IsOptional(t.properties[r]))return b.True;if(Cf(e.properties[r],t.properties[r])===b.False)return b.False}return b.True})():b.False}function qS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)&&KS(t)?b.True:d.IsPromise(t)?Mt(ne(e.item,t.item)):b.False}function Ml(e){return vr in e.patternProperties?Ye():Lr in e.patternProperties?Re():ki("Unknown record key pattern")}function Bl(e){return vr in e.patternProperties?e.patternProperties[vr]:Lr in e.patternProperties?e.patternProperties[Lr]:ki("Unable to get record value schema")}function Bt(e,t){let[r,i]=[Ml(t),Bl(t)];return d.IsLiteralString(e)&&d.IsNumber(r)&&Mt(ne(e,i))===b.True?b.True:d.IsUint8Array(e)&&d.IsNumber(r)||d.IsString(e)&&d.IsNumber(r)||d.IsArray(e)&&d.IsNumber(r)?ne(e,i):d.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(Cf(i,e.properties[o])===b.False)return b.False;return b.True})():b.False}function WS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?ne(Bl(e),Bl(t)):b.False}function HS(e,t){let r=d.IsRegExp(e)?Re():e,i=d.IsRegExp(t)?Re():t;return ne(r,i)}function Tf(e,t){return d.IsLiteral(e)&&De.IsString(e.const)||d.IsString(e)?b.True:b.False}function zS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?b.True:b.False}function JS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsSymbol(t)?b.True:b.False}function YS(e,t){return d.IsTemplateLiteral(e)?ne(In(e),t):d.IsTemplateLiteral(t)?ne(e,In(t)):ki("Invalid fallthrough for TemplateLiteral")}function XS(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(r=>ne(r,t.items)===b.True)}function QS(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function ZS(e,t){return Te(t)?Pe(e,t):d.IsObject(t)&&Es(t)||d.IsArray(t)&&XS(e,t)?b.True:d.IsTuple(t)?De.IsUndefined(e.items)&&!De.IsUndefined(t.items)||!De.IsUndefined(e.items)&&De.IsUndefined(t.items)?b.False:De.IsUndefined(e.items)&&!De.IsUndefined(t.items)||e.items.every((r,i)=>ne(r,t.items[i])===b.True)?b.True:b.False:b.False}function eI(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsUint8Array(t)?b.True:b.False}function tI(e,t){return Te(t)?Pe(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?iI(e,t):d.IsUndefined(t)?b.True:b.False}function Kl(e,t){return t.anyOf.some(r=>ne(e,r)===b.True)?b.True:b.False}function rI(e,t){return e.anyOf.every(r=>ne(r,t)===b.True)?b.True:b.False}function Pf(e,t){return b.True}function nI(e,t){return d.IsNever(t)?If(e,t):d.IsIntersect(t)?Ps(e,t):d.IsUnion(t)?Kl(e,t):d.IsAny(t)?Vl(e,t):d.IsString(t)?Tf(e,t):d.IsNumber(t)?wf(e,t):d.IsInteger(t)?Sf(e,t):d.IsBoolean(t)?xf(e,t):d.IsArray(t)?IS(e,t):d.IsTuple(t)?QS(e,t):d.IsObject(t)?Ke(e,t):d.IsUnknown(t)?b.True:b.False}function iI(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function oI(e,t){return d.IsIntersect(t)?Ps(e,t):d.IsUnion(t)?Kl(e,t):d.IsUnknown(t)?Pf(e,t):d.IsAny(t)?Vl(e,t):d.IsObject(t)?Ke(e,t):d.IsVoid(t)?b.True:b.False}function ne(e,t){return d.IsTemplateLiteral(e)||d.IsTemplateLiteral(t)?YS(e,t):d.IsRegExp(e)||d.IsRegExp(t)?HS(e,t):d.IsNot(e)||d.IsNot(t)?FS(e,t):d.IsAny(e)?SS(e,t):d.IsArray(e)?wS(e,t):d.IsBigInt(e)?TS(e,t):d.IsBoolean(e)?PS(e,t):d.IsAsyncIterator(e)?CS(e,t):d.IsConstructor(e)?ES(e,t):d.IsDate(e)?AS(e,t):d.IsFunction(e)?$S(e,t):d.IsInteger(e)?vS(e,t):d.IsIntersect(e)?LS(e,t):d.IsIterator(e)?RS(e,t):d.IsLiteral(e)?NS(e,t):d.IsNever(e)?kS(e,t):d.IsNull(e)?jS(e,t):d.IsNumber(e)?US(e,t):d.IsObject(e)?GS(e,t):d.IsRecord(e)?WS(e,t):d.IsString(e)?zS(e,t):d.IsSymbol(e)?JS(e,t):d.IsTuple(e)?ZS(e,t):d.IsPromise(e)?qS(e,t):d.IsUint8Array(e)?eI(e,t):d.IsUndefined(e)?tI(e,t):d.IsUnion(e)?rI(e,t):d.IsUnknown(e)?nI(e,t):d.IsVoid(e)?oI(e,t):ki(`Unknown left type operand \'${e[g]}\'`)}function Mr(e,t){return ne(e,t)}function aI(e,t,r,i,o){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Br(e[s],t,r,i,se(o));return a}function sI(e,t,r,i,o){return aI(e.properties,t,r,i,o)}function Gl(e,t,r,i,o){let a=sI(e,t,r,i,o);return q(a)}function cI(e,t,r,i){let o=Mr(e,t);return o===b.Union?V([r,i]):o===b.True?r:i}function Br(e,t,r,i,o){return pe(e)?Gl(e,t,r,i,o):ot(e)?y(ql(e,t,r,i,o)):y(cI(e,t,r,i),o)}function lI(e,t,r,i,o){return{[e]:Br(j(e),t,r,i,se(o))}}function pI(e,t,r,i,o){return e.reduce((a,s)=>({...a,...lI(s,t,r,i,o)}),{})}function mI(e,t,r,i,o){return pI(e.keys,t,r,i,o)}function ql(e,t,r,i,o){let a=mI(e,t,r,i,o);return q(a)}function uI(e){return e.allOf.every(t=>wn(t))}function dI(e){return e.anyOf.some(t=>wn(t))}function fI(e){return!wn(e.not)}function wn(e){return e[g]==="Intersect"?uI(e):e[g]==="Union"?dI(e):e[g]==="Not"?fI(e):e[g]==="Undefined"}function Wl(e,t){return Vr(In(e),t)}function hI(e,t){let r=e.filter(i=>Mr(i,t)===b.False);return r.length===1?r[0]:V(r)}function Vr(e,t,r={}){return at(e)?y(Wl(e,t),r):pe(e)?y(Hl(e,t),r):y(B(e)?hI(e.anyOf,t):Mr(e,t)!==b.False?k():e,r)}function gI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Vr(e[i],t);return r}function yI(e,t){return gI(e.properties,t)}function Hl(e,t){let r=yI(e,t);return q(r)}function zl(e,t){return Kr(In(e),t)}function bI(e,t){let r=e.filter(i=>Mr(i,t)!==b.False);return r.length===1?r[0]:V(r)}function Kr(e,t,r){return at(e)?y(zl(e,t),r):pe(e)?y(Jl(e,t),r):y(B(e)?bI(e.anyOf,t):Mr(e,t)!==b.False?e:k(),r)}function OI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Kr(e[i],t);return r}function xI(e,t){return OI(e.properties,t)}function Jl(e,t){let r=xI(e,t);return q(r)}function _o(e,t){return Nt(e)?y(e.returns,t):k(t)}function ci(e){return Me(Ee(e))}function li(e,t,r){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},r)}function Yl(e,t,r){let i={};for(let o of e)i[o]=t;return K(i,{...r,[ze]:"Record"})}function SI(e,t,r){return $o(e)?Yl(Xe(e),t,r):li(e.pattern,t,r)}function II(e,t,r){return Yl(Xe(V(e)),t,r)}function wI(e,t,r){return Yl([e.toString()],t,r)}function CI(e,t,r){return li(e.source,t,r)}function TI(e,t,r){let i=Ie(e.pattern)?Lr:e.pattern;return li(i,t,r)}function PI(e,t,r){return li(Lr,t,r)}function EI(e,t,r){return li(Cl,t,r)}function AI(e,t,r){return K({true:t,false:t},r)}function $I(e,t,r){return li(vr,t,r)}function vI(e,t,r){return li(vr,t,r)}function pi(e,t,r={}){return B(e)?II(e.anyOf,t,r):at(e)?SI(e,t,r):_e(e)?wI(e.const,t,r):gr(e)?AI(e,t,r):Ft(e)?$I(e,t,r):jt(e)?vI(e,t,r):hs(e)?CI(e,t,r):yr(e)?TI(e,t,r):ds(e)?PI(e,t,r):Ar(e)?EI(e,t,r):k(r)}function Mo(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function Xl(e){let t=Mo(e);return t===Lr?Re():t===vr?Ye():Re({pattern:t})}function Bo(e){return e.patternProperties[Mo(e)]}function LI(e,t){return t.parameters=Fi(e,t.parameters),t.returns=er(e,t.returns),t}function RI(e,t){return t.parameters=Fi(e,t.parameters),t.returns=er(e,t.returns),t}function NI(e,t){return t.allOf=Fi(e,t.allOf),t}function kI(e,t){return t.anyOf=Fi(e,t.anyOf),t}function FI(e,t){return Ie(t.items)||(t.items=Fi(e,t.items)),t}function jI(e,t){return t.items=er(e,t.items),t}function UI(e,t){return t.items=er(e,t.items),t}function DI(e,t){return t.items=er(e,t.items),t}function _I(e,t){return t.item=er(e,t.item),t}function MI(e,t){let r=GI(e,t.properties);return{...t,...K(r)}}function BI(e,t){let r=er(e,Xl(t)),i=er(e,Bo(t)),o=pi(r,i);return{...t,...o}}function VI(e,t){return t.index in e?e[t.index]:ct()}function KI(e,t){let r=Jn(t),i=Je(t),o=er(e,t);return r&&i?ci(o):r&&!i?Me(o):!r&&i?Ee(o):o}function GI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:KI(e,t[i])}),{})}function Fi(e,t){return t.map(r=>er(e,r))}function er(e,t){return Nt(t)?LI(e,t):kt(t)?RI(e,t):he(t)?NI(e,t):B(t)?kI(e,t):st(t)?FI(e,t):Lt(t)?jI(e,t):gn(t)?UI(e,t):bn(t)?DI(e,t):On(t)?_I(e,t):Oe(t)?MI(e,t):xn(t)?BI(e,t):fs(t)?VI(e,t):t}function Vo(e,t){return er(t,hn(e))}function Ko(e){return y({[g]:"Integer",type:"integer"},e)}function qI(e,t,r){return{[e]:Vt(j(e),t,se(r))}}function WI(e,t,r){return e.reduce((o,a)=>({...o,...qI(a,t,r)}),{})}function HI(e,t,r){return WI(e.keys,t,r)}function Ql(e,t,r){let i=HI(e,t,r);return q(i)}function zI(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function JI(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function YI(e){return e.toUpperCase()}function XI(e){return e.toLowerCase()}function QI(e,t,r){let i=Xn(e.pattern);if(!Sn(i))return{...e,pattern:Ef(e.pattern,t)};let s=[...Ri(i)].map(p=>j(p)),c=Af(s,t),l=V(c);return ei([l],r)}function Ef(e,t){return typeof e=="string"?t==="Uncapitalize"?zI(e):t==="Capitalize"?JI(e):t==="Uppercase"?YI(e):t==="Lowercase"?XI(e):e:e.toString()}function Af(e,t){return e.map(r=>Vt(r,t))}function Vt(e,t,r={}){return ot(e)?Ql(e,t,r):at(e)?QI(e,t,r):B(e)?V(Af(e.anyOf,t),r):_e(e)?j(Ef(e.const,t),r):y(e,r)}function Go(e,t={}){return Vt(e,"Capitalize",t)}function qo(e,t={}){return Vt(e,"Lowercase",t)}function Wo(e,t={}){return Vt(e,"Uncapitalize",t)}function Ho(e,t={}){return Vt(e,"Uppercase",t)}function ZI(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=tr(e[o],t,se(r));return i}function e0(e,t,r){return ZI(e.properties,t,r)}function Zl(e,t,r){let i=e0(e,t,r);return q(i)}function t0(e,t){return e.map(r=>ep(r,t))}function r0(e,t){return e.map(r=>ep(r,t))}function n0(e,t){let{[t]:r,...i}=e;return i}function i0(e,t){return t.reduce((r,i)=>n0(r,i),e)}function o0(e,t){let r=be(e,[ue,"$id","required","properties"]),i=i0(e.properties,t);return K(i,r)}function a0(e){let t=e.reduce((r,i)=>Io(i)?[...r,j(i)]:r,[]);return V(t)}function ep(e,t){return he(e)?Ae(t0(e.allOf,t)):B(e)?V(r0(e.anyOf,t)):Oe(e)?o0(e,t):K({})}function tr(e,t,r){let i=Se(t)?a0(t):t,o=de(t)?Xe(t):t,a=ye(e),s=ye(t);return pe(e)?Zl(e,o,r):ot(t)?tp(e,t,r):a&&s?ae("Omit",[e,i],r):!a&&s?ae("Omit",[e,i],r):a&&!s?ae("Omit",[e,i],r):y({...ep(e,o),...r})}function s0(e,t,r){return{[t]:tr(e,[t],se(r))}}function c0(e,t,r){return t.reduce((i,o)=>({...i,...s0(e,o,r)}),{})}function l0(e,t,r){return c0(e,t.keys,r)}function tp(e,t,r){let i=l0(e,t,r);return q(i)}function p0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=rr(e[o],t,se(r));return i}function m0(e,t,r){return p0(e.properties,t,r)}function rp(e,t,r){let i=m0(e,t,r);return q(i)}function u0(e,t){return e.map(r=>np(r,t))}function d0(e,t){return e.map(r=>np(r,t))}function f0(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}function h0(e,t){let r=be(e,[ue,"$id","required","properties"]),i=f0(e.properties,t);return K(i,r)}function g0(e){let t=e.reduce((r,i)=>Io(i)?[...r,j(i)]:r,[]);return V(t)}function np(e,t){return he(e)?Ae(u0(e.allOf,t)):B(e)?V(d0(e.anyOf,t)):Oe(e)?h0(e,t):K({})}function rr(e,t,r){let i=Se(t)?g0(t):t,o=de(t)?Xe(t):t,a=ye(e),s=ye(t);return pe(e)?rp(e,o,r):ot(t)?ip(e,t,r):a&&s?ae("Pick",[e,i],r):!a&&s?ae("Pick",[e,i],r):a&&!s?ae("Pick",[e,i],r):y({...np(e,o),...r})}function y0(e,t,r){return{[t]:rr(e,[t],se(r))}}function b0(e,t,r){return t.reduce((i,o)=>({...i,...y0(e,o,r)}),{})}function O0(e,t,r){return b0(e,t.keys,r)}function ip(e,t,r){let i=O0(e,t,r);return q(i)}function x0(e,t){return ae("Partial",[ae(e,t)])}function S0(e){return ae("Partial",[bt(e)])}function I0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Ee(e[r]);return t}function w0(e){let t=be(e,[ue,"$id","required","properties"]),r=I0(e.properties);return K(r,t)}function $f(e){return e.map(t=>vf(t))}function vf(e){return Rt(e)?x0(e.target,e.parameters):ye(e)?S0(e.$ref):he(e)?Ae($f(e.allOf)):B(e)?V($f(e.anyOf)):Oe(e)?w0(e):yn(e)||gr(e)||Ft(e)||_e(e)||Ei(e)||jt(e)||yr(e)||Ai(e)||br(e)?e:K({})}function Gr(e,t){return pe(e)?op(e,t):y({...vf(e),...t})}function C0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Gr(e[i],se(t));return r}function T0(e,t){return C0(e.properties,t)}function op(e,t){let r=T0(e,t);return q(r)}function P0(e,t){return ae("Required",[ae(e,t)])}function E0(e){return ae("Required",[bt(e)])}function A0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=be(e[r],[ve]);return t}function $0(e){let t=be(e,[ue,"$id","required","properties"]),r=A0(e.properties);return K(r,t)}function Lf(e){return e.map(t=>Rf(t))}function Rf(e){return Rt(e)?P0(e.target,e.parameters):ye(e)?E0(e.$ref):he(e)?Ae(Lf(e.allOf)):B(e)?V(Lf(e.anyOf)):Oe(e)?$0(e):yn(e)||gr(e)||Ft(e)||_e(e)||Ei(e)||jt(e)||yr(e)||Ai(e)||br(e)?e:K({})}function qr(e,t){return pe(e)?ap(e,t):y({...Rf(e),...t})}function v0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=qr(e[i],t);return r}function L0(e,t){return v0(e.properties,t)}function ap(e,t){let r=L0(e,t);return q(r)}function R0(e,t){return t.map(r=>ye(r)?sp(e,r.$ref):Ot(e,r))}function sp(e,t){return t in e?ye(e[t])?sp(e,e[t].$ref):Ot(e,e[t]):k()}function N0(e){return Dr(e[0])}function k0(e){return Zt(e[0],e[1])}function F0(e){return _r(e[0])}function j0(e){return Gr(e[0])}function U0(e){return tr(e[0],e[1])}function D0(e){return rr(e[0],e[1])}function _0(e){return qr(e[0])}function M0(e,t,r){let i=R0(e,r);return t==="Awaited"?N0(i):t==="Index"?k0(i):t==="KeyOf"?F0(i):t==="Partial"?j0(i):t==="Omit"?U0(i):t==="Pick"?D0(i):t==="Required"?_0(i):k()}function B0(e,t){return Rr(Ot(e,t))}function V0(e,t){return Nr(Ot(e,t))}function K0(e,t,r){return kr(zo(e,t),Ot(e,r))}function G0(e,t,r){return yt(zo(e,t),Ot(e,r))}function q0(e,t){return Ae(zo(e,t))}function W0(e,t){return Ur(Ot(e,t))}function H0(e,t){return K(globalThis.Object.keys(t).reduce((r,i)=>({...r,[i]:Ot(e,t[i])}),{}))}function z0(e,t){let[r,i]=[Ot(e,Bo(t)),Mo(t)],o=hn(t);return o.patternProperties[i]=r,o}function J0(e,t){return ye(t)?{...sp(e,t.$ref),[ue]:t[ue]}:t}function Y0(e,t){return Qe(zo(e,t))}function X0(e,t){return V(zo(e,t))}function zo(e,t){return t.map(r=>Ot(e,r))}function Ot(e,t){return Je(t)?y(Ot(e,be(t,[ve])),t):Jn(t)?y(Ot(e,be(t,[vt])),t):z(t)?y(J0(e,t),t):Lt(t)?y(B0(e,t.items),t):gn(t)?y(V0(e,t.items),t):Rt(t)?y(M0(e,t.target,t.parameters)):Nt(t)?y(K0(e,t.parameters,t.returns),t):kt(t)?y(G0(e,t.parameters,t.returns),t):he(t)?y(q0(e,t.allOf),t):bn(t)?y(W0(e,t.items),t):Oe(t)?y(H0(e,t.properties),t):xn(t)?y(z0(e,t)):st(t)?y(Y0(e,t.items||[]),t):B(t)?y(X0(e,t.anyOf),t):t}function Q0(e,t){return t in e?Ot(e,e[t]):k()}function Nf(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:Q0(e,r)}),{})}var As=class{constructor(t){let r=Nf(t),i=this.WithIdentifiers(r);this.$defs=i}Import(t,r){let i={...this.$defs,[t]:y(this.$defs[t],r)};return y({[g]:"Import",$defs:i,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:{...t[i],$id:i}}),{})}};function Jo(e){return new As(e)}function Yo(e,t){return y({[g]:"Not",not:e},t)}function Xo(e,t){return kt(e)?Qe(e.parameters,t):k()}var Z0=0;function Qo(e,t={}){Ie(t.$id)&&(t.$id=`T${Z0++}`);let r=hn(e({[g]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,y({[ze]:"Recursive",...r},t)}function Zo(e,t){let r=ie(e)?new globalThis.RegExp(e):e;return y({[g]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}function ew(e){return he(e)?e.allOf:B(e)?e.anyOf:st(e)?e.items??[]:[]}function ea(e){return ew(e)}function ta(e,t){return kt(e)?y(e.returns,t):k(t)}var $s=class{constructor(t){this.schema=t}Decode(t){return new vs(this.schema,t)}},vs=class{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let a={Encode:s=>r[ue].Encode(t(s)),Decode:s=>this.decode(r[ue].Decode(s))};return{...r,[ue]:a}}EncodeSchema(t,r){let i={Decode:this.decode,Encode:t};return{...r,[ue]:i}}Encode(t){return z(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function ra(e){return new $s(e)}function na(e={}){return y({[g]:e[g]??"Unsafe"},e)}function ia(e){return y({[g]:"Void",type:"void"},e)}var ji=class{ReadonlyOptional(t){return ci(t)}Readonly(t,r){return Me(t,r??!0)}Optional(t,r){return Ee(t,r??!0)}Any(t){return Xt(t)}Array(t,r){return Rr(t,r)}Boolean(t){return Zn(t)}Capitalize(t,r){return Go(t,r)}Composite(t,r){return Fo(t,r)}Const(t,r){return jo(t,r)}Enum(t,r){return Do(t,r)}Exclude(t,r,i){return Vr(t,r,i)}Extends(t,r,i,o,a){return Br(t,r,i,o,a)}Extract(t,r,i){return Kr(t,r,i)}Index(t,r,i){return Zt(t,r,i)}Integer(t){return Ko(t)}Intersect(t,r){return Ae(t,r)}KeyOf(t,r){return _r(t,r)}Literal(t,r){return j(t,r)}Lowercase(t,r){return qo(t,r)}Mapped(t,r,i){return Ro(t,r,i)}Module(t){return Jo(t)}Never(t){return k(t)}Not(t,r){return Yo(t,r)}Null(t){return ii(t)}Number(t){return Ye(t)}Object(t,r){return K(t,r)}Omit(t,r,i){return tr(t,r,i)}Partial(t,r){return Gr(t,r)}Pick(t,r,i){return rr(t,r,i)}Record(t,r,i){return pi(t,r,i)}Recursive(t,r){return Qo(t,r)}Ref(...t){return bt(t[0],t[1])}Required(t,r){return qr(t,r)}Rest(t){return ea(t)}String(t){return Re(t)}TemplateLiteral(t,r){return ei(t,r)}Transform(t){return ra(t)}Tuple(t,r){return Qe(t,r)}Uncapitalize(t,r){return Wo(t,r)}Union(t,r){return V(t,r)}Unknown(t){return ct(t)}Unsafe(t){return na(t)}Uppercase(t,r){return Ho(t,r)}};var cp={};rt(cp,{Any:()=>Xt,Argument:()=>To,Array:()=>Rr,AsyncIterator:()=>Nr,Awaited:()=>Dr,BigInt:()=>jr,Boolean:()=>Zn,Capitalize:()=>Go,Composite:()=>Fo,Const:()=>jo,Constructor:()=>kr,ConstructorParameters:()=>Uo,Date:()=>ni,Enum:()=>Do,Exclude:()=>Vr,Extends:()=>Br,Extract:()=>Kr,Function:()=>yt,Index:()=>Zt,InstanceType:()=>_o,Instantiate:()=>Vo,Integer:()=>Ko,Intersect:()=>Ae,Iterator:()=>Ur,KeyOf:()=>_r,Literal:()=>j,Lowercase:()=>qo,Mapped:()=>Ro,Module:()=>Jo,Never:()=>k,Not:()=>Yo,Null:()=>ii,Number:()=>Ye,Object:()=>K,Omit:()=>tr,Optional:()=>Ee,Parameters:()=>Xo,Partial:()=>Gr,Pick:()=>rr,Promise:()=>ti,Readonly:()=>Me,ReadonlyOptional:()=>ci,Record:()=>pi,Recursive:()=>Qo,Ref:()=>bt,RegExp:()=>Zo,Required:()=>qr,Rest:()=>ea,ReturnType:()=>ta,String:()=>Re,Symbol:()=>oi,TemplateLiteral:()=>ei,Transform:()=>ra,Tuple:()=>Qe,Uint8Array:()=>si,Uncapitalize:()=>Wo,Undefined:()=>ai,Union:()=>V,Unknown:()=>ct,Unsafe:()=>na,Uppercase:()=>Ho,Void:()=>ia});var Ls=class extends ji{Argument(t){return To(t)}AsyncIterator(t,r){return Nr(t,r)}Awaited(t,r){return Dr(t,r)}BigInt(t){return jr(t)}ConstructorParameters(t,r){return Uo(t,r)}Constructor(t,r,i){return kr(t,r,i)}Date(t={}){return ni(t)}Function(t,r,i){return yt(t,r,i)}InstanceType(t,r){return _o(t,r)}Instantiate(t,r){return Vo(t,r)}Iterator(t,r){return Ur(t,r)}Parameters(t,r){return Xo(t,r)}Promise(t,r){return ti(t,r)}RegExp(t,r){return Zo(t,r)}ReturnType(t,r){return ta(t,r)}Symbol(t){return oi(t)}Undefined(t){return ai(t)}Uint8Array(t){return si(t)}Void(t){return ia(t)}};var n=cp;var Cp={};rt(Cp,{Assert:()=>oa,AssertError:()=>Fs,Cast:()=>_i,Check:()=>F,Clean:()=>sa,Clone:()=>W,Convert:()=>pa,Create:()=>Kt,Decode:()=>fp,Default:()=>ha,Delete:()=>Xf,Diff:()=>yp,Edit:()=>gp,Encode:()=>Op,Equal:()=>Pn,HasPropertyKey:()=>E,HasTransform:()=>Tn,Hash:()=>mi,Insert:()=>Jf,IsArray:()=>$,IsAsyncIterator:()=>yo,IsBigInt:()=>$t,IsBigInt64Array:()=>dO,IsBigUint64Array:()=>fO,IsBoolean:()=>Jt,IsDate:()=>Ve,IsFloat32Array:()=>mO,IsFloat64Array:()=>uO,IsFunction:()=>fr,IsInstanceObject:()=>nO,IsInt16Array:()=>sO,IsInt32Array:()=>lO,IsInt8Array:()=>oO,IsInteger:()=>xo,IsIterator:()=>bo,IsMap:()=>bl,IsNull:()=>dr,IsNumber:()=>le,IsObject:()=>L,IsPromise:()=>Oo,IsRegExp:()=>iO,IsSet:()=>Ol,IsStandardObject:()=>us,IsString:()=>Q,IsSymbol:()=>hr,IsTypedArray:()=>gt,IsUint16Array:()=>cO,IsUint32Array:()=>pO,IsUint8Array:()=>zn,IsUint8ClampedArray:()=>aO,IsUndefined:()=>ce,IsValueType:()=>it,Mutate:()=>Sp,Parse:()=>wp,ParseDefault:()=>Ip,ParseError:()=>Oa,ParseRegistry:()=>Gs,Patch:()=>bp,TransformDecode:()=>ua,TransformDecodeCheckError:()=>ma,TransformDecodeError:()=>Us,TransformEncode:()=>fa,TransformEncodeCheckError:()=>da,TransformEncodeError:()=>Ds,Update:()=>Yf,Value:()=>T,ValueCastError:()=>aa,ValueCheckUnknownTypeError:()=>Ns,ValueCreateError:()=>pt,ValueDiffError:()=>ya,ValueErrorIterator:()=>Or,ValueErrorType:()=>h,ValueHashError:()=>Rs,ValueMutateError:()=>ba,ValuePointer:()=>Gt});function tw(e){switch(e.errorType){case h.ArrayContains:return"Expected array to contain at least one matching value";case h.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case h.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case h.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case h.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case h.ArrayUniqueItems:return"Expected array elements to be unique";case h.Array:return"Expected array";case h.AsyncIterator:return"Expected AsyncIterator";case h.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case h.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case h.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case h.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case h.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case h.BigInt:return"Expected bigint";case h.Boolean:return"Expected boolean";case h.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case h.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case h.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case h.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case h.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case h.Date:return"Expected Date";case h.Function:return"Expected function";case h.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case h.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case h.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case h.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case h.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case h.Integer:return"Expected integer";case h.IntersectUnevaluatedProperties:return"Unexpected property";case h.Intersect:return"Expected all values to match";case h.Iterator:return"Expected Iterator";case h.Literal:return`Expected ${typeof e.schema.const=="string"?`\'${e.schema.const}\'`:e.schema.const}`;case h.Never:return"Never";case h.Not:return"Value should not match";case h.Null:return"Expected null";case h.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case h.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case h.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case h.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case h.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case h.Number:return"Expected number";case h.Object:return"Expected object";case h.ObjectAdditionalProperties:return"Unexpected property";case h.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case h.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case h.ObjectRequiredProperty:return"Expected required property";case h.Promise:return"Expected Promise";case h.RegExp:return"Expected string to match regular expression";case h.StringFormatUnknown:return`Unknown format \'${e.schema.format}\'`;case h.StringFormat:return`Expected string to match \'${e.schema.format}\' format`;case h.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case h.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case h.StringPattern:return`Expected string to match \'${e.schema.pattern}\'`;case h.String:return"Expected string";case h.Symbol:return"Expected symbol";case h.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case h.Tuple:return"Expected tuple";case h.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case h.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case h.Uint8Array:return"Expected Uint8Array";case h.Undefined:return"Expected undefined";case h.Union:return"Expected union value";case h.Void:return"Expected void";case h.Kind:return`Expected kind \'${e.schema[g]}\'`;default:return"Unknown error type"}}var rw=tw;function kf(){return rw}var pp=class extends v{constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function nw(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw new pp(e);return Y(r,t)}function Ne(e,t){return!Q(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Y(e,t){return e[g]==="This"||e[g]==="Ref"?nw(e,t):e}var Rs=class extends v{constructor(t){super("Unable to hash value"),this.value=t}},xt;(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"})(xt||(xt={}));var Ui=BigInt("14695981039346656037"),[iw,ow]=[BigInt("1099511628211"),BigInt("18446744073709551616")],aw=Array.from({length:256}).map((e,t)=>BigInt(t)),Ff=new Float64Array(1),jf=new DataView(Ff.buffer),Uf=new Uint8Array(Ff.buffer);function*sw(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}function cw(e){Ge(xt.Array);for(let t of e)Di(t)}function lw(e){Ge(xt.Boolean),Ge(e?1:0)}function pw(e){Ge(xt.BigInt),jf.setBigInt64(0,e);for(let t of Uf)Ge(t)}function mw(e){Ge(xt.Date),Di(e.getTime())}function uw(e){Ge(xt.Null)}function dw(e){Ge(xt.Number),jf.setFloat64(0,e);for(let t of Uf)Ge(t)}function fw(e){Ge(xt.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Di(t),Di(e[t])}function hw(e){Ge(xt.String);for(let t=0;t<e.length;t++)for(let r of sw(e.charCodeAt(t)))Ge(r)}function gw(e){Ge(xt.Symbol),Di(e.description)}function yw(e){Ge(xt.Uint8Array);for(let t=0;t<e.length;t++)Ge(e[t])}function bw(e){return Ge(xt.Undefined)}function Di(e){if($(e))return cw(e);if(Jt(e))return lw(e);if($t(e))return pw(e);if(Ve(e))return mw(e);if(dr(e))return uw(e);if(le(e))return dw(e);if(L(e))return fw(e);if(Q(e))return hw(e);if(hr(e))return gw(e);if(zn(e))return yw(e);if(ce(e))return bw(e);throw new Rs(e)}function Ge(e){Ui=Ui^aw[e],Ui=Ui*iw%ow}function mi(e){return Ui=BigInt("14695981039346656037"),Di(e),Ui}var Ns=class extends v{constructor(t){super("Unknown type"),this.schema=t}};function Ow(e){return e[g]==="Any"||e[g]==="Unknown"}function _(e){return e!==void 0}function xw(e,t,r){return!0}function Sw(e,t,r){return!0}function Iw(e,t,r){if(!$(r)||_(e.minItems)&&!(r.length>=e.minItems)||_(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(a=>ke(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let s of r){let c=mi(s);if(a.has(c))return!1;a.add(c)}return!0}())return!1;if(!(_(e.contains)||le(e.minContains)||le(e.maxContains)))return!0;let i=_(e.contains)?e.contains:k(),o=r.reduce((a,s)=>ke(i,t,s)?a+1:a,0);return!(o===0||le(e.minContains)&&o<e.minContains||le(e.maxContains)&&o>e.maxContains)}function ww(e,t,r){return yo(r)}function Cw(e,t,r){return!(!$t(r)||_(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||_(e.maximum)&&!(r<=e.maximum)||_(e.minimum)&&!(r>=e.minimum)||_(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function Tw(e,t,r){return Jt(r)}function Pw(e,t,r){return ke(e.returns,t,r.prototype)}function Ew(e,t,r){return!(!Ve(r)||_(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||_(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||_(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||_(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||_(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function Aw(e,t,r){return fr(r)}function $w(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ke(o,[...t,...i],r)}function vw(e,t,r){return!(!xo(r)||_(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||_(e.maximum)&&!(r<=e.maximum)||_(e.minimum)&&!(r>=e.minimum)||_(e.multipleOf)&&r%e.multipleOf!==0)}function Lw(e,t,r){let i=e.allOf.every(o=>ke(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(ri(e)),a=Object.getOwnPropertyNames(r).every(s=>o.test(s));return i&&a}else if(de(e.unevaluatedProperties)){let o=new RegExp(ri(e)),a=Object.getOwnPropertyNames(r).every(s=>o.test(s)||ke(e.unevaluatedProperties,t,r[s]));return i&&a}else return i}function Rw(e,t,r){return bo(r)}function Nw(e,t,r){return r===e.const}function kw(e,t,r){return!1}function Fw(e,t,r){return!ke(e.not,t,r)}function jw(e,t,r){return dr(r)}function Uw(e,t,r){return!(!Ce.IsNumberLike(r)||_(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||_(e.minimum)&&!(r>=e.minimum)||_(e.maximum)&&!(r<=e.maximum)||_(e.multipleOf)&&r%e.multipleOf!==0)}function Dw(e,t,r){if(!Ce.IsObjectLike(r)||_(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||_(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let i=Object.getOwnPropertyNames(e.properties);for(let o of i){let a=e.properties[o];if(e.required&&e.required.includes(o)){if(!ke(a,t,r[o])||(wn(a)||Ow(a))&&!(o in r))return!1}else if(Ce.IsExactOptionalProperty(r,o)&&!ke(a,t,r[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===i.length&&o.length===i.length?!0:o.every(a=>i.includes(a))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(a=>i.includes(a)||ke(e.additionalProperties,t,r[a])):!0}function _w(e,t,r){return Oo(r)}function Mw(e,t,r){if(!Ce.IsRecordLike(r)||_(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||_(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[i,o]=Object.entries(e.patternProperties)[0],a=new RegExp(i),s=Object.entries(r).every(([p,m])=>a.test(p)?ke(o,t,m):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([p,m])=>a.test(p)?!0:ke(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(p=>a.test(p)):!0;return s&&c&&l}function Bw(e,t,r){return ke(Y(e,t),t,r)}function Vw(e,t,r){let i=new RegExp(e.source,e.flags);return _(e.minLength)&&!(r.length>=e.minLength)||_(e.maxLength)&&!(r.length<=e.maxLength)?!1:i.test(r)}function Kw(e,t,r){return!Q(r)||_(e.minLength)&&!(r.length>=e.minLength)||_(e.maxLength)&&!(r.length<=e.maxLength)||_(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:_(e.format)?Ut.Has(e.format)?Ut.Get(e.format)(r):!1:!0}function Gw(e,t,r){return hr(r)}function qw(e,t,r){return Q(r)&&new RegExp(e.pattern).test(r)}function Ww(e,t,r){return ke(Y(e,t),t,r)}function Hw(e,t,r){if(!$(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let i=0;i<e.items.length;i++)if(!ke(e.items[i],t,r[i]))return!1;return!0}function zw(e,t,r){return ce(r)}function Jw(e,t,r){return e.anyOf.some(i=>ke(i,t,r))}function Yw(e,t,r){return!(!zn(r)||_(e.maxByteLength)&&!(r.length<=e.maxByteLength)||_(e.minByteLength)&&!(r.length>=e.minByteLength))}function Xw(e,t,r){return!0}function Qw(e,t,r){return Ce.IsVoidLike(r)}function Zw(e,t,r){return Dt.Has(e[g])?Dt.Get(e[g])(e,r):!1}function ke(e,t,r){let i=_(e.$id)?Ne(e,t):t,o=e;switch(o[g]){case"Any":return xw(o,i,r);case"Argument":return Sw(o,i,r);case"Array":return Iw(o,i,r);case"AsyncIterator":return ww(o,i,r);case"BigInt":return Cw(o,i,r);case"Boolean":return Tw(o,i,r);case"Constructor":return Pw(o,i,r);case"Date":return Ew(o,i,r);case"Function":return Aw(o,i,r);case"Import":return $w(o,i,r);case"Integer":return vw(o,i,r);case"Intersect":return Lw(o,i,r);case"Iterator":return Rw(o,i,r);case"Literal":return Nw(o,i,r);case"Never":return kw(o,i,r);case"Not":return Fw(o,i,r);case"Null":return jw(o,i,r);case"Number":return Uw(o,i,r);case"Object":return Dw(o,i,r);case"Promise":return _w(o,i,r);case"Record":return Mw(o,i,r);case"Ref":return Bw(o,i,r);case"RegExp":return Vw(o,i,r);case"String":return Kw(o,i,r);case"Symbol":return Gw(o,i,r);case"TemplateLiteral":return qw(o,i,r);case"This":return Ww(o,i,r);case"Tuple":return Hw(o,i,r);case"Undefined":return zw(o,i,r);case"Union":return Jw(o,i,r);case"Uint8Array":return Yw(o,i,r);case"Unknown":return Xw(o,i,r);case"Void":return Qw(o,i,r);default:if(!Dt.Has(o[g]))throw new Ns(o);return Zw(o,i,r)}}function F(...e){return e.length===3?ke(e[0],e[1],e[2]):ke(e[0],[],e[1])}var h;(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"})(h||(h={}));var mp=class extends v{constructor(t){super("Unknown type"),this.schema=t}};function Wr(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function M(e){return e!==void 0}var Or=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 C(e,t,r,i,o=[]){return{type:e,schema:t,path:r,value:i,message:kf()({errorType:e,path:r,schema:t,value:i,errors:o}),errors:o}}function*eC(e,t,r,i){}function*tC(e,t,r,i){}function*rC(e,t,r,i){if(!$(i))return yield C(h.Array,e,r,i);M(e.minItems)&&!(i.length>=e.minItems)&&(yield C(h.ArrayMinItems,e,r,i)),M(e.maxItems)&&!(i.length<=e.maxItems)&&(yield C(h.ArrayMaxItems,e,r,i));for(let s=0;s<i.length;s++)yield*Fe(e.items,t,`${r}/${s}`,i[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let c of i){let l=mi(c);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield C(h.ArrayUniqueItems,e,r,i)),!(M(e.contains)||M(e.minContains)||M(e.maxContains)))return;let o=M(e.contains)?e.contains:k(),a=i.reduce((s,c,l)=>Fe(o,t,`${r}${l}`,c).next().done===!0?s+1:s,0);a===0&&(yield C(h.ArrayContains,e,r,i)),le(e.minContains)&&a<e.minContains&&(yield C(h.ArrayMinContains,e,r,i)),le(e.maxContains)&&a>e.maxContains&&(yield C(h.ArrayMaxContains,e,r,i))}function*nC(e,t,r,i){yo(i)||(yield C(h.AsyncIterator,e,r,i))}function*iC(e,t,r,i){if(!$t(i))return yield C(h.BigInt,e,r,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.BigIntExclusiveMaximum,e,r,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.BigIntExclusiveMinimum,e,r,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.BigIntMaximum,e,r,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.BigIntMinimum,e,r,i)),M(e.multipleOf)&&i%e.multipleOf!==BigInt(0)&&(yield C(h.BigIntMultipleOf,e,r,i))}function*oC(e,t,r,i){Jt(i)||(yield C(h.Boolean,e,r,i))}function*aC(e,t,r,i){yield*Fe(e.returns,t,r,i.prototype)}function*sC(e,t,r,i){if(!Ve(i))return yield C(h.Date,e,r,i);M(e.exclusiveMaximumTimestamp)&&!(i.getTime()<e.exclusiveMaximumTimestamp)&&(yield C(h.DateExclusiveMaximumTimestamp,e,r,i)),M(e.exclusiveMinimumTimestamp)&&!(i.getTime()>e.exclusiveMinimumTimestamp)&&(yield C(h.DateExclusiveMinimumTimestamp,e,r,i)),M(e.maximumTimestamp)&&!(i.getTime()<=e.maximumTimestamp)&&(yield C(h.DateMaximumTimestamp,e,r,i)),M(e.minimumTimestamp)&&!(i.getTime()>=e.minimumTimestamp)&&(yield C(h.DateMinimumTimestamp,e,r,i)),M(e.multipleOfTimestamp)&&i.getTime()%e.multipleOfTimestamp!==0&&(yield C(h.DateMultipleOfTimestamp,e,r,i))}function*cC(e,t,r,i){fr(i)||(yield C(h.Function,e,r,i))}function*lC(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Fe(a,[...t,...o],r,i)}function*pC(e,t,r,i){if(!xo(i))return yield C(h.Integer,e,r,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.IntegerExclusiveMaximum,e,r,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.IntegerExclusiveMinimum,e,r,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.IntegerMaximum,e,r,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.IntegerMinimum,e,r,i)),M(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.IntegerMultipleOf,e,r,i))}function*mC(e,t,r,i){let o=!1;for(let a of e.allOf)for(let s of Fe(a,t,r,i))o=!0,yield s;if(o)return yield C(h.Intersect,e,r,i);if(e.unevaluatedProperties===!1){let a=new RegExp(ri(e));for(let s of Object.getOwnPropertyNames(i))a.test(s)||(yield C(h.IntersectUnevaluatedProperties,e,`${r}/${s}`,i))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(ri(e));for(let s of Object.getOwnPropertyNames(i))if(!a.test(s)){let c=Fe(e.unevaluatedProperties,t,`${r}/${s}`,i[s]).next();c.done||(yield c.value)}}}function*uC(e,t,r,i){bo(i)||(yield C(h.Iterator,e,r,i))}function*dC(e,t,r,i){i!==e.const&&(yield C(h.Literal,e,r,i))}function*fC(e,t,r,i){yield C(h.Never,e,r,i)}function*hC(e,t,r,i){Fe(e.not,t,r,i).next().done===!0&&(yield C(h.Not,e,r,i))}function*gC(e,t,r,i){dr(i)||(yield C(h.Null,e,r,i))}function*yC(e,t,r,i){if(!Ce.IsNumberLike(i))return yield C(h.Number,e,r,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.NumberExclusiveMaximum,e,r,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.NumberExclusiveMinimum,e,r,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.NumberMaximum,e,r,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.NumberMinimum,e,r,i)),M(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.NumberMultipleOf,e,r,i))}function*bC(e,t,r,i){if(!Ce.IsObjectLike(i))return yield C(h.Object,e,r,i);M(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,r,i)),M(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,r,i));let o=Array.isArray(e.required)?e.required:[],a=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(i);for(let c of o)s.includes(c)||(yield C(h.ObjectRequiredProperty,e.properties[c],`${r}/${Wr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield C(h.ObjectAdditionalProperties,e,`${r}/${Wr(c)}`,i[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Fe(e.additionalProperties,t,`${r}/${Wr(c)}`,i[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Fe(l,t,`${r}/${Wr(c)}`,i[c]),wn(e)&&!(c in i)&&(yield C(h.ObjectRequiredProperty,l,`${r}/${Wr(c)}`,void 0))):Ce.IsExactOptionalProperty(i,c)&&(yield*Fe(l,t,`${r}/${Wr(c)}`,i[c]))}}function*OC(e,t,r,i){Oo(i)||(yield C(h.Promise,e,r,i))}function*xC(e,t,r,i){if(!Ce.IsRecordLike(i))return yield C(h.Object,e,r,i);M(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,r,i)),M(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,r,i));let[o,a]=Object.entries(e.patternProperties)[0],s=new RegExp(o);for(let[c,l]of Object.entries(i))s.test(c)&&(yield*Fe(a,t,`${r}/${Wr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(i))s.test(c)||(yield*Fe(e.additionalProperties,t,`${r}/${Wr(c)}`,l));if(e.additionalProperties===!1){for(let[c,l]of Object.entries(i))if(!s.test(c))return yield C(h.ObjectAdditionalProperties,e,`${r}/${Wr(c)}`,l)}}function*SC(e,t,r,i){yield*Fe(Y(e,t),t,r,i)}function*IC(e,t,r,i){if(!Q(i))return yield C(h.String,e,r,i);if(M(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,r,i)),M(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,r,i)),!new RegExp(e.source,e.flags).test(i))return yield C(h.RegExp,e,r,i)}function*wC(e,t,r,i){if(!Q(i))return yield C(h.String,e,r,i);M(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,r,i)),M(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,r,i)),Q(e.pattern)&&(new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,r,i))),Q(e.format)&&(Ut.Has(e.format)?Ut.Get(e.format)(i)||(yield C(h.StringFormat,e,r,i)):yield C(h.StringFormatUnknown,e,r,i))}function*CC(e,t,r,i){hr(i)||(yield C(h.Symbol,e,r,i))}function*TC(e,t,r,i){if(!Q(i))return yield C(h.String,e,r,i);new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,r,i))}function*PC(e,t,r,i){yield*Fe(Y(e,t),t,r,i)}function*EC(e,t,r,i){if(!$(i))return yield C(h.Tuple,e,r,i);if(e.items===void 0&&i.length!==0)return yield C(h.TupleLength,e,r,i);if(i.length!==e.maxItems)return yield C(h.TupleLength,e,r,i);if(e.items)for(let o=0;o<e.items.length;o++)yield*Fe(e.items[o],t,`${r}/${o}`,i[o])}function*AC(e,t,r,i){ce(i)||(yield C(h.Undefined,e,r,i))}function*$C(e,t,r,i){if(F(e,t,i))return;let o=e.anyOf.map(a=>new Or(Fe(a,t,r,i)));yield C(h.Union,e,r,i,o)}function*vC(e,t,r,i){if(!zn(i))return yield C(h.Uint8Array,e,r,i);M(e.maxByteLength)&&!(i.length<=e.maxByteLength)&&(yield C(h.Uint8ArrayMaxByteLength,e,r,i)),M(e.minByteLength)&&!(i.length>=e.minByteLength)&&(yield C(h.Uint8ArrayMinByteLength,e,r,i))}function*LC(e,t,r,i){}function*RC(e,t,r,i){Ce.IsVoidLike(i)||(yield C(h.Void,e,r,i))}function*NC(e,t,r,i){Dt.Get(e[g])(e,i)||(yield C(h.Kind,e,r,i))}function*Fe(e,t,r,i){let o=M(e.$id)?[...t,e]:t,a=e;switch(a[g]){case"Any":return yield*eC(a,o,r,i);case"Argument":return yield*tC(a,o,r,i);case"Array":return yield*rC(a,o,r,i);case"AsyncIterator":return yield*nC(a,o,r,i);case"BigInt":return yield*iC(a,o,r,i);case"Boolean":return yield*oC(a,o,r,i);case"Constructor":return yield*aC(a,o,r,i);case"Date":return yield*sC(a,o,r,i);case"Function":return yield*cC(a,o,r,i);case"Import":return yield*lC(a,o,r,i);case"Integer":return yield*pC(a,o,r,i);case"Intersect":return yield*mC(a,o,r,i);case"Iterator":return yield*uC(a,o,r,i);case"Literal":return yield*dC(a,o,r,i);case"Never":return yield*fC(a,o,r,i);case"Not":return yield*hC(a,o,r,i);case"Null":return yield*gC(a,o,r,i);case"Number":return yield*yC(a,o,r,i);case"Object":return yield*bC(a,o,r,i);case"Promise":return yield*OC(a,o,r,i);case"Record":return yield*xC(a,o,r,i);case"Ref":return yield*SC(a,o,r,i);case"RegExp":return yield*IC(a,o,r,i);case"String":return yield*wC(a,o,r,i);case"Symbol":return yield*CC(a,o,r,i);case"TemplateLiteral":return yield*TC(a,o,r,i);case"This":return yield*PC(a,o,r,i);case"Tuple":return yield*EC(a,o,r,i);case"Undefined":return yield*AC(a,o,r,i);case"Union":return yield*$C(a,o,r,i);case"Uint8Array":return yield*vC(a,o,r,i);case"Unknown":return yield*LC(a,o,r,i);case"Void":return yield*RC(a,o,r,i);default:if(!Dt.Has(a[g]))throw new mp(e);return yield*NC(a,o,r,i)}}function Cn(...e){let t=e.length===3?Fe(e[0],e[1],"",e[2]):Fe(e[0],[],"",e[1]);return new Or(t)}var kC=function(e,t,r,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},_f=function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)},up,ks,Mf,Fs=class extends v{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),up.add(this),ks.set(this,void 0),kC(this,ks,t,"f"),this.error=r}Errors(){return new Or(_f(this,up,"m",Mf).call(this))}};ks=new WeakMap,up=new WeakSet,Mf=function*(){this.error&&(yield this.error),yield*_f(this,ks,"f")};function Df(e,t,r){if(!F(e,t,r))throw new Fs(Cn(e,t,r))}function oa(...e){return e.length===3?Df(e[0],e[1],e[2]):Df(e[0],[],e[1])}function FC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=W(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=W(e[r]);return t}function jC(e){return e.map(t=>W(t))}function UC(e){return e.slice()}function DC(e){return new Map(W([...e.entries()]))}function _C(e){return new Set(W([...e.entries()]))}function MC(e){return new Date(e.toISOString())}function W(e){if($(e))return jC(e);if(Ve(e))return MC(e);if(gt(e))return UC(e);if(bl(e))return DC(e);if(Ol(e))return _C(e);if(L(e))return FC(e);if(it(e))return e;throw new Error("ValueClone: Unable to clone value")}var pt=class extends v{constructor(t,r){super(r),this.schema=t}};function J(e){return fr(e)?e():W(e)}function BC(e,t){return E(e,"default")?J(e.default):{}}function VC(e,t){return{}}function KC(e,t){if(e.uniqueItems===!0&&!E(e,"default"))throw new pt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!E(e,"default"))throw new pt(e,"Array with the contains constraint requires a default value");return"default"in e?J(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>St(e.items,t)):[]}function GC(e,t){return E(e,"default")?J(e.default):async function*(){}()}function qC(e,t){return E(e,"default")?J(e.default):BigInt(0)}function WC(e,t){return E(e,"default")?J(e.default):!1}function HC(e,t){if(E(e,"default"))return J(e.default);{let r=St(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[i,o]of Object.entries(r)){let a=this;a[i]=o}}}:class{}}}function zC(e,t){return E(e,"default")?J(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function JC(e,t){return E(e,"default")?J(e.default):()=>St(e.returns,t)}function YC(e,t){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return St(i,[...t,...r])}function XC(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function QC(e,t){if(E(e,"default"))return J(e.default);{let r=e.allOf.reduce((i,o)=>{let a=St(o,t);return typeof a=="object"?{...i,...a}:a},{});if(!F(e,t,r))throw new pt(e,"Intersect produced invalid value. Consider using a default value.");return r}}function ZC(e,t){return E(e,"default")?J(e.default):function*(){}()}function eT(e,t){return E(e,"default")?J(e.default):e.const}function tT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"Never types cannot be created. Consider using a default value.")}function rT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"Not types must have a default value")}function nT(e,t){return E(e,"default")?J(e.default):null}function iT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function oT(e,t){if(E(e,"default"))return J(e.default);{let r=new Set(e.required),i={};for(let[o,a]of Object.entries(e.properties))r.has(o)&&(i[o]=St(a,t));return i}}function aT(e,t){return E(e,"default")?J(e.default):Promise.resolve(St(e.item,t))}function sT(e,t){return E(e,"default")?J(e.default):{}}function cT(e,t){return E(e,"default")?J(e.default):St(Y(e,t),t)}function lT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"RegExp types cannot be created. Consider using a default value.")}function pT(e,t){if(e.pattern!==void 0){if(E(e,"default"))return J(e.default);throw new pt(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(E(e,"default"))return J(e.default);throw new pt(e,"String types with formats must specify a default value")}else return E(e,"default")?J(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function mT(e,t){return E(e,"default")?J(e.default):"value"in e?Symbol.for(e.value):Symbol()}function uT(e,t){if(E(e,"default"))return J(e.default);if(!$o(e))throw new pt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Qn(e)[0]}function dT(e,t){if(Bf++>ST)throw new pt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return E(e,"default")?J(e.default):St(Y(e,t),t)}function fT(e,t){return E(e,"default")?J(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,i)=>St(e.items[i],t))}function hT(e,t){if(E(e,"default"))return J(e.default)}function gT(e,t){if(E(e,"default"))return J(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return St(e.anyOf[0],t)}function yT(e,t){return E(e,"default")?J(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function bT(e,t){return E(e,"default")?J(e.default):{}}function OT(e,t){if(E(e,"default"))return J(e.default)}function xT(e,t){if(E(e,"default"))return J(e.default);throw new Error("User defined types must specify a default value")}function St(e,t){let r=Ne(e,t),i=e;switch(i[g]){case"Any":return BC(i,r);case"Argument":return VC(i,r);case"Array":return KC(i,r);case"AsyncIterator":return GC(i,r);case"BigInt":return qC(i,r);case"Boolean":return WC(i,r);case"Constructor":return HC(i,r);case"Date":return zC(i,r);case"Function":return JC(i,r);case"Import":return YC(i,r);case"Integer":return XC(i,r);case"Intersect":return QC(i,r);case"Iterator":return ZC(i,r);case"Literal":return eT(i,r);case"Never":return tT(i,r);case"Not":return rT(i,r);case"Null":return nT(i,r);case"Number":return iT(i,r);case"Object":return oT(i,r);case"Promise":return aT(i,r);case"Record":return sT(i,r);case"Ref":return cT(i,r);case"RegExp":return lT(i,r);case"String":return pT(i,r);case"Symbol":return mT(i,r);case"TemplateLiteral":return uT(i,r);case"This":return dT(i,r);case"Tuple":return fT(i,r);case"Undefined":return hT(i,r);case"Union":return gT(i,r);case"Uint8Array":return yT(i,r);case"Unknown":return bT(i,r);case"Void":return OT(i,r);default:if(!Dt.Has(i[g]))throw new pt(i,"Unknown type");return xT(i,r)}}var ST=512,Bf=0;function Kt(...e){return Bf=0,e.length===2?St(e[0],e[1]):St(e[0],[])}var aa=class extends v{constructor(t,r){super(r),this.schema=t}};function Vf(e,t,r){if(e[g]==="Object"&&typeof r=="object"&&!dr(r)){let i=e,o=Object.getOwnPropertyNames(r),a=Object.entries(i.properties),[s,c]=[1/a.length,a.length];return a.reduce((l,[p,m])=>{let u=m[g]==="Literal"&&m.const===r[p]?c:0,f=F(m,t,r[p])?s:0,O=o.includes(p)?s:0;return l+(u+f+O)},0)}else if(e[g]==="Union"){let o=e.anyOf.map(a=>Y(a,t)).map(a=>Vf(a,t,r));return Math.max(...o)}else return F(e,t,r)?1:0}function IT(e,t,r){let i=e.anyOf.map(s=>Y(s,t)),[o,a]=[i[0],0];for(let s of i){let c=Vf(s,t,r);c>a&&(o=s,a=c)}return o}function wT(e,t,r){if("default"in e)return typeof r=="function"?e.default:W(e.default);{let i=IT(e,t,r);return _i(i,t,r)}}function CT(e,t,r){return F(e,t,r)?W(r):Kt(e,t)}function TT(e,t,r){return F(e,t,r)?r:Kt(e,t)}function PT(e,t,r){if(F(e,t,r))return W(r);let i=$(r)?W(r):Kt(e,t),o=le(e.minItems)&&i.length<e.minItems?[...i,...Array.from({length:e.minItems-i.length},()=>null)]:i,s=(le(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(l=>nr(e.items,t,l));if(e.uniqueItems!==!0)return s;let c=[...new Set(s)];if(!F(e,t,c))throw new aa(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function ET(e,t,r){if(F(e,t,r))return Kt(e,t);let i=new Set(e.returns.required||[]),o=function(){};for(let[a,s]of Object.entries(e.returns.properties))!i.has(a)&&r.prototype[a]===void 0||(o.prototype[a]=nr(s,t,r.prototype[a]));return o}function AT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return nr(o,[...t,...i],r)}function Kf(e,t){return L(e)&&!L(t)||!L(e)&&L(t)?e:!L(e)||!L(t)?t:globalThis.Object.getOwnPropertyNames(e).reduce((r,i)=>{let o=i in t?Kf(e[i],t[i]):e[i];return{...r,[i]:o}},{})}function $T(e,t,r){if(F(e,t,r))return r;let i=Kt(e,t),o=Kf(i,r);return F(e,t,o)?o:i}function vT(e,t,r){throw new aa(e,"Never types cannot be cast")}function LT(e,t,r){if(F(e,t,r))return r;if(r===null||typeof r!="object")return Kt(e,t);let i=new Set(e.required||[]),o={};for(let[a,s]of Object.entries(e.properties))!i.has(a)&&r[a]===void 0||(o[a]=nr(s,t,r[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(r))a.includes(s)||(o[s]=nr(e.additionalProperties,t,r[s]))}return o}function RT(e,t,r){if(F(e,t,r))return W(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Kt(e,t);let i=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[i],a={};for(let[s,c]of Object.entries(r))a[s]=nr(o,t,c);return a}function NT(e,t,r){return nr(Y(e,t),t,r)}function kT(e,t,r){return nr(Y(e,t),t,r)}function FT(e,t,r){return F(e,t,r)?W(r):$(r)?e.items===void 0?[]:e.items.map((i,o)=>nr(i,t,r[o])):Kt(e,t)}function jT(e,t,r){return F(e,t,r)?W(r):wT(e,t,r)}function nr(e,t,r){let i=Q(e.$id)?Ne(e,t):t,o=e;switch(e[g]){case"Array":return PT(o,i,r);case"Constructor":return ET(o,i,r);case"Import":return AT(o,i,r);case"Intersect":return $T(o,i,r);case"Never":return vT(o,i,r);case"Object":return LT(o,i,r);case"Record":return RT(o,i,r);case"Ref":return NT(o,i,r);case"This":return kT(o,i,r);case"Tuple":return FT(o,i,r);case"Union":return jT(o,i,r);case"Date":case"Symbol":case"Uint8Array":return CT(e,t,r);default:return TT(o,i,r)}}function _i(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}function UT(e){return $r(e)&&e[g]!=="Unsafe"}function DT(e,t,r){return $(r)?r.map(i=>mt(e.items,t,i)):r}function _T(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return mt(o,[...t,...i],r)}function MT(e,t,r){let i=e.unevaluatedProperties,a=e.allOf.map(c=>mt(c,t,W(r))).reduce((c,l)=>L(l)?{...c,...l}:l,{});if(!L(r)||!L(a)||!$r(i))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||F(i,t,r[c])&&(a[c]=mt(i,t,r[c]));return a}function BT(e,t,r){if(!L(r)||$(r))return r;let i=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(E(e.properties,o)){r[o]=mt(e.properties[o],t,r[o]);continue}if($r(i)&&F(i,t,r[o])){r[o]=mt(i,t,r[o]);continue}delete r[o]}return r}function VT(e,t,r){if(!L(r))return r;let i=e.additionalProperties,o=Object.getOwnPropertyNames(r),[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of o){if(c.test(l)){r[l]=mt(s,t,r[l]);continue}if($r(i)&&F(i,t,r[l])){r[l]=mt(i,t,r[l]);continue}delete r[l]}return r}function KT(e,t,r){return mt(Y(e,t),t,r)}function GT(e,t,r){return mt(Y(e,t),t,r)}function qT(e,t,r){if(!$(r))return r;if(ce(e.items))return[];let i=Math.min(r.length,e.items.length);for(let o=0;o<i;o++)r[o]=mt(e.items[o],t,r[o]);return r.length>i?r.slice(0,i):r}function WT(e,t,r){for(let i of e.anyOf)if(UT(i)&&F(i,t,r))return mt(i,t,r);return r}function mt(e,t,r){let i=Q(e.$id)?Ne(e,t):t,o=e;switch(o[g]){case"Array":return DT(o,i,r);case"Import":return _T(o,i,r);case"Intersect":return MT(o,i,r);case"Object":return BT(o,i,r);case"Record":return VT(o,i,r);case"Ref":return KT(o,i,r);case"This":return GT(o,i,r);case"Tuple":return qT(o,i,r);case"Union":return WT(o,i,r);default:return r}}function sa(...e){return e.length===3?mt(e[0],e[1],e[2]):mt(e[0],[],e[1])}function js(e){return Q(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function HT(e){return $t(e)||Jt(e)||le(e)}function ca(e){return e===!0||le(e)&&e===1||$t(e)&&e===BigInt("1")||Q(e)&&(e.toLowerCase()==="true"||e==="1")}function la(e){return e===!1||le(e)&&(e===0||Object.is(e,-0))||$t(e)&&e===BigInt("0")||Q(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function zT(e){return Q(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function JT(e){return Q(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function YT(e){return Q(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 XT(e){return Q(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 QT(e){return Q(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function ZT(e,t){let r=qf(e);return r===t?r:e}function eP(e,t){let r=Wf(e);return r===t?r:e}function tP(e,t){let r=Gf(e);return r===t?r:e}function rP(e,t){return Q(e.const)?ZT(t,e.const):le(e.const)?eP(t,e.const):Jt(e.const)?tP(t,e.const):t}function Gf(e){return ca(e)?!0:la(e)?!1:e}function nP(e){let t=r=>r.split(".")[0];return js(e)?BigInt(t(e)):le(e)?BigInt(Math.trunc(e)):la(e)?BigInt(0):ca(e)?BigInt(1):e}function qf(e){return hr(e)&&e.description!==void 0?e.description.toString():HT(e)?e.toString():e}function Wf(e){return js(e)?parseFloat(e):ca(e)?1:la(e)?0:e}function iP(e){return js(e)?parseInt(e):le(e)?Math.trunc(e):ca(e)?1:la(e)?0:e}function oP(e){return Q(e)&&e.toLowerCase()==="null"?null:e}function aP(e){return Q(e)&&e==="undefined"?void 0:e}function sP(e){return Ve(e)?e:le(e)?new Date(e):ca(e)?new Date(1):la(e)?new Date(0):js(e)?new Date(parseInt(e)):JT(e)?new Date(`1970-01-01T${e}.000Z`):zT(e)?new Date(`1970-01-01T${e}`):XT(e)?new Date(`${e}.000Z`):YT(e)?new Date(e):QT(e)?new Date(`${e}T00:00:00.000Z`):e}function cP(e,t,r){return($(r)?r:[r]).map(o=>ir(e.items,t,o))}function lP(e,t,r){return nP(r)}function pP(e,t,r){return Gf(r)}function mP(e,t,r){return sP(r)}function uP(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ir(o,[...t,...i],r)}function dP(e,t,r){return iP(r)}function fP(e,t,r){return e.allOf.reduce((i,o)=>ir(o,t,i),r)}function hP(e,t,r){return rP(e,r)}function gP(e,t,r){return oP(r)}function yP(e,t,r){return Wf(r)}function bP(e,t,r){if(!L(r))return r;for(let i of Object.getOwnPropertyNames(e.properties))E(r,i)&&(r[i]=ir(e.properties[i],t,r[i]));return r}function OP(e,t,r){if(!L(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[o];for(let[s,c]of Object.entries(r))r[s]=ir(a,t,c);return r}function xP(e,t,r){return ir(Y(e,t),t,r)}function SP(e,t,r){return qf(r)}function IP(e,t,r){return Q(r)||le(r)?Symbol(r):r}function wP(e,t,r){return ir(Y(e,t),t,r)}function CP(e,t,r){return $(r)&&!ce(e.items)?r.map((o,a)=>a<e.items.length?ir(e.items[a],t,o):o):r}function TP(e,t,r){return aP(r)}function PP(e,t,r){for(let i of e.anyOf)if(F(i,t,r))return r;for(let i of e.anyOf){let o=ir(i,t,W(r));if(F(i,t,o))return o}return r}function ir(e,t,r){let i=Ne(e,t),o=e;switch(e[g]){case"Array":return cP(o,i,r);case"BigInt":return lP(o,i,r);case"Boolean":return pP(o,i,r);case"Date":return mP(o,i,r);case"Import":return uP(o,i,r);case"Integer":return dP(o,i,r);case"Intersect":return fP(o,i,r);case"Literal":return hP(o,i,r);case"Null":return gP(o,i,r);case"Number":return yP(o,i,r);case"Object":return bP(o,i,r);case"Record":return OP(o,i,r);case"Ref":return xP(o,i,r);case"String":return SP(o,i,r);case"Symbol":return IP(o,i,r);case"This":return wP(o,i,r);case"Tuple":return CP(o,i,r);case"Undefined":return TP(o,i,r);case"Union":return PP(o,i,r);default:return r}}function pa(...e){return e.length===3?ir(e[0],e[1],e[2]):ir(e[0],[],e[1])}var ma=class extends v{constructor(t,r,i){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},Us=class extends v{constructor(t,r,i,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=i,this.error=o}};function ge(e,t,r){try{return z(e)?e[ue].Decode(r):r}catch(i){throw new Us(e,t,r,i)}}function EP(e,t,r,i){return $(i)?ge(e,r,i.map((o,a)=>or(e.items,t,`${r}/${a}`,o))):ge(e,r,i)}function AP(e,t,r,i){if(!L(i)||it(i))return ge(e,r,i);let o=ko(e),a=o.map(m=>m[0]),s={...i};for(let[m,u]of o)m in s&&(s[m]=or(u,t,`${r}/${m}`,s[m]));if(!z(e.unevaluatedProperties))return ge(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=ge(l,`${r}/${m}`,p[m]));return ge(e,r,p)}function $P(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...o],r,i);return ge(e,r,s)}function vP(e,t,r,i){return ge(e,r,or(e.not,t,r,i))}function LP(e,t,r,i){if(!L(i))return ge(e,r,i);let o=Ze(e),a={...i};for(let p of o)E(a,p)&&(ce(a[p])&&(!br(e.properties[p])||Ce.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${r}/${p}`,a[p])));if(!de(e.additionalProperties))return ge(e,r,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)o.includes(p)||(l[p]=ge(c,`${r}/${p}`,l[p]));return ge(e,r,l)}function RP(e,t,r,i){if(!L(i))return ge(e,r,i);let o=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(o),s={...i};for(let m of Object.getOwnPropertyNames(i))a.test(m)&&(s[m]=or(e.patternProperties[o],t,`${r}/${m}`,s[m]));if(!de(e.additionalProperties))return ge(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=ge(l,`${r}/${m}`,p[m]));return ge(e,r,p)}function NP(e,t,r,i){let o=Y(e,t);return ge(e,r,or(o,t,r,i))}function kP(e,t,r,i){let o=Y(e,t);return ge(e,r,or(o,t,r,i))}function FP(e,t,r,i){return $(i)&&$(e.items)?ge(e,r,e.items.map((o,a)=>or(o,t,`${r}/${a}`,i[a]))):ge(e,r,i)}function jP(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=or(o,t,r,i);return ge(e,r,a)}return ge(e,r,i)}function or(e,t,r,i){let o=Ne(e,t),a=e;switch(e[g]){case"Array":return EP(a,o,r,i);case"Import":return $P(a,o,r,i);case"Intersect":return AP(a,o,r,i);case"Not":return vP(a,o,r,i);case"Object":return LP(a,o,r,i);case"Record":return RP(a,o,r,i);case"Ref":return NP(a,o,r,i);case"Symbol":return ge(a,r,i);case"This":return kP(a,o,r,i);case"Tuple":return FP(a,o,r,i);case"Union":return jP(a,o,r,i);default:return ge(a,r,i)}}function ua(e,t,r){return or(e,t,"",r)}var da=class extends v{constructor(t,r,i){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},Ds=class extends v{constructor(t,r,i,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=t,this.path=r,this.value=i,this.error=o}};function Be(e,t,r){try{return z(e)?e[ue].Encode(r):r}catch(i){throw new Ds(e,t,r,i)}}function UP(e,t,r,i){let o=Be(e,r,i);return $(o)?o.map((a,s)=>ar(e.items,t,`${r}/${s}`,a)):o}function DP(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Be(e,r,i);return ar(a,[...t,...o],r,s)}function _P(e,t,r,i){let o=Be(e,r,i);if(!L(i)||it(i))return o;let a=ko(e),s=a.map(u=>u[0]),c={...o};for(let[u,f]of a)u in c&&(c[u]=ar(f,t,`${r}/${u}`,c[u]));if(!z(e.unevaluatedProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.unevaluatedProperties,m={...c};for(let u of l)s.includes(u)||(m[u]=Be(p,`${r}/${u}`,m[u]));return m}function MP(e,t,r,i){return Be(e.not,r,Be(e,r,i))}function BP(e,t,r,i){let o=Be(e,r,i);if(!L(o))return o;let a=Ze(e),s={...o};for(let m of a)E(s,m)&&(ce(s[m])&&(!br(e.properties[m])||Ce.IsExactOptionalProperty(s,m))||(s[m]=ar(e.properties[m],t,`${r}/${m}`,s[m])));if(!de(e.additionalProperties))return s;let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=Be(l,`${r}/${m}`,p[m]));return p}function VP(e,t,r,i){let o=Be(e,r,i);if(!L(i))return o;let a=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(a),c={...o};for(let u of Object.getOwnPropertyNames(i))s.test(u)&&(c[u]=ar(e.patternProperties[a],t,`${r}/${u}`,c[u]));if(!de(e.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.additionalProperties,m={...c};for(let u of l)s.test(u)||(m[u]=Be(p,`${r}/${u}`,m[u]));return m}function KP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Be(e,r,a)}function GP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Be(e,r,a)}function qP(e,t,r,i){let o=Be(e,r,i);return $(e.items)?e.items.map((a,s)=>ar(a,t,`${r}/${s}`,o[s])):[]}function WP(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=ar(o,t,r,i);return Be(e,r,a)}for(let o of e.anyOf){let a=ar(o,t,r,i);if(F(e,t,a))return Be(e,r,a)}return Be(e,r,i)}function ar(e,t,r,i){let o=Ne(e,t),a=e;switch(e[g]){case"Array":return UP(a,o,r,i);case"Import":return DP(a,o,r,i);case"Intersect":return _P(a,o,r,i);case"Not":return MP(a,o,r,i);case"Object":return BP(a,o,r,i);case"Record":return VP(a,o,r,i);case"Ref":return KP(a,o,r,i);case"This":return GP(a,o,r,i);case"Tuple":return qP(a,o,r,i);case"Union":return WP(a,o,r,i);default:return Be(a,r,i)}}function fa(e,t,r){return ar(e,t,"",r)}function HP(e,t){return z(e)||$e(e.items,t)}function zP(e,t){return z(e)||$e(e.items,t)}function JP(e,t){return z(e)||$e(e.returns,t)||e.parameters.some(r=>$e(r,t))}function YP(e,t){return z(e)||$e(e.returns,t)||e.parameters.some(r=>$e(r,t))}function XP(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(r=>$e(r,t))}function QP(e,t){let r=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((o,a)=>[...o,e.$defs[a]],[]),i=e.$defs[e.$ref];return z(e)||$e(i,[...r,...t])}function ZP(e,t){return z(e)||$e(e.items,t)}function eE(e,t){return z(e)||$e(e.not,t)}function tE(e,t){return z(e)||Object.values(e.properties).some(r=>$e(r,t))||de(e.additionalProperties)&&$e(e.additionalProperties,t)}function rE(e,t){return z(e)||$e(e.item,t)}function nE(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[r];return z(e)||$e(i,t)||de(e.additionalProperties)&&z(e.additionalProperties)}function iE(e,t){return z(e)?!0:$e(Y(e,t),t)}function oE(e,t){return z(e)?!0:$e(Y(e,t),t)}function aE(e,t){return z(e)||!ce(e.items)&&e.items.some(r=>$e(r,t))}function sE(e,t){return z(e)||e.anyOf.some(r=>$e(r,t))}function $e(e,t){let r=Ne(e,t),i=e;if(e.$id&&dp.has(e.$id))return!1;switch(e.$id&&dp.add(e.$id),e[g]){case"Array":return HP(i,r);case"AsyncIterator":return zP(i,r);case"Constructor":return JP(i,r);case"Function":return YP(i,r);case"Import":return QP(i,r);case"Intersect":return XP(i,r);case"Iterator":return ZP(i,r);case"Not":return eE(i,r);case"Object":return tE(i,r);case"Promise":return rE(i,r);case"Record":return nE(i,r);case"Ref":return iE(i,r);case"This":return oE(i,r);case"Tuple":return aE(i,r);case"Union":return sE(i,r);default:return z(e)}}var dp=new Set;function Tn(e,t){return dp.clear(),$e(e,t)}function fp(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!F(t,r,i))throw new ma(t,i,Cn(t,r,i).First());return Tn(t,r)?ua(t,r,i):i}function Hr(e,t){let r=E(e,"default")?e.default:void 0,i=fr(r)?r():W(r);return ce(t)?i:L(t)&&L(i)?Object.assign(i,t):t}function hp(e){return $r(e)&&"default"in e}function cE(e,t,r){if($(r)){for(let o=0;o<r.length;o++)r[o]=et(e.items,t,r[o]);return r}let i=Hr(e,r);if(!$(i))return i;for(let o=0;o<i.length;o++)i[o]=et(e.items,t,i[o]);return i}function lE(e,t,r){return Ve(r)?r:Hr(e,r)}function pE(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return et(o,[...t,...i],r)}function mE(e,t,r){let i=Hr(e,r);return e.allOf.reduce((o,a)=>{let s=et(a,t,i);return L(s)?{...o,...s}:s},{})}function uE(e,t,r){let i=Hr(e,r);if(!L(i))return i;let o=Object.getOwnPropertyNames(e.properties);for(let a of o){let s=et(e.properties[a],t,i[a]);ce(s)||(i[a]=et(e.properties[a],t,i[a]))}if(!hp(e.additionalProperties))return i;for(let a of Object.getOwnPropertyNames(i))o.includes(a)||(i[a]=et(e.additionalProperties,t,i[a]));return i}function dE(e,t,r){let i=Hr(e,r);if(!L(i))return i;let o=e.additionalProperties,[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of Object.getOwnPropertyNames(i))c.test(l)&&hp(s)&&(i[l]=et(s,t,i[l]));if(!hp(o))return i;for(let l of Object.getOwnPropertyNames(i))c.test(l)||(i[l]=et(o,t,i[l]));return i}function fE(e,t,r){return et(Y(e,t),t,Hr(e,r))}function hE(e,t,r){return et(Y(e,t),t,r)}function gE(e,t,r){let i=Hr(e,r);if(!$(i)||ce(e.items))return i;let[o,a]=[e.items,Math.max(e.items.length,i.length)];for(let s=0;s<a;s++)s<o.length&&(i[s]=et(o[s],t,i[s]));return i}function yE(e,t,r){let i=Hr(e,r);for(let o of e.anyOf){let a=et(o,t,W(i));if(F(o,t,a))return a}return i}function et(e,t,r){let i=Ne(e,t),o=e;switch(o[g]){case"Array":return cE(o,i,r);case"Date":return lE(o,i,r);case"Import":return pE(o,i,r);case"Intersect":return mE(o,i,r);case"Object":return uE(o,i,r);case"Record":return dE(o,i,r);case"Ref":return fE(o,i,r);case"This":return hE(o,i,r);case"Tuple":return gE(o,i,r);case"Union":return yE(o,i,r);default:return Hr(o,r)}}function ha(...e){return e.length===3?et(e[0],e[1],e[2]):et(e[0],[],e[1])}var Gt={};rt(Gt,{Delete:()=>OE,Format:()=>ga,Get:()=>SE,Has:()=>xE,Set:()=>bE,ValuePointerRootDeleteError:()=>Ms,ValuePointerRootSetError:()=>_s});var _s=class extends v{constructor(t,r,i){super("Cannot set root value"),this.value=t,this.path=r,this.update=i}},Ms=class extends v{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function Hf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*ga(e){if(e==="")return;let[t,r]=[0,0];for(let i=0;i<e.length;i++)e.charAt(i)==="/"?(i===0||(r=i,yield Hf(e.slice(t,r))),t=i+1):r=i;yield Hf(e.slice(t))}function bE(e,t,r){if(t==="")throw new _s(e,t,r);let[i,o,a]=[null,e,""];for(let s of ga(t))o[s]===void 0&&(o[s]={}),i=o,o=o[s],a=s;i[a]=r}function OE(e,t){if(t==="")throw new Ms(e,t);let[r,i,o]=[null,e,""];for(let a of ga(t)){if(i[a]===void 0||i[a]===null)return;r=i,i=i[a],o=a}if(Array.isArray(r)){let a=parseInt(o);r.splice(a,1)}else delete r[o]}function xE(e,t){if(t==="")return!0;let[r,i,o]=[null,e,""];for(let a of ga(t)){if(i[a]===void 0)return!1;r=i,i=i[a],o=a}return Object.getOwnPropertyNames(r).includes(o)}function SE(e,t){if(t==="")return e;let r=e;for(let i of ga(t)){if(r[i]===void 0)return;r=r[i]}return r}function IE(e,t){if(!L(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],i=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==i.length?!1:r.every(o=>Pn(e[o],t[o]))}function wE(e,t){return Ve(t)&&e.getTime()===t.getTime()}function CE(e,t){return!$(t)||e.length!==t.length?!1:e.every((r,i)=>Pn(r,t[i]))}function TE(e,t){return!gt(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,i)=>Pn(r,t[i]))}function PE(e,t){return e===t}function Pn(e,t){if(Ve(e))return wE(e,t);if(gt(e))return TE(e,t);if($(e))return CE(e,t);if(L(e))return IE(e,t);if(it(e))return PE(e,t);throw new Error("ValueEquals: Unable to compare value")}var Jf=K({type:j("insert"),path:Re(),value:ct()}),Yf=K({type:j("update"),path:Re(),value:ct()}),Xf=K({type:j("delete"),path:Re()}),gp=V([Jf,Yf,Xf]),ya=class extends v{constructor(t,r){super(r),this.value=t}};function Bs(e,t){return{type:"update",path:e,value:t}}function Qf(e,t){return{type:"insert",path:e,value:t}}function Zf(e){return{type:"delete",path:e}}function zf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ya(e,"Cannot diff objects with symbols")}function*EE(e,t,r){if(zf(t),zf(r),!us(r))return yield Bs(e,r);let i=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let a of o)E(t,a)||(yield Qf(`${e}/${a}`,r[a]));for(let a of i)E(r,a)&&(Pn(t,r)||(yield*Vs(`${e}/${a}`,t[a],r[a])));for(let a of i)E(r,a)||(yield Zf(`${e}/${a}`))}function*AE(e,t,r){if(!$(r))return yield Bs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*Vs(`${e}/${i}`,t[i],r[i]);for(let i=0;i<r.length;i++)i<t.length||(yield Qf(`${e}/${i}`,r[i]));for(let i=t.length-1;i>=0;i--)i<r.length||(yield Zf(`${e}/${i}`))}function*$E(e,t,r){if(!gt(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield Bs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*Vs(`${e}/${i}`,t[i],r[i])}function*vE(e,t,r){t!==r&&(yield Bs(e,r))}function*Vs(e,t,r){if(us(t))return yield*EE(e,t,r);if($(t))return yield*AE(e,t,r);if(gt(t))return yield*$E(e,t,r);if(it(t))return yield*vE(e,t,r);throw new ya(t,"Unable to diff value")}function yp(e,t){return[...Vs("",e,t)]}function LE(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function RE(e){return e.length===0}function bp(e,t){if(LE(t))return W(t[0].value);if(RE(t))return W(e);let r=W(e);for(let i of t)switch(i.type){case"insert":{Gt.Set(r,i.path,i.value);break}case"update":{Gt.Set(r,i.path,i.value);break}case"delete":{Gt.Delete(r,i.path);break}}return r}function Op(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Tn(t,r)?fa(t,r,i):i;if(!F(t,r,o))throw new da(t,o,Cn(t,r,o).First());return o}function Ks(e){return L(e)&&!$(e)}var ba=class extends v{constructor(t){super(t)}};function NE(e,t,r,i){if(!Ks(r))Gt.Set(e,t,W(i));else{let o=Object.getOwnPropertyNames(r),a=Object.getOwnPropertyNames(i);for(let s of o)a.includes(s)||delete r[s];for(let s of a)o.includes(s)||(r[s]=null);for(let s of a)xp(e,`${t}/${s}`,r[s],i[s])}}function kE(e,t,r,i){if(!$(r))Gt.Set(e,t,W(i));else{for(let o=0;o<i.length;o++)xp(e,`${t}/${o}`,r[o],i[o]);r.splice(i.length)}}function FE(e,t,r,i){if(gt(r)&&r.length===i.length)for(let o=0;o<r.length;o++)r[o]=i[o];else Gt.Set(e,t,W(i))}function jE(e,t,r,i){r!==i&&Gt.Set(e,t,i)}function xp(e,t,r,i){if($(i))return kE(e,t,r,i);if(gt(i))return FE(e,t,r,i);if(Ks(i))return NE(e,t,r,i);if(it(i))return jE(e,t,r,i)}function eh(e){return gt(e)||it(e)}function UE(e,t){return Ks(e)&&$(t)||$(e)&&Ks(t)}function Sp(e,t){if(eh(e)||eh(t))throw new ba("Only object and array types can be mutated at the root level");if(UE(e,t))throw new ba("Cannot assign due type mismatch of assignable values");xp(e,"",e,t)}var Oa=class extends v{constructor(t){super(t)}},Gs;(function(e){let t=new Map([["Assert",(a,s,c)=>(oa(a,s,c),c)],["Cast",(a,s,c)=>_i(a,s,c)],["Clean",(a,s,c)=>sa(a,s,c)],["Clone",(a,s,c)=>W(c)],["Convert",(a,s,c)=>pa(a,s,c)],["Decode",(a,s,c)=>Tn(a,s)?ua(a,s,c):c],["Default",(a,s,c)=>ha(a,s,c)],["Encode",(a,s,c)=>Tn(a,s)?fa(a,s,c):c]]);function r(a){t.delete(a)}e.Delete=r;function i(a,s){t.set(a,s)}e.Set=i;function o(a){return t.get(a)}e.Get=o})(Gs||(Gs={}));var Ip=["Clone","Clean","Default","Convert","Assert","Decode"];function DE(e,t,r,i){return e.reduce((o,a)=>{let s=Gs.Get(a);if(ce(s))throw new Oa(`Unable to find Parse operation \'${a}\'`);return s(t,r,o)},i)}function wp(...e){let[t,r,i,o]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?$(e[0])?[e[0],e[1],[],e[2]]:[Ip,e[0],e[1],e[2]]:e.length===2?[Ip,e[0],[],e[1]]:(()=>{throw new Oa("Invalid Arguments")})();return DE(t,r,i,o)}var T={};rt(T,{Assert:()=>oa,Cast:()=>_i,Check:()=>F,Clean:()=>sa,Clone:()=>W,Convert:()=>pa,Create:()=>Kt,Decode:()=>fp,Default:()=>ha,Diff:()=>yp,Edit:()=>gp,Encode:()=>Op,Equal:()=>Pn,Errors:()=>Cn,Hash:()=>mi,Mutate:()=>Sp,Parse:()=>wp,Patch:()=>bp,ValueErrorIterator:()=>Or});var hm={};rt(hm,{BLOCK_SLOT_PLACEMENT_PROPS:()=>sm,BLOCK_SLOT_ROLES:()=>Xh,BLUEPRINT_FORMATS:()=>pg,BlockDefinitionsSchema:()=>Xr,BlockEvaluationError:()=>va,BlockInvocationPropsSchema:()=>Dn,BlockSlotSchema:()=>Qh,BlueprintPagesSchema:()=>mg,BlueprintSchema:()=>dm,BlueprintVariantSchema:()=>ug,CANVASES:()=>bh,ChromeSchema:()=>Vp,ComponentValidationError:()=>yi,DEFAULT_CHART_CONCURRENCY:()=>Ig,DEFAULT_CHART_THEME_COLORS:()=>r$,DEFAULT_ERROR_CONFIG:()=>En,DEFAULT_VISUAL_DPI:()=>La,DesignSpacingSchema:()=>Bp,DesignSystemProperties:()=>kn,DesignSystemSchema:()=>Oh,DuplicateComponentError:()=>Ki,ERROR_EMOJIS:()=>di,FONT_URL_ALLOWLIST:()=>Ap,FeatureRequirementCollector:()=>uh,FontFamilyNameSchema:()=>Ht,FontRegistry:()=>zA,FontRegistryEntrySchema:()=>jp,FontRegistrySchema:()=>wr,FontSourceSchema:()=>Fp,JsonBlockDefinitionSchema:()=>Zh,JsonBlockEvaluator:()=>u$,MAX_RASTERIZE_BATCH_SLIDES:()=>PA,MAX_RASTERIZE_FONTS:()=>CA,MAX_RASTERIZE_FONT_BYTES:()=>TA,MAX_VISUAL_DPI:()=>Na,MIN_VISUAL_DPI:()=>Ra,MotifSchema:()=>Kp,POINTS_PER_PIXEL_96DPI:()=>zh,POPULAR_GOOGLE_FONTS:()=>Gh,PaletteSchema:()=>Dp,REMOTE_EXPORT_WARNING:()=>L$,RENDERER_DEPENDENCY_MISSING:()=>Xs,ROLE_SCALE_STEPS:()=>Gp,RendererRegistry:()=>fh,SAFE_FONTS:()=>nc,SERVICE_UNAVAILABLE_CODE:()=>fm,TYPE_ROLES:()=>Wi,TextCaseSchema:()=>Oi,TypeRoleNameSchema:()=>Up,TypeRoleSchema:()=>wt,TypeRolesSchema:()=>_p,TypographySchema:()=>Mp,UPSTREAM_OVERRIDES:()=>qh,UnknownPreservedComponentError:()=>zs,UnsupportedRendererFeatureError:()=>vp,WEIGHT_LABELS:()=>Vh,applyDocumentBlocksToSchema:()=>w$,applyExportMode:()=>t$,applyFontSubstitution:()=>rm,assertNever:()=>sh,assertRendererSupports:()=>dh,blockDependencies:()=>um,blockInvocationExample:()=>lg,blockInvocationPropsSchema:()=>ag,blockPointerKey:()=>xe,blockReferencesFromDocument:()=>C$,blockSlotBudgets:()=>f$,blockSlotEditorSchema:()=>fc,blockSlotFacts:()=>ng,blockSlotJsonSchema:()=>uc,blockSlotMarkdown:()=>ig,blockSlotRoles:()=>h$,blockSlotsEditorSchema:()=>og,blockSlotsJsonSchema:()=>pm,blockValueAt:()=>Un,blockWordCount:()=>cm,buildDefaultSubstitutionMap:()=>Hh,calculatePosition:()=>Mi,capsFormatting:()=>wh,chartFamilyResolver:()=>a$,chartFontFaceCss:()=>Yh,chartPointsPerPixel:()=>n$,chartRequestKey:()=>z$,clampVisualDpi:()=>wA,clearComponentNamesCache:()=>Sa,collectFontNamesFromDocx:()=>EA,collectFontNamesFromPptx:()=>AA,compareSemver:()=>hi,composeBlocksWithPlugins:()=>S$,convertToJsonSchema:()=>Zs,createBlockAuthoringSchema:()=>ka,createComponent:()=>Vi,createComponentSchema:()=>Gi,createComponentSchemaObject:()=>ec,createErrorConfig:()=>Ir,createJsonParseError:()=>fi,createLimiter:()=>Sg,createVersion:()=>Bi,cssFontFamily:()=>Jh,dedupeChartRequest:()=>J$,defaultSubstituteFor:()=>Wh,definitionsFor:()=>hg,designCanvas:()=>xh,designColors:()=>qp,detectFontFormat:()=>zr,diagnoseUnsupportedFeatures:()=>Rp,documentBlockMetadata:()=>d$,documentFontRegistry:()=>vA,exportSchemaToFile:()=>qi,extractStandardComponentNames:()=>ui,fetchGoogleFontSources:()=>Kh,fixSchemaReferences:()=>Rn,formatErrorMessage:()=>xr,formatErrorSummary:()=>Yr,getChartRequestStats:()=>K$,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>Ia,getUpstreamOverride:()=>QA,getValidationSummary:()=>Ys,groupErrorsByPath:()=>wa,instantiateBlueprint:()=>A$,isAllowedFontUrl:()=>Ws,isBlockRecord:()=>H,isBlueprint:()=>T$,isLiteralSchema:()=>Jr,isObjectSchema:()=>qt,isPrivateServiceUrl:()=>xg,isSafeFont:()=>bi,isUnionSchema:()=>xa,isValidSemver:()=>vn,isValidationSuccess:()=>Js,latestVersion:()=>ut,limitChartRequest:()=>H$,mergeFontRegistries:()=>LA,mergeWithDefaults:()=>v$,parseSemver:()=>$n,partitionDiagnostics:()=>mh,postJsonToService:()=>V$,readBlockDefinitions:()=>Qr,recordChartRetry:()=>q$,registerBlueprints:()=>P$,remoteExportNotice:()=>R$,rendererError:()=>Lp,rendererWarning:()=>ph,resetChartLimiters:()=>Y$,resetChartRequestStats:()=>G$,resolveBlockSlot:()=>gc,resolveComponentVersion:()=>gi,resolveDesignColor:()=>Wp,resolveMotif:()=>Ch,resolveServiceUrl:()=>U$,resolveTypeRoles:()=>Th,restructureNameDiscriminatedUnions:()=>Ca,rewriteFontFamilyName:()=>Pp,selectVariant:()=>fg,slotAt:()=>gg,synthesizeFamilyName:()=>kA,themeFontRegistry:()=>Bh,toAuthoredBlockPointer:()=>jn,transformValueError:()=>An,transformValueErrors:()=>tt,typeScaleSizes:()=>Ih,unionBranches:()=>Qs,validateBlockDefinitions:()=>yc,validateBlockInvocations:()=>Ji,validateBlueprint:()=>dg,validateCustomComponentProps:()=>Ln,validateDesignColors:()=>Ph,validateFontReferences:()=>NA,valueAt:()=>bg,withChartFontFaceCss:()=>l$,withChartTypography:()=>s$});var _E=new Set([1,4,6,16]),ME=2981146554;function th(e){let t=0,r=e.length,i=r-r%4;for(let o=0;o<i;o+=4)t=t+e.readUInt32BE(o)>>>0;if(i<r){let o=0,a=r-i;a>=1&&(o|=e[i]<<24),a>=2&&(o|=e[i+1]<<16),a>=3&&(o|=e[i+2]<<8),t=t+o>>>0}return t>>>0}function BE(e,t){if(e.platformID===1)return Buffer.from(t,"ascii");let r=Buffer.alloc(t.length*2);for(let i=0;i<t.length;i+=1)r.writeUInt16BE(t.charCodeAt(i),i*2);return r}function VE(e){let t=e.length,r=6+t*12,i=0;for(let s of e)i+=s.bytes.length;let o=Buffer.alloc(r+i);o.writeUInt16BE(0,0),o.writeUInt16BE(t,2),o.writeUInt16BE(r,4);let a=0;for(let s=0;s<t;s+=1){let c=e[s],l=6+s*12;o.writeUInt16BE(c.platformID,l),o.writeUInt16BE(c.encodingID,l+2),o.writeUInt16BE(c.languageID,l+4),o.writeUInt16BE(c.nameID,l+6),o.writeUInt16BE(c.bytes.length,l+8),o.writeUInt16BE(a,l+10),c.bytes.copy(o,r+a),a+=c.bytes.length}return o}function KE(e,t){if(e.length<12)return e;let r=e.readUInt32BE(0);if(!(r===65536||r===1330926671||r===1953658213||r===1954115633))return e;let o=e.readUInt16BE(4);if(o===0||e.length<12+o*16)return e;let a=[];for(let I=0;I<o;I+=1){let N=12+I*16,G=e.toString("ascii",N,N+4),qe=e.readUInt32BE(N+4),We=e.readUInt32BE(N+8),He=e.readUInt32BE(N+12);if(We+He>e.length)return e;a.push({tag:G,checksum:qe,offset:0,originalOffset:We,data:e.slice(We,We+He)})}let s=a.findIndex(I=>I.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 I=0;I<l;I+=1){let N=6+I*12,G=c.readUInt16BE(N),qe=c.readUInt16BE(N+2),We=c.readUInt16BE(N+4),He=c.readUInt16BE(N+6),te=c.readUInt16BE(N+8),P=c.readUInt16BE(N+10),Z=c.slice(p+P,p+P+te);m.push({platformID:G,encodingID:qe,languageID:We,nameID:He,bytes:Z})}let u=[];for(let I of m){let N=t(I);N.action!=="drop"&&(N.action==="set"&&(I.bytes=BE(I,N.value)),u.push(I))}m.length=0,m.push(...u);let f=VE(m);a[s]={...a[s],data:f,checksum:th(f)},a.sort((I,N)=>I.originalOffset-N.originalOffset);let O=12+a.length*16;for(let I of a)O=O+3&-4,I.offset=O,O+=I.data.length;let S=O+3&-4,w=Buffer.alloc(S);e.copy(w,0,0,12),w.writeUInt16BE(a.length,4);let x=[...a].sort((I,N)=>I.tag<N.tag?-1:I.tag>N.tag?1:0);for(let I=0;I<x.length;I+=1){let N=x[I],G=12+I*16;w.write(N.tag,G,4,"ascii"),w.writeUInt32BE(N.checksum,G+4),w.writeUInt32BE(N.offset,G+8),w.writeUInt32BE(N.data.length,G+12)}for(let I of a)I.data.copy(w,I.offset);let A=a.find(I=>I.tag==="head");if(A&&A.data.length>=12){w.writeUInt32BE(0,A.offset+8);let I=th(w),N=ME-I>>>0;w.writeUInt32BE(N,A.offset+8)}return w}function GE(e,t){if(e.length<12)return null;let r=e.readUInt16BE(4);for(let i=0;i<r;i+=1){let o=12+i*16;if(o+16>e.length)return null;if(e.toString("ascii",o,o+4)===t)return{offset:e.readUInt32BE(o+8),length:e.readUInt32BE(o+12)}}return null}function qs(e,t){let r=GE(e,"name");if(!r)return[];let i=r.offset;if(i+6>e.length)return[];let o=Math.min(i+r.length,e.length),a=e.readUInt16BE(i+2),s=i+e.readUInt16BE(i+4),c=Math.min(s,o),l=[];for(let p=0;p<a;p+=1){let m=i+6+p*12;if(m+12>c)break;let u=e.readUInt16BE(m),f=e.readUInt16BE(m+6);if(t&&!t.has(f))continue;let O=e.readUInt16BE(m+8),S=e.readUInt16BE(m+10),w=s+S;if(w+O>o)continue;let x=e.slice(w,w+O),A;if(u===1)A=x.toString("ascii");else{let I=Buffer.from(x);I.length%2===0&&I.swap16(),A=I.toString("utf16le")}l.push({platformID:u,nameID:f,value:A})}return l}function Tp(e){let t=[];for(let r of qs(e,qE)){let i=r.value.trim();i.length>0&&!t.includes(i)&&t.push(i)}return t}var qE=new Set([1,16]);function WE(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function Pp(e,t,r){let i=r&&r!=="Regular"?r:"",o=i?`${t} ${i}`:t,a=/[[\\](){}<>/%]/g,s=/^[\\x00-\\x7f]*$/.test(o),c=p=>p.replace(/\\s+/g,"").replace(a,"").replace(/[^\\x21-\\x7e]/g,""),l=i?`${c(t)}-${c(i)}`:c(t);return KE(e,p=>_E.has(p.nameID)?p.platformID===1&&!s?{action:"drop"}:p.nameID===6?{action:"set",value:l}:p.nameID===4?{action:"set",value:o}:{action:"set",value:t}:{action:"keep"})}var HE={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Ep(e,t){let r=HE[e];return r?{typographic:t?`${r} Italic`:r,legacy:WE(e>=600,t)}:null}var Ap=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function Ws(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:Ap.includes(t.hostname.toLowerCase())}function zr(e){if(e.length<4)return"unknown";let t=e[0],r=e[1],i=e[2],o=e[3];return t===0&&r===1&&i===0&&o===0||t===116&&r===114&&i===117&&o===101||t===116&&r===121&&i===112&&o===49?"ttf":t===79&&r===84&&i===84&&o===79?"otf":t===119&&r===79&&i===70&&o===70?"woff":t===119&&r===79&&i===70&&o===50?"woff2":e.length>=36&&e[34]===76&&e[35]===80?"eot":t===128&&r===1||e.length>=14&&e.slice(0,14).toString("ascii")==="%!PS-AdobeFont"?"pfb":"unknown"}var Hs=new Map;function xa(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function qt(e){return e.type==="object"&&"properties"in e}function Jr(e){return"const"in e}function Sr(e){return qt(e)?Object.keys(e.properties):[]}function It(e){if(Jr(e))return e.const}function ui(e){if(Hs.has(e))return Hs.get(e);let t=[];if("anyOf"in e&&Array.isArray(e.anyOf)){for(let r of e.anyOf)if(qt(r)){let i=r.properties?.name;if(i&&Jr(i)){let o=It(i);typeof o=="string"&&t.push(o)}}}else if(qt(e)){let r=e.properties?.name??e.properties?.type;if(r&&Jr(r)){let i=It(r);typeof i=="string"&&t.push(i)}}return Hs.set(e,t),t}function Sa(){Hs.clear()}function Ia(e){let t={};return"type"in e&&(t.type=String(e.type)),qt(e)&&(t.properties=Sr(e)),Jr(e)&&(t.literal=It(e)),t}function rh(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function zE(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!rh()}var En={includeEmojis:!rh(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:zE()};function Ir(e){return{...En,...e}}var di={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function xr(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function JE(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?YE(e):e.message?.includes("additionalProperties")?XE(e):e.message?.includes("Required property")?QE(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?ZE(e):r==="literal"?eA(e):r==="pattern"||r==="RegExp"?tA(e):`At ${i}: ${e.message}`}function YE(e){let t=e.path||"root",r=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(r&&typeof r=="object"){if("name"in r)return`Invalid component configuration for \'${r.name}\'. Check that all required fields are present.`;if("children"in r&&Array.isArray(r.children))return"Document is missing required \'name\' field."}return"Invalid document structure. Check required fields."}return t.includes("/children/")?r&&typeof r=="object"&&"name"in r?`Invalid component configuration for type \'${r.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 XE(e){let t=e.path||"root",r=e.value;if(typeof r=="object"&&r!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(r).filter(c=>!o.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${o.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function QE(e){let t=e.path||"root",r=e.message?.match(/Required property \'([^\']+)\'/);return r?`Missing required field \'${r[1]}\' at ${t}. This field is mandatory.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function ZE(e){let t=e.path||"root",r=String(e.type),i=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 ${r} but got ${i}`}function eA(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function tA(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 An(e,t,r){let i=Ir(r),o=JE(e,i),a={path:e.path||"root",message:xr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=rA(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=Mi(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function tt(e,t){let r=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=r)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push(An(a,t?.jsonString,void 0)))}return i}function Mi(e,t){try{let r=t.split("/").filter(Boolean);if(r.length===0)return{line:1,column:1};let o=`"${r[r.length-1]}"`,a=e.indexOf(o);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 rA(e,t){let{type:r,path:i}=e,o=String(r);if(o==="62"||o==="union")return i==="root"||i==="/"?\'Ensure the document has proper structure with a root "name" field\':i?.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(o==="string")return i?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(o==="number")return"Provide a numeric value";if(o==="boolean")return"Use true or false (without quotes)";if(o==="array")return"Provide an array of values using square brackets []";if(o==="object")return"Provide an object with key-value pairs using curly braces {}";if(o==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(It(e.schema)):"specific value"}`}function Yr(e){if(e.length===0)return"No errors";if(e.length===1)return e[0].message;let t=e.slice(0,3).map(r=>`${r.path}: ${r.message}`).join(", ");return e.length>3?`${t} and ${e.length-3} more...`:t}function wa(e){let t=new Map;for(let r of e){let i=r.path||"root",o=t.get(i)||[];o.push(r),t.set(i,o)}return t}function fi(e,t){let r=e.message.match(/position (\\d+)/),i=r?parseInt(r[1],10):0,o=1,a=1;if(i>0){let s=t.substring(0,i).split(`\n`);o=s.length,a=s[s.length-1].length+1}return{path:"root",message:`JSON Parse Error: ${e.message}`,code:"json_parse_error",line:o,column:a,suggestion:"Check for missing commas, quotes, or brackets"}}var nh=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function vn(e){return nh.test(e)}function $n(e){let t=e.match(nh);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 hi(e,t){let r=$n(e),i=$n(t);return r.major-i.major||r.minor-i.minor||r.patch-i.patch}function ut(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,r)=>hi(r,t)>0?r:t)}function Bi(e){return e}function Vi(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 r of t){if(!vn(r))throw new Error(`Component "${e.name}": invalid semver key "${r}". Expected format: major.minor.patch`);let i=e.versions[r];if(!i.propsSchema)throw new Error(`Component "${e.name}" version "${r}" requires a propsSchema`);if(!i.render||typeof i.render!="function")throw new Error(`Component "${e.name}" version "${r}" requires a render function`)}return e}function gi(e,t,r){let i=Object.keys(t);if(r){let a=t[r];if(!a)throw new Error(`Component "${e}" does not have version "${r}". Available versions: ${i.join(", ")}`);return a}let o=ut(i);return t[o]}var Ki=class ih extends Error{constructor(r){super(`Cannot register component "${r}": a component with this name is already registered. Component names must be unique within a document generator.`);R(this,"componentName");R(this,"code","DUPLICATE_COMPONENT");this.name="DuplicateComponentError",this.componentName=r,Error.captureStackTrace&&Error.captureStackTrace(this,ih)}},zs=class oh extends Error{constructor(r,i){let o=r.map(s=>`"${s}"`).join(", "),a=i.length?i.map(s=>`"${s}"`).join(", "):"(none)";super(`preserveCustomComponents lists unregistered component name(s): ${o}. Registered components: ${a}.`);R(this,"unknownNames");R(this,"registeredNames");R(this,"code","UNKNOWN_PRESERVED_COMPONENT");this.name="UnknownPreservedComponentError",this.unknownNames=[...r],this.registeredNames=[...i],Error.captureStackTrace&&Error.captureStackTrace(this,oh)}},yi=class extends Error{constructor(t,r){let i=r!==void 0?`\nProps: ${JSON.stringify(r,null,2)}`:"",o=`Document validation failed:\n${t.map(a=>` ${a.path}: ${a.message}`).join(`\n`)}${i}`;super(o);R(this,"errors");R(this,"props");this.name="ComponentValidationError",this.errors=t,this.props=r}};function $p(e,t,r){try{let i=T.Clone(t);if(r?.applyDefaults&&(i=T.Default(e,i)),r?.clean&&(i=T.Clean(e,i)),!T.Check(e,i)){let o=[...T.Errors(e,i)];return{valid:!1,errors:tt(o,{jsonString:r?.jsonString,maxErrors:r?.maxErrors||100})}}return{valid:!0,data:i}}catch(i){return{valid:!1,errors:[{path:"root",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}]}}}function Ln(e,t,r){let i=r?.componentName??"custom";try{let o=$p(e,t,{...r,clean:r?.clean??!0,applyDefaults:r?.applyDefaults??!0});return{...o,success:o.valid,data:o.data,componentName:i,isCustomComponent:!0}}catch(o){return{valid:!1,success:!1,errors:[{path:"props",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}],componentName:i,isCustomComponent:!0}}}function Js(e){return e.valid===!0&&e.data!==void 0}function Ys(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Yr(e.errors)}function sh(e,t){let r=nA(e);throw new Error(t?`Unhandled variant in ${t}: ${r}`:`Unhandled variant: ${r}`)}function nA(e){if(e===null||typeof e!="object")return String(e);let t=e.kind,r=e.type;if(typeof t=="string")return`kind="${t}"`;if(typeof r=="string")return`type="${r}"`;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}var vp=class ch extends Error{constructor(r){let{format:i,rendererId:o,diagnostics:a}=r,s=ah(a.map(l=>l.feature)),c=ah(a.map(l=>l.path));super(oA(i,o,a,s));R(this,"code","UNSUPPORTED_RENDERER_FEATURE");R(this,"format");R(this,"rendererId");R(this,"features");R(this,"paths");R(this,"diagnostics");this.name="UnsupportedRendererFeatureError",this.format=i,this.rendererId=o,this.features=s,this.paths=c,this.diagnostics=[...a],Error.captureStackTrace&&Error.captureStackTrace(this,ch)}},iA=class lh extends Error{constructor(r,i,o){let a=o.map(s=>`"${s}"`).join(", ");super(`Unknown ${r} renderer "${i}". Available renderers: ${a}.`);R(this,"code","UNKNOWN_RENDERER");R(this,"format");R(this,"rendererId");R(this,"availableIds");this.name="UnknownRendererError",this.format=r,this.rendererId=i,this.availableIds=[...o],Error.captureStackTrace&&Error.captureStackTrace(this,lh)}};function ah(e){return[...new Set(e)]}function oA(e,t,r,i){let o=i.map(s=>`"${s}"`).join(", "),a=r.map(s=>` - ${s.feature} at ${s.path}: ${s.message}`);return`The "${t}" ${e} renderer does not support ${i.length} required feature(s): ${o}.\n${a.join(`\n`)}`}function Lp(e,t,r){return{feature:e,path:t,severity:"error",message:r}}function ph(e,t,r){return{feature:e,path:t,severity:"warning",message:r}}function mh(e){let t=[],r=[];for(let i of e)i.severity==="error"?t.push(i):r.push(i);return{errors:t,warnings:r}}var uh=class{constructor(){R(this,"requirements",[]);R(this,"seen",new Set)}require(e,t,r){let i=`${e}\\0${t}`;this.seen.has(i)||(this.seen.add(i),this.requirements.push(r===void 0?{feature:e,path:t}:{feature:e,path:t,detail:r}))}list(){return this.requirements}features(){return[...new Set(this.requirements.map(e=>e.feature))]}isEmpty(){return this.requirements.length===0}};function Rp(e,t,r){let i=[];for(let o of e)t.has(o.feature)||i.push(Lp(o.feature,o.path,aA(o,r)));return i}function aA(e,t){let r=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${r} (${e.detail})`:r}function dh(e,t){let r=Rp(e,t.capabilities,t.id);if(r.length!==0)throw new vp({format:t.format,rendererId:t.id,diagnostics:r})}var fh=class{constructor(e,t){R(this,"renderers",new Map);R(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,r=this.renderers.get(t);if(!r)throw new iA(this.format,t,this.ids());try{return await r()}catch(i){throw sA(i,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(r){let o=r instanceof Error&&r.name===Xs&&r instanceof Error?r.packageName:void 0;return{...t,available:!1,reason:r instanceof Error?r.message:String(r),...o?{installHint:`pnpm add ${o}`}:{}}}}))}};function sA(e,t,r){let i=e instanceof Error?e.message:String(e);if(!/Cannot find (?:module|package)|ERR_MODULE_NOT_FOUND|Failed to resolve/i.test(i))return e instanceof Error?e:new Error(i);let a=cA(i),s=a??`the "${r}" backend`,c=new Error(`The "${r}" ${t} renderer requires ${s}, which is not installed. Install it with: pnpm add ${s}\nOriginal error: ${i}`);return c.name=Xs,a&&(c.packageName=a),c}var Xs="RendererDependencyMissingError";function cA(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var lA="Sheet1";var T6=`<?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="${lA}" sheetId="1" r:id="rId1"/></sheets></workbook>`;function gh(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 pA(e){return typeof e.properties?.version?.const=="string"}function mA(e){return Array.isArray(e.required)&&e.required.includes("name")}function uA(e){let t=new Map;for(let r of e){let i=gh(r),o=t.get(i);o?o.push(r):t.set(i,[r])}return t}function dA(e,t){let r=t.find(i=>!pA(i)&&typeof i.description=="string")??t.find(i=>typeof i.description=="string");return{const:e,type:"string",...r?{description:r.description}:{}}}function Ca(e){let t=new WeakSet;function r(i){if(typeof i!="object"||i===null||t.has(i))return;if(t.add(i),Array.isArray(i)){i.forEach(r);return}let o=i,a=o.anyOf,c=Array.isArray(a)&&a.length>=2&&a.every(l=>gh(l)!==void 0&&mA(l))&&o.properties===void 0&&o.allOf===void 0&&o.if===void 0&&o.required===void 0&&o.additionalProperties===void 0&&(o.type===void 0||o.type==="object")?uA(a):void 0;c&&c.size>=2&&(o.type="object",o.required=["name"],o.properties={name:{description:"Component or registered plugin to render.",anyOf:[...c.entries()].map(([l,p])=>dA(l,p))}},o.allOf=[...c.entries()].map(([l,p])=>({if:{properties:{name:{const:l}},required:["name"]},then:p.length===1?p[0]:{anyOf:p}})),delete o.anyOf);for(let l of Object.values(o))r(l)}r(e)}function Qs(e){if(typeof e!="object"||e===null)return[];let t=e;return Array.isArray(t.anyOf)?t.anyOf.filter(r=>typeof r=="object"&&r!==null):Array.isArray(t.allOf)?t.allOf.flatMap(r=>{let i=r?.then;if(typeof i!="object"||i===null)return[];let o=i.anyOf;return Array.isArray(o)?o.filter(a=>typeof a=="object"&&a!==null):[i]}):[]}function kp(e,t,r){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(i=>{typeof i=="object"&&i!==null&&kp(i,t,r)});return}e.$ref===t&&(e.$ref=r);for(let i of Object.values(e))typeof i=="object"&&i!==null&&kp(i,t,r)}}function Rn(e,t="ComponentDefinition"){let r=new Set(Object.keys(e.definitions??{})),i=s=>{let c=r.has(s)?s:t;return r.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||r.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 u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&r.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&o(u.items.$ref)){let f=u.items.$ref,O=i(f);u.items=O?{$ref:O}:{}}if(o(u.$ref)){let f=i(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&o(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function Zs(e,t={}){let{$schema:r="http://json-schema.org/draft-07/schema#",$id:i,title:o,description:a,definitions:s={},enrich:c}=t,l=JSON.parse(JSON.stringify(e));if(l.$id&&typeof l.$id=="string"&&/^T\\d+$/.test(l.$id)){let f=l.$id;delete l.$id,kp(l,f,"#")}let p={...s};function m(f,O=""){if(!(typeof f!="object"||f===null)){for(let[S,w]of Object.entries(f))if(w&&typeof w=="object"){let x=w;if(x.$id&&typeof x.$id=="string"){let A=x.$id;if(O!==`definitions.${A}`){let{$id:I,...N}=x;p[A]=N,f[S]={$ref:`#/definitions/${A}`},m(N,`definitions.${A}`);continue}}m(w,O?`${O}.${S}`:S)}}}m(l);let u={$schema:r};return i&&(u.$id=i),Object.assign(u,l),u.$schema=r,i&&(u.$id=i),o!==void 0&&(u.title=o),a!==void 0&&(u.description=a),Object.keys(p).length>0&&(u.definitions=p),Rn(u),c?.(u),Ca(u),u}function Gi(e,t,r,i,o="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 r.includes(e)&&(a.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${o}`}},i&&(a.definitions={[o]:JSON.parse(JSON.stringify(i))})),Rn(a,o),a.additionalProperties=!1,a}async function qi(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>od(Np(),1))).writeFile(t,o,"utf-8")}function ec(e,t){let r={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(r.$schema=n.Optional(n.String({format:"uri"}))),r.props=e.propsSchema,e.hasChildren&&t&&(r.children=n.Optional(n.Array(t))),n.Object(r,{additionalProperties:!1})}var nc=["Arial","Calibri","Cambria","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","Helvetica","Helvetica Neue","Menlo","Monaco"];function bi(e){let t=e.toLowerCase();return nc.some(r=>r.toLowerCase()===t)}var Ht=n.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"]}),Ta=n.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),ic=n.Boolean({description:"Whether this source is italic. Default false."}),fA=n.Object({kind:n.Literal("safe"),family:n.String({description:"A SAFE_FONTS name \\u2014 installed with Office."})},{additionalProperties:!1,description:"Office-installed font \\u2014 no embedding"}),hA=n.Object({kind:n.Literal("google"),family:n.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:n.Optional(n.Array(Ta,{description:"Weights to fetch. Default [400, 700]."})),italics:n.Optional(n.Boolean({description:"Include italic variants. Default false."}))},{additionalProperties:!1,description:"Google Fonts \\u2014 auto-fetched and embedded"}),gA=n.Object({kind:n.Literal("file"),path:n.String({description:"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file."}),weight:n.Optional(Ta),italic:n.Optional(ic)},{additionalProperties:!1,description:"Local font file to embed"}),yA=n.Object({kind:n.Literal("url"),url:n.String({description:"HTTPS URL of a TTF or OTF file."}),weight:n.Optional(Ta),italic:n.Optional(ic)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),bA=n.Object({kind:n.Literal("variable"),url:n.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:Ta,italic:n.Optional(ic),axes:n.Optional(n.Record(n.String(),n.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."}),OA=n.Object({kind:n.Literal("data"),data:n.String({description:"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size."}),weight:n.Optional(Ta),italic:n.Optional(ic)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Fp=n.Union([fA,hA,gA,OA,yA,bA],{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.\'}),xA=n.Union([n.Literal("sans"),n.Literal("serif"),n.Literal("mono"),n.Literal("display"),n.Literal("handwriting")],{description:"Broad category used for fallback selection"}),jp=n.Object({id:n.String({description:\'Registry key. By convention, match the display family name ("Inter", "Roboto Slab").\'}),family:n.String({description:"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id."}),category:n.Optional(xA),sources:n.Array(Fp,{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.*."}),wr=n.Array(jp,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),Wi=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],Up=n.Union(Wi.map(e=>n.Literal(e))),bh=["a4","letter","wide169","standard43"],Oi=n.Union([n.Literal("none"),n.Literal("upper"),n.Literal("smallCaps")]),Wt=n.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:"Six-digit hex or a theme color/palette token. References must resolve without cycles."}),Dp=n.Object({rule:n.Optional(Wt),textMuted:n.Optional(Wt),onPrimary:n.Optional(Wt),surfaceInverse:n.Optional(Wt),positive:n.Optional(Wt),negative:n.Optional(Wt),chart:n.Optional(n.Array(Wt,{minItems:1,maxItems:12}))},{additionalProperties:!1}),wt=n.Object({face:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),weight:n.Optional(n.Integer({minimum:100,maximum:900})),size:n.Optional(n.Number({minimum:5,maximum:200,description:"Explicit size in points; takes precedence over the canvas scale."})),lineHeight:n.Optional(n.Number({minimum:.5,maximum:3})),tracking:n.Optional(n.Number({description:"Tracking in hundredths of an em."})),case:n.Optional(Oi),color:n.Optional(Wt),spaceBefore:n.Optional(n.Number({minimum:0})),spaceAfter:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1}),_p=n.Object({eyebrow:n.Optional(wt),display:n.Optional(wt),stat:n.Optional(wt),quote:n.Optional(wt),label:n.Optional(wt),footer:n.Optional(wt),tableHeader:n.Optional(wt),tableCell:n.Optional(wt),chartLabel:n.Optional(wt),tracker:n.Optional(wt),source:n.Optional(wt)},{additionalProperties:!1}),tc=n.Object({base:n.Number({minimum:5,maximum:200}),ratio:n.Optional(n.Number({minimum:1,maximum:2})),baselinePt:n.Optional(n.Number({exclusiveMinimum:0,maximum:24}))},{additionalProperties:!1}),Mp=n.Object({roles:n.Optional(_p),scale:n.Optional(n.Object({a4:n.Optional(tc),letter:n.Optional(tc),wide169:n.Optional(tc),standard43:n.Optional(tc)},{additionalProperties:!1}))},{additionalProperties:!1}),rc=n.Object({safeAreaIn:n.Optional(n.Number({minimum:0})),gutterIn:n.Optional(n.Number({minimum:0})),columns:n.Optional(n.Integer({minimum:1,maximum:100})),rows:n.Optional(n.Integer({minimum:1,maximum:100}))},{additionalProperties:!1}),Bp=n.Object({basePt:n.Optional(n.Number({exclusiveMinimum:0})),blockGap:n.Optional(n.Object({tight:n.Optional(n.Number({minimum:0})),normal:n.Optional(n.Number({minimum:0})),loose:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),canvas:n.Optional(n.Object({a4:n.Optional(rc),letter:n.Optional(rc),wide169:n.Optional(rc),standard43:n.Optional(rc)},{additionalProperties:!1}))},{additionalProperties:!1}),Nn=n.Object({type:n.Optional(Up),color:n.Optional(Wt),fill:n.Optional(Wt),rule:n.Optional(n.Object({weightPt:n.Optional(n.Number({minimum:0})),color:n.Optional(Wt)},{additionalProperties:!1})),padPt:n.Optional(n.Number({minimum:0})),alignment:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")]))},{additionalProperties:!1}),Vp=n.Object({runningHead:n.Optional(Nn),tracker:n.Optional(Nn),actionTitle:n.Optional(Nn),keyTakeaways:n.Optional(Nn),sourceLine:n.Optional(Nn),confidentialFooter:n.Optional(Nn),logoSlot:n.Optional(Nn),cover:n.Optional(Nn)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),Kp=n.Object({kind:n.Union([n.Literal("none"),n.Literal("rule"),n.Literal("corner"),n.Literal("band")]),color:n.Optional(Wt),weightPt:n.Optional(n.Number({minimum:0})),placement:n.Optional(n.Union([n.Literal("top"),n.Literal("bottom"),n.Literal("left"),n.Literal("right"),n.Literal("topLeft"),n.Literal("topRight"),n.Literal("bottomLeft"),n.Literal("bottomRight")]))},{additionalProperties:!1,description:"At most one motif. Rendering consumers land in #361."}),kn={palette:n.Optional(Dp),typography:n.Optional(Mp),spacing:n.Optional(Bp),chrome:n.Optional(Vp),motif:n.Optional(Kp)},Oh=n.Object(kn,{additionalProperties:!1});function xh(e,t){if(e==="docx")return t==="LETTER"?"letter":"a4";let r=typeof t=="object"?t.width/t.height:4/3;return Math.abs(r-16/9)<Math.abs(r-4/3)?"wide169":"standard43"}var Gp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function Sh(e,t){if(t===0)return e.base;let r=e.baselinePt??4,i=e.base*(e.ratio??1.25)**t;return Math.max(5,Math.min(200,Math.round(i/r)*r))}var yh={from:-2,to:5};function Ih(e){let t=new Set;for(let r=yh.from;r<=yh.to;r+=1)t.add(Sh(e,r));return[...t].sort((r,i)=>r-i)}function SA(e){let t={};for(let[r,i]of Object.entries(e??{}))typeof i=="string"&&(t[r]=i);return t}function wh(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function Ch(e){return e&&e.kind!=="none"?e:void 0}function Th(e,t,r){let i=e.typography?.scale?.[t],o={};for(let a of Wi){let s=e.typography?.roles?.[a];s&&(o[a]={...s,size:s.size??(i?Sh(i,Gp[a]):r)})}return o}function qp(e,t){return{...e,...SA(t)}}function Wp(e,t){let r=new Set,i=e;for(;i!==void 0&&!r.has(i);)if(!i.startsWith("#")&&Object.hasOwn(t,i))r.add(i),i=t[i];else return/^#?[0-9a-f]{6}$/i.test(i)?i.replace(/^#/,""):void 0}function Ph(e,t){let r=qp(t,e.palette),i=Object.entries(e.palette??{}).flatMap(([o,a])=>Array.isArray(a)?a.map((s,c)=>[`palette.${o}[${c}]`,s]):[[`palette.${o}`,a]]);for(let[o,a]of Object.entries(e.typography?.roles??{}))a.color&&i.push([`typography.roles.${o}.color`,a.color]);for(let[o,a]of i)if(a&&!Wp(a,r))throw new Error(`Unresolvable theme color at ${o}: "${a}" (unknown token or cycle)`)}function oc(e){return/^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(e)}var IA=[{id:"scaffold-marker",kind:"scaffold-marker",expression:/\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}/},{id:"lorem-ipsum",kind:"filler",expression:/lorem\\s+ipsum/i},{id:"your-x-here",kind:"filler",expression:/\\byour\\b[^.!?\\n]{0,40}?\\bhere\\b/i},{id:"goes-here",kind:"filler",expression:/\\b(?:goes\\s+here|go\\s+here|(?:text|title|subtitle|content|image|logo|caption|name)\\s+here)\\b/i},{id:"click-to-add",kind:"filler",expression:/\\bclick\\s+to\\s+(?:add|edit)\\b/i},{id:"bracketed",kind:"filler",expression:/^\\[[^[\\]\\n]*[A-Za-z][^[\\]\\n]*\\]$/},{id:"debris",kind:"filler",expression:/^(?:todo|fixme|x{3,}|placeholder|sample\\s+text|dummy\\s+text|insert\\s+text)$/i}];var j6=IA.map(e=>e.id);var La=200,Ra=36,Na=600;function wA(e){return typeof e!="number"||!Number.isFinite(e)?La:Math.min(Na,Math.max(Ra,Math.round(e)))}var CA=32,TA=8*1024*1024,PA=32,Uh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),Dh=new Set(["heading","body","mono","light"]),_h=new Set(["fontRegistry"]);function tm(e,t,r){if(e!=null){if(typeof e=="string"){if(r&&(Uh.has(r)||Dh.has(r))){let i=e.trim();i.length>0&&t.add(i)}return}if(Array.isArray(e)){for(let i of e)tm(i,t,r);return}if(typeof e=="object"){let i=e.fonts;if(r==="theme"&&i&&typeof i=="object"){for(let[o,a]of Object.entries(i))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[o,a]of Object.entries(e))_h.has(o)||tm(a,t,o)}}}function zi(e){let t=new Set;return tm(e,t),t}var EA=zi,AA=zi;function $A(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 Mh(e,t){if(!e||typeof e!="object")return[];let r=e[t];return Array.isArray(r)?r.filter($A):[]}function vA(e){return!e||typeof e!="object"?[]:Mh(e.props,"fontRegistry")}function Bh(e){return Mh(e,"fontRegistry")}function LA(...e){let t=[];for(let r of e)for(let i of r??[]){let o=i.family.toLowerCase(),a=i.id.toLowerCase();for(let s=t.length-1;s>=0;s--)t[s].family.toLowerCase()===o&&t[s].id.toLowerCase()===a&&t.splice(s,1);t.push(i)}return t}function RA(e){let t=new Set;for(let r of e??[])t.add(r.family.toLowerCase()),t.add(r.id.toLowerCase());return t}function NA(e){let t=RA(e.registeredEntries),r=[],i=[],o=[];for(let a of e.referencedNames){if(bi(a)||t.has(a.toLowerCase())){r.push(a);continue}i.push(a),o.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: ${nc.join(", ")}.`})}return{resolved:r,unresolved:i,warnings:o}}var Vh={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function kA(e,t,r){if(t==null)return{family:e,bold:!1,italic:r,nonCanonicalWeight:!1};if(t===400)return{family:e,bold:!1,italic:r,nonCanonicalWeight:!1};if(t===700)return{family:e,bold:!0,italic:r,nonCanonicalWeight:!1};let i=Vh[t];if(!i)return{family:e,bold:t>=600,italic:r,nonCanonicalWeight:!0};let o=r?` ${i} Italic`:` ${i}`;return{family:`${e}${o}`,bold:!1,italic:!1,nonCanonicalWeight:!1}}var ac=5*1024*1024;function FA(e){let t=e.data.trim(),r;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");r=t.slice(s+1)}else r=t;if(Math.floor(r.length*3/4)>ac)throw new Error(`Font data payload exceeds ${ac} byte limit`);let o=Buffer.from(r,"base64");if(o.length===0)throw new Error("Decoded font buffer is empty");if(o.length>ac)throw new Error(`Font data payload exceeds ${ac} byte limit`);let a=zr(o);if(a==="unknown")throw new Error("Decoded font buffer is not a recognized font (expected TTF/OTF/WOFF/WOFF2)");return{data:o,weight:e.weight??400,italic:e.italic??!1,format:a}}var jA="Mozilla/4.0";async function Eh(e,t){let r=new AbortController,i=setTimeout(()=>r.abort(),t.timeoutMs??5e3);try{return await(t.fetcher??fetch)(e,{headers:t.headers,signal:r.signal})}finally{clearTimeout(i)}}function UA(e,t,r){let i=encodeURIComponent(e).replace(/%20/g,"+"),o=[...t].sort((s,c)=>s-c);if(r){let s=o.flatMap(c=>[`0,${c}`,`1,${c}`]).join(";");return`https://fonts.googleapis.com/css2?family=${i}:ital,wght@${s}&display=swap`}let a=o.join(";");return`https://fonts.googleapis.com/css2?family=${i}:wght@${a}&display=swap`}function DA(e){let t=[],r=/@font-face\\s*\\{([^}]*)\\}/g,i;for(;(i=r.exec(e))!==null;){let o=i[1],a=o.match(/src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/[^)]+\\.ttf)\\)/);if(!a)continue;let s=o.match(/font-weight:\\s*(\\d+)/),c=o.match(/font-style:\\s*italic/);t.push({weight:s?parseInt(s[1],10):400,italic:!!c,ttfUrl:a[1]})}return t}function Ah(e,t,r){return`google|${e}|${t}|${r?"i":"r"}`}async function Kh(e){let t=e.weights?.length?e.weights:[400,700],r=e.italics??!1,i=[],o=[],a=[];for(let m of t)a.push({weight:m,italic:!1}),r&&a.push({weight:m,italic:!0});let s=[];for(let m of a){let u=Ah(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){o.push({data:f,weight:m.weight,italic:m.italic,format:zr(f)});continue}let O=await e.diskCache?.get(u);if(O){e.memoryCache?.set(u,O),o.push({data:O,weight:m.weight,italic:m.italic,format:zr(O)});continue}s.push(m)}if(s.length===0)return{sources:o,warnings:i};let c=s.some(m=>m.italic),l=UA(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await Eh(l,{headers:{"User-Agent":jA},timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!m.ok)return i.push(`Google Fonts CSS fetch for "${e.family}" returned ${m.status}`),{sources:o,warnings:i};let u=await m.text();p=DA(u)}catch(m){return i.push(`Google Fonts CSS fetch for "${e.family}" failed: ${m.message}`),{sources:o,warnings:i}}for(let m of s){let u=p.find(f=>f.weight===m.weight&&f.italic===m.italic);if(!u){i.push(`Google Fonts "${e.family}" missing weight ${m.weight}${m.italic?" italic":""}`);continue}try{let f=await Eh(u.ttfUrl,{timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!f.ok){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} returned ${f.status}`);continue}let O=await f.arrayBuffer(),S=Buffer.from(O),w=Ah(e.family,m.weight,m.italic);e.memoryCache?.set(w,S),await e.diskCache?.set(w,S),o.push({data:S,weight:m.weight,italic:m.italic,format:zr(S)})}catch(f){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:o,warnings:i}}function _A(e,t,r){return`url|${e}|${t}|${r?"i":"r"}`}async function MA(e){if(!Ws(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=_A(e.url,e.weight,e.italic),r=e.memoryCache?.get(t);if(r)return{source:{data:r,weight:e.weight,italic:e.italic,format:zr(r)},warnings:[]};let i=await e.diskCache?.get(t);if(i)return e.memoryCache?.set(t,i),{source:{data:i,weight:e.weight,italic:e.italic,format:zr(i)},warnings:[]};let o=new AbortController,a=setTimeout(()=>o.abort(),e.fetchTimeoutMs??1e4);try{let s=e.fetcher??fetch,c=await s(e.url,{signal:o.signal,redirect:"manual"}),l=0;for(;c.status>=300&&c.status<400&&c.status!==304;){let O=c.headers.get("location");if(!O)return{warnings:[`URL font fetch "${e.url}" ${c.status} with no Location header`]};let S=new URL(O,e.url).toString();if(!Ws(S))return{warnings:[`URL font fetch "${e.url}" redirected to disallowed host: ${S}`]};if(++l>3)return{warnings:[`URL font fetch "${e.url}" too many redirects`]};c=await s(S,{signal:o.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),u=zr(m);if(u==="unknown"||m.length<512)return{warnings:[`URL font fetch "${e.url}" returned ${m.length} bytes of ${u} \\u2014 not a TTF/OTF. Skipping.`]};let f=m;return e.memoryCache?.set(t,f),await e.diskCache?.set(t,f),{source:{data:f,weight:e.weight,italic:e.italic,format:u},warnings:[]}}catch(s){return{warnings:[`URL font fetch "${e.url}" failed: ${s.message}`]}}finally{clearTimeout(a)}}var $h=12,vh=16;function BA(e,t){if(e.length<$h)return null;let r=e.readUInt32BE(0);if(r!==65536&&r!==1330926671)return null;let i=e.readUInt16BE(4);for(let o=0;o<i;o++){let a=$h+o*vh;if(a+vh>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 VA(e){let t=BA(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function KA(e,t,r,i){let o=[],a=VA(e);a!=null&&a!==t&&o.push({code:"WEIGHT_CLASS_MISMATCH",message:`Font "${i}" weight ${t}: OS/2.usWeightClass reports ${a}. Likely a defective redistribution \\u2014 consider adding an upstream override.`});let s=Tp(e);s.length>0&&!s.includes(i.trim())&&o.push({code:"FAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name table declares ${s.map(u=>`"${u}"`).join(" / ")}, not "${i}". Referencing runs will not resolve this face.`});let c=Ep(t,r);if(!c)return o;let l=c.typographic,p=c.legacy,m=qs(e,new Set([2,17]));for(let u of m)u.nameID===17&&u.value!==l&&o.push({code:"SUBFAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name record (platform ${u.platformID}) nameID 17 = "${u.value}", expected "${l}".`}),u.nameID===2&&u.value!==p&&o.push({code:"LEGACY_SUBFAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name record (platform ${u.platformID}) nameID 2 = "${u.value}", expected "${p}".`});return o}var GA=new Set([65536,1330926671,1953658213,1954115633]),Hp=12,Lh=16;function qA(e,t,r,i){let o=`Font "${i}" weight ${t}${r?" italic":""}`,a=f=>({code:"FONT_UNREADABLE",message:`${o}: ${f} The face will not resolve; text referencing it renders in a fallback.`});if(e.length<Hp)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!GA.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=Hp+c*Lh;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 f=0;f<c;f+=1){let O=Hp+f*Lh,S=e.toString("ascii",O,O+4),w=e.readUInt32BE(O+8),x=e.readUInt32BE(O+12);if(w+x>e.length)return a(`its "${S}" table runs to byte ${w+x} but the file is ${e.length} bytes \\u2014 truncated.`);p.add(S)}for(let f of["name","head"])if(!p.has(f))return a(`it has no "${f}" table.`);let m=p.has("glyf")&&p.has("loca"),u=p.has("CFF ")||p.has("CFF2");return!m&&!u?a(\'it carries no glyph outlines (neither "glyf" + "loca" nor "CFF ").\'):qs(e).length===0?a(\'its "name" table carries no readable records.\'):null}var WA=class{constructor(e={}){R(this,"store",new Map);R(this,"bytes",0);R(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 r=this.store.get(e);for(r&&(this.bytes-=r.byteLength),this.store.set(e,t),this.bytes+=t.byteLength;this.bytes>this.maxBytes&&this.store.size>0;){let i=this.store.keys().next().value;if(!i)break;let o=this.store.get(i);this.store.delete(i),o&&(this.bytes-=o.byteLength)}}size(){return this.store.size}};function HA(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let r=Tp(e.data);if(r.length===0||r.includes(t))return e;let i=Ep(e.weight,e.italic)?.legacy;return{...e,data:Pp(e.data,t,i)}}var zA=class{constructor(e={}){R(this,"index");R(this,"cache");R(this,"opts");R(this,"memoryCache");R(this,"diskCache");R(this,"fileLoader");R(this,"variableLoader");this.opts=e.opts??{},this.index=new Map,this.cache=new Map,this.memoryCache=new WA,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 r of e)t.push(await this.resolve(r));return t}async resolve(e){let t=e.toLowerCase(),r=this.cache.get(t);if(r)return r;let i=this.index.get(t),o;return i?o=await this.materializeEntry(i):bi(e)?o={family:e,sources:[],warnings:[]}:o={family:e,sources:[],warnings:[`Font "${e}" is not registered and not in SAFE_FONTS; will rely on host fallback.`]},this.cache.set(t,o),o}async materializeEntry(e){let t=[],r=[];for(let i of e.sources)try{let o=await this.materializeSource(i,r);for(let a of o){let s=a.format==="ttf"||a.format==="otf",c=s?qA(a.data,a.weight,a.italic,e.family):null;if(c){r.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=HA(a,e.family);if(s)for(let p of KA(l.data,l.weight,l.italic,e.family))r.push(`[FONT_METADATA_DEFECT:${p.code}] ${p.message}`);t.push(l)}}catch(o){r.push(`Font "${e.family}" source (${i.kind}) failed: ${o.message}`)}return{family:e.family,sources:t,warnings:r}}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[FA({data:e.data,weight:e.weight,italic:e.italic})];case"google":{let r=this.opts.googleFonts;if(r?.enabled===!1)return t.push(`Google Fonts fetch disabled \\u2014 skipping "${e.family}".`),[];let{sources:i,warnings:o}=await Kh({family:e.family,weights:e.weights??[400,700],italics:e.italics??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return t.push(...o),i}case"url":{let r=this.opts.googleFonts,{source:i,warnings:o}=await MA({url:e.url,weight:e.weight??400,italic:e.italic??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return o&&t.push(...o),i?[i]:[]}case"variable":{if(!this.variableLoader)return t.push(`kind:"variable" source for "${e.url}" requires a variableLoader (Node-only); skipping.`),[];let r=this.opts.googleFonts,{source:i,warnings:o}=await this.variableLoader({url:e.url,weight:e.weight,italic:e.italic??!1,axes:e.axes,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return o&&t.push(...o),i?[i]:[]}default:throw new Error(`Unknown font source kind: ${e.kind}`)}}},Gh=[{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}],JA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",YA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function XA(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(i=>({kind:"variable",url:JA,weight:i,italic:!1})),r=e.map(i=>({kind:"variable",url:YA,weight:i,italic:!0}));return[...t,...r]}var qh={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:XA()}};function QA(e){return qh[e.toLowerCase()]}function rm(e,t){let r=new Map,i=pc(e,t,r),o=[];for(let[a,s]of r)o.push({from:a,to:s});return{doc:i,substitutions:o}}function pc(e,t,r,i){if(e==null)return e;if(typeof e=="string")return i&&(Uh.has(i)||Dh.has(i))?zp(e,t,r):e;if(Array.isArray(e))return e.map(o=>pc(o,t,r,i));if(typeof e=="object"){let o={};for(let[a,s]of Object.entries(e)){if(_h.has(a)){o[a]=s;continue}if(i==="theme"&&a==="fonts"&&s&&typeof s=="object"){let c={};for(let[l,p]of Object.entries(s))if(typeof p=="string")c[l]=zp(p,t,r);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:zp(m,t,r)}:pc(p,t,r,l)}else c[l]=p;o[a]=c;continue}o[a]=pc(s,t,r,a)}return o}return e}function zp(e,t,r){let i=e.trim();if(i.length===0||bi(i))return e;let o=i.toLowerCase();for(let[a,s]of Object.entries(t))if(a.toLowerCase()===o)return r.set(i,s),s;return e}var ZA={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"},e$={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function Wh(e){let t=e.trim();for(let[i,o]of Object.entries(ZA))if(i.toLowerCase()===t.toLowerCase())return o;let r=Gh.find(i=>i.family.toLowerCase()===t.toLowerCase());if(r){let i=e$[r.category];if(i)return i}return"Calibri"}function Hh(e){let t={};for(let r of e){let i=r.trim();i.length!==0&&(bi(i)||t[i]||(t[i]=Wh(i)))}return t}function t$(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...zi(e.doc),...zi(e.theme)])].filter(f=>!bi(f.trim())),u=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:u}}let r=new Set([...zi(e.doc),...zi(e.theme)]),o={...Hh(r),...e.fonts?.substitution??{}},a=rm(e.doc,o),s=rm(e.theme,o),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,u])=>`${m} \\u2192 ${u}`).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 r$=["primary","secondary","accent","accent4","accent5","accent6"],zh=.75;function n$(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?zh:t/e}var i$=new Set(["georgia","times new roman","cambria"]),o$=new Set(["consolas","courier new","menlo","monaco"]);function Jh(e,t){let r=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&i$.has(e.toLowerCase())?"serif":t===void 0&&o$.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${r}`}function a$(e){let t=new Map(Bh(e).map(r=>[r.family.toLowerCase(),r.category]));return r=>Jh(r,t.get(r.toLowerCase()))}function Pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sr(e,t){if(e!==void 0&&!Pa(e))return e;let r=Pa(e)?{...e}:{};for(let[i,o]of Object.entries(t)){if(o===void 0)continue;let a=r[i];a===void 0?r[i]=Pa(o)?sr(void 0,o):o:Pa(a)&&Pa(o)&&(r[i]=sr(a,o))}return r}function Rh(e,t){return Array.isArray(e)?e.map(r=>sr(r,t)):sr(e,t)}function Nh(e){return e===void 0?void 0:String(e)}function s$(e,t,r){let i=m=>`${Math.round(m/r*10)/10}px`,o=i(t.labelPt),a=i(t.sourcePt),s={fontSize:o,color:t.mutedColor},c={fontSize:a,color:t.mutedColor},l={fontSize:o,color:t.textColor,fontWeight:Nh(t.labelWeight)},p={labels:{style:s},title:{style:s}};return{...e,chart:sr(e.chart,{style:{fontFamily:t.bodyFamily}}),title:sr(e.title,{style:{fontFamily:t.headingFamily,fontSize:i(t.titlePt),fontWeight:Nh(t.titleWeight),color:t.textColor}}),subtitle:sr(e.subtitle,{style:s}),caption:sr(e.caption,{style:c}),xAxis:Rh(e.xAxis,p),yAxis:Rh(e.yAxis,p),legend:sr(e.legend,{itemStyle:l}),plotOptions:sr(e.plotOptions,{series:{dataLabels:{style:l}}}),credits:sr(e.credits,{enabled:!1,style:c})}}var c$={ttf:{mime:"font/ttf",format:"truetype"},otf:{mime:"font/otf",format:"opentype"},woff:{mime:"font/woff",format:"woff"},woff2:{mime:"font/woff2",format:"woff2"}};function Yh(e,t){let r=new Set(t.map(i=>i.toLowerCase()));return e.filter(i=>r.has(i.family.toLowerCase())).map(i=>{let{mime:o,format:a}=c$[i.format??"ttf"];return`@font-face{font-family:"${i.family.replace(/["\\\\]/g,"\\\\$&")}";font-weight:${i.weight};font-style:${i.italic?"italic":"normal"};src:url(data:${o};base64,${i.data}) format("${a}")}`}).join(`\n`)}function l$(e,t,r){let i=Yh(t,r);if(!i)return e;let o=e.resources?.css;return{...e,resources:{...e.resources,css:o?`${i}\n${o}`:i}}}var Xh=["actionTitle","takeaway","source","tracker","footer"],Qh=n.Recursive(e=>n.Object({type:n.Union(["string","number","integer","boolean","object","array","component"].map(t=>n.Literal(t)),{description:"Content type accepted by this slot. Use component for a document component or registered plugin."}),description:n.Optional(n.String({description:"Explain this slot\\u2019s content and purpose to authors."})),required:n.Optional(n.Boolean({description:"Require a value when no default is provided. Defaults to false."})),default:n.Optional(n.Unknown({description:"Value used when the caller omits this slot. Must satisfy the slot\\u2019s type and constraints."})),enum:n.Optional(n.Array(n.Union([n.String(),n.Number(),n.Boolean()]),{minItems:1,description:"Allowed scalar values for this slot."})),minItems:n.Optional(n.Integer({minimum:0,description:"Minimum number of array entries, inclusive."})),maxItems:n.Optional(n.Integer({minimum:0,description:"Maximum number of array entries, inclusive."})),minLength:n.Optional(n.Integer({minimum:0,description:"Minimum string length in characters, inclusive."})),maxLength:n.Optional(n.Integer({minimum:0,description:"Maximum string length in characters, inclusive."})),minimum:n.Optional(n.Number({description:"Minimum numeric value, inclusive."})),maximum:n.Optional(n.Number({description:"Maximum numeric value, inclusive."})),maxWords:n.Optional(n.Integer({minimum:1,description:"Maximum whitespace-separated word count. Exceeding it fails validation."})),oneLine:n.Optional(n.Boolean({description:"Reject newline characters in string values. Does not prevent visual line wrapping."})),items:n.Optional({...e,description:"Slot type and constraints for each array entry."}),properties:n.Optional(n.Record(n.String(),e,{description:"Named child slots accepted by an object slot. Undeclared properties are rejected."})),role:n.Optional(n.Union(Xh.map(t=>n.Literal(t)),{description:"Content role for quality profiles: actionTitle, takeaway, source, tracker or footer. A profile may require or measure it; the theme only styles it."}))},{additionalProperties:!1}),{$id:"BlockSlot"}),Zh=n.Unsafe(n.Object({description:n.Optional(n.String({description:"Describe what this reusable block renders and when to use it."})),slots:n.Record(n.String(),Qh,{description:"Named inputs and their types, defaults and constraints. Use an empty object for a block with no inputs."}),body:n.Array(n.Unknown(),{description:"Components and binding directives expanded in order when this block is invoked."}),section:n.Optional(n.Object({tracker:n.Optional(n.Unknown({description:"Section tracker value or binding, available to headers and footers through $context at /section/tracker."})),header:n.Optional(n.Array(n.Unknown(),{description:"Header component templates. Explicit header settings on the section take precedence."})),footer:n.Optional(n.Array(n.Unknown(),{description:"Footer component templates. Explicit footer settings on the section take precedence."})),pageBreak:n.Optional(n.Boolean({description:"Start the containing section on a new page. An explicit section pageBreak setting takes precedence."})),scope:n.Optional(n.Union([n.Literal("section"),n.Literal("following")],{description:"Apply header/footer templates to this section only, or inherit them in following sections. Defaults to section."}))},{additionalProperties:!1,description:"DOCX section tracker, header/footer templates and page-break behavior. Place this block at the section boundary."})),slide:n.Optional(n.Object({background:n.Optional(n.Unknown({description:"Slide background (color, gradient or image) or a binding. A background the slide states itself takes precedence."})),grid:n.Optional(n.Unknown({description:"Grid configuration merged over the presentation grid when resolving grid placements in this block\\u2019s body."})),notes:n.Optional(n.Unknown({description:"Speaker notes or a binding. Notes the slide states itself take precedence."}))},{additionalProperties:!1,description:"PPTX slide background, grid and notes supplied by this block. Invoke the block as a direct child of a slide."}))},{additionalProperties:!1})),Xr=n.Record(n.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),Zh,{description:"Document-local JSON block definitions. Names are not built into the engine."}),Dn=n.Object({ref:n.String({minLength:1,description:"Name in this document\\u2019s props.blocks."}),slots:n.Optional(n.Record(n.String(),n.Unknown(),{description:"Input values keyed by the slot names declared in the referenced block definition."}))},{additionalProperties:!1});function uc(e){let{oneLine:t,properties:r,items:i,role:o,...a}=e;return delete a.required,delete a.maxWords,e.type==="component"?{type:"object",properties:{name:{type:"string"}},required:["name"],description:e.description}:{...a,...t&&{pattern:"^[^\\\\r\\\\n]*$"},...i&&{items:uc(i)},...r&&{properties:Object.fromEntries(Object.entries(r).map(([s,c])=>[s,uc(c)])),required:Object.entries(r).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var om={$slot:{keys:["$slot","default","props"],result:"dynamic"},$item:{keys:["$item","default","props"],result:"dynamic"},$theme:{keys:["$theme","default"],result:"dynamic"},$context:{keys:["$context","default"],result:"dynamic"},$count:{keys:["$count"],result:"number"},$if:{keys:["$if","then","else"],result:"dynamic"},$each:{keys:["$each","template"],result:"array"},$join:{keys:["$join","separator","keepEmpty"],result:"string"},$measure:{keys:["$measure","fraction","unit"],result:"number"}},am=["$item","$slot","$context","$theme"],va=class extends Error{constructor(e){super(e.map(t=>`${t.path}: ${t.message}`).join(`\n`)),this.issues=e,this.name="BlockEvaluationError"}},H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),xe=e=>e.replace(/~/g,"~0").replace(/\\//g,"~1"),Ct=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Un(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let r=e;for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(!H(r)&&!Array.isArray(r)||!Ct(r,o))return;r=r[o]}return r}function jn(e,t){let r;for(let i of Object.keys(e))(t===i||t.startsWith(`${i}/`))&&(r===void 0||i.length>r.length)&&(r=i);return r===void 0?t:`${e[r]}${t.slice(r.length)}`}var sm=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],cm=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,Jp=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),Fn=(e,t,r)=>{throw new va([{path:e,code:t,message:r}])};function gc(e,t,r,i){let o=t===void 0&&e.default!==void 0?structuredClone(e.default):t;if(o===void 0){e.required&&i.push({path:r,code:"block_required_slot",message:"Required block slot is missing."});return}if(!(e.type==="array"?Array.isArray(o):e.type==="component"?H(o)&&typeof o.name=="string":e.type==="object"?H(o):e.type==="integer"?typeof o=="number"&&Number.isInteger(o):typeof o===e.type&&(typeof o!="number"||Number.isFinite(o))))return i.push({path:r,code:"block_slot_type",message:`Expected ${e.type}.`}),o;let s=l=>i.push({path:r,code:"block_slot_budget",message:l}),c=typeof o=="string"&&oc(o);if(!c&&e.enum&&!e.enum.includes(o)&&s("Value is not one of the declared choices."),typeof o=="string"&&!c&&(e.oneLine&&/[\\r\\n]/.test(o)&&s("Slot must contain one line."),e.minLength!==void 0&&o.length<e.minLength&&s(`Minimum length is ${e.minLength}.`),e.maxLength!==void 0&&o.length>e.maxLength&&s(`Maximum length is ${e.maxLength}.`),e.maxWords!==void 0&&cm(o)>e.maxWords&&s(`Maximum word count is ${e.maxWords}.`)),typeof o=="number"&&(e.minimum!==void 0&&o<e.minimum&&s(`Minimum value is ${e.minimum}.`),e.maximum!==void 0&&o>e.maximum&&s(`Maximum value is ${e.maximum}.`)),Array.isArray(o))return e.minItems!==void 0&&o.length<e.minItems&&s(`Minimum item count is ${e.minItems}.`),e.maxItems!==void 0&&o.length>e.maxItems&&s(`Maximum item count is ${e.maxItems}.`),e.items?o.map((l,p)=>gc(e.items,l,`${r}/${p}`,i)):o;if(e.type==="component"&&H(o)){let l=(p,m,u=0)=>{if(u>64){i.push({path:m,code:"block_expansion_limit",message:"Component slot exceeds 64 levels."});return}if(Array.isArray(p)){p.forEach((O,S)=>l(O,`${m}/${S}`,u+1));return}if(!H(p))return;let f=typeof p.name=="string"&&H(p.props)?p.props:{};for(let O of sm)Ct(f,O)&&i.push({path:`${m}/props/${O}`,code:"block_slot_placement",message:"Block placement belongs in the definition, not in a component slot."});for(let[O,S]of Object.entries(p))l(S,`${m}/${xe(O)}`,u+1)};l(o,r)}return e.type==="object"&&H(o)&&e.properties?lm(e.properties,o,r,i):o}function lm(e,t,r,i){let o={};for(let a of Object.keys(t))Ct(e,a)||i.push({path:`${r}/${xe(a)}`,code:"block_unknown_slot",message:`Unknown slot \'${a}\'. Expected: ${Object.keys(e).join(", ")}.`});for(let[a,s]of Object.entries(e)){let c=gc(s,Ct(t,a)?t[a]:void 0,`${r}/${xe(a)}`,i);c!==void 0&&Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}var p$=Object.fromEntries(Object.entries(om).map(([e,t])=>[e,t.keys]));function m$(e,t){let r={type:"object",properties:e};for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(r?.type==="object"){if(!r.properties)return{type:"object"};r=Ct(r.properties,o)?r.properties[o]:void 0}else if(r?.type==="array"&&/^(0|[1-9]\\d*)$/.test(o))r=r.items??{type:"object"};else return r?.type==="component"?{type:"object"}:void 0}return r}var nm=["$if","$each","$count"],dc=e=>typeof e=="string"&&(e===""||e.startsWith("/")),eg=e=>dc(e)?[e]:Array.isArray(e)&&e.length>0&&e.every(dc)?e:void 0;function tg(e,t){if(dc(e))return{root:nm.includes(t)?"$slot":t,pointer:e};if(!nm.includes(t)||!H(e))return;let r=Object.keys(e),i=am.find(o=>o===r[0]);if(!(r.length!==1||!i||!dc(e[i])))return{root:i,pointer:e[i]}}function Ea(e,t,r,i,o=!1,a=0){if(a>64){i.push({path:t,code:"block_depth",message:"Definition exceeds 64 levels."});return}if(Array.isArray(e)){e.forEach((c,l)=>Ea(c,`${t}/${l}`,r,i,o,a+1));return}if(!H(e))return;let s=Object.keys(e).filter(c=>c.startsWith("$"));if(s.length){let c=s[0],l=p$[c];if(!l||s.length!==1||Object.keys(e).some(p=>!l.includes(p))){i.push({path:t,code:"block_invalid_binding",message:"Unknown or malformed block directive."});return}if(["$slot","$item","$theme","$context","$if","$each","$count"].includes(c)){let p=tg(e[c],c),m=c==="$theme"?eg(e[c]):void 0;if(!p&&!m)i.push({path:t,code:"block_invalid_binding",message:nm.includes(c)?`${c} takes a slot pointer such as /items, or one reference: ${am.map(u=>`{ "${u}": ... }`).join(", ")}.`:c==="$theme"?"Bindings use a JSON Pointer, e.g. /styles/source/size, or a non-empty array of them tried in order.":"Bindings use JSON Pointers, e.g. /title."});else if(p?.root==="$slot"){let u=m$(r,p.pointer);u?["$each","$count"].includes(c)&&u.type!=="array"&&i.push({path:t,code:"block_invalid_binding",message:`${c} requires an array slot.`}):i.push({path:t,code:"block_unknown_binding",message:`No slot field \'${p.pointer}\' is declared.`})}p?.root==="$item"&&!o&&i.push({path:t,code:"block_invalid_binding",message:"$item is only available inside $each."}),(c==="$slot"||c==="$item")&&Ct(e,"props")&&!H(e.props)&&i.push({path:`${t}/props`,code:"block_invalid_binding",message:"props must be an object of component props merged beneath a component-slot value."})}c==="$join"&&e.keepEmpty!==void 0&&typeof e.keepEmpty!="boolean"&&i.push({path:t,code:"block_invalid_binding",message:"keepEmpty must be boolean."}),c==="$if"&&!Ct(e,"then")&&i.push({path:t,code:"block_invalid_binding",message:"$if requires then."}),c==="$each"&&(!Ct(e,"template")||Array.isArray(e.template))&&i.push({path:t,code:"block_invalid_binding",message:"$each requires one template value; use a group for multiple flow children."}),c==="$join"&&(!Array.isArray(e.$join)||e.separator!==void 0&&typeof e.separator!="string")&&i.push({path:t,code:"block_invalid_binding",message:"$join requires an array and an optional string separator."}),c==="$measure"&&(!["width","height"].includes(String(e.$measure))||!["pt","twip","in"].includes(String(e.unit??"pt"))||e.fraction!==void 0&&(typeof e.fraction!="number"||e.fraction<0||e.fraction>1))&&i.push({path:t,code:"block_invalid_binding",message:"$measure requires width/height, pt/twip/in and a fraction between 0 and 1."})}for(let[c,l]of Object.entries(e))c.startsWith("$")&&c!=="$join"||Ea(l,`${t}/${xe(c)}`,r,i,o||Ct(e,"$each"),a+1)}function Qr(e){return(H(e)&&H(e.props)?e.props.blocks:void 0)??{}}function yc(e,t,r=[]){if(!T.Check(Xr,e))return[...T.Errors(Xr,e)].slice(0,100).map(o=>({path:`/props/blocks${o.path}`,code:"block_invalid_definition",message:o.message}));let i=[];for(let[o,a]of Object.entries(e)){let s=`/props/blocks/${xe(o)}`;r.includes(o)&&i.push({path:s,code:"block_name_collision",message:`Block \'${o}\' conflicts with a registered component.`}),t!=="docx"&&a.section&&i.push({path:`${s}/section`,code:"block_format",message:"Section effects are DOCX-only."}),t!=="pptx"&&a.slide&&i.push({path:`${s}/slide`,code:"block_format",message:"Slide effects are PPTX-only."});let c=(l,p)=>{l.default!==void 0&&gc(l,l.default,`${p}/default`,i);for(let[m,u]of[["minItems","maxItems"],["minLength","maxLength"],["minimum","maximum"]])l[m]!==void 0&&l[u]!==void 0&&l[m]>l[u]&&i.push({path:p,code:"block_invalid_definition",message:`${m} exceeds ${u}.`});l.items&&c(l.items,`${p}/items`);for(let[m,u]of Object.entries(l.properties??{}))c(u,`${p}/properties/${xe(m)}`)};for(let[l,p]of Object.entries(a.slots))c(p,`${s}/slots/${xe(l)}`);Ea(a.body,`${s}/body`,a.slots,i),a.section&&Ea(a.section,`${s}/section`,a.slots,i),a.slide&&Ea(a.slide,`${s}/slide`,a.slots,i)}return i}function Ji(e,t,r,i=[]){let o=yc(t,r,i);if(o.length)return o;let a=(s,c)=>{if(Array.isArray(s)){s.forEach((l,p)=>a(l,`${c}/${p}`));return}if(!(!H(s)||s.enabled===!1)){if(s.name==="block"&&H(s.props)&&typeof s.props.ref=="string"){let l=Ct(t,s.props.ref)?t[s.props.ref]:void 0;l?((s.props.slots===void 0||H(s.props.slots))&&lm(l.slots,s.props.slots??{},`${c}/props/slots`,o),l.section&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&o.push({path:c,code:"invalid_placement",message:"A block with section effects must be a direct child of a top-level section."}),l.slide&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&o.push({path:c,code:"invalid_placement",message:"A block with slide effects must be a direct child of a slide."})):o.push({path:`${c}/props/ref`,code:"block_unknown_reference",message:`Block \'${s.props.ref}\' is not defined in this document.`})}for(let[l,p]of Object.entries(s))c==="/props"&&l==="blocks"||a(p,`${c}/${xe(l)}`)}};return a(e,""),o}var u$=class{constructor(e,t){R(this,"sourceMap",{});R(this,"blocks",[]);R(this,"blockSources",new Set);R(this,"nodes",0);this.definitions=e,this.options=t;let r=yc(e,t.format,t.reservedNames);if(r.length)throw new va(r)}guard(e,t){(t>64||++this.nodes>5e4)&&Fn(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}operand(e,t,r){let{root:i,pointer:o}=tg(e,t),{value:a,source:s}=this.reference(i,o,r);return{value:a,source:s,element:c=>this.reference(i,`${o}/${c}`,r).source}}reference(e,t,r){if(e==="$item")return{value:Un(r.item,t),source:`${r.itemSource??r.source}${t}`};if(e==="$context"){let i=jn(r.contextSources??{},t);return{value:Un(r.context,t),source:i===t?r.source:i}}return e==="$theme"?{value:Un(this.options.theme,t),source:r.source}:{value:Un(r.slots,t),source:r.slotSources?jn(r.slotSources,t):`${r.source}/props/slots${t}`}}evaluate(e,t,r,i,o=0){if(this.guard(t.source,o),this.sourceMap[r]=t.source,Array.isArray(e)){let s=[];return e.forEach((c,l)=>{let p=this.evaluate(c,t,`${r}/${s.length}`,`${i}/${l}`,o+1);if(p!==void 0)if(H(c)&&("$if"in c||"$each"in c)&&Array.isArray(p)){let m=`${r}/${s.length}`,u=Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${m}/`));for(let[f]of u)delete this.sourceMap[f];for(let[f,O]of u){let S=f.slice(m.length+1),[w,...x]=S.split("/");this.sourceMap[`${r}/${s.length+Number(w)}${x.length?"/"+x.join("/"):""}`]=O}s.push(...p)}else s.push(p)}),s}if(!H(e))return e;if("$slot"in e||"$item"in e||"$theme"in e||"$context"in e){let s=["$slot","$item","$theme","$context"].find(f=>f in e),c=(s==="$theme"?eg(e[s]):void 0)??[],l=c[0]??e[s],p,m=t.source;for(let f of c.length?c:[l]){let O=this.reference(s,f,t);if(m=O.source,O.value!==void 0){p=O.value;break}}this.sourceMap[r]=m;let u=p!==void 0?structuredClone(p):void 0;if(u===void 0&&Ct(e,"default")&&(u=this.evaluate(e.default,t,r,`${i}/default`,o+1)),u===void 0&&s==="$theme")return Fn(i,"block_unknown_theme_binding",`Theme value \'${c.length>1?c.join(", "):l}\' is missing; declare a fallback or use an existing token.`);if((s==="$slot"||s==="$item")&&Ct(e,"props")&&H(u)&&typeof u.name=="string"){let f=this.sourceMap[r],O=this.evaluate(e.props,t,`${r}/props`,`${i}/props`,o+1),S=H(u.props)?u.props:{};for(let w of Object.keys(S)){let x=`${r}/props/${xe(w)}`;for(let A of Object.keys(this.sourceMap))(A===x||A.startsWith(`${x}/`))&&delete this.sourceMap[A];this.sourceMap[x]=`${f}/props/${xe(w)}`}u={...u,props:{...H(O)?O:{},...S}}}return u}if("$if"in e){let s=this.operand(e.$if,"$if",t),c=Jp(s.value)?e.then:e.else,l=this.evaluate(c,t,r,i,o+1);return(!H(c)||!Object.keys(c).some(m=>m.startsWith("$")))&&this.sourceMap[r]===t.source&&(this.sourceMap[r]=s.source),l}if("$count"in e){let s=this.operand(e.$count,"$count",t);return Array.isArray(s.value)?s.value.length:Fn(s.source,"block_slot_type","$count requires an array.")}if("$each"in e){let s=this.operand(e.$each,"$each",t),c=s.value;if(!Array.isArray(c))return Fn(s.source,"block_slot_type","$each requires an array.");let l=[];return c.forEach((p,m)=>{let u=`${r}/${l.length}`,f=this.evaluate(e.template,{...t,item:p,itemSource:s.element(m)},u,`${i}/template`,o+1);if(f!==void 0)this.sourceMap[u]===t.source&&(this.sourceMap[u]=s.element(m)),l.push(f);else for(let O of Object.keys(this.sourceMap))(O===u||O.startsWith(`${u}/`))&&delete this.sourceMap[O]}),l}if("$join"in e){let s=e.$join.map((l,p)=>this.evaluate(l,t,`${r}/${p}`,`${i}/$join/${p}`,o+1)),c=s.findIndex(Jp);return c>=0&&(this.sourceMap[r]=this.sourceMap[`${r}/${c}`]),(e.keepEmpty===!0?s:s.filter(Jp)).map(l=>String(l??"")).join(String(e.separator??""))}if("$measure"in e)return this.options.measure?this.options.measure(e.$measure,e.unit??"pt",t.context)*Number(e.fraction??1):Fn(i,"block_unsupported_operation","This format does not support $measure.");let a={};for(let[s,c]of Object.entries(e)){let l=this.evaluate(c,t,`${r}/${xe(s)}`,`${i}/${xe(s)}`,o+1);l!==void 0&&Object.defineProperty(a,s,{value:l,enumerable:!0,configurable:!0,writable:!0})}return a}expand(e,t="",r=0){if(this.guard(t,r),Array.isArray(e))return e.map((o,a)=>this.expand(o,`${t}/${a}`,r+1));if(!H(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!H(e.props)||typeof e.props.ref!="string")return Fn(t,"block_invalid_invocation","A block requires props.ref and optional props.slots.");if(Object.keys(e.props).some(f=>!["ref","slots"].includes(f))||e.props.slots!==void 0&&!H(e.props.slots))return Fn(t,"block_invalid_invocation","Block props accept only ref and an object of slots.");let o=Ct(this.definitions,e.props.ref)?this.definitions[e.props.ref]:void 0;if(!o)return Fn(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=jn(this.sourceMap,t),c=`${t}/props/slots`,l=lm(o.slots,e.props.slots??{},c,a);if(a.length)throw new va(a.map(f=>({...f,path:jn(this.sourceMap,f.path)})));let p=Object.fromEntries([["",jn(this.sourceMap,c)],...Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${c}/`)).map(([f,O])=>[f.slice(c.length),O])]),m={slots:l,slotSources:p,source:s,definition:`/props/blocks/${xe(e.props.ref)}`,context:this.options.contextAt?.(t)??this.options.context??{},contextSources:this.options.contextSources};o.section&&this.options.onSection?.({settings:o.section,environment:m,path:t}),o.slide&&this.options.onSlide?.({settings:o.slide,environment:m,path:t}),this.blockSources.has(s)||(this.blockSources.add(s),this.blocks.push(s));let u=this.evaluate(o.body,m,`${t}/children`,`${m.definition}/body`,r+1);return{name:"group",...e.id!==void 0&&{id:e.id},children:this.expand(u,`${t}/children`,r+1)}}if(e.enabled===!1)return{...e};let i={...e};for(let[o,a]of Object.entries(e))t==="/props"&&o==="blocks"||Object.defineProperty(i,o,{value:this.expand(a,`${t}/${xe(o)}`,r+1),enumerable:!0,configurable:!0,writable:!0});return i}};function pm(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,r])=>[t,uc(r)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function d$(e){let t=Qr(e);if(!T.Check(Xr,t))return{definitions:[],invocations:[],invalidDefinitions:!0};let r=[],i=(o,a)=>{if(Array.isArray(o)){o.forEach((s,c)=>i(s,`${a}/${c}`));return}if(H(o)){o.name==="block"&&H(o.props)&&typeof o.props.ref=="string"&&r.push({ref:o.props.ref,path:a,slotsPath:`${a}/props/slots`,defined:Object.prototype.hasOwnProperty.call(t,o.props.ref)});for(let[s,c]of Object.entries(o))a==="/props"&&s==="blocks"||i(c,`${a}/${xe(s)}`)}};return i(e,""),{definitions:Object.entries(t).map(([o,a])=>({name:o,definitionPointer:`/props/blocks/${xe(o)}`,definition:a,slotsSchema:pm(a)})),invocations:r,invalidDefinitions:!1}}function rg(e,t,r){let i=Qr(e);for(let o of t){let a=Un(e,o);if(!H(a)||!H(a.props)||typeof a.props.ref!="string")continue;let s=a.props.ref,c=i[s];if(!c)continue;let l=(p,m,u,f)=>{if(r(s,p,m,u,f),H(m)&&p.properties)for(let[O,S]of Object.entries(p.properties))l(S,Un(m,`/${xe(O)}`),`${u}/${xe(O)}`,`${f}.${O}`);Array.isArray(m)&&p.items&&m.forEach((O,S)=>l(p.items,O,`${u}/${S}`,f))};for(let[p,m]of Object.entries(c.slots)){let u=Un(a.props.slots,`/${xe(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${o}/props/slots/${xe(p)}`,p)}}}function f$(e,t){let r=[];return rg(e,t,(i,o,a,s,c)=>{typeof a=="string"&&o.maxWords!==void 0&&!oc(a)&&r.push({block:i,slot:c,path:s,words:cm(a),maxWords:o.maxWords})}),r}function h$(e,t){let r=[];return rg(e,t,(i,o,a,s,c)=>{o.role&&r.push({block:i,invocation:s.replace(/\\/props\\/slots\\/.*$/,""),slot:c,role:o.role,path:s,value:a})}),r}var Yp=["null","boolean","number","string","array","object"],Hi=(e,t)=>new Set([...e].filter(r=>t.has(r))),g$=e=>new Set(e.flatMap(t=>[...t])),kh=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function Aa(e,t,r=new Set){if(e===!1)return new Set;if(e===!0||r.has(e))return new Set(Yp);let i=e.not;if(i===!0||i&&typeof i=="object"&&Object.keys(i).length===0)return new Set;let o=new Set(r).add(e),a=new Set(Yp);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=Hi(a,new Set(Yp.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=Hi(a,new Set([kh(e.const)]))),Array.isArray(e.enum)&&(a=Hi(a,new Set(e.enum.map(kh)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=Hi(a,Aa(s,t,o)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=Hi(a,g$(e[s].map(c=>Aa(c,t,o)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=Hi(a,Aa(s,t,o));if(i&&typeof i=="object"&&i.type&&Object.keys(i).every(s=>["type","description","title","$comment"].includes(s))){let s=(Array.isArray(i.type)?i.type:[i.type]).filter(c=>c!=="integer");a=new Set([...a].filter(c=>!s.includes(c)))}return a}function mc(e,t,r=new Set){if(e===!1)return!1;if(e===!0||r.has(e))return{};let i=new Set(r).add(e),o=[];if(typeof e.$ref=="string"){let a=t(e.$ref);a!==void 0&&o.push(mc(a,t,i))}e.items!==void 0&&o.push(Array.isArray(e.items)?{anyOf:[...e.items,...e.additionalItems===!1?[]:[e.additionalItems??{}]]}:e.items);for(let a of["anyOf","oneOf"])Array.isArray(e[a])&&o.push({anyOf:e[a].filter(s=>Aa(s,t).has("array")).map(s=>mc(s,t,i))});return Array.isArray(e.allOf)&&o.push(...e.allOf.map(a=>mc(a,t,i))),o.length===0?{}:o.length===1?o[0]:{allOf:o}}var xi=(e,t)=>({type:"object",properties:e,required:t,additionalProperties:!1}),$a=e=>({type:"string",pattern:"^(|/.*)$",description:e}),y$=e=>({anyOf:[$a(e),{type:"array",minItems:1,items:$a(e),description:e}],description:e}),b$=e=>({$slot:"Read a named input slot by JSON Pointer, e.g. /title or /client/name.",$item:"Read the current $each entry by JSON Pointer. Use an empty string for the whole entry or /title for a property.",$theme:\'Read the active theme by JSON Pointer, e.g. /colors/primary, or by a list of pointers tried in order, e.g. ["/chrome/sourceLine/color", "/styles/source/color"] \\u2014 the chrome recipe if the theme sets one, else the type role. A missing value requires a default.\',$context:e==="pptx"?"Read deck or slide context by JSON Pointer, e.g. /document/title, /slide/width or /slide/index.":"Read document or section context by JSON Pointer, e.g. /document/title or /section/tracker."}),O$=e=>e==="pptx"?{axis:"Measure the slide canvas width or height, in the unit given.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt; use in for frame coordinates."}:{axis:"Measure the usable page width or height after margins, using the containing section\\u2019s page settings.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt."},sc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),Xp=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},x$=e=>({type:"object",required:[e]}),cc=Object.keys(om);function ka(e,t,r=[],i="docx"){let o=`BlockTemplate_${t}`,a=b$(i),s=O$(i),c=P=>({description:P,anyOf:[$a(P),...am.map(Z=>xi({[Z]:$a(a[Z])},[Z]))]}),l=`${o}_Body`,p=P=>({$ref:`#/definitions/${P}`});if(e[l])return p(l);let m={...e},u=m[t];m[t]={...u,anyOf:(u.anyOf??[u]).filter(P=>!r.includes(P.properties?.name?.const))};let f=P=>{if(!P.startsWith("#/definitions/"))return;let Z=m;for(let je of P.slice(14).split("/")){let Ue=je.replace(/~1/g,"/").replace(/~0/g,"~");if(!Z||typeof Z!="object"||!Object.hasOwn(Z,Ue))return;Z=Z[Ue]}return typeof Z=="boolean"||Z&&typeof Z=="object"?Z:void 0},O=new Map,S=new Map,w=0,x=p(t),A=new Map,I=P=>{let Z=JSON.stringify(P),je=A.get(Z);return je||(je=`${o}_Shared${w++}`,A.set(Z,je),e[je]=P),p(je)},N=Object.fromEntries(cc.map(P=>[P,I(x$(P))])),G=I({anyOf:Object.values(N)}),qe=[...new Set(["",...cc.flatMap(P=>Array.from({length:P.length-1},(Z,je)=>P.slice(0,je+1)))])],We=I({type:"object",propertyNames:{pattern:`^(?:${qe.map(P=>P.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})$`}});function He(P){if(typeof P=="boolean")return P;let Z=JSON.stringify(P),je=S.get(Z);if(je)return{...p(je),...Xp(P)};let Ue=`${o}_Literal${w++}`;S.set(Z,Ue),e[Ue]={};let ht={...P};if(typeof P.$ref=="string"){let me=f(P.$ref);if(me!==void 0){let we=He(me);typeof we=="object"?ht.$ref=we.$ref:(delete ht.$ref,we||(ht.not={}))}}P.properties&&(ht.properties=Object.fromEntries(Object.entries(P.properties).map(([me,we])=>[me,["name","version"].includes(me)&&typeof we=="object"&&typeof we.const=="string"?we:te(we)]))),P.patternProperties&&(ht.patternProperties=Object.fromEntries(Object.entries(P.patternProperties).map(([me,we])=>[me,te(we)]))),P.items!==void 0&&(ht.items=Array.isArray(P.items)?P.items.map(me=>te(me,!0)):te(P.items,!0));for(let me of["additionalProperties","additionalItems"])typeof P[me]=="object"&&(ht[me]=te(P[me],me==="additionalItems"));for(let me of["anyOf","oneOf","allOf"])Array.isArray(P[me])&&(ht[me]=P[me].map(we=>{let zt=He(we);return typeof we=="object"&&typeof we.properties?.name?.const=="string"&&typeof zt=="object"&&zt.$ref?e[zt.$ref.slice(14)]:zt}));for(let me of["then","else"])P[me]!==void 0&&(ht[me]=He(P[me]));return e[Ue]=ht,{...p(Ue),...Xp(P)}}function te(P,Z=!1){if(P===!1)return!1;let je=Xp(P),Ue=typeof P=="object"?{...P}:P;typeof Ue=="object"&&(delete Ue.description,delete Ue.markdownDescription);let ht=`${Z?"sequence":"value"}:${JSON.stringify(Ue)}`,me=O.get(ht);if(me)return{...p(me),...je};let we=`${o}_Value${w++}`;O.set(ht,we),e[we]={};let zt=p(we),rd=Aa(Ue,f);if(rd.size===0)return e[we]={allOf:[He(Ue)]},zt;let nd=()=>Z?te(Ue):zt,id=()=>Z?{anyOf:[zt,{type:"array",items:zt}]}:zt,Vb=()=>Z?nd():te(mc(Ue,f)),mr={};for(let fe of cc){let Wn=om[fe].result;if(!(Wn!=="dynamic"&&!rd.has(Wn)&&!(Z&&Wn==="array")))switch(fe){case"$slot":case"$item":case"$theme":case"$context":mr[fe]=xi({[fe]:fe==="$theme"?y$(a[fe]):$a(a[fe]),default:sc(nd(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...fe==="$slot"||fe==="$item"?{props:{type:"object",description:"Component props merged beneath a component-slot value. Put placement (x, y, w, h, grid) and styling defaults here; the slot content may override styling but never placement."}}:{}},[fe]);break;case"$if":mr[fe]=xi({$if:c(\'Test a slot by JSON Pointer, e.g. /subtitle, or a reference such as { "$item": "/numeric" } or { "$theme": "/chrome/keyTakeaways/fill" }. Missing, null, false, empty text and empty arrays select else; zero selects then.\'),then:sc(id(),"Value or components to emit when the slot tested by $if is present."),else:sc(id(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":mr[fe]=xi({$each:c(\'Repeat template for each entry in an array slot, e.g. /items, or in an array named by a reference, { "$item": "/cells" } or { "$theme": "/palette/chart" }. Read the current entry with $item.\'),template:sc(Vb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":mr[fe]=xi({$count:c(\'Return the number of entries in an array slot, e.g. /items, or in an array of the current entry, { "$item": "/cells" }.\')},["$count"]);break;case"$join":mr[fe]=xi({$join:{type:"array",items:te({}),description:"Evaluate these values or bindings and join them as text. Empty values are skipped unless keepEmpty is true."},separator:{type:"string",description:"Text inserted between joined values. Defaults to an empty string."},keepEmpty:{type:"boolean",description:"Keep missing, null, false, empty text and empty arrays in the join. Defaults to false."}},["$join"]);break;case"$measure":mr[fe]=xi({$measure:{enum:["width","height"],description:s.axis},fraction:{type:"number",minimum:0,maximum:1,description:"Fraction of the measured dimension, from 0 to 1. Defaults to 1."},unit:{enum:["pt","twip","in"],description:s.unit}},["$measure"]);break;default:{let ul=fe;throw new Error(`Missing authoring schema for directive ${ul}`)}}}return e[we]={allOf:[{if:G,then:{allOf:cc.map(fe=>({if:N[fe],then:mr[fe]?I({...mr[fe],properties:Object.fromEntries(Object.entries(mr[fe].properties).map(([Wn,ul])=>[Wn,I(ul)]))}):!1}))},else:He(Ue)},{if:We,then:{properties:Object.fromEntries(Object.entries(mr).map(([fe,Wn])=>[fe,I(Wn.properties[fe])]))}}]},{...zt,...je}}return e[l]=te(x,!0),p(l)}async function S$(e,t,r){let i=r.preserve??new Set,o=0,a=async(s,c,l)=>{if(l>64||++o>1e5)throw new va([{path:jn(e.sourceMap,c),code:"block_expansion_limit",message:"Combined plugin/block expansion exceeds depth/node limits (64/100000)."}]);if(Array.isArray(s)){let u=[];for(let f=0;f<s.length;f++)u.push(await a(s[f],`${c}/${f}`,l+1));return{standard:u.map(f=>f.standard),preserved:u.map(f=>f.preserved)}}if(!H(s)||s.enabled===!1)return{standard:s,preserved:s};if(s.name==="block")return a(e.expand(s,c,l),c,l+1);let p={...s},m={...s};for(let[u,f]of Object.entries(s)){if(c==="/props"&&u==="blocks")continue;let O=await a(f,`${c}/${u}`,l+1);Object.defineProperty(p,u,{value:O.standard,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(m,u,{value:O.preserved,enumerable:!0,configurable:!0,writable:!0})}if(typeof s.name=="string"&&r.plugins.has(s.name)){let u=jn(e.sourceMap,c),f=await r.render(p,u);e.sourceMap[`${c}/children`]=u;let O=await a(f,`${c}/children`,l+1);return{standard:{name:"group",children:O.standard},preserved:i.has(s.name)?s:{name:"group",children:O.preserved}}}return{standard:p,preserved:m}};return a(t,"",0)}var I$="^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$",mm=e=>JSON.parse(JSON.stringify(e));function Qp(e,t,r){if(e!==void 0&&t!==void 0)return e===t?`${e} ${r}`:`${e}\\u2013${t} ${r}`;if(e!==void 0)return`at least ${e} ${r}`;if(t!==void 0)return`at most ${t} ${r}`}function ng(e){let t=[];e.required&&e.default===void 0&&t.push("Required"),e.default!==void 0&&t.push(`Default: \\`${JSON.stringify(e.default)}\\``),e.type==="component"&&t.push("A component; placement stays in the definition"),e.enum&&t.push(`One of ${e.enum.map(a=>`\\`${JSON.stringify(a)}\\``).join(", ")}`);let r=Qp(e.minLength,e.maxLength,"characters");r&&t.push(r),e.maxWords!==void 0&&t.push(`at most ${e.maxWords} words`),e.oneLine&&t.push("one line");let i=Qp(e.minimum,e.maximum,"");i&&t.push(i.trim());let o=Qp(e.minItems,e.maxItems,"entries");return o&&t.push(o),e.role&&t.push(`Role: ${e.role}`),t}function ig(e){return[e.description,ng(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function fc(e,t){let r;if(e.type==="component")r=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...sm]},errorMessage:"Block placement belongs in the definition, not in a component slot."}}}}]}:{type:"object",properties:{name:{type:"string"}},required:["name"]};else{let{oneLine:o,properties:a,items:s,...c}=e;for(let l of["role","required","maxWords","description"])delete c[l];if(r={...c},c.minLength!==void 0||c.maxLength!==void 0||c.enum!==void 0){let{minLength:l,maxLength:p,enum:m,...u}=c;r={...u,anyOf:[{...l!==void 0&&{minLength:l},...p!==void 0&&{maxLength:p},...m!==void 0&&{enum:m}},{type:"string",pattern:I$}]}}o&&(r.pattern="^[^\\\\r\\\\n]*$"),s&&(r.items=fc(s,t)),a&&(r.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,fc(p,t)])),r.required=Object.entries(a).filter(([,l])=>l.required&&l.default===void 0).map(([l])=>l),r.additionalProperties=!1)}e.description&&(r.description=e.description);let i=ig(e);return i&&(r.markdownDescription=i),r}function og(e,t){return{type:"object",additionalProperties:!1,description:"Input values keyed by the slot names declared in the referenced block definition.",properties:Object.fromEntries(Object.entries(e.slots).map(([r,i])=>[r,fc(i,t)])),required:Object.entries(e.slots).filter(([,r])=>r.required&&r.default===void 0).map(([r])=>r)}}function ag(e,t){let r=Object.keys(e),i={type:"object",additionalProperties:!1,required:["ref"],properties:{ref:{type:"string",minLength:1,description:"Name in this document\\u2019s props.blocks.",...r.length&&{anyOf:r.map(o=>({const:o,type:"string",description:e[o].description??`Block "${o}", defined in this document.`}))}},slots:{type:"object",description:"Input values keyed by the slot names declared in the referenced block definition."}}};return r.length&&(i.allOf=r.map(o=>({if:{properties:{ref:{const:o}},required:["ref"]},then:{properties:{slots:og(e[o],t)}}}))),i}function w$(e,t,r){for(let i of r){let o=e.definitions?.[i.name];if(!o)continue;let a=ag(t,i.componentRef),s=new Set,c=l=>{if(!l||typeof l!="object"||s.has(l))return;if(s.add(l),Array.isArray(l)){l.forEach(c);return}let p=l;if(p.properties?.name?.const==="block"&&p.properties.props){p.properties.props=mm(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(o)}}function hc(e,t){if(Array.isArray(e)){e.forEach(r=>hc(r,t));return}if(H(e)){e.name==="block"&&H(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let r of Object.values(e))hc(r,t)}}function um(e,t){let r=[],i=new Set([t]),o=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&hc([s.body,s.section,s.slide],c=>{i.has(c)||(i.add(c),Object.prototype.hasOwnProperty.call(e,c)&&(o(c),r.push(c)))})};return o(t),r}function sg(e,t,r){if(e.default!==void 0)return mm(e.default);if(e.enum?.length)return e.enum[0];switch(e.type){case"string":return t;case"number":case"integer":{let i=e.minimum??0;return e.maximum!==void 0&&e.maximum<i?e.maximum:i}case"boolean":return!0;case"array":{let i=Math.min(Math.max(3,e.minItems??0),e.maxItems??Number.POSITIVE_INFINITY),o=e.items??{type:"string"};return Array.from({length:i},(a,s)=>sg(o,`${t} ${s+1}`,r))}case"object":return cg(e.properties??{},r);case"component":return r==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function cg(e,t){return Object.fromEntries(Object.entries(e).filter(([,r])=>r.required&&r.default===void 0||r.role).map(([r,i])=>[r,sg(i,r,t)]))}function lg(e,t,r){let i;if(H(r.document)){let o=Object.fromEntries(Object.entries(r.document).filter(([a])=>a!=="props"));hc(o,(a,s)=>{if(i||a!==e)return;let c=s.props;i={name:"block",props:{ref:a,...H(c.slots)&&{slots:mm(c.slots)}}}})}return i??{name:"block",props:{ref:e,slots:cg(t.slots,r.format)}}}function C$(e,t){let r=Qr(e);return!T.Check(Xr,r)||yc(r,t.format).length>0?[]:Object.entries(r).map(([i,o])=>({name:i,format:t.format,template:t.template,definitionPointer:`/props/blocks/${xe(i)}`,description:o.description??"",definition:o,slotsSchema:pm(o),example:lg(i,o,{document:e,format:t.format}),dependencies:um(r,i)}))}var pg=["docx","pptx"],Zp=n.String({pattern:"^[a-z][a-z0-9]*(-[a-z0-9]+)*$",description:"Kebab-case identifier."}),mg=n.Object({min:n.Integer({minimum:1}),max:n.Integer({minimum:1})},{additionalProperties:!1,description:"Expected length once filled: pages for a document, slides for a deck."}),ug=n.Object({description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),pages:mg,metadata:n.Optional(n.Record(n.String(),n.String(),{description:"Document metadata the scaffold writes; a value may be a scaffold marker."})),children:n.Array(n.Unknown(),{minItems:1,description:"The top-level children of the scaffolded document, in order: sections holding block invocations and ordinary components, every slot carrying a {{\\u2026}} marker whose text is the guidance for filling it."})},{additionalProperties:!1}),dm=n.Object({id:Zp,format:n.Union(pg.map(e=>n.Literal(e))),title:n.String({minLength:1}),description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),theme:n.String({minLength:1,description:"Recommended theme. Any theme renders the scaffold; this one is the archetype\\u2019s house look."}),profile:Zp,definitions:n.String({minLength:1,description:"The playground template whose props.blocks the variants invoke. The scaffold copies the definitions it needs, and their dependencies, into the document."}),numbering:n.Union([n.Literal("none"),n.Literal("sections")],{description:"Whether section openers carry numbers the reader cites (01, 02, \\u2026)."}),toc:n.Boolean({description:"Whether the scaffold places a table of contents."}),variants:n.Record(Zp,ug,{minProperties:1,description:"Structural variants of the same archetype, so two documents from one brief do not look alike."})},{additionalProperties:!1,description:"A document archetype as data."});function dg(e){let t=[...T.Errors(dm,e)].map(r=>({path:r.path,message:r.message}));if(t.length>0)return t;for(let[r,i]of Object.entries(e.variants))i.pages.min>i.pages.max&&t.push({path:`/variants/${r}/pages`,message:`min (${i.pages.min}) exceeds max (${i.pages.max})`});return t}function T$(e){return T.Check(dm,e)}function P$(e,t){let r={};for(let i of t){let o=dg(i);if(o.length>0)throw new Error(`Invalid bundled blueprint: ${o.map(s=>`${s.path}: ${s.message}`).join("; ")}`);let a=i;if(a.format!==e)throw new Error(`Blueprint ${a.id} is not a ${e.toUpperCase()} blueprint.`);if(r[a.id])throw new Error(`Two bundled blueprints share the id "${a.id}"; the later one would silently replace the earlier.`);r[a.id]=a}return r}var E$=/^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;function fg(e,t,r){if(e.format!==t)throw new Error(`Blueprint ${e.id} is a ${e.format} blueprint; this instantiates ${t.toUpperCase()} ones.`);let i=r??Object.keys(e.variants)[0],o=e.variants[i];if(!o)throw new Error(`Blueprint ${e.id} has no variant "${i}"; it has ${Object.keys(e.variants).join(", ")}.`);return{id:i,variant:o}}function A$(e,t,r){let{id:i,variant:o}=fg(e,r.format,t.variant),a=structuredClone(o.children),s=hg(a,t.definitions,e),c={...o.metadata,...t.metadata},l={theme:t.theme??e.theme,qualityProfile:e.profile,...r.props,...Object.keys(s).length>0&&{blocks:s},...r.metadataPointer==="/props"?c:{metadata:c}},p={name:r.format,props:l,children:a};return{document:p,fillMap:$$(p,s,r),variant:i}}function hg(e,t,r){let i=new Set,o=s=>{if(Array.isArray(s))return s.forEach(o);if(!s||typeof s!="object")return;let c=s,l=c.props;c.name==="block"&&typeof l?.ref=="string"&&i.add(l.ref),Object.values(c).forEach(o)};o(e);let a={};for(let s of i){if(!t[s])throw new Error(`Blueprint ${r.id} invokes "${s}", which ${r.definitions} does not define.`);for(let c of[...um(t,s),s])a[c]??(a[c]=structuredClone(t[c]))}return a}function $$(e,t,r){let i=`${r.metadataPointer}/`;return r.markers(e).map(o=>{let a=o.text.match(E$)?.[1]??o.text,s={path:o.path,marker:o.text,guidance:a};if(o.path.startsWith(i)&&!o.path.slice(i.length).includes("/"))return{...s,kind:"metadata"};let c=gg(e,o.path,t);return c?{...s,kind:"slot",...c}:{...s,kind:"text"}})}function gg(e,t,r){let i=t.lastIndexOf("/props/slots/");if(i<0)return;let a=bg(e,t.slice(0,i))?.props?.ref;if(typeof a!="string"||!r[a])return;let s=t.slice(i+13).split("/").map(yg),c=r[a].slots[s[0]],l=[s[0]];for(let p of s.slice(1)){if(!c)break;if(c.type==="array"&&/^\\d+$/.test(p))c=c.items;else if(c.type==="object")c=c.properties?.[p],l.push(p);else{if(c.type==="component")break;c=void 0}}if(c)return{block:a,slot:l.join("."),type:c.type,...c.maxWords!==void 0&&{maxWords:c.maxWords},...c.maxLength!==void 0&&{maxLength:c.maxLength},...c.oneLine!==void 0&&{oneLine:c.oneLine},...c.required!==void 0&&{required:c.required}}}function yg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function bg(e,t){if(t==="")return e;let r=e;for(let i of t.split("/").slice(1).map(yg))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}function lc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Og(e,t){let r={...e};return lc(e)&&lc(t)&&Object.keys(t).forEach(i=>{lc(t[i])?!(i in e)||!lc(e[i])?r[i]=t[i]:r[i]=Og(e[i],t[i]):r[i]=t[i]}),r}function v$(e,t){return Og(t,e)}function xg(e){let t;try{t=new URL(/^https?:\\/\\//i.test(e.trim())?e.trim():`http://${e.trim()}`).hostname.toLowerCase()}catch{return!1}let r=t.replace(/^\\[|\\]$/g,"").replace(/\\.$/,"");if(r==="localhost"||r.endsWith(".localhost")||r==="::1"||/^f[cd][0-9a-f]{2}:/.test(r)||/^fe[89ab][0-9a-f]:/.test(r))return!0;let i=/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/.exec(r);if(i){let[o,a]=[Number(i[1]),Number(i[2])];return o===127||o===10||o===172&&a>=16&&a<=31||o===192&&a===168||o===169&&a===254}return/\\.(local|internal|home\\.arpa)$/.test(r)}var L$="W_HIGHCHARTS_REMOTE_EXPORT";function R$(e,t){if(!xg(e)){if(!t)throw new Error(`Highcharts export server ${e} is outside this machine and its private networks, and a chart is posted whole \\u2014 every series, label and title. Run the export server locally (pnpm dlx highcharts-export-server --enableServer true), or set services.highcharts.allowRemote (HIGHCHARTS_ALLOW_REMOTE=1) to send chart data there deliberately.`);return`Chart data \\u2014 every series, label and title \\u2014 was sent to ${e}, outside this machine and its private networks (services.highcharts.allowRemote).`}}var N$=3e4,k$=2,F$=250,j$=2e3;function U$(e,t,r){let i=(e||t||r).trim();return(/^https?:\\/\\//i.test(i)?i:`http://${i}`).replace(/\\/+$/,"")}var fm="SERVICE_UNAVAILABLE";function Fh(e){return Object.assign(new Error(e),{code:fm})}function D$(e){let{code:t,status:r}=e;return t===fm?!0:r===429||r!==void 0&&r>=500}function _$(e,t){let r=new Error(`${e.message} (after ${t} attempts)`),{code:i,status:o}=e;return i!==void 0&&Object.assign(r,{code:i}),o!==void 0&&Object.assign(r,{status:o}),r}function M$(e,t){let r=Math.min(t*2**(e-1),j$);return Math.round(r*(.5+Math.random()*.5))}async function B$(e,t,r){let i=new AbortController,o=setTimeout(()=>i.abort(),r),a;try{a=await fetch(`${e.url}${e.path}`,{method:"POST",headers:t,body:JSON.stringify(e.body),signal:i.signal})}catch(s){if(s?.name==="AbortError")throw Fh(`${e.serviceLabel} timed out after ${r}ms at ${e.url}.`);let c=s instanceof Error?s.message:String(s);throw Fh(e.onUnreachable(e.url,c))}finally{clearTimeout(o)}if(!a.ok)throw Object.assign(new Error(`${e.serviceLabel} returned ${a.status}: ${a.statusText}`),{status:a.status});return a}async function V$(e){let r={"Content-Type":"application/json",...typeof e.headers=="function"?await e.headers(e.body):e.headers},i=e.timeoutMs??N$,o=e.retryBaseDelayMs??F$,a=1+Math.max(0,e.retries??k$);for(let s=1;;s++)try{return await B$(e,r,i)}catch(c){let l=c;if(s>=a||!D$(l))throw s===1?l:_$(l,s);e.onRetry?.(s,l),await new Promise(p=>setTimeout(p,M$(s,o)))}}function Sg(e){let t=0,r=[],i=()=>{t--,r.shift()?.()};return async function(a){for(;t>=e;)await new Promise(s=>r.push(s));t++;try{return await a()}finally{i()}}}var Ig=4,Cr={collected:0,unique:0,retries:0,maxInFlight:0},em=0;function K$(){return{...Cr}}function G$(){Cr.collected=0,Cr.unique=0,Cr.retries=0,Cr.maxInFlight=0}function q$(){Cr.retries++}var im=new Map;function W$(e,t){let r=im.get(e);if(r)return r;let i=Math.max(1,Math.floor(Number.isFinite(t)?t:Ig)),o=Sg(i);return im.set(e,o),o}function H$(e,t,r){return Cr.collected++,W$(e,t)(r)}function z$(e,t){return`${e}\n${JSON.stringify(t)}`}function J$(e,t,r){if(!e)return jh(r);let i=e.get(t);if(i)return i;let o=jh(r);return e.set(t,o),o}async function jh(e){Cr.unique++,em++,Cr.maxInFlight=Math.max(Cr.maxInFlight,em);try{return await e()}finally{em--}}function Y$(){im.clear()}var gm={};rt(gm,{ComponentValidationError:()=>yi,DuplicateComponentError:()=>Ki,UnknownPreservedComponentError:()=>zs,createComponent:()=>Vi,createVersion:()=>Bi,getValidationSummary:()=>Ys,isValidationSuccess:()=>Js,resolveComponentVersion:()=>gi,validateAgainstSchema:()=>$p,validateCustomComponentProps:()=>Ln});var Au={};rt(Au,{AlignmentSchema:()=>en,BASE_SCHEMA_METADATA:()=>py,BUILT_IN_DOCX_THEME_NAMES:()=>Ja,BaseComponentPropsSchema:()=>Eg,BlockInvocationPropsSchema:()=>Dn,BorderSchema:()=>Tg,COMPONENT_METADATA:()=>ly,ChartPropsSchema:()=>eu,ColumnsPropsSchema:()=>mn,CommentReplySchema:()=>Vm,CommentSchema:()=>ro,ComponentDefinitionSchema:()=>ft,CustomComponentDefinitionSchema:()=>Pr,DEFAULT_DOCX_RENDERER_ID:()=>za,DEFAULT_ERROR_CONFIG:()=>En,DOCX_RENDERER_IDS:()=>Tr,DividerPropsSchema:()=>Qm,ERROR_EMOJIS:()=>di,ERROR_TEMPLATES:()=>Ay,EndnotesSchema:()=>Gm,FootnotesSchema:()=>Km,GenerateDocumentRequestSchema:()=>Wy,GenerateDocumentResponseSchema:()=>zy,GroupPropsSchema:()=>Jm,HeadingLevelSchema:()=>Oc,HeadingPropsSchema:()=>on,HighchartsPropsSchema:()=>Zm,ImagePropsSchema:()=>sn,IndentSchema:()=>_n,JSON_SCHEMA_URLS:()=>Xy,JsonComponentDefinitionSchema:()=>Yy,JsonDocumentParser:()=>Pu,JsonParsingError:()=>po,JsonValidationError:()=>mo,JustifiedAlignmentSchema:()=>ja,LineSpacingSchema:()=>Ua,ListMarkerFontSchema:()=>Hm,ListPropsSchema:()=>un,MarginsSchema:()=>Cg,NATIVE_RENDER_MODE:()=>vc,NATIVE_VISUAL_ELEMENT_NAMES:()=>Ug,NativeVisualCanvasSchema:()=>Rm,NativeVisualElementSchema:()=>Lm,NativeVisualImagePropsSchema:()=>vm,NativeVisualShapePropsSchema:()=>$m,NativeVisualTextPropsSchema:()=>Am,NoteSchema:()=>Nc,NumberingSchema:()=>Pg,ParagraphIndentSchema:()=>Da,ParagraphPropsSchema:()=>an,ReportPropsSchema:()=>dn,RevisionMarkSchema:()=>Bm,RevisionSchema:()=>to,RevisionSegmentSchema:()=>Mm,SHARED_DOCX_VERSION:()=>dR,STANDARD_COMPONENTS:()=>ab,STANDARD_COMPONENTS_REGISTRY:()=>dt,STANDARD_COMPONENTS_SET:()=>QL,SectionPropsSchema:()=>pn,SpacingSchema:()=>Tt,StandardComponentDefinitionSchema:()=>_c,StatisticPropsSchema:()=>cn,THEME_SCHEMA_METADATA:()=>my,TabStopLeaderSchema:()=>Sm,TabStopSchema:()=>Im,TabStopTypeSchema:()=>xm,TabStopsSchema:()=>xc,TablePropsSchema:()=>ln,TextBoxPropsSchema:()=>Ym,TextSpaceAfterComponentSchema:()=>ru,TextSpaceAfterPropsSchema:()=>tu,ThemeConfigSchema:()=>io,ThemeOverridesSchema:()=>jc,TocPropsSchema:()=>Xm,ValidateDocumentRequestSchema:()=>Hy,ValidateDocumentResponseSchema:()=>Jy,VisualCanvasBackgroundSchema:()=>Nm,VisualCanvasSchema:()=>km,VisualNativePropsSchema:()=>jm,VisualPropsSchema:()=>$c,VisualRasterPropsSchema:()=>Fm,calculatePosition:()=>Mi,clearComponentNamesCache:()=>Sa,collectDocxRendererErrors:()=>Rc,collectIndentConflicts:()=>lu,collectNoteRevisionConflicts:()=>pu,collectTextBoxShapeConflicts:()=>mu,compareSemver:()=>hi,componentValidator:()=>so,comprehensiveValidateDocument:()=>du,convertDocxToJsonSchema:()=>ay,convertToJsonSchema:()=>ay,createComponentSchema:()=>Gi,createComponentValidator:()=>Hc,createDocumentValidator:()=>Vc,createDocxComponentSchema:()=>sy,createErrorConfig:()=>Ir,createJsonParseError:()=>fi,createJsonValidator:()=>Oy,createMinimalTheme:()=>ry,createThemeValidator:()=>Wc,createValidatedComponent:()=>YL,createValidator:()=>by,deepValidateDocument:()=>uu,diffDocuments:()=>jL,diffWords:()=>el,documentValidator:()=>ao,docxComponentDefinitionName:()=>nn,docxDocumentBlockTargets:()=>Bg,exportDocxSchemaToFile:()=>cy,exportSchemaToFile:()=>qi,extractStandardComponentNames:()=>ui,fixDocxSchemaReferences:()=>Dc,fixSchemaReferences:()=>Rn,formatErrorMessage:()=>xr,formatErrorReport:()=>rs,formatErrorSummary:()=>Yr,formatValidationError:()=>WL,formatValidationErrorStrings:()=>HL,formatValidationErrors:()=>_L,generateUnifiedDocumentSchema:()=>uy,getAllStandardComponentNames:()=>ny,getErrorSummary:()=>ob,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>Ia,getStandardComponent:()=>Ya,getThemeName:()=>Ly,getValidationContext:()=>qL,getValidationErrors:()=>VL,getValidationSummary:()=>Sy,groupErrorsByPath:()=>wa,hasCriticalErrors:()=>ns,isColumnsComponent:()=>tR,isColumnsProps:()=>Dy,isCustomComponentProps:()=>Ky,isHeadingComponent:()=>rR,isHeadingProps:()=>jy,isHighchartsComponent:()=>pR,isImageComponent:()=>iR,isImageProps:()=>_y,isListComponent:()=>cR,isListProps:()=>Vy,isLiteralSchema:()=>Jr,isNativeVisualProps:()=>_g,isObjectSchema:()=>qt,isParagraphComponent:()=>nR,isParagraphProps:()=>Uy,isReportComponent:()=>ZL,isReportProps:()=>ky,isSectionComponent:()=>eR,isSectionProps:()=>Fy,isStandardComponentName:()=>lo,isStatisticComponent:()=>aR,isStatisticProps:()=>My,isTableComponent:()=>sR,isTableProps:()=>By,isTextBoxComponent:()=>oR,isTextSpaceAfterComponent:()=>uR,isThemeConfig:()=>Ry,isTocComponent:()=>lR,isUnionSchema:()=>xa,isValidComponent:()=>XL,isValidDocument:()=>Cy,isValidSemver:()=>vn,isValidTheme:()=>vy,isValidThemeConfig:()=>ty,isValidThemeJson:()=>vy,isValidationSuccess:()=>xy,isVisualComponent:()=>mR,latestVersion:()=>ut,parseJsonComponent:()=>UL,parseJsonWithLineNumbers:()=>DL,parseSemver:()=>$n,safeValidateComponentDefinition:()=>BL,safeValidateComponentProps:()=>ML,sharedCreateComponentSchemaObject:()=>ec,strictComponentValidator:()=>Gc,strictDocumentValidator:()=>Xa,strictThemeValidator:()=>Kc,stripMarkdown:()=>es,themeValidator:()=>Qa,transformAndValidate:()=>JL,transformDocxValueError:()=>su,transformDocxValueErrors:()=>cu,transformValueError:()=>An,transformValueErrors:()=>tt,validate:()=>Gy,validateAgainstSchema:()=>Pt,validateBatch:()=>gy,validateComponent:()=>nl,validateComponentDefinition:()=>Eu,validateComponentProps:()=>co,validateComponents:()=>zL,validateCustomComponentProps:()=>yu,validateDocument:()=>Mc,validateDocumentWithSchema:()=>Ey,validateJson:()=>oo,validateJsonComponent:()=>Bc,validateJsonComponentDoc:()=>Py,validateJsonDocument:()=>Bc,validateStrict:()=>qy,validateTheme:()=>qc,validateThemeJson:()=>fu,validateThemeWithEnhancement:()=>hu,validateWithEnhancement:()=>yy});var X=n.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\'}),ym=n.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"\'}),bm=n.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"]}),Om=n.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),Fa=n.Array(n.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"]]}),bc=n.Object({case:n.Optional(Oi),size:n.Optional(n.Number({minimum:8,maximum:1638})),color:n.Optional(X),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.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:n.Optional(n.Boolean()),underline:n.Optional(n.Boolean()),lineSpacing:n.Optional(n.Object({type:n.Union([n.Literal("single"),n.Literal("atLeast"),n.Literal("exactly"),n.Literal("double"),n.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:n.Optional(n.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:n.Optional(n.Object({before:n.Optional(n.Number({minimum:0})),after:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),characterSpacing:n.Optional(n.Object({type:n.Union([n.Literal("condensed"),n.Literal("expanded")]),value:n.Number()},{additionalProperties:!1})),scale:n.Optional(n.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}),Zr=n.Object({family:Ht,...bc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var en=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Text alignment options"}),ja=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Text alignment options including justify"}),Oc=n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)],{description:"Heading level (1-6)"}),Tt=n.Object({before:n.Optional(n.Number({minimum:0,description:"Spacing before element in points"})),after:n.Optional(n.Number({minimum:0,description:"Spacing after element in points"}))},{description:"Spacing configuration",additionalProperties:!1}),wg=n.Object({before:n.Optional(n.Number({minimum:0,description:"Spacing before list in points"})),after:n.Optional(n.Number({minimum:0,description:"Spacing after list in points"})),item:n.Optional(n.Number({minimum:0,description:"Spacing between list items in points"}))},{description:"List spacing configuration with item spacing",additionalProperties:!1}),Cg=n.Object({top:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0}))},{description:"Margin configuration",additionalProperties:!1}),Tg=n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(X)},{description:"Border configuration",additionalProperties:!1}),Ua=n.Object({type:n.Union([n.Literal("single"),n.Literal("atLeast"),n.Literal("exactly"),n.Literal("double"),n.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:n.Optional(n.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}),_n=n.Object({left:n.Optional(n.Number({minimum:0,description:"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."})),hanging:n.Optional(n.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}),Da=n.Object({left:n.Optional(n.Number({description:"Left indentation in twips (1/20 of a point)"})),right:n.Optional(n.Number({description:"Right indentation in twips (1/20 of a point)"})),hanging:n.Optional(n.Number({minimum:0,description:"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine."})),firstLine:n.Optional(n.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}),xm=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("decimal"),n.Literal("bar")],{description:"Tab stop alignment type"}),Sm=n.Union([n.Literal("dot"),n.Literal("hyphen"),n.Literal("underscore"),n.Literal("middleDot"),n.Literal("none")],{description:"Leader character filling the space before the tab stop"}),Im=n.Object({type:xm,position:n.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:n.Optional(Sm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var xc=n.Array(Im,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),X$=n.Union([n.Literal("character"),n.Literal("column"),n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Horizontal position relative to"}),Q$=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("paragraph"),n.Literal("line"),n.Literal("text")],{description:"Vertical position relative to"}),Z$=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Horizontal alignment"}),ev=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Vertical alignment"}),tv=n.Union([n.Literal("none"),n.Literal("square"),n.Literal("topAndBottom"),n.Literal("around"),n.Literal("tight"),n.Literal("through")],{description:"Text wrapping type"}),rv=n.Union([n.Literal("bothSides"),n.Literal("left"),n.Literal("right"),n.Literal("largest")],{description:"Text wrapping side"}),Si=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(X$),align:n.Optional(Z$),offset:n.Optional(n.Union([n.Number({description:"Horizontal offset in twips (1/20 of a point)"}),n.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:n.Optional(n.Object({relative:n.Optional(Q$),align:n.Optional(ev),offset:n.Optional(n.Union([n.Number({description:"Vertical offset in twips (1/20 of a point)"}),n.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:n.Optional(n.Object({type:tv,side:n.Optional(rv),margins:n.Optional(n.Object({top:n.Optional(n.Union([n.Number({description:"Top margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Top margin as percentage of page height"})])),bottom:n.Optional(n.Union([n.Number({description:"Bottom margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Bottom margin as percentage of page height"})])),left:n.Optional(n.Union([n.Number({description:"Left margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Left margin as percentage of page width"})])),right:n.Optional(n.Union([n.Number({description:"Right margin in twips"}),n.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:n.Optional(n.Boolean({description:"Allow element to overlap with other elements"})),behindDocument:n.Optional(n.Boolean({description:"Place element behind document text"})),lockAnchor:n.Optional(n.Boolean({description:"Lock the anchor position"})),layoutInCell:n.Optional(n.Boolean({description:"Layout element within table cell"})),zIndex:n.Optional(n.Number({minimum:0,description:"Z-order for overlapping elements (must be non-negative)"})),rotation:n.Optional(n.Number({description:"Rotation angle in degrees"})),visibility:n.Optional(n.Union([n.Literal("hidden"),n.Literal("inherit")],{description:"Visibility of the floating element"}))},{description:"Floating element properties",additionalProperties:!1}),Pg=n.Object({start:n.Optional(n.Number({minimum:1})),style:n.Optional(n.Union([n.Literal("decimal"),n.Literal("lowerLetter"),n.Literal("upperLetter"),n.Literal("lowerRoman"),n.Literal("upperRoman")])),separator:n.Optional(n.String())},{description:"Numbering configuration for lists",additionalProperties:!1}),nv={},Eg=n.Object(nv,{description:"Base component props",additionalProperties:!0});var iv=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Ic=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],wc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],Mn=n.Union([iv,...Ic.map(e=>n.Literal(e)),...wc.map(e=>n.Literal(e))],{description:"Hex color or semantic theme color name"}),Xi=["title","subtitle","heading1","heading2","heading3","body","caption",...Wi],_a=n.Union(Xi.map(e=>n.Literal(e)),{description:"Predefined style name"}),Ma=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Horizontal alignment options"}),Ii=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical alignment options"}),Qi=n.Object({type:n.Optional(n.Union([n.Literal("outer"),n.Literal("inner")],{description:"Shadow type"})),color:n.Optional(Mn),blur:n.Optional(n.Number({description:"Shadow blur radius in points"})),offset:n.Optional(n.Number({description:"Shadow offset in points"})),angle:n.Optional(n.Number({description:"Shadow angle in degrees"})),opacity:n.Optional(n.Number({minimum:0,maximum:1,description:"Shadow opacity (0-1)"}))},{description:"Shadow configuration",additionalProperties:!1}),rn=n.Object({column:n.Number({minimum:0,description:"Starting column (0-indexed)"}),row:n.Number({minimum:0,description:"Starting row (0-indexed)"}),columnSpan:n.Optional(n.Number({minimum:1,description:"Number of columns to span (default: 1)"})),rowSpan:n.Optional(n.Number({minimum:1,description:"Number of rows to span (default: 1)"}))},{additionalProperties:!1,description:"Grid-based positioning"}),Cc=n.Object({text:n.String({description:"Run text content"}),color:n.Optional(n.String({description:"Run color (hex without # or semantic theme name)"})),bold:n.Optional(n.Boolean({description:"Bold run"})),fontWeight:n.Optional(n.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:n.Optional(n.Boolean({description:"Italic run"})),underline:n.Optional(n.Union([n.Boolean({description:"Simple underline toggle"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")])),color:n.Optional(n.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:n.Optional(n.Boolean({description:"Strikethrough run"})),fontSize:n.Optional(n.Number({minimum:1,description:"Run font size in points"})),fontFace:n.Optional(n.String({description:"Run font family"})),superscript:n.Optional(n.Boolean({description:"Render run as superscript"})),subscript:n.Optional(n.Boolean({description:"Render run as subscript"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points"})),breakLine:n.Optional(n.Boolean({description:"Insert line break after this run"}))},{description:"A styled text run. Run options override component-level defaults.",additionalProperties:!1}),Ba=n.Object({text:n.Optional(n.String({description:"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two."})),runs:n.Optional(n.Array(Cc,{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:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fit:n.Optional(n.Object({maxLines:n.Optional(n.Integer({minimum:1,description:"Lines the text may occupy, estimated with the width model at the effective font size."})),shrink:n.Optional(n.Array(n.Number({minimum:1}),{minItems:1,description:"Readable font sizes to try in order when the text exceeds maxLines or the box height. The first that fits is used."}))},{additionalProperties:!1,description:"Bounded fit: estimate the lines at the effective size, step down only through the declared readable sizes, and fail generation with text_fit_overflow when nothing fits. Without maxLines the box height bounds the text; without shrink the text must fit as sized."})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size in points"})),fontFace:n.Optional(Ht),color:n.Optional(n.String({description:\'Text color (hex without #, e.g., "FF0000")\'})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.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:n.Optional(n.Boolean({description:"Italic text"})),underline:n.Optional(n.Union([n.Boolean({description:"Simple underline toggle"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")])),color:n.Optional(n.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:n.Optional(n.Boolean({description:"Strikethrough text"})),language:n.Optional(n.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:n.Optional(Ma),valign:n.Optional(Ii),breakLine:n.Optional(n.Boolean({description:"Add line break after text"})),bullet:n.Optional(n.Union([n.Boolean({description:"Enable default bullet"}),n.Object({type:n.Optional(n.Union([n.Literal("bullet"),n.Literal("number")])),style:n.Optional(n.String({description:"Bullet character or style"})),startAt:n.Optional(n.Number({description:"Starting number for numbered lists"}))},{additionalProperties:!1})])),margin:n.Optional(n.Union([n.Number({description:"Margin in points (all sides)"}),n.Array(n.Number(),{description:"Margins as [top, right, bottom, left] in points",minItems:4,maxItems:4})])),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),shadow:n.Optional(Qi),fill:n.Optional(n.Object({color:n.String({description:"Fill color (hex without #)"}),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"}))},{additionalProperties:!1})),hyperlink:n.Optional(n.Object({url:n.Optional(n.String({description:"Hyperlink URL"})),slide:n.Optional(n.Number({description:"Slide number to link to"})),tooltip:n.Optional(n.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),lineSpacing:n.Optional(n.Number({description:"Line spacing in points"})),lineSpacingMultiple:n.Optional(n.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:n.Optional(n.Number({description:"Character spacing in points (positive = wider, negative = tighter)"})),paraSpaceBefore:n.Optional(n.Number({description:"Space before paragraph in points"})),paraSpaceAfter:n.Optional(n.Number({description:"Space after paragraph in points"})),grid:n.Optional(rn),style:n.Optional(_a)},{description:"Text component props",additionalProperties:!1}),Va=n.Object({path:n.Optional(n.String({description:"Image file path or URL (mutually exclusive with base64 and svg)"})),base64:n.Optional(n.String({description:"Base64-encoded image data in data URI format (mutually exclusive with path and svg)"})),svg:n.Optional(n.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:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),sizing:n.Optional(n.Object({type:n.Union([n.Literal("contain"),n.Literal("cover"),n.Literal("crop")],{description:"Image sizing strategy"}),w:n.Optional(n.Number({description:"Target width in inches"})),h:n.Optional(n.Number({description:"Target height in inches"}))},{description:"Image sizing options",additionalProperties:!1})),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),rounding:n.Optional(n.Boolean({description:"Apply rounded corners to image"})),shadow:n.Optional(Qi),hyperlink:n.Optional(n.Object({url:n.Optional(n.String({description:"Hyperlink URL"})),slide:n.Optional(n.Number({description:"Slide number to link to"})),tooltip:n.Optional(n.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),grid:n.Optional(rn)},{description:"PPTX image component props",additionalProperties:!1}),Zi=n.Union([n.Literal("rect"),n.Literal("roundRect"),n.Literal("ellipse"),n.Literal("triangle"),n.Literal("diamond"),n.Literal("pentagon"),n.Literal("hexagon"),n.Literal("star5"),n.Literal("star6"),n.Literal("line"),n.Literal("arc"),n.Literal("pie"),n.Literal("blockArc"),n.Literal("chord"),n.Literal("arrow"),n.Literal("chevron"),n.Literal("cloud"),n.Literal("heart"),n.Literal("lightning")],{description:"Shape type"}),$g=n.Object({text:n.String(),fontSize:n.Optional(n.Number({minimum:1})),fontFace:n.Optional(n.String()),color:n.Optional(n.String({description:"Segment color (hex without # or semantic name)"})),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),breakLine:n.Optional(n.Boolean({description:"Insert line break after this segment"})),spaceBefore:n.Optional(n.Number({minimum:0,description:"Space before paragraph in points"})),spaceAfter:n.Optional(n.Number({minimum:0,description:"Space after paragraph in points"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points"}))},{additionalProperties:!1}),Tc=["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"],Pc=n.Object({color:n.String({description:"Stop color (hex without # or semantic theme name)"}),pos:n.Number({minimum:0,maximum:100,description:"Stop position along the gradient (0-100)"}),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Stop transparency (0-100)"}))},{additionalProperties:!1,description:"Gradient color stop"}),eo=n.Object({type:n.Union([n.Literal("linear"),n.Literal("radial")],{description:"Gradient type"}),angle:n.Optional(n.Number({minimum:0,maximum:360,description:"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0."})),stops:n.Array(Pc,{minItems:2,description:"Gradient color stops (at least 2)"}),focus:n.Optional(n.Union([n.Literal("center"),n.Literal("topLeft"),n.Literal("topRight"),n.Literal("bottomLeft"),n.Literal("bottomRight")],{description:\'Focus point for radial gradients (default: "center")\'}))},{additionalProperties:!1,description:"Gradient fill configuration"}),Ec=n.Object({preset:n.Union(Tc.map(e=>n.Literal(e)),{description:"OOXML pattern preset name (a:pattFill prst value)"}),foreground:n.String({description:"Pattern foreground color (hex without # or semantic name)"}),background:n.String({description:"Pattern background color (hex without # or semantic name)"})},{additionalProperties:!1,description:"Pattern fill configuration"}),Ka=n.Object({type:Zi,x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fill:n.Optional(n.Object({color:n.Optional(n.String({description:"Fill color (hex without #)"})),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"})),gradient:n.Optional(eo),pattern:n.Optional(Ec)},{additionalProperties:!1})),line:n.Optional(n.Object({color:n.Optional(n.String({description:"Line color (hex without #)"})),width:n.Optional(n.Number({minimum:0,description:"Line width in points"})),dashType:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("dashDot")]))},{additionalProperties:!1})),text:n.Optional(n.Union([n.String({description:"Plain text"}),n.Array($g,{description:"Rich text segments with per-segment formatting"})],{description:"Text content inside the shape"})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size for shape text"})),fontFace:n.Optional(n.String({description:"Font family for shape text"})),fontColor:n.Optional(n.String({description:"Font color for shape text (hex without #)"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points for shape text"})),bold:n.Optional(n.Boolean({description:"Bold shape text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-shape weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic shape text"})),align:n.Optional(Ma),valign:n.Optional(Ii),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),angleRange:n.Optional(n.Array(n.Number(),{minItems:2,maxItems:2,description:"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"})),flipH:n.Optional(n.Boolean({description:"Flip shape horizontally"})),flipV:n.Optional(n.Boolean({description:"Flip shape vertically"})),shadow:n.Optional(Qi),rectRadius:n.Optional(n.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:n.Optional(rn),style:n.Optional(_a)},{description:"Shape component props",additionalProperties:!1}),ov=n.Union([n.String({description:"Simple text cell"}),n.Object({text:n.String({description:"Cell text content"}),color:n.Optional(n.String({description:"Text color (hex without #)"})),fill:n.Optional(n.String({description:"Cell background color (hex without #)"})),fontSize:n.Optional(n.Number({description:"Font size in points"})),fontFace:n.Optional(n.String({description:"Font family"})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic text"})),align:n.Optional(Ma),valign:n.Optional(Ii),colspan:n.Optional(n.Number({minimum:1,description:"Column span"})),rowspan:n.Optional(n.Number({minimum:1,description:"Row span"})),margin:n.Optional(n.Union([n.Number({description:"Margin in points (all sides)"}),n.Array(n.Number(),{minItems:4,maxItems:4})]))},{additionalProperties:!1})]),Ga=n.Object({rows:n.Array(n.Array(ov,{description:"Row of cells"}),{description:"Table rows (array of arrays)",minItems:1}),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),colW:n.Optional(n.Union([n.Number({description:"Uniform column width in inches"}),n.Array(n.Number(),{description:"Individual column widths in inches"})])),rowH:n.Optional(n.Union([n.Number({description:"Uniform row height in inches"}),n.Array(n.Number(),{description:"Individual row heights in inches"})])),border:n.Optional(n.Object({type:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("none")])),pt:n.Optional(n.Number({minimum:0,description:"Border width in points"})),color:n.Optional(n.String({description:"Border color (hex without #)"}))},{additionalProperties:!1})),fill:n.Optional(n.String({description:"Table background color (hex without #)"})),fontSize:n.Optional(n.Number({minimum:1,description:"Default font size for all cells"})),fontFace:n.Optional(n.String({description:"Default font family for all cells"})),fontWeight:n.Optional(n.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:n.Optional(n.String({description:"Default text color for all cells (hex without #)"})),align:n.Optional(Ma),valign:n.Optional(Ii),headerRow:n.Optional(n.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:n.Optional(n.Boolean({description:"Auto-paginate table across multiple slides when content overflows"})),autoPageRepeatHeader:n.Optional(n.Boolean({description:"Repeat first row as header on each auto-paged slide"})),margin:n.Optional(n.Union([n.Number({description:"Cell margin in points (all sides)"}),n.Array(n.Number(),{minItems:4,maxItems:4})])),borderRadius:n.Optional(n.Number({minimum:0,description:"Rounded corner radius in inches. Renders a roundRect shape behind the table."})),grid:n.Optional(rn)},{description:"PPTX table component props",additionalProperties:!1}),qa=n.Object({options:n.Intersect([n.Record(n.String(),n.Unknown()),n.Object({chart:n.Object({width:n.Number(),height:n.Number()})})]),scale:n.Optional(n.Number()),serverUrl:n.Optional(n.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),resources:n.Optional(n.Object({css:n.Optional(n.String()),js:n.Optional(n.String()),files:n.Optional(n.Array(n.String()))})),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),grid:n.Optional(rn)},{description:"PPTX Highcharts component props",additionalProperties:!1}),Sc=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),av=n.Union([n.Literal("area"),n.Literal("bar"),n.Literal("bar3D"),n.Literal("bubble"),n.Literal("doughnut"),n.Literal("line"),n.Literal("pie"),n.Literal("radar"),n.Literal("scatter")],{description:"Chart type"}),sv=n.Object({name:n.Optional(n.String({description:"Series name"})),labels:n.Optional(n.Array(n.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:n.Optional(n.Array(n.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."})),sizes:n.Optional(n.Array(n.Number(),{description:"Bubble sizes (bubble charts only)"}))},{additionalProperties:!1}),Ag=n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("none")],{description:"Grid line style"})),size:n.Optional(n.Number({minimum:0,description:"Grid line width (points)"})),color:n.Optional(n.String({description:"Grid line color (hex or semantic)"}))},{additionalProperties:!1,description:"Axis grid line styling"}),Wa=n.Object({type:av,data:n.Array(sv,{description:"Chart data series",minItems:1}),showLegend:n.Optional(n.Boolean({description:"Show chart legend"})),showTitle:n.Optional(n.Boolean({description:"Show chart title"})),showValue:n.Optional(n.Boolean({description:"Show data values"})),showPercent:n.Optional(n.Boolean({description:"Show percentages (pie/doughnut)"})),showLabel:n.Optional(n.Boolean({description:"Show category labels on data points"})),showSerName:n.Optional(n.Boolean({description:"Show series name on data points"})),title:n.Optional(n.String({description:"Chart title text"})),titleFontSize:n.Optional(n.Number({description:"Title font size (points)"})),titleColor:n.Optional(n.String({description:"Title color (hex or semantic)"})),titleFontFace:n.Optional(n.String({description:"Title font face"})),titleFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),chartColors:n.Optional(n.Array(n.String(),{description:"Series colors (hex or semantic theme names). Defaults to theme palette."})),dataBorder:n.Optional(n.Object({pt:n.Number({minimum:0,description:"Border width (points)"}),color:n.String({description:"Border color (hex or semantic)"})},{additionalProperties:!1,description:"Outline on data elements (bars, slices, areas)"})),legendPos:n.Optional(n.Union([n.Literal("b"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("tr")],{description:"Legend position"})),legendFontSize:n.Optional(n.Number({description:"Legend font size"})),legendFontFace:n.Optional(n.String({description:"Legend font face"})),legendFontWeight:n.Optional(n.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:n.Optional(n.String({description:"Legend text color"})),catAxisTitle:n.Optional(n.String({description:"Category axis title"})),catAxisHidden:n.Optional(n.Boolean({description:"Hide category axis"})),catAxisLabelRotate:n.Optional(n.Number({description:"Category axis label rotation (degrees)"})),catAxisLabelFontSize:n.Optional(n.Number({description:"Category axis label font size"})),catAxisLabelColor:n.Optional(n.String({description:"Category axis label color (hex or semantic)"})),catAxisLabelFontFace:n.Optional(n.String({description:"Category axis label font face"})),catAxisLabelFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),catGridLine:n.Optional(Ag),valAxisTitle:n.Optional(n.String({description:"Value axis title"})),valAxisHidden:n.Optional(n.Boolean({description:"Hide value axis"})),valAxisMinVal:n.Optional(n.Number({description:"Value axis minimum"})),valAxisMaxVal:n.Optional(n.Number({description:"Value axis maximum"})),valAxisLabelFormatCode:n.Optional(n.String({description:\'Value axis label format (e.g. "$0.00", "#%")\'})),valAxisMajorUnit:n.Optional(n.Number({description:"Value axis major unit / tick interval"})),valAxisLabelColor:n.Optional(n.String({description:"Value axis label color (hex or semantic)"})),valAxisLabelFontFace:n.Optional(n.String({description:"Value axis label font face"})),valAxisLabelFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),valAxisLabelFontSize:n.Optional(n.Number({description:"Value axis label font size"})),valGridLine:n.Optional(Ag),catAxisLineShow:n.Optional(n.Boolean({description:"Show the category axis line"})),valAxisLineShow:n.Optional(n.Boolean({description:"Show the value axis line"})),barDir:n.Optional(n.Union([n.Literal("bar"),n.Literal("col")],{description:\'Bar direction: "bar" (horizontal) or "col" (vertical, default)\'})),barGrouping:n.Optional(n.Union([n.Literal("clustered"),n.Literal("stacked"),n.Literal("percentStacked")],{description:"Bar grouping style"})),barGapWidthPct:n.Optional(n.Number({minimum:0,maximum:500,description:"Bar gap width (0-500%)"})),barOverlapPct:n.Optional(n.Number({minimum:-100,maximum:100,description:"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."})),lineSmooth:n.Optional(n.Boolean({description:"Smooth lines"})),lineDataSymbol:n.Optional(n.Union([n.Literal("circle"),n.Literal("dash"),n.Literal("diamond"),n.Literal("dot"),n.Literal("none"),n.Literal("square"),n.Literal("triangle")],{description:"Line data point marker symbol"})),lineSize:n.Optional(n.Number({description:"Line width (points)"})),lineDataSymbolSize:n.Optional(n.Number({minimum:2,maximum:72,description:"Line data point marker size (points)"})),firstSliceAng:n.Optional(n.Number({minimum:0,maximum:359,description:"Angle of first slice (degrees)"})),holeSize:n.Optional(n.Number({minimum:10,maximum:90,description:"Doughnut hole size (%)"})),radarStyle:n.Optional(n.Union([n.Literal("standard"),n.Literal("marker"),n.Literal("filled")],{description:"Radar chart style"})),dataLabelColor:n.Optional(n.String({description:"Data label text color"})),dataLabelFontSize:n.Optional(n.Number({description:"Data label font size"})),dataLabelFontFace:n.Optional(n.String({description:"Data label font face"})),dataLabelFontWeight:n.Optional(n.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:n.Optional(n.Boolean({description:"Bold data labels"})),dataLabelPosition:n.Optional(n.Union([n.Literal("b"),n.Literal("bestFit"),n.Literal("ctr"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("inEnd"),n.Literal("outEnd")],{description:"Data label position"})),x:n.Optional(Sc("X position in inches","X as percentage")),y:n.Optional(Sc("Y position in inches","Y as percentage")),w:n.Optional(Sc("Width in inches","Width as percentage")),h:n.Optional(Sc("Height in inches","Height as percentage")),grid:n.Optional(rn)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function wi(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var tn=[{name:"text",propsSchema:Ba,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:Va,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Ka,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:Ga,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:qa,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Wa,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 Yi(e){return n.Object({name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:wi(e)?e.propsSchema:n.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var Ha=n.Union([Yi(tn[0]),Yi(tn[1]),Yi(tn[2]),Yi(tn[3]),Yi(tn[4]),Yi(tn[5])],{$id:"PptxSlideContent",discriminator:{propertyName:"name"},description:"A single PPTX slide content element (text, image, shape, table, highcharts, or chart)."});var Bn=n.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")\'}),cv="^-?\\\\d+(\\\\.\\\\d+)?%$",lv="^\\\\d+(\\\\.\\\\d+)?%$",vg=n.Union([n.Number({description:"Inches from the canvas origin"}),n.String({pattern:cv,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Lg=n.Union([n.Number({minimum:0,description:"Size in inches"}),n.String({pattern:lv,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),Em={x:n.Optional(vg),y:n.Optional(vg),w:n.Optional(Lg),h:n.Optional(Lg),rotate:n.Optional(n.Number({description:"Clockwise rotation in degrees"}))},Rg=n.Union([n.Boolean({description:"Single underline in the text colour"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")],{description:\'Underline style (default "sng")\'})),color:n.Optional(Bn)},{additionalProperties:!1})],{description:"Underline: true for a single line, or a style/colour object"}),Ac={fontFace:n.Optional(n.String({description:"Font family name"})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size in points"})),bold:n.Optional(n.Boolean()),italic:n.Optional(n.Boolean())},pv=n.Object({text:n.String({description:"Run text"}),color:n.Optional(Bn),...Ac,underline:n.Optional(Rg),strike:n.Optional(n.Boolean({description:"Strikethrough"})),breakLine:n.Optional(n.Boolean({description:"Start a new line after this run"}))},{additionalProperties:!1,description:"A formatted run inside a native visual text element"}),mv=n.Object({text:n.String({description:"Segment text"}),color:n.Optional(Bn),...Ac,breakLine:n.Optional(n.Boolean({description:"Start a new line after this segment"}))},{additionalProperties:!1,description:"A formatted segment of a native visual shape\\u2019s text"}),Ng=n.Object({color:n.Optional(Bn),transparency:n.Optional(n.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."}),uv=n.Object({color:n.Optional(Bn),width:n.Optional(n.Number({minimum:0,description:"Outline width in points"})),dashType:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("dashDot")],{description:\'Outline dash pattern (default "solid")\'}))},{additionalProperties:!1,description:"Shape outline"}),kg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Fg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),jg=n.Union([n.Number({minimum:0,description:"Inset on every side, in points"}),n.Array(n.Number({minimum:0}),{minItems:4,maxItems:4,description:"Insets as [top, right, bottom, left], in points"})],{description:"Text insets in points"}),Am=n.Object({text:n.Optional(n.String({description:"Plain text content"})),runs:n.Optional(n.Array(pv,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...Em,color:n.Optional(Bn),...Ac,underline:n.Optional(Rg),strike:n.Optional(n.Boolean({description:"Strikethrough"})),align:n.Optional(kg),valign:n.Optional(Fg),margin:n.Optional(jg),fill:n.Optional(Ng)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),$m=n.Object({type:Zi,...Em,fill:n.Optional(Ng),line:n.Optional(uv),text:n.Optional(n.Union([n.String(),n.Array(mv,{minItems:1})],{description:"Text drawn inside the shape"})),...Ac,fontColor:n.Optional(Bn),align:n.Optional(kg),valign:n.Optional(Fg),margin:n.Optional(jg),flipH:n.Optional(n.Boolean({description:"Mirror horizontally"})),flipV:n.Optional(n.Boolean({description:"Mirror vertically"}))},{additionalProperties:!1,description:"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group"}),vm=n.Object({path:n.Optional(n.String({description:"File path or http(s) URL"})),base64:n.Optional(n.String({description:"Base64 data URI"})),svg:n.Optional(n.String({description:"Raw SVG markup"})),...Em,sizing:n.Optional(n.Object({type:n.Union([n.Literal("contain"),n.Literal("cover"),n.Literal("crop")],{description:"How the image fills its box"}),w:n.Optional(n.Number({minimum:0,description:\'Box width in inches; overrides the element\\u2019s own "w"\'})),h:n.Optional(n.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:n.Optional(n.String({description:"Alternative text for accessibility"}))},{additionalProperties:!1,description:"Native visual image element \\u2014 becomes a native picture inside the drawing group"}),Ug=["text","shape","image"];function wm(e,t,r){return n.Object({name:n.Literal(e),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this element is filtered out and not drawn. Defaults to true."})),props:t},{additionalProperties:!1,description:r})}var Lm=n.Union([wm("text",Am,"Text element - a native Word text box drawn on the visual canvas."),wm("shape",$m,"Shape element - a native preset-geometry shape, optionally holding text."),wm("image",vm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),Rm=n.Object({width:n.Number({minimum:.1,description:"Canvas width in inches"}),height:n.Number({minimum:.1,description:"Canvas height in inches"}),background:n.Optional(n.Object({color:n.Optional(Bn),image:n.Optional(n.Object({path:n.Optional(n.String()),base64:n.Optional(n.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"}),Nm=n.Object({color:n.Optional(n.String({description:\'Background color (hex like "#FFFFFF" or a theme color name)\'})),image:n.Optional(n.Object({path:n.Optional(n.String()),base64:n.Optional(n.String())},{additionalProperties:!1}))},{additionalProperties:!1}),km=n.Object({width:n.Number({minimum:.1,description:"Canvas width in inches (pptx slideWidth)"}),height:n.Number({minimum:.1,description:"Canvas height in inches (pptx slideHeight)"}),theme:n.Optional(n.String({description:"pptx theme name applied to the slide"})),background:n.Optional(Nm)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),Dg={width:n.Optional(n.Union([n.Number({minimum:1,description:"Rendered width in pixels"}),n.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:n.Optional(n.Union([n.Number({minimum:1,description:"Rendered height in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered height as percentage (e.g. "90%")\'})])),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),spacing:n.Optional(Tt),floating:n.Optional(Si),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"}))},Fm=n.Object({renderMode:n.Optional(n.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:km,elements:n.Optional(n.Array(Ha,{description:"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches"})),dpi:n.Optional(n.Number({minimum:Ra,maximum:Na,default:La,description:`Raster resolution in DPI (default ${La}, range ${Ra}-${Na}). Higher = sharper + larger.`})),serverUrl:n.Optional(n.String({description:"Rasterization service URL override (default from services.pptx)"})),...Dg},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),jm=n.Object({renderMode:n.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:Rm,elements:n.Optional(n.Array(Lm,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...Dg},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),$c=n.Union([Fm,jm],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),vc="native";function _g(e){return!!e&&e.renderMode===vc}var Tr=["docxjs","office-open"],za="docxjs",dv=new Set(["text","shape","image"]);function nn(e){return`ComponentDefinition_${e}`}function Lc(e,t,r){let i=Pm(t);return Tm(i,nn(r)),e==="visual"&&r!=="office-open"?hv(i)??i:(r==="office-open"&&Cm(i),i)}function Rc(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??za;if(!Tr.includes(r))return[{path:"/renderer",message:`Invalid renderer "${String(r)}". Expected "docxjs" or "office-open".`,code:"invalid_value"}];let i=[],o=r==="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(o){let p=l.comment;if(p&&typeof p=="object"&&!Array.isArray(p)){let m=p;for(let u of["replies","resolved"])m[u]!==void 0&&i.push({path:`${c}/comment/${u}`,message:\'The "office-open" renderer does not support comment threads.\',code:"unsupported_renderer_feature"})}}l.name==="visual"&&fv(l,`${c}`,o,i),l.name==="chart"&&!o&&i.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,""),i}function fv(e,t,r,i){let o=e.props;if(!o||typeof o!="object"||Array.isArray(o))return;let a=o;if(a.renderMode!==vc)return;if(!r){i.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"||dv.has(p)||i.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 hv(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Cm(e){if(Array.isArray(e)){e.forEach(Cm);return}if(!e||typeof e!="object")return;let t=e,r=t.properties;if(r?.text&&r?.author&&(r.replies||r.resolved)&&typeof t.description=="string"&&t.description.includes("Word review comment")){delete r.replies,delete r.resolved;let i=t.required;i&&(t.required=i.filter(o=>o!=="replies"&&o!=="resolved"))}for(let i of Reflect.ownKeys(t))Cm(t[i])}function Tm(e,t){if(Array.isArray(e)){e.forEach(i=>Tm(i,t));return}if(!e||typeof e!="object")return;let r=e;r.type==="array"&&r.items&&typeof r.items=="object"&&Object.keys(r.items).length===0&&r.items[g]==="Any"&&(r.items={$ref:t});for(let i of Reflect.ownKeys(r))Tm(r[i],t)}function Pm(e){if(Array.isArray(e))return e.map(Pm);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Pm(e[r]);return t}function Mg(e){let t=e.definitions??{},r=new Map;for(let o of Tr){let a=nn(o);t[a]&&r.set(o,ka(t,a,["docx","section"]))}let i=o=>{if(!o||typeof o!="object")return;if(Array.isArray(o)){o.forEach(i);return}let a=o;if(a.properties?.name?.const==="docx"){let s=r.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c)){l.properties.body.items=s;for(let p of["header","footer"])l.properties.section.properties[p].items=s}}Object.values(a).forEach(i)};i(e)}function Bg(e){let t=e.definitions??{};return Tr.filter(r=>t[nn(r)]).map(r=>{let i=nn(r);return{name:i,componentRef:{$ref:`#/definitions/${i}`}}})}var Mm=n.Object({type:n.Union([n.Literal("equal"),n.Literal("insert"),n.Literal("delete")],{description:"Segment kind: \'equal\' renders as normal text, \'insert\' as a tracked insertion, \'delete\' as a tracked deletion"}),text:n.String({description:"Literal text of this segment (rendered without markdown)"})},{description:"A contiguous run of text sharing one revision state",additionalProperties:!1}),to=n.Object({author:n.Optional(n.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:n.Optional(n.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"})),segments:n.Array(Mm,{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}),Bm=n.Object({type:n.Union([n.Literal("insert"),n.Literal("delete")],{description:"Whether the element was inserted or deleted"}),author:n.Optional(n.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:n.Optional(n.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}),Kg={text:n.String({minLength:1,description:"Comment body. Newlines split it into separate paragraphs in the comment pane."}),author:n.Optional(n.String({description:\'Comment author shown in Word (default: "json-to-office")\'})),initials:n.Optional(n.String({description:"Author initials shown on the comment bubble (derived from the author when omitted)"})),date:n.Optional(n.String({format:"date-time",description:"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},Vm=n.Object(Kg,{description:"A reply within a comment thread",additionalProperties:!1}),ro=n.Object({...Kg,replies:n.Optional(n.Array(Vm,{minItems:1,description:"Replies, in order. They anchor to the same text and Word shows them as one thread."})),resolved:n.Optional(n.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}),on=n.Object({text:n.String({description:"Heading text (required)"}),level:n.Optional(Oc),font:n.Optional(n.Partial(Zr)),language:n.Optional(bm),noProof:n.Optional(Om),noProofWords:n.Optional(Fa),alignment:n.Optional(ja),spacing:n.Optional(Tt),indent:n.Optional(Da),lineSpacing:n.Optional(n.Union([n.Number({minimum:0}),Ua],{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:n.Optional(n.Boolean({description:"Insert page break before heading"})),columnBreak:n.Optional(n.Boolean({description:"Insert column break before heading"})),numbering:n.Optional(n.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:n.Optional(n.Boolean({description:"Keep heading with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of heading together on same page"})),revision:n.Optional(to),comment:n.Optional(ro)},{description:"Heading component props",additionalProperties:!1}),Nc=n.Object({id:n.String({minLength:1,pattern:"^[^\\\\]\\\\s]+$",description:\'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".\'}),text:n.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}),Km=n.Array(Nc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),Gm=n.Array(Nc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),gv=n.Union([n.Literal("around"),n.Literal("none"),n.Literal("notBeside"),n.Literal("through"),n.Literal("tight"),n.Literal("auto")],{description:"Frame text wrapping type"}),Vg=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Frame anchor type"}),yv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Frame horizontal alignment"}),bv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Frame vertical alignment"}),Ov=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(Vg),align:n.Optional(yv),offset:n.Optional(n.Union([n.Number({description:"Horizontal offset in twips (1/20 of a point)"}),n.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:n.Optional(n.Object({relative:n.Optional(Vg),align:n.Optional(bv),offset:n.Optional(n.Union([n.Number({description:"Vertical offset in twips (1/20 of a point)"}),n.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:n.Optional(n.Object({type:gv},{description:"Text wrapping configuration",additionalProperties:!1})),lockAnchor:n.Optional(n.Boolean({description:"Lock the anchor position"})),width:n.Optional(n.Number({minimum:1,description:"Frame width in twips (DXA units)"})),height:n.Optional(n.Number({minimum:1,description:"Frame height in twips (DXA units)"}))},{description:"Floating text frame properties",additionalProperties:!1}),xv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Paragraph text alignment"}),an=n.Object({text:n.String({description:"Text content (required)"}),font:n.Optional(n.Partial(Zr)),themeStyle:n.Optional(n.String()),language:n.Optional(bm),noProof:n.Optional(Om),noProofWords:n.Optional(Fa),boldColor:n.Optional(X),spacing:n.Optional(Tt),alignment:n.Optional(xv),indent:n.Optional(Da),tabStops:n.Optional(xc),pageBreak:n.Optional(n.Boolean({description:"Insert page break before paragraph"})),columnBreak:n.Optional(n.Boolean({description:"Insert column break before paragraph"})),floating:n.Optional(Ov),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"})),id:n.Optional(n.String({description:"Unique identifier for internal linking (bookmark anchor)"})),revision:n.Optional(to),comment:n.Optional(ro),footnotes:n.Optional(Km),endnotes:n.Optional(Gm)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),sn=n.Object({path:n.Optional(n.String({description:"Image source URL or file path (mutually exclusive with base64 and svg)"})),base64:n.Optional(n.String({description:\'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)\'})),svg:n.Optional(n.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:n.Optional(n.String({description:"Alternative text for accessibility"})),width:n.Optional(n.Union([n.Number({minimum:1,description:"Image width in pixels"}),n.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:n.Optional(n.Union([n.Number({minimum:1,description:"Image height in pixels"}),n.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:n.Optional(n.Union([n.Literal("content"),n.Literal("page")],{description:"Reference for width percentages: content (page width minus margins) or page (full page width)",default:"content"})),heightRelativeTo:n.Optional(n.Union([n.Literal("content"),n.Literal("page")],{description:"Reference for height percentages: content (page height minus margins) or page (full page height)",default:"content"})),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:n.Optional(Tt),floating:n.Optional(Si),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:"Image component props",additionalProperties:!1}),cn=n.Object({number:n.String({description:"Statistic number/value (required)"}),description:n.String({description:"Statistic description (required)"}),unit:n.Optional(n.String({description:"Unit of measurement"})),format:n.Optional(n.String({description:"Number format pattern"})),trend:n.Optional(n.Union([n.Literal("up"),n.Literal("down"),n.Literal("neutral")])),trendValue:n.Optional(n.Union([n.String(),n.Number()])),alignment:n.Optional(en),spacing:n.Optional(Tt),size:n.Optional(n.Union([n.Literal("small"),n.Literal("medium"),n.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),Sv=n.Recursive(e=>n.Union([n.String(),n.Object({name:n.String(),props:n.Object({},{additionalProperties:!0}),children:n.Optional(n.Array(e))},{additionalProperties:!1})])),Gg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),qg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical cell alignment"}),Wg=n.Object({family:n.Optional(n.String({description:"Font family name"})),size:n.Optional(n.Number({minimum:0,description:"Font size in points"})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic text"})),underline:n.Optional(n.Boolean({description:"Underlined text"})),lineSpacing:n.Optional(n.Object({...Ua.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}),Dm=n.Union([n.String({description:"Border color for all sides (hex without #)"}),n.Object({bottom:n.Optional(n.String({description:"Bottom border color (hex without #)"})),top:n.Optional(n.String({description:"Top border color (hex without #)"})),right:n.Optional(n.String({description:"Right border color (hex without #)"})),left:n.Optional(n.String({description:"Left border color (hex without #)"}))},{additionalProperties:!1})]),_m=n.Union([n.Number({minimum:0,description:"Border size for all sides in points"}),n.Object({bottom:n.Optional(n.Number({minimum:0,description:"Bottom border size in points"})),top:n.Optional(n.Number({minimum:0,description:"Top border size in points"})),right:n.Optional(n.Number({minimum:0,description:"Right border size in points"})),left:n.Optional(n.Number({minimum:0,description:"Left border size in points"}))},{additionalProperties:!1})]),Iv=n.Union([n.Boolean({description:"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border"}),n.Object({bottom:n.Optional(n.Boolean({description:"Hide bottom border"})),top:n.Optional(n.Boolean({description:"Hide top border"})),right:n.Optional(n.Boolean({description:"Hide right border"})),left:n.Optional(n.Boolean({description:"Hide left border"})),insideHorizontal:n.Optional(n.Boolean({description:"Hide horizontal borders between rows"})),insideVertical:n.Optional(n.Boolean({description:"Hide vertical borders between columns"}))},{description:"Selectively hide specific borders",additionalProperties:!1})]),Hg=n.Union([n.Number({minimum:0,description:"Padding for all sides in points"}),n.Object({bottom:n.Optional(n.Number({minimum:0,description:"Bottom padding in points"})),top:n.Optional(n.Number({minimum:0,description:"Top padding in points"})),right:n.Optional(n.Number({minimum:0,description:"Right padding in points"})),left:n.Optional(n.Number({minimum:0,description:"Left padding in points"}))},{additionalProperties:!1})]),Um=n.Object({color:n.Optional(X),backgroundColor:n.Optional(ym),horizontalAlignment:n.Optional(Gg),verticalAlignment:n.Optional(qg),font:n.Optional(Wg),borderColor:n.Optional(Dm),borderSize:n.Optional(_m),padding:n.Optional(Hg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function qm(e){let t=n.Union([n.String(),e]),r={color:n.Optional(X),backgroundColor:n.Optional(ym),horizontalAlignment:n.Optional(Gg),verticalAlignment:n.Optional(qg),font:n.Optional(Wg),borderColor:n.Optional(Dm),borderSize:n.Optional(_m),padding:n.Optional(Hg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"})),comment:n.Optional(ro),revision:n.Optional(to)},i=n.Object({...r,content:n.Optional(t)},{additionalProperties:!1}),o=n.Object({...r,content:n.Optional(t)},{additionalProperties:!1}),a=n.Object({width:n.Optional(n.Union([n.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."}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "40%")\'})])),cellDefaults:n.Optional(Um),header:n.Optional(i),cells:n.Optional(n.Array(o))},{additionalProperties:!1});return n.Object({borderColor:n.Optional(Dm),borderSize:n.Optional(_m),hideBorders:n.Optional(Iv),cellDefaults:n.Optional(Um),headerCellDefaults:n.Optional(Um),width:n.Optional(n.Number({minimum:0,maximum:100,description:"Table width in percentage (0-100)"})),columns:n.Array(a,{description:"Table columns with headers and cells",minItems:1}),rows:n.Optional(n.Array(n.Object({revision:n.Optional(Bm),cantSplit:n.Optional(n.Boolean({description:"Keep this row on one page"})),tableHeader:n.Optional(n.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:n.Optional(n.Boolean({description:"Keep table rows together on the same page by setting keepNext on all paragraphs"})),keepNext:n.Optional(n.Boolean({description:"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."})),repeatHeaderOnPageBreak:n.Optional(n.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 ln=qm(Sv),Wm=e=>n.Object({meta:n.Optional(n.Object({title:n.Optional(n.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:n.Optional(n.Union([n.Array(e||n.Any(),{description:"Section header components"}),n.Literal("linkToPrevious",{description:"Link header to previous section"})])),footer:n.Optional(n.Union([n.Array(e||n.Any(),{description:"Section footer components"}),n.Literal("linkToPrevious",{description:"Link footer to previous section"})])),pageBreak:n.Optional(n.Boolean({description:"Insert page break before section",default:!0})),spacing:n.Optional(Tt),page:n.Optional(n.Object({size:n.Optional(n.Union([n.Literal("A4"),n.Literal("A3"),n.Literal("LETTER"),n.Literal("LEGAL"),n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})})])),margins:n.Optional(n.Object({top:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0})),header:n.Optional(n.Number({minimum:0})),footer:n.Optional(n.Number({minimum:0})),gutter:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1}))},{description:"Page configuration override for this section (overrides theme page settings)",additionalProperties:!1}))},{description:"Section component props",additionalProperties:!1}),pn=Wm(),wv=n.Object({width:n.Optional(n.Union([n.Number({minimum:1,description:"Column width in points"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "30%")\'}),n.Literal("auto",{description:"Auto width: consume remaining space after fixed widths and gaps"})])),gap:n.Optional(n.Union([n.Number({minimum:0,description:"Gap after this column in points"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Gap after this column as percentage of available width (e.g., "5%")\'})]))},{additionalProperties:!1}),mn=n.Object({columns:n.Union([n.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),n.Array(wv,{minItems:1,description:"List of columns in order; width and gap can be points, percentages, or auto width"})]),gap:n.Optional(n.Union([n.Number({minimum:0,description:"Default gap applied after each column except the last (points)"}),n.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}),zg=n.Union([n.Literal("decimal"),n.Literal("upperRoman"),n.Literal("lowerRoman"),n.Literal("upperLetter"),n.Literal("lowerLetter"),n.Literal("bullet"),n.Literal("ordinal"),n.Literal("cardinalText"),n.Literal("ordinalText"),n.Literal("hex"),n.Literal("chicago"),n.Literal("ideographDigital"),n.Literal("japaneseCounting"),n.Literal("aiueo"),n.Literal("iroha"),n.Literal("decimalFullWidth"),n.Literal("decimalHalfWidth"),n.Literal("japaneseLegal"),n.Literal("japaneseDigitalTenThousand"),n.Literal("decimalEnclosedCircle"),n.Literal("decimalFullWidth2"),n.Literal("aiueoFullWidth"),n.Literal("irohaFullWidth"),n.Literal("decimalZero"),n.Literal("ganada"),n.Literal("chosung"),n.Literal("decimalEnclosedFullstop"),n.Literal("decimalEnclosedParen"),n.Literal("decimalEnclosedCircleChinese"),n.Literal("ideographEnclosedCircle"),n.Literal("ideographTraditional"),n.Literal("ideographZodiac"),n.Literal("ideographZodiacTraditional"),n.Literal("taiwaneseCounting"),n.Literal("ideographLegalTraditional"),n.Literal("taiwaneseCountingThousand"),n.Literal("taiwaneseDigital"),n.Literal("chineseCounting"),n.Literal("chineseLegalSimplified"),n.Literal("chineseCountingThousand"),n.Literal("koreanDigital"),n.Literal("koreanCounting"),n.Literal("koreanLegal"),n.Literal("koreanDigital2"),n.Literal("vietnameseCounting"),n.Literal("russianLower"),n.Literal("russianUpper"),n.Literal("none"),n.Literal("numberInDash"),n.Literal("hebrew1"),n.Literal("hebrew2"),n.Literal("arabicAlpha"),n.Literal("arabicAbjad"),n.Literal("hindiVowels"),n.Literal("hindiConsonants"),n.Literal("hindiNumbers"),n.Literal("hindiCounting"),n.Literal("thaiLetters"),n.Literal("thaiNumbers"),n.Literal("thaiCounting")],{description:"Number or bullet format for list levels"}),Hm=n.Object({family:n.Optional(n.String({description:"Font family name"})),size:n.Optional(n.Number({minimum:1,description:"Marker size in points"})),color:n.Optional(X),bold:n.Optional(n.Boolean({description:"Bold marker"})),italic:n.Optional(n.Boolean({description:"Italic marker"})),underline:n.Optional(n.Boolean({description:"Underlined marker"}))},{description:"Styling for the number/bullet glyph only. The list text is unaffected.",additionalProperties:!1}),Cv=n.Object({level:n.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:n.Optional(zg),text:n.Optional(n.String({description:\'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)\'})),alignment:n.Optional(n.Union([n.Literal("start"),n.Literal("end"),n.Literal("left"),n.Literal("right"),n.Literal("center")],{description:"Alignment of the numbering/bullet"})),indent:n.Optional(_n),start:n.Optional(n.Number({minimum:1,description:"Starting number for this level (default: 1)"})),font:n.Optional(Hm)},{description:"Configuration for a single list level",additionalProperties:!1}),un=n.Object({items:n.Array(n.Union([n.String(),n.Object({text:n.String(),level:n.Optional(n.Number({minimum:0,maximum:8,description:"Nesting level for this item"})),id:n.Optional(n.String({description:"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])"})),revision:n.Optional(to)},{additionalProperties:!1})]),{description:"List items (required)",minItems:1}),reference:n.Optional(n.String({description:"Unique reference ID for this numbering configuration (auto-generated if not provided)"})),levels:n.Optional(n.Array(Cv,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:n.Optional(n.Union([zg,n.Literal("numbered"),n.Literal("none")],{description:"Format for level 0 (simplified option when levels not specified)"})),bullet:n.Optional(n.String({description:"Custom bullet character (simplified option when levels not specified)"})),start:n.Optional(n.Number({minimum:1,description:"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."})),font:n.Optional(n.Partial(Zr)),spacing:n.Optional(wg),alignment:n.Optional(ja),keepNext:n.Optional(n.Boolean({description:"Keep every item with what follows, so the list stays with the text that introduces it"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of each item together on the same page"})),indent:n.Optional(n.Union([n.Number({minimum:0}),_n])),comment:n.Optional(ro)},{description:"List component props",additionalProperties:!1}),zm=["revision","comment","footnotes","endnotes"],Tv=n.Partial(n.Omit(on,zm)),Pv=n.Partial(n.Omit(an,zm)),Ev=n.Partial(sn),Av=n.Partial(cn),$v=n.Partial(n.Omit(ln,["rows"])),vv=n.Partial(pn),Lv=n.Partial(mn),Rv=n.Partial(n.Omit(un,zm)),kc=n.Object({heading:n.Optional(Tv),paragraph:n.Optional(Pv),image:n.Optional(Ev),statistic:n.Optional(Av),table:n.Optional($v),section:n.Optional(vv),columns:n.Optional(Lv),list:n.Optional(Rv)},{additionalProperties:!0});var Ja=["consulting","devportal","minimal","vermilion"],Nv=n.Object({top:n.Number({minimum:0}),bottom:n.Number({minimum:0}),left:n.Number({minimum:0}),right:n.Number({minimum:0}),header:n.Number({minimum:0}),footer:n.Number({minimum:0}),gutter:n.Number({minimum:0})},{additionalProperties:!1,description:"Document margin configuration"}),nH=n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),kv=n.Object({size:n.Union([n.Literal("A4"),n.Literal("A3"),n.Literal("LETTER"),n.Literal("LEGAL"),n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1})],{description:"Standard page size or custom dimensions"}),margins:Nv},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),Jg=n.Object({heading:Zr,body:Zr,mono:Zr,light:Zr},{additionalProperties:!1,description:"Font definitions for different text types"}),Fv=n.Union([n.Literal("single"),n.Literal("dashDotStroked"),n.Literal("dashed"),n.Literal("dashSmallGap"),n.Literal("dotDash"),n.Literal("dotDotDash"),n.Literal("dotted"),n.Literal("double"),n.Literal("doubleWave"),n.Literal("inset"),n.Literal("nil"),n.Literal("none"),n.Literal("outset"),n.Literal("thick"),n.Literal("thickThinLargeGap"),n.Literal("thickThinMediumGap"),n.Literal("thickThinSmallGap"),n.Literal("thinThickLargeGap"),n.Literal("thinThickMediumGap"),n.Literal("thinThickSmallGap"),n.Literal("thinThickThinLargeGap"),n.Literal("thinThickThinMediumGap"),n.Literal("thinThickThinSmallGap"),n.Literal("threeDEmboss"),n.Literal("threeDEngrave"),n.Literal("triple"),n.Literal("wave")],{description:"Paragraph border style"}),Yg={style:Fv,size:n.Number({minimum:0,description:"Width in eighths of a point (docx sz)"}),color:X,space:n.Optional(n.Number({minimum:0,description:"Space between text and border in points"}))},Fc=n.Object(Yg,{additionalProperties:!1,description:"Paragraph border side definition"}),jv=n.Object(Yg,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),Xg=n.Object({top:n.Optional(Fc),bottom:n.Optional(Fc),left:n.Optional(Fc),right:n.Optional(Fc),between:n.Optional(jv)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),Qg=n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),cr=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...bc.properties,alignment:Qg,priority:n.Optional(n.Number()),baseStyle:n.Optional(n.String()),followingStyle:n.Optional(n.String()),widowControl:n.Optional(n.Boolean()),keepNext:n.Optional(n.Boolean()),keepLinesTogether:n.Optional(n.Boolean()),outlineLevel:n.Optional(n.Number()),borders:n.Optional(Xg),indent:n.Optional(_n)},{additionalProperties:!1}),Uv=n.Union([n.Literal("dot"),n.Literal("hyphen"),n.Literal("middleDot"),n.Literal("none"),n.Literal("underscore")],{description:"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore"}),Dv=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("bar"),n.Literal("clear"),n.Literal("decimal"),n.Literal("end"),n.Literal("num"),n.Literal("start")],{description:"Tab stop alignment type"}),_v=n.Object({type:Dv,position:n.Union([n.Number({description:"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin"}),n.Literal("max",{description:"Use maximum position (TabStopPosition.MAX = 9026 twips)"})]),leader:n.Optional(Uv)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),no=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...bc.properties,alignment:Qg,tabStops:n.Optional(n.Array(_v,{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:n.Optional(n.Number()),followingStyle:n.Optional(n.String()),widowControl:n.Optional(n.Boolean()),keepNext:n.Optional(n.Boolean()),keepLinesTogether:n.Optional(n.Boolean()),outlineLevel:n.Optional(n.Number()),borders:n.Optional(Xg),indent:n.Optional(_n)},{additionalProperties:!1}),Zg=n.Object({normal:n.Optional(cr),heading1:n.Optional(cr),heading2:n.Optional(cr),heading3:n.Optional(cr),heading4:n.Optional(cr),heading5:n.Optional(cr),heading6:n.Optional(cr),title:n.Optional(cr),subtitle:n.Optional(cr),TOC1:n.Optional(no),TOC2:n.Optional(no),TOC3:n.Optional(no),TOC4:n.Optional(no),TOC5:n.Optional(no),TOC6:n.Optional(no)},{additionalProperties:cr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),iH=n.Object({level:n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)]),...cr.properties},{additionalProperties:!1}),ey=n.Object({primary:X,secondary:X,accent:X,text:X,background:X,border:X,textPrimary:X,textSecondary:X,textMuted:X,borderPrimary:X,borderSecondary:X,backgroundPrimary:X,backgroundSecondary:X,accent4:n.Optional(X),accent5:n.Optional(X),accent6:n.Optional(X)},{additionalProperties:!1}),jc=n.Object({...kn,colors:n.Optional(n.Partial(ey)),fonts:n.Optional(n.Partial(Jg)),styles:n.Optional(Zg)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),io=n.Object({...kn,$schema:n.Optional(n.String()),name:n.String(),displayName:n.String(),description:n.String({description:"The visual voice: what the theme looks like, in one sentence."}),whenToUse:n.Optional(n.String({description:"The documents the theme suits; discovery and the design guide quote it."})),version:n.String(),colors:ey,fonts:Jg,fontRegistry:n.Optional(wr),page:kv,styles:n.Optional(Zg),componentDefaults:n.Optional(kc),noProofWords:n.Optional(n.Array(n.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive)."}))},{additionalProperties:!1,description:"Theme configuration"});function ty(e){return T.Check(io,e)}function ry(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 Jm=n.Object({},{additionalProperties:!1}),Mv=e=>n.Object({blocks:n.Optional(Xr),theme:n.Optional(n.String({description:`Theme name to apply (default: "minimal"). Built-ins: ${Ja.join(", ")} (consulting is the house style).`,examples:[...Ja],default:"minimal"})),themeOverrides:n.Optional(jc),qualityProfile:n.Optional(n.String({description:"The quality profile validation judges this document by when the caller names none \\u2014 a blueprint scaffold writes its archetype\\u2019s profile here. A profile names required structure and content; the theme only paints. Built-ins: client-report, technical-report, executive-report, legal-appendix, general (the format default); an unknown name falls back to it.",examples:["client-report","technical-report","executive-report","legal-appendix","general"]})),fontRegistry:n.Optional(wr),componentDefaults:n.Optional(kc),language:n.Optional(n.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:n.Optional(Fa),trackRevisions:n.Optional(n.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:n.Optional(n.Object({title:n.Optional(n.String({description:"Document title",examples:["Annual Report 2024","Technical Documentation"]})),subtitle:n.Optional(n.String({description:"Document subtitle"})),description:n.Optional(n.String()),author:n.Optional(n.String()),company:n.Optional(n.String({description:"Company name, written to docProps/custom.xml (Word has no core-property slot for it)"})),date:n.Optional(n.String({description:"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)"})),version:n.Optional(n.String({description:"Document version, written to docProps/custom.xml",examples:["1.0","2024.3"]})),tags:n.Optional(n.Array(n.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}),dn=Mv(),Ym=n.Object({width:n.Optional(n.Union([n.Number({minimum:1,description:"Text box width in pixels"}),n.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:n.Optional(n.Union([n.Number({minimum:1,description:"Text box height in pixels"}),n.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:n.Optional(n.Union([n.Literal("table"),n.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:n.Optional(Si),style:n.Optional(n.Object({padding:n.Optional(n.Object({top:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),border:n.Optional(n.Object({top:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(X)},{additionalProperties:!1})),right:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(X)},{additionalProperties:!1})),bottom:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(X)},{additionalProperties:!1})),left:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(X)},{additionalProperties:!1}))},{additionalProperties:!1})),shading:n.Optional(n.Object({fill:n.Optional(X)},{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"]}}}]))}}}}}}]}),Bv=n.Union([n.Literal("numeric"),n.Literal("bullet"),n.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"}),Vv=n.Union([n.Literal("document"),n.Literal("section")],{description:"TOC scope: document-wide or section-only"}),Kv=n.Object({styleId:n.String({description:"Custom style ID matching a key in theme.styles"}),level:n.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}),OH=n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.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}),Xm=n.Object({pageBreak:n.Optional(n.Boolean({description:"Insert page break before TOC block"})),depth:n.Optional(n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.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:n.Optional(n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.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:n.Optional(Bv),title:n.Optional(n.String({description:"TOC heading title"})),includePageNumbers:n.Optional(n.Boolean({default:!0,description:"Show page numbers next to entries"})),numberSeparator:n.Optional(n.Boolean({default:!0,description:\'Use tab separator between entry and page number. True applies "\\\\t" (default), false applies " "\'})),scope:n.Optional(n.Union([Vv,n.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:n.Optional(n.Array(Kv,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),Qm=n.Object({thickness:n.Optional(n.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:n.Optional(X),style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.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:n.Optional(n.Union([n.Number({minimum:1,description:"Divider width in points"}),n.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:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:\'Which end of the measure a partial divider sits at (default "left"). Ignored at full width.\'})),spacing:n.Optional(Tt)},{description:"Horizontal divider \\u2014 a thin line across the measure, drawn as a Word paragraph border so it stays editable in Word.",additionalProperties:!1}),Zm=n.Object({options:n.Intersect([n.Record(n.String(),n.Unknown()),n.Object({chart:n.Object({width:n.Number(),height:n.Number()})})]),scale:n.Optional(n.Number()),resources:n.Optional(n.Object({css:n.Optional(n.String()),js:n.Optional(n.String()),files:n.Optional(n.Array(n.String()))})),serverUrl:n.Optional(n.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),width:n.Optional(n.Union([n.Number({minimum:1,description:"Image width in pixels"}),n.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:n.Optional(n.Union([n.Number({minimum:1,description:"Image height in pixels"}),n.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%")\'}))}),Gv=n.Union([n.Literal("area"),n.Literal("bar"),n.Literal("column"),n.Literal("doughnut"),n.Literal("line"),n.Literal("pie"),n.Literal("radar"),n.Literal("scatter")],{description:"Chart type"}),qv=n.Object({name:n.Optional(n.String({description:"Series name"})),labels:n.Optional(n.Array(n.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:n.Optional(n.Array(n.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."}))},{additionalProperties:!1}),eu=n.Object({type:Gv,data:n.Array(qv,{description:"Chart data series",minItems:1}),title:n.Optional(n.String({description:"Chart title text"})),showTitle:n.Optional(n.Boolean({description:"Show the chart title. Defaults to true when `title` is set."})),showLegend:n.Optional(n.Boolean({description:"Show chart legend"})),legendPos:n.Optional(n.Union([n.Literal("b"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("tr")],{description:"Legend position"})),chartColors:n.Optional(n.Array(n.String(),{description:"Series colors (hex or semantic theme names). Defaults to the theme palette."})),catAxisTitle:n.Optional(n.String({description:"Category axis title"})),valAxisTitle:n.Optional(n.String({description:"Value axis title"})),width:n.Optional(n.Number({minimum:0,exclusiveMinimum:0,description:"Chart width in inches. Defaults to the content width."})),height:n.Optional(n.Number({minimum:0,exclusiveMinimum:0,description:"Chart height in inches. Defaults to 3."})),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Chart caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),spacing:n.Optional(Tt),floating:n.Optional(Si),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.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}),dt=[{name:"docx",propsSchema:dn,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:pn,createPropsSchema:Wm,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:["block","group","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:mn,hasChildren:!0,allowedChildren:["block","group","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:Ym,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:on,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:an,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:sn,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:cn,hasChildren:!1,category:"content",description:"Statistic display - shows a number with description. Perfect for KPIs and metrics."},{name:"block",propsSchema:Dn,hasChildren:!1,category:"content",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine."},{name:"group",propsSchema:Jm,hasChildren:!0,allowedChildren:["group","block","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],category:"container",description:"Transparent group of flow components; also the inspectable result of block expansion."},{name:"table",propsSchema:ln,createPropsSchema:qm,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:un,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:Xm,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:Qm,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:Zm,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:eu,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:$c,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 Ya(e){return dt.find(t=>t.name===e)}function ny(){return dt.map(e=>e.name)}function iy(){return dt.filter(e=>e.hasChildren)}function Wv(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function Ci(e,t,r,i){let o={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.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&&(o.$schema=n.Optional(n.String({format:"uri"})),o.renderer=i?i.requireDiscriminator?n.Literal(i.renderer,{description:"Renderer backend for this document"}):n.Optional(n.Literal(i.renderer,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})):n.Optional(n.Union(Tr.map(c=>n.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&r?e.createPropsSchema(r):e.propsSchema,s=i?Lc(e.name,a,i.renderer):a;return o.props=Wv(s)?s:n.Optional(s),e.hasChildren&&t&&(o.children=e.special?.hasSchemaField?n.Array(t):n.Optional(n.Array(t))),n.Object(o,{additionalProperties:!1,description:e.description})}function oy(e){return dt.map(t=>Ci(t,e))}function Uc(e,t=[],r){let i=p=>!r||!p.renderers||p.renderers.includes(r.renderer),o=new Map;for(let p of dt)i(p)&&(p.hasChildren||o.set(p.name,Ci(p,void 0,e,r)));let a=dt.filter(p=>p.hasChildren&&i(p)),s=new Map,c=[...a];for(;c.length>0;){let p=c.length;for(let m=c.length-1;m>=0;m--){let u=c[m];if(u.name==="group"){let x=n.Intersect([e,n.Object({name:n.Union([...u.allowedChildren.map(A=>n.Literal(A)),...t.map(A=>A.properties.name)])})]);s.set(u.name,Ci(u,x,e,r)),c.splice(m,1);continue}if(!u.allowedChildren){s.set(u.name,Ci(u,e,e,r)),c.splice(m,1);continue}if(!u.allowedChildren.filter(x=>a.some(A=>A.name===x)).every(x=>s.has(x)))continue;let S=[...u.allowedChildren.map(x=>s.get(x)??o.get(x)).filter(x=>x!==void 0),...t],w=S.length===1?S[0]:n.Union(S);s.set(u.name,Ci(u,w,e,r)),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,...o]);return{schemas:[...l.values()],byName:l}}function Dc(e,t="ComponentDefinition"){let r=new Set(Object.keys(e.definitions??{})),i=s=>{let c=r.has(s)?s:t;return r.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||r.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 u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&r.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&o(u.items.$ref)){let f=i(u.items.$ref);u.items=f?{$ref:f}:{}}if(o(u.$ref)){let f=i(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&o(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function ay(e,t={}){let{$schema:r="http://json-schema.org/draft-07/schema#",$id:i,title:o,description:a,definitions:s={}}=t,c=JSON.parse(JSON.stringify(e)),l={...s};function p(u,f=""){if(!(typeof u!="object"||u===null)){for(let[O,S]of Object.entries(u))if(S&&typeof S=="object"){let w=S;if(w.$id&&typeof w.$id=="string"){let x=w.$id;if(f!==`definitions.${x}`){let{$id:A,...I}=w;l[x]=I,u[O]={$ref:`#/definitions/${x}`},p(I,`definitions.${x}`);continue}}p(S,f?`${f}.${O}`:O)}}}p(c);let m={$schema:r};return i&&(m.$id=i),Object.assign(m,c),o!==void 0&&(m.title=o),a!==void 0&&(m.description=a),Object.keys(l).length>0&&(m.definitions=l),Dc(m),Mg(m),Ca(m),m}function sy(e,t,r,i="ComponentDefinition"){let o={$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(iy().map(s=>s.name).includes(e)&&(o.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${i}`}},r&&(o.definitions={[i]:JSON.parse(JSON.stringify(r))})),t.enhanceForRichContent&&e==="table"){let s=o;s.definitions||(s.definitions={}),r&&(s.definitions[i]=JSON.parse(JSON.stringify(r)));let l=o.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 f=m.items.items;if(f?.anyOf&&Array.isArray(f.anyOf)){let O=`#/definitions/${i}`;f.anyOf.some(w=>w.$ref===O)||f.anyOf.push({description:"Rich content cell with component (e.g., image, paragraph)",$ref:O})}}}}return Dc(o,i),o.additionalProperties=!1,o}async function cy(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>od(Np(),1))).writeFile(t,o,"utf-8")}var ly={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"\'}},py={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"}},my={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function uy(e={}){return n.Union(Tr.map(t=>Hv(e,t,t!==za)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function Hv(e,t,r){let{includeStandardComponents:i=!0,customComponents:o=[],title:a="JSON Report Definition",description:s="JSON report definition with TypeBox schemas"}=e,c=[],l=[],p=nn(t),m=n.Recursive(f=>{let O=[];for(let I of o)if(I.versionedProps&&I.versionedProps.length>0){let N=I.versionedProps,G=ut(N.map(te=>te.version));for(let te of N){let P=te.description||I.description,Z={name:n.Literal(I.name),id:n.Optional(n.String()),version:P?n.Literal(te.version,{description:P}):n.Literal(te.version),props:te.propsSchema};te.hasChildren&&(Z.children=n.Optional(n.Array(f)));let je=te.description?`${I.name} v${te.version} \\u2014 ${te.description}`:I.description?`${I.name} v${te.version} \\u2014 ${I.description}`:`${I.name} v${te.version}`;O.push(n.Object(Z,{additionalProperties:!1,description:je}))}let qe=N.find(te=>te.version===G),We={name:n.Literal(I.name),id:n.Optional(n.String()),props:qe.propsSchema};qe.hasChildren&&(We.children=n.Optional(n.Array(f)));let He=qe.description?`${I.name} (latest: v${G}) \\u2014 ${qe.description}`:I.description?`${I.name} (latest: v${G}) \\u2014 ${I.description}`:`${I.name} (latest: v${G})`;O.push(n.Object(We,{additionalProperties:!1,description:He}))}else{let N=!!I.hasChildren,G={name:n.Literal(I.name),id:n.Optional(n.String()),props:I.propsSchema};N&&(G.children=n.Optional(n.Array(f))),O.push(n.Object(G,{additionalProperties:!1,...I.description?{description:I.description}:{}}))}let{schemas:S,byName:w}=i?Uc(f,O,{renderer:t,requireDiscriminator:r}):{schemas:[],byName:new Map};c=["section",...Ya("section")?.allowedChildren??[]].map(I=>w.get(I)).filter(I=>I!==void 0),l=O;let A=[...S,...O];if(A.length===0)return n.Any();if(A.length===1)return A[0];{let I=o.length>0?"Component definition with discriminated union including custom components":"Component definition with discriminated union";return n.Union(A,{discriminator:{propertyName:"name"},description:I})}},{$id:p}),u=Ya("docx");if(!u)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 n.Object({name:n.Literal("docx"),id:n.Optional(n.String()),$schema:n.Optional(n.String({format:"uri"})),renderer:r?n.Literal(t,{description:"Renderer backend for this document"}):n.Optional(n.Literal(t,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})),props:n.Optional(Lc(u.name,u.propsSchema,t)),children:n.Array(n.Union([...c,...l],{discriminator:{propertyName:"name"}}))},{additionalProperties:!1,title:a,description:s,definitions:{[p]:m}})}var _c=n.Union([...oy(n.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),ft=n.Recursive(e=>n.Union([...Uc(e).schemas],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"}));var tu=n.Object({content:n.String({description:"Text content (required)"}),spaceAfter:n.Optional(n.Number({minimum:0,description:"Spacing after text in points"})),fontSize:n.Optional(n.Number({minimum:1})),fontFamily:n.Optional(n.String()),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),underline:n.Optional(n.Boolean()),color:n.Optional(n.String({pattern:"^#[0-9A-Fa-f]{6}$"})),alignment:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")]))}),ru=n.Object({name:n.Literal("text-space-after"),id:n.Optional(n.String()),props:tu}),Pr=ru;function zv(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?Jv(e):e.message?.includes("additionalProperties")?Yv(e):e.message?.includes("Required property")?Xv(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?Qv(e):r==="literal"?Zv(e):r==="pattern"||r==="RegExp"?eL(e):`At ${i}: ${e.message}`}function Jv(e){let t=e.path||"root",r=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(r&&typeof r=="object"){if("name"in r){let o=r.name;return o==="docx"?"Document structure appears valid but contains invalid component configurations. Check each component for errors.":`Unknown document name \'${o}\'. Expected \'docx\'.`}let i=r;if("children"in r&&Array.isArray(i.children))return`Document is missing required \'name\' field. Add "name": "docx" at the root level.`;if("name"in r||"styles"in r)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/")?r&&typeof r=="object"&&"name"in r?`Invalid component configuration for type \'${r.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 Yv(e){let t=e.path||"root",r=e.value;if(typeof r=="object"&&r!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(r).filter(c=>!o.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${o.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function Xv(e){let t=e.path||"root",r=e.message?.match(/Required property \'([^\']+)\'/);return r?`Missing required field \'${r[1]}\' at ${t}. This field is mandatory for this configuration.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function Qv(e){let t=e.path||"root",r=String(e.type),i=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 ${r} but got ${i}`}function Zv(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function eL(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 su(e,t,r){let i=Ir(r),o=zv(e,i),a={path:e.path||"root",message:xr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=rL(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=tL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function cu(e,t){let r=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=r)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push(su(a,t?.jsonString,void 0)))}return i}function tL(e,t){try{let r=t.split("/").filter(Boolean);if(r.length===0)return{line:1,column:1};let o=`"${r[r.length-1]}"`,a=e.indexOf(o);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 rL(e,t){let{type:r,path:i,value:o}=e,a=String(r);if(a==="62"||a==="union"){if(i==="root"||i==="/"){if(o&&typeof o=="object"){if(!("name"in o)){let s=\'Add a "name" field with value "docx" for documents\';return t.includeEmojis?`${di.FIX} ${s}`:s}if("props"in o&&typeof o.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${Sr(dn).join(", ")}`}return\'Ensure the document has proper structure: { "name": "docx", "props": {...}, "children": [...] }\'}return i?.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 i?.includes("alignment")?"Use one of: left, center, right, justify":i?.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 i?.includes("fontSize")||i?.includes("size")?"Use a number in points (e.g., 12, 14, 16)":i?.includes("margin")||i?.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 i?.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(It(e.schema)):"specific value"}`;if(a==="pattern"||a==="RegExp")return i?.includes("email")?"Use valid email format: user@example.com":i?.includes("url")?"Use valid URL format: https://example.com":i?.includes("date")?"Use ISO date format: YYYY-MM-DD":"Ensure the value matches the required format";if(i?.includes("name")||i?.includes("type"))return"Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual"}var nL=Object.fromEntries([...dt.map(e=>[e.name,e.propsSchema]),["custom",Pr]]),iL=new Map(dt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),nu=new Set(dt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),oL=new Map(dt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),aL={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function fy(e,t,r,i){let o=typeof e.name=="string"?oL.get(e.name):void 0;if(o)for(let a of Object.keys(e)){if(!o.has(a)){if(r.allowUnknownFields)continue;i.push({path:`${t}/${a}`,message:`Unknown key "${a}" on component "${e.name}". Allowed keys: ${[...o].join(", ")}.`,code:"unknown_key"});continue}let s=aL[a];s&&typeof e[a]!==s&&i.push({path:`${t}/${a}`,message:`Key "${a}" on component "${e.name}" must be a ${s}.`,code:"invalid_type"})}}var sL=["path","base64","svg"];function cL(e){if(!e||typeof e!="object")return[];let t=e;return sL.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function lL(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=cL(i.props);a.length>1&&t.push({path:`${o}/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(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}var pL=new Set(["paragraph","heading"]);function lu(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(pL.has(i.name)){let a=i.props?.indent;a&&typeof a=="object"&&a.hanging!==void 0&&a.firstLine!==void 0&&t.push({path:`${o}/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(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function pu(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((s,c)=>r(s,`${o}/${c}`));return}if(!i||typeof i!="object")return;let a=[];if(i.name==="paragraph"&&i.props?.revision)for(let s of["footnotes","endnotes"])a.push({notes:i.props[s],path:`${o}/props/${s}`});if(i.revision&&i.content?.name==="paragraph")for(let s of["footnotes","endnotes"])a.push({notes:i.content.props?.[s],path:`${o}/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(i))r(i[s],`${o}/${s}`)};return r(e,""),t}var mL=new Set(["dashed","dotted","double"]);function mu(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="text-box"&&i.props?.renderAs==="shape"){let a=["width","height"].filter(c=>i.props[c]===void 0);a.length>0&&t.push({path:`${o}/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=i.props.style?.border;if(s&&typeof s=="object")for(let c of["top","right","bottom","left"]){let l=s[c]?.style;typeof l=="string"&&mL.has(l)&&t.push({path:`${o}/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(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function uu(e,t={}){let r=[];if(!e||typeof e!="object")return r.push({path:"root",message:"Document must be an object",code:"invalid_type"}),r;if(!e.name)r.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!nu.has(e.name)){let i=[...nu].map(o=>`"${o}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}if(fy(e,"",t,r),nu.has(e.name)&&"props"in e){let i=ou(e.name,e.props,"/props",t);r.push(...i)}return e.children?Array.isArray(e.children)||r.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):r.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),hy(e,"",t,r),r}function hy(e,t,r,i){if(!e||typeof e!="object")return;let o=(s,c,l)=>{if(!s||typeof s!="object"){l&&i.push({path:c,message:"Component must be an object",code:"invalid_type"});return}if(typeof s.name!="string"||s.name.length===0){l&&i.push({path:`${c}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}r.knownCustomNames?.has(s.name)||(fy(s,c,r,i),"props"in s?i.push(...ou(s.name,s.props,`${c}/props`,r)):s.name!=="custom"&&i.push(...ou(s.name,{},`${c}/props`,r)),hy(s,c,r,i))},a=typeof e.name=="string"?iL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)iu(e.props,s.path,`${t}/props`,(c,l)=>{s.arity==="component-array"?Array.isArray(c)&&c.forEach((p,m)=>o(p,`${l}/${m}`,s.reportStructure)):c&&typeof c=="object"&&!Array.isArray(c)&&o(c,l,s.reportStructure)});Array.isArray(e.children)?e.children.forEach((s,c)=>o(s,`${t}/children/${c}`,!0)):e.children!=null&&t!==""&&i.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function iu(e,t,r,i){if(t.length===0){i(e,r);return}if(!e||typeof e!="object")return;let[o,...a]=t;if(o==="*"){if(!Array.isArray(e))return;e.forEach((s,c)=>iu(s,a,`${r}/${c}`,i));return}iu(e[o],a,`${r}/${o}`,i)}function ou(e,t,r,i={}){let o=[],a=nL[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=uL(a,t),c=i.allowUnknownFields?T.Clean(s,T.Clone(t)):t;if(!T.Check(s,c)){let l=[...T.Errors(s,c)];cu(l,{maxErrors:100}).forEach(m=>{let u=m.path==="root"?r:`${r}${m.path.startsWith("/")?m.path:"/"+m.path}`;o.push({...m,path:u})})}return o}function uL(e,t){let r=e.anyOf;if(!Array.isArray(r)||r.length===0)return e;let i=r.filter(c=>dL(c,t));if(i.length===1)return i[0];let o=i.length>1?i:r,a=o[0],s=Number.POSITIVE_INFINITY;for(let c of o){let l=[...T.Errors(c,t)].length;l<s&&(s=l,a=c)}return a}function dL(e,t){let r=e.properties;if(!r)return!1;let i=new Set(e.required??[]),o=t??{};for(let[a,s]of Object.entries(r)){let c=s.const;if(c===void 0)continue;if(!(o[a]!==void 0)){if(i.has(a))return!1;continue}if(o[a]!==c)return!1}return!0}function du(e,t=[],r={}){let i=uu(e,r),o=t.filter(a=>!fL(a));return hL([...o,...i])}function fL(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let r=e.message||"";return/invalid component configurations?/i.test(r)||/invalid document structure/i.test(r)}function hL(e){let t=new Set,r=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),r.push(i))}return r}function Pt(e,t,r){try{if(!T.Check(e,t)){let o=[...T.Errors(e,t)];return{valid:!1,errors:tt(o,{jsonString:r?.jsonString,maxErrors:r?.maxErrors||100})}}let i=t;return r?.clean&&(i=T.Clean(e,T.Clone(i))),r?.applyDefaults&&(i=T.Default(e,i)),{valid:!0,data:i}}catch(i){return{valid:!1,errors:[{path:"root",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}]}}}function oo(e,t,r){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 o;try{o=JSON.parse(t)}catch(s){return s instanceof Error?{valid:!1,errors:[fi(s,t)],isJsonError:!0}:{valid:!1,errors:[{path:"root",message:"Failed to parse JSON",code:"json_parse_error"}],isJsonError:!0}}return{...Pt(e,o,{...r,jsonString:t,calculatePosition:!0}),parsed:o,isJsonError:!1}}return{...Pt(e,t,r),parsed:t,isJsonError:!1}}function gy(e,t,r){let i=[],o=[],a=!1;for(let s=0;s<t.length;s++){let c=Pt(e,t[s],r);if(c.valid&&c.data)i.push(c.data);else if(a=!0,c.errors){let l=c.errors.map(p=>({...p,path:`[${s}]${p.path?"/"+p.path:""}`}));o.push(...l)}if(r?.maxErrors&&o.length>=r.maxErrors)break}return a?{valid:!1,errors:o.slice(0,r?.maxErrors)}:{valid:!0,data:i}}function yy(e,t,r,i){let o=Pt(e,t,i);return!o.valid&&o.errors&&(o.errors=r(o.errors)),o}function by(e,t){return(r,i)=>Pt(e,r,{...t,...i})}function Oy(e,t){return(r,i)=>oo(e,r,{...t,...i})}function xy(e){return e.valid===!0&&e.data!==void 0}function Sy(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Yr(e.errors)}var gL=ft,yL=[{why:"image source mutual-exclusivity",collect:lL},{why:"indent hanging/firstLine mutual-exclusivity",collect:lu},{why:"notes on a revised paragraph",collect:pu},{why:"a text box asking for a shape rendering a shape cannot give it",collect:mu},{why:"renderer profile compatibility",collect:Rc}];function Iy(e){return yL.flatMap(({collect:t})=>t(e))}function au(e,t){if(Array.isArray(e))return e.some(i=>au(i,t));if(!e||typeof e!="object")return!1;let r=e;return typeof r.name=="string"&&t.has(r.name)?!0:Object.values(r).some(i=>au(i,t))}var dy;function bL(){return dy??(dy=n.Recursive(e=>n.Union(dt.map(t=>Ci(t,e,e))))),dy}function OL(e,t,r){return r?.allowUnknownFields===!0||r?.knownCustomNames!==void 0&&r.knownCustomNames.size>0&&au(e,r.knownCustomNames)||T.Check(bL(),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 wy(e,t,r){let i=du(e,t,{allowUnknownFields:r?.allowUnknownFields,knownCustomNames:r?.knownCustomNames});return i.length===0?OL(e,t,r):{valid:!1,errors:i}}function Mc(e,t){let r=Pt(ft,e,t),i=r.errors||[],o=r.valid;!r.valid&&e&&({valid:o,errors:i}=wy(e,r.errors||[],t));let a=[...Iy(e),...Ji(e,Qr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=r.data??(o?e:void 0),c={...r,valid:o,documentType:"docx",errors:i,data:s};if(o){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Ty(m.name));c.hasCustomComponents=p}}return c}function Bc(e,t){let r=oo(gL,e,t),i=r.errors||[],o=r.valid;!r.valid&&r.parsed&&({valid:o,errors:i}=wy(r.parsed,r.errors||[],t));let a=[...Iy(r.parsed),...Ji(r.parsed,Qr(r.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=r.data??(o?r.parsed:void 0),c={...r,valid:o,documentType:"docx",errors:i,data:s};if(o){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Ty(m.name));c.hasCustomComponents=p}}return c}function Cy(e){return e.valid===!0&&e.data!==void 0}function xL(){return ui(_c)}function Ty(e){return xL().includes(e)}function Vc(e){return{validate:(t,r)=>Mc(t,{...e,...r}),validateJson:(t,r)=>Bc(t,{...e,...r})}}var ao=Vc({clean:!0,applyDefaults:!0,maxErrors:100}),Xa=Vc({clean:!1,applyDefaults:!1,maxErrors:100}),Py=Bc,Ey=Mc;function SL(){return{includeEmojis:!$y(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:IL()}}var oz=SL(),Ay={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 $y(){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 IL(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!$y()}function qc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let r=Pt(io,e,t),i={...r};if(r.valid&&r.data){let o=r.data;o.name&&(i.themeName=o.name)}return i}function fu(e,t){let r=oo(io,e,t),i={...r};if(r.valid&&r.data){let o=r.data;typeof o=="object"&&!o.$schema&&(o.$schema="./json-schemas/theme.schema.json"),o.name&&(i.themeName=o.name)}return i}function hu(e,t){let r=qc(e,t);return!r.valid&&r.errors&&(r.errors=r.errors.map(i=>(i.path.includes("colors")&&!i.suggestion&&(i.suggestion="Colors must be valid hex, rgb, or named colors"),i.path.includes("fonts")&&!i.suggestion&&(i.suggestion="Fonts must include size and family properties"),i.path.includes("headings")&&!i.suggestion&&(i.suggestion="Headings must be an array of 6 style definitions"),i))),r}function vy(e){return e.valid===!0&&e.data!==void 0}function Wc(e){return{validate:(t,r)=>qc(t,{...e,...r}),validateJson:(t,r)=>fu(t,{...e,...r}),validateWithEnhancement:(t,r)=>hu(t,{...e,...r})}}var Qa=Wc({clean:!0,applyDefaults:!0}),Kc=Wc({clean:!1,applyDefaults:!1,maxErrors:10});function Ly(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 Ry(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var Ny={report:dn,section:pn,heading:on,paragraph:an,columns:mn,image:sn,statistic:cn,table:ln,list:un,custom:Pr};function co(e,t,r){let i=Ny[e];if(!i){let a=Pt(Pr,t,r);return{...a,success:a.valid,componentName:e,isCustomComponent:!0}}let o=Pt(i,t,r);return{...o,success:o.valid,componentName:e,isCustomComponent:e==="custom"}}function gu(e,t){let r=Pt(ft,e,t),i={...r};if(r.valid&&r.data){let o=r.data;i.componentName=o.name,i.isCustomComponent=!lo(o.name)}return i}function yu(e,t,r){return Ln(e,t,r)}function lo(e){return e in Ny}function ky(e){return T.Check(dn,e)}function Fy(e){return T.Check(pn,e)}function jy(e){return T.Check(on,e)}function Uy(e){return T.Check(an,e)}function Dy(e){return T.Check(mn,e)}function _y(e){return T.Check(sn,e)}function My(e){return T.Check(cn,e)}function By(e){return T.Check(ln,e)}function Vy(e){return T.Check(un,e)}function Ky(e){return T.Check(Pr,e)}function Hc(e){return{validate:(t,r,i)=>lo(t)?co(t,r,{...e,...i}):co("custom",r,{...e,...i}),validateDefinition:(t,r)=>gu(t,{...e,...r}),validateCustom:(t,r,i)=>yu(t,r,{...e,...i})}}var so=Hc({clean:!0,applyDefaults:!0}),Gc=Hc({clean:!1,applyDefaults:!1,maxErrors:10}),Gy={document:e=>ao.validate(e),jsonDocument:e=>ao.validateJson(e),theme:e=>Qa.validate(e),jsonTheme:e=>Qa.validateJson(e),component:(e,t)=>so.validate(e,t),componentDefinition:e=>so.validateDefinition(e),components:e=>e.map(t=>so.validate(t.name,t.props)),isDocument:e=>ao.validate(e).valid,isTheme:e=>Qa.validate(e).valid,isComponent:(e,t)=>so.validate(e,t).valid},qy={document:e=>Xa.validate(e),jsonDocument:e=>Xa.validateJson(e),theme:e=>Kc.validate(e),jsonTheme:e=>Kc.validateJson(e),component:(e,t)=>Gc.validate(e,t),componentDefinition:e=>Gc.validateDefinition(e)};var Wy=n.Object({definition:ft,format:n.Optional(n.Union([n.Literal("docx"),n.Literal("pdf"),n.Literal("html")])),options:n.Optional(n.Object({includeMetadata:n.Optional(n.Boolean()),includeComments:n.Optional(n.Boolean({deprecated:!0,description:"Deprecated and ignored. Comments are authored per component via the `comment` prop."})),trackChanges:n.Optional(n.Boolean())},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation request"}),Hy=n.Object({definition:n.Unknown(),strict:n.Optional(n.Boolean())},{additionalProperties:!1,description:"Document validation request"}),zy=n.Object({success:n.Boolean(),documentId:n.Optional(n.String()),downloadUrl:n.Optional(n.String()),error:n.Optional(n.String()),metadata:n.Optional(n.Object({pageCount:n.Optional(n.Number()),wordCount:n.Optional(n.Number()),generatedAt:n.Optional(n.String({format:"date-time"}))},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation response"}),Jy=n.Object({valid:n.Boolean(),errors:n.Array(n.Object({path:n.String(),message:n.String(),code:n.Optional(n.String())})),warnings:n.Optional(n.Array(n.Object({path:n.String(),message:n.String(),code:n.Optional(n.String())})))},{additionalProperties:!1,description:"Document validation response"});var Yy=ft,Xy={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"};var wL=1e6;function Qy(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function zc(e){let t=[];for(let r of e){if(!r.text)continue;let i=t[t.length-1];i&&i.type===r.type?i.text+=r.text:t.push({...r})}return t}function CL(e){let t=[];for(let o=0;o<e.length;o++){let a=e[o];if(a.type==="equal"&&/^\\s+$/.test(a.text)){let s=t[t.length-1],c=e[o+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 r=[],i=0;for(;i<t.length;){if(t[i].type==="equal"){r.push(t[i]),i++;continue}let o="",a="";for(;i<t.length&&t[i].type!=="equal";)t[i].type==="delete"?o+=t[i].text:a+=t[i].text,i++;o&&r.push({type:"delete",text:o}),a&&r.push({type:"insert",text:a})}return zc(r)}function el(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let r=Qy(e),i=Qy(t);if(r.length===0)return zc([{type:"insert",text:t}]);if(i.length===0)return zc([{type:"delete",text:e}]);if(r.length*i.length>wL)return zc([{type:"delete",text:e},{type:"insert",text:t}]);let o=r.length,a=i.length,s=Array.from({length:o+1},()=>new Int32Array(a+1));for(let m=o-1;m>=0;m--)for(let u=a-1;u>=0;u--)s[m][u]=r[m]===i[u]?s[m+1][u+1]+1:Math.max(s[m+1][u],s[m][u+1]);let c=[],l=0,p=0;for(;l<o&&p<a;)r[l]===i[p]?(c.push({type:"equal",text:r[l]}),l++,p++):s[l+1][p]>=s[l][p+1]?(c.push({type:"delete",text:r[l]}),l++):(c.push({type:"insert",text:i[p]}),p++);for(;l<o;)c.push({type:"delete",text:r[l]}),l++;for(;p<a;)c.push({type:"insert",text:i[p]}),p++;return CL(c)}function es(e){return e.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g,"$1").replace(/(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,(t,r,i,o,a,s,c)=>i??a??c??"")}var wu=new Set(["paragraph","heading"]);function lr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Vn(e,t){return{...e.author&&{author:e.author},...e.date&&{date:e.date},segments:t}}function Za(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Jc(e){return es(Za(e))}var TL=/\\{[^}]+\\}/;function Yc(e){return e.enabled!==!1}function is(e,t,r,i){e.some(o=>o.type!=="equal"&&TL.test(o.text))&&i.summary.untracked.push({path:t,kind:"modified",component:r,detail:"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline"})}function Kn(e,...t){let r={...e||{}};for(let i of t)delete r[i];return r}var PL=4e6;function Cu(e,t,r){let i=e.map(r),o=t.map(r),a=0;for(;a<e.length&&a<t.length&&i[a]===o[a];)a++;let s=e.length,c=t.length;for(;s>a&&c>a&&i[s-1]===o[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,u=c-a,f=[];if(m*u>PL){for(let x=0;x<m;x++)f.push({op:"delete",oldItem:e[a+x]});for(let x=0;x<u;x++)f.push({op:"insert",newItem:t[a+x]});return[...l,...f,...p]}let O=Array.from({length:m+1},()=>new Int32Array(u+1));for(let x=m-1;x>=0;x--)for(let A=u-1;A>=0;A--)O[x][A]=i[a+x]===o[a+A]?O[x+1][A+1]+1:Math.max(O[x+1][A],O[x][A+1]);let S=0,w=0;for(;S<m&&w<u;)i[a+S]===o[a+w]?(f.push({op:"equal",oldItem:e[a+S],newItem:t[a+w]}),S++,w++):O[S+1][w]>=O[S][w+1]?(f.push({op:"delete",oldItem:e[a+S]}),S++):(f.push({op:"insert",newItem:t[a+w]}),w++);for(;S<m;)f.push({op:"delete",oldItem:e[a+S++]});for(;w<u;)f.push({op:"insert",newItem:t[a+w++]});return[...l,...f,...p]}function Tu(e,t,r){let i=new Array(e.length).fill(!1),o=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(!i[m]&&r(e[m],t[p])){i[m]=!0,o[p]=m,a=m+1;break}let s=[],c=[],l=0;for(let p=0;p<t.length;p++){let m=o[p];if(m>=0){for(;l<m;)i[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++)i[p]||s.push({kind:"deleted",oldItem:e[p]});return{pairs:c,plan:s}}function EL(e,t,r,i){let o=Jc(e),a=Jc(t),s=!lr(Kn(e.props,"text","revision","comment"),Kn(t.props,"text","revision","comment"));if(s&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"formatting/props changed (not expressible as a tracked change); new version rendered"}),o===a)return Za(e)!==Za(t)?i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"inline formatting or link target changed (markdown-only); new version rendered without a tracked change"}):s||i.summary.unchangedBlocks++,t;i.summary.tracked.modified++;let c=el(o,a);return is(c,r,t.name,i),(Za(e)!==o||Za(t)!==a)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"inline formatting or links flattened to plain text in the redline (revision segments render literally)"}),{...t,props:{...tl(t,r,i),text:a,revision:Vn(i,c)}}}function tl(e,t,r){let i={...e.props??{}},o=["footnotes","endnotes"].filter(a=>{let s=i[a];return Array.isArray(s)&&s.length>0});if(o.length===0)return i;for(let a of o)delete i[a];return r.summary.untracked.push({path:t,kind:"modified",component:e.name,detail:`${o.join(" and ")} dropped from a tracked-change paragraph (note markers do not resolve inside revision text); the note bodies are not in the redline`}),i}function AL(e,t,r){r.summary.tracked.inserted++;let i=Jc(e),o=[{type:"insert",text:i}];return is(o,t,e.name,r),{...e,props:{...tl(e,t,r),text:i,revision:Vn(r,o)}}}function $L(e,t,r){r.summary.tracked.deleted++;let o=[{type:"delete",text:Jc(e)}];return is(o,t,e.name,r),{...e,props:{...tl(e,t,r),text:"",revision:Vn(r,o)}}}function bu(e){return(e.props?.items||[]).map(r=>{let i=typeof r=="string"?r:r.text,o=typeof r=="string"?0:r.level||0;return{raw:i,text:es(i.normalize("NFC")),level:o}})}function vL(e,t,r,i){let o=!lr(Kn(e.props,"items"),Kn(t.props,"items"));o&&i.summary.untracked.push({path:r,kind:"modified",component:"list",detail:"list configuration changed (format/levels/spacing); new version rendered"});let a=bu(e),s=bu(t),c=f=>f.map(O=>({text:O.text,level:O.level}));if(lr(c(a),c(s)))return lr(a.map(f=>f.raw),s.map(f=>f.raw))?o||i.summary.unchangedBlocks++:i.summary.untracked.push({path:r,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=Cu(a,s,f=>`${f.level}:${f.text}`),p=[],m=!1,u=0;for(;u<l.length;){let f=l[u];if(f.op==="equal"){p.push({text:f.newItem.raw,level:f.newItem.level}),u++;continue}let O=[],S=[];for(;u<l.length&&l[u].op!=="equal";){let x=l[u];x.op==="delete"?O.push(x.oldItem):x.op==="insert"&&S.push(x.newItem),u++}let{plan:w}=Tu(O,S,(x,A)=>x.level===A.level);for(let x of w)if(m=!0,x.kind==="paired"){let A=el(x.oldItem.text,x.newItem.text);is(A,r,"list",i),p.push({text:x.newItem.text,level:x.newItem.level,revision:Vn(i,A)})}else x.kind==="inserted"?p.push({text:x.newItem.text,level:x.newItem.level,revision:Vn(i,[{type:"insert",text:x.newItem.text}])}):p.push({text:"",level:x.oldItem.level,revision:Vn(i,[{type:"delete",text:x.oldItem.text}])})}return m&&i.summary.tracked.modified++,{...t,props:{...t.props,items:p}}}function eb(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=bu(e).map(o=>({text:t==="insert"?o.text:"",level:o.level,revision:Vn(r,[{type:t,text:o.text}])}));return{...e,props:{...e.props,items:i}}}function Ou(e){if(!e)return"";let t=e.content;if(typeof t=="string")return es(t.normalize("NFC"));if(t&&typeof t=="object"){let i=t.props?.text;if(typeof i=="string")return es(i.normalize("NFC"))}return""}function xu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return t.normalize("NFC");if(t&&typeof t=="object"){let r=t.props?.text;if(typeof r=="string")return r.normalize("NFC")}return""}function Zy(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function Su(e){let t=e.props?.columns??[],r=t.reduce((o,a)=>Math.max(o,a.cells?.length??0),0),i=e.props?.rows??[];return Array.from({length:r},(o,a)=>{let s=t.map(c=>c.cells?.[a]);return{cells:s,key:s.map(Ou).join("\\0"),rawKey:s.map(xu).join("\\0"),rowProps:i[a]}})}function tb(e,t,r){let i=e.props?.columns??[],o=t.map((a,s)=>({...a.rowProps??{},...r[s]}));return{...e,props:{...e.props,columns:i.map((a,s)=>({...a,cells:t.map(c=>c.cells[s]??{content:""})})),...o.some(a=>Object.keys(a).length>0)&&{rows:o}}}}function Xc(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function LL(e,t,r,i,o,a){let s=el(r,i);is(s,o,"table",a),(xu(t)!==r||xu(e)!==i)&&a.summary.untracked.push({path:o,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:RL(c.content,i,o,a),revision:Vn(a,s)}}function RL(e,t,r,i){if(!e||typeof e!="object")return t;let o=e;return{...o,props:{...tl(o,r,i),text:t}}}function NL(e,t,r,i){let o=Su(e),a=Su(t),s=e.props?.columns??[],c=t.props?.columns??[];if(s.length!==c.length)return i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table column count changed (columns are not expressible as a tracked change); new version rendered"}),t;let l=!lr(Kn(e.props,"columns","rows"),Kn(t.props,"columns","rows"));l&&i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table configuration changed (borders/widths/defaults); new version rendered"});let p=!lr(s.map(x=>x.header),c.map(x=>x.header));if(p&&i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table header row changed (headers are not row content); new version rendered"}),lr(o.map(x=>x.key),a.map(x=>x.key)))return lr(o.map(x=>x.rawKey),a.map(x=>x.rawKey))?!l&&!p&&lr(o,a)&&i.summary.unchangedBlocks++:i.summary.untracked.push({path:r,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=Cu(o,a,x=>x.key),u=[],f=[],O=!1,S=(x,A)=>{u.push(x),f.push(A)},w=0;for(;w<m.length;){let x=m[w];if(x.op==="equal"){S(x.newItem,{}),w++;continue}let A=[],I=[];for(;w<m.length&&m[w].op!=="equal";){let G=m[w];G.op==="delete"?A.push(G.oldItem):G.op==="insert"&&I.push(G.newItem),w++}let{plan:N}=Tu(A,I,(G,qe)=>G.cells.length===qe.cells.length&&G.cells.every(Zy)&&qe.cells.every(Zy));for(let G of N)if(O=!0,G.kind==="paired"){let qe=G.newItem.cells.map((We,He)=>{let te=Ou(G.oldItem.cells[He]),P=Ou(We);return te===P?We??{content:""}:LL(We,G.oldItem.cells[He],te,P,r,i)});S({...G.newItem,cells:qe},{})}else G.kind==="inserted"?(i.summary.tracked.inserted++,S(G.newItem,{revision:Iu(i,"insert")})):(i.summary.tracked.deleted++,S(G.oldItem,{revision:Iu(i,"delete")}))}return O&&i.summary.tracked.modified++,tb(t,u,f)}function rb(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=Su(e);return tb(e,i,i.map(()=>({revision:Iu(r,t)})))}function Iu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function Qc(e){return Array.isArray(e.children)}function kL(e,t){return e.name===t.name}function FL(e,t,r,i){let o=Yc(e),a=Yc(t);return!o&&!a?(i.summary.unchangedBlocks++,t):!o&&a?nb(t,r,i):o&&!a?ib(e,r,i)??t:wu.has(t.name)?EL(e,t,r,i):t.name==="list"?vL(e,t,r,i):t.name==="table"&&Xc(e)&&Xc(t)?NL(e,t,r,i):Qc(t)||Qc(e)?(!lr(e.props,t.props)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:rl(e.children||[],t.children||[],`${r}/children`,i)}):(i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:`"${t.name}" changed (no native tracked-change support); new version rendered`}),t)}function nb(e,t,r){return Yc(e)?wu.has(e.name)?AL(e,t,r):e.name==="list"?eb(e,"insert",r):e.name==="table"&&Xc(e)?rb(e,"insert",r):Qc(e)?(typeof e.props?.title=="string"&&r.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:rl([],e.children||[],`${t}/children`,r)}):(r.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 ib(e,t,r){if(!Yc(e))return null;if(wu.has(e.name))return $L(e,t,r);if(e.name==="list")return eb(e,"delete",r);if(e.name==="table"&&Xc(e))return rb(e,"delete",r);if(Qc(e)){typeof e.props?.title=="string"&&r.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 i=rl(e.children||[],[],`${t}/children`,r);return{...e,children:i}}return r.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 rl(e,t,r,i){let o=Cu(e,t,l=>JSON.stringify(l)),a=[],s=0,c=0;for(;s<o.length;){let l=o[s];if(l.op==="equal"){i.summary.unchangedBlocks++,a.push(l.newItem),s++,c++;continue}let p=[],m=[];for(;s<o.length&&o[s].op!=="equal";){let f=o[s];f.op==="delete"?p.push(f.oldItem):f.op==="insert"&&m.push(f.newItem),s++}let{plan:u}=Tu(p,m,kL);for(let f of u)if(f.kind==="paired")a.push(FL(f.oldItem,f.newItem,`${r}/${c}`,i)),c++;else if(f.kind==="inserted")a.push(nb(f.newItem,`${r}/${c}`,i)),c++;else{let O=ib(f.oldItem,`${r}/${c}`,i);O&&a.push(O)}}return a}function jL(e,t,r={}){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 i={tracked:{modified:0,inserted:0,deleted:0},untracked:[],unchangedBlocks:0,notes:[]},o={author:r.author,date:r.date,summary:i};!lr(Kn(e.props,"trackRevisions"),Kn(t.props,"trackRevisions"))&&i.untracked.push({path:"/props",kind:"modified",component:"docx",detail:"document props changed (theme/metadata/defaults); new version used"});let s=rl(e.children||[],t.children||[],"/children",o);return i.tracked.deleted>0&&i.notes.push(`${i.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:i}}Ut.Set("uri",e=>{try{return new URL(e),!0}catch{return e.includes(".json")||e.includes("/")||e.includes("\\\\")?!0:/^https?:\\/\\/.+/.test(e)}});Ut.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 Pu=class{constructor(){R(this,"schema",ft)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(r){throw new po("Invalid JSON syntax",this.extractJSONSyntaxError(r,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new mo(\'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(!T.Check(this.schema,t)){let r=[...T.Errors(this.schema,t)];throw new mo("JSON validation failed",this.formatTypeBoxErrors(r,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 po||t instanceof mo?{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(r){if(r instanceof po||r instanceof mo){let i=r.validationErrors.map(o=>({...o,...this.findLineNumber(o.path,e,t)}));throw r instanceof po?new po(r.message,i):new mo(r.message,i)}throw r}}extractJSONSyntaxError(e,t){let r=e.message,i=r.match(/position\\s+(\\d+)/i)||r.match(/at\\s+(\\d+)/i)||r.match(/character\\s+(\\d+)/i),o=0,a=0;if(i){let s=parseInt(i[1],10),c=t.substring(0,s).split(`\n`);o=c.length,a=c[c.length-1].length+1}return[{path:"",message:`JSON syntax error: ${r}`,code:"JSON_SYNTAX_ERROR",line:o||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(r=>{let i=r.path||"",o=this.findLineNumber(i,t);return{path:i,message:this.formatTypeBoxErrorMessage(r),code:this.getErrorCode(r),line:o.line,column:o.column,suggestions:this.generateSuggestions(r)}})}formatTypeBoxErrorMessage(e){let t=e.path?`at "${e.path}"`:"",r=e.message;return r.includes("Expected")?`${r} ${t}`:r.includes("Required property")?`${r} ${t}`:r.includes("Unexpected property")?`${r} ${t}`:r.includes("minimum")?`Value is too small ${t}. ${r}`:r.includes("maximum")?`Value is too big ${t}. ${r}`:`${r} ${t}`}getErrorCode(e){let t=String(e.type||"VALIDATION_ERROR").toUpperCase(),r=e.path?e.path.replace(/\\//g,"_").toUpperCase():"";return r?`${t}_${r}`:t}generateSuggestions(e){let t=[],r=e.message;if(r.includes("Expected string"))t.push("Ensure the value is wrapped in quotes");else if(r.includes("Expected number"))t.push("Remove quotes around numeric values");else if(r.includes("Expected array"))t.push("Use square brackets [] for arrays");else if(r.includes("Expected object"))t.push("Use curly braces {} for objects");else if(r.includes("Expected literal")){let i=r.match(/Expected literal (.+)/);i&&t.push(`Use the exact value: ${i[1]}`)}else if(r.includes("Unexpected property"))t.push("Remove unknown properties or check spelling"),t.push("Refer to the JSON schema documentation for valid properties");else if(r.includes("Expected union")){t.push("Check that the value matches one of the allowed formats");let i=e.path??"";(/\\/children\\/\\d+$/.test(i)||i.endsWith("/name"))&&t.push("Verify the component name is spelled correctly")}else if(r.includes("minimum")){let i=r.match(/minimum.*?(\\d+)/);i&&(r.includes("Array")?t.push(`Array must have at least ${i[1]} items`):t.push(`Value must be at least ${i[1]}`))}else r.includes("format")&&r.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,r){if(!e)return{};let i=r||t.split(`\n`),o=e.split(".");for(let a=0;a<i.length;a++){let s=i[a],c=o[o.length-1];if(s.includes(`"${c}"`)){let l=s.indexOf(`"${c}"`)+1;return{line:a+1,column:l}}}return{}}},po=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=r}},mo=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=r}};function UL(e){return new Pu().parse(e)}function DL(e){return new Pu().parseWithLineNumbers(e)}function _L(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;let r=t.path?`${t.path}: `:"",i=t.message||"Validation error";return`${r}${i}`}):[]}function ML(e,t){let r=lo(e)?e:"custom",i=co(r,t);return i.valid?{success:!0,data:i.data}:{success:!1,error:i.errors||[]}}function BL(e){let t=gu(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function VL(e,t){let r=t&&lo(t)?t:"custom",i=co(r,e);return i.valid?[]:(i.errors||[]).map(o=>o.path?`${o.path}: ${o.message}`:o.message)}function KL(e){let t=e.path||"root",r=e.message,i,o,a,s;if(r.includes("Expected")){let c=r.match(/Expected (.+) but received (.+)/);c&&(o=c[1],a=c[2],i=GL(o,a))}if(r.includes("Required property")){let c=r.match(/Required property \'(.+)\'/);c&&(r=`Missing required field: ${c[1]}`,i=`Add the required field: ${c[1]}`)}if(r.includes("Unexpected property")){let c=r.match(/Unexpected property \'(.+)\'/);c&&(r=`Unknown property: ${c[1]}`,i=`Remove the unknown property: ${c[1]}`)}if(r.includes("Expected union")&&(r="Value does not match any of the expected types",i="Check the documentation for valid format options"),r.includes("Expected literal")){let c=r.match(/Expected literal (.+)/);c&&(o=c[1],r=`Expected value: ${o}`,i=`Use the exact value: ${o}`)}if(r.includes("String length")){let c=r.match(/minimum length of (\\d+)/),l=r.match(/maximum length of (\\d+)/);c?(r=`String must be at least ${c[1]} characters long`,i=`Add more characters to meet the minimum length of ${c[1]}`):l&&(r=`String must be at most ${l[1]} characters long`,i=`Reduce to ${l[1]} characters or less`)}if(r.includes("Expected number")){let c=r.match(/minimum value of ([\\d.]+)/),l=r.match(/maximum value of ([\\d.]+)/);c?(r=`Number must be greater than or equal to ${c[1]}`,i=`Use a value of ${c[1]} or higher`):l&&(r=`Number must be less than or equal to ${l[1]}`,i=`Use a value of ${l[1]} or lower`)}if(r.includes("Array length")){let c=r.match(/minimum length of (\\d+)/),l=r.match(/maximum length of (\\d+)/);c?(r=`Array must have at least ${c[1]} items`,i=`Add more items to meet the minimum of ${c[1]}`):l&&(r=`Array must have at most ${l[1]} items`,i=`Remove items to meet the maximum of ${l[1]}`)}return r.includes("format")&&(r.includes("email")?(r="Invalid email address format",i="Use a valid email format like user@example.com"):r.includes("uri")||r.includes("url")?(r="Invalid URL format",i="Use a valid URL format like https://example.com"):r.includes("date-time")&&(r="Invalid date-time format",i="Use ISO 8601 format like 2024-01-01T00:00:00Z")),r.includes("pattern")&&(r="String does not match the required pattern",i="Check the format requirements for this field"),{path:t,message:r,code:String(e.type||"validation_error"),suggestion:i,expected:o,received:a,options:s}}function GL(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 Gn(e){return e.map(KL)}function ts(e){return Gn(e).map(t=>{let r=`${t.path}: ${t.message}`;return t.suggestion&&(r+=` (Suggestion: ${t.suggestion})`),r})}function ob(e){let t=new Map;for(let r of Gn(e)){let i=t.get(r.path)||[];i.push(r),t.set(r.path,i)}return t}function rs(e){let t=Gn(e),r=ob(e),i=`Validation failed with ${t.length} error${t.length>1?"s":""}:\n\n`;for(let[o,a]of r){i+=`\\u{1F4CD} ${o}:\n`;for(let s of a)i+=` \\u274C ${s.message}\n`,s.suggestion&&(i+=` \\u{1F4A1} ${s.suggestion}\n`),s.expected&&s.received&&(i+=` \\u{1F4CB} Expected: ${s.expected}, Received: ${s.received}\n`),s.options&&(i+=` \\u{1F4CB} Valid options: ${s.options.join(", ")}\n`);i+=`\n`}return i}function ns(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 qL(e){if(!e||e==="root")return"document root";let t=e.split(".");if(t.includes("children")){let r=t.indexOf("children");if(t.length>r+1)return`component at index ${t[r+1]}`}return t.includes("props")?"props section":t.includes("theme")?"theme configuration":t.join(" > ")}var WL=Gn,HL=ts,Zc={report:dn,section:pn,heading:on,paragraph:an,columns:mn,image:sn,statistic:cn,table:ln,list:un};function nl(e,t,r){let i=Zc[e];if(!i){if(T.Check(Pr,t))return{success:!0,data:t};let s=[...T.Errors(Pr,t)];return{success:!1,errors:Gn(s),errorStrings:ts(s),report:r?.includeReport?rs(s):void 0,hasCriticalErrors:r?.checkCritical?ns(s):void 0}}if(T.Check(i,t))return{success:!0,data:t};let o=[...T.Errors(i,t)];return{success:!1,errors:Gn(o),errorStrings:ts(o),report:r?.includeReport?rs(o):void 0,hasCriticalErrors:r?.checkCritical?ns(o):void 0}}function Eu(e,t){let r=t?.maxDepth??10,i=t?.currentDepth??0;if(i>r)return{success:!1,errors:[{path:"children",message:`Maximum nesting depth (${r}) exceeded`,code:"custom",suggestion:"Reduce the nesting level of components"}],errorStrings:[`Maximum nesting depth (${r}) exceeded`],hasCriticalErrors:!0};if(T.Check(ft,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=Eu(s.children[l],{...t,currentDepth:i+1});if(!p.success){let m=p.errors?.map(u=>({...u,path:`children[${l}].${u.path}`}));return{success:!1,errors:m,errorStrings:m?.map(u=>`${u.path}: ${u.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 o=[...T.Errors(ft,e)];return{success:!1,errors:Gn(o),errorStrings:ts(o),report:t?.includeReport?rs(o):void 0,hasCriticalErrors:t?.checkCritical?ns(o):void 0}}function zL(e,t){let r=[],i=0;for(let{name:s,props:c}of e){let l=s in Zc?nl(s,c,t):Eu(c,t);if(r.push(l),l.hasCriticalErrors&&i++,!l.success&&t?.stopOnFirst)break}let o=r.filter(s=>s.success).length,a=r.length-o;return{success:a===0,results:r,summary:{total:r.length,valid:o,invalid:a,criticalErrors:i}}}function JL(e,t,r){try{let i=r?r(t):t;return nl(e,i,{includeReport:!0,checkCritical:!0})}catch(i){return{success:!1,errors:[{path:"root",message:`Transformation failed: ${i instanceof Error?i.message:String(i)}`,code:"custom"}],errorStrings:[`Transformation failed: ${i instanceof Error?i.message:String(i)}`],hasCriticalErrors:!0}}}function YL(e,t){let r=Zc[e];if(!r)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(Zc).join(", ")}`}],errorStrings:[`Unknown component name: ${e}`],hasCriticalErrors:!0};if(T.Check(r,t))return{success:!0,data:t};let i=[...T.Errors(r,t)];return{success:!1,errors:Gn(i),errorStrings:ts(i),report:rs(i),hasCriticalErrors:ns(i)}}function XL(e,t){return nl(e,t).success}var ab=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],QL=new Set(ab);function ZL(e){return e.name==="docx"}function eR(e){return e.name==="section"}function tR(e){return e.name==="columns"}function rR(e){return e.name==="heading"}function nR(e){return e.name==="paragraph"}function iR(e){return e.name==="image"}function oR(e){return e.name==="text-box"}function aR(e){return e.name==="statistic"}function sR(e){return e.name==="table"}function cR(e){return e.name==="list"}function lR(e){return e.name==="toc"}function pR(e){return e.name==="highcharts"}function mR(e){return e.name==="visual"}function uR(e){return e.name==="text-space-after"}var dR="1.0.0";var Ju={};rt(Ju,{BUILT_IN_PPTX_THEME_NAMES:()=>os,ChartComponentDefaultsSchema:()=>ku,ColorValueSchema:()=>Mn,DEFAULT_ERROR_CONFIG:()=>En,DEFAULT_PPTX_RENDERER_ID:()=>fn,GradientFillSchema:()=>eo,GradientStopSchema:()=>Pc,HighchartsComponentDefaultsSchema:()=>Nu,ImageComponentDefaultsSchema:()=>vu,PATTERN_FILL_PRESETS:()=>Tc,PPTX_BASE_SCHEMA_METADATA:()=>Cb,PPTX_COMPONENT_METADATA:()=>wb,PPTX_JSON_SCHEMA_URLS:()=>xb,PPTX_RENDERER_IDS:()=>Et,PPTX_SHARED_VERSION:()=>AR,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>At,PatternFillSchema:()=>Ec,PositionSchema:()=>mb,PptxChartPropsSchema:()=>Wa,PptxComponentDefaultsSchema:()=>uo,PptxComponentDefinitionSchema:()=>cl,PptxHighchartsPropsSchema:()=>qa,PptxImagePropsSchema:()=>Va,PptxJsonComponentDefinitionSchema:()=>Ob,PptxSlideContentSchema:()=>Ha,PptxStandardComponentDefinitionSchema:()=>bb,PptxTablePropsSchema:()=>Ga,PresentationPropsSchema:()=>_u,SEMANTIC_COLOR_ALIASES:()=>wc,SEMANTIC_COLOR_NAMES:()=>Ic,STYLE_NAMES:()=>Xi,ShadowSchema:()=>Qi,ShapeComponentDefaultsSchema:()=>Lu,ShapePropsSchema:()=>Ka,ShapeTypeSchema:()=>Zi,SlideBackgroundSchema:()=>Mu,SlidePropsSchema:()=>Vu,StyleNameSchema:()=>_a,TableComponentDefaultsSchema:()=>Ru,TextComponentDefaultsSchema:()=>$u,TextPropsSchema:()=>Ba,TextRunSchema:()=>Cc,TextStyleSchema:()=>ju,ThemeConfigSchema:()=>Ti,TransitionSchema:()=>Bu,VerticalAlignmentSchema:()=>Ii,addPptxBlockAuthoringSchemas:()=>ll,collectImageSourceConflicts:()=>Pb,collectPptxRendererErrors:()=>Du,collectTextContentConflicts:()=>Eb,compareSemver:()=>hi,comprehensiveValidatePresentation:()=>Lb,convertToJsonSchema:()=>Ib,createAllPptxComponentSchemas:()=>al,createComponentSchema:()=>Gi,createErrorConfig:()=>Ir,createPptxComponentSchemaObject:()=>Pi,deepValidatePresentation:()=>vb,dispatchPptxRootByRenderer:()=>pl,exportSchemaToFile:()=>qi,fixSchemaReferences:()=>Rn,generateUnifiedDocumentSchema:()=>yb,getAllPptxComponentNames:()=>ub,getPptxComponentsByCategory:()=>db,getPptxContainerComponents:()=>fb,getPptxContentComponents:()=>hb,getPptxStandardComponent:()=>fo,isPptxStandardComponent:()=>gb,isValidSemver:()=>vn,isValidThemeConfig:()=>sb,latestVersion:()=>ut,parseSemver:()=>$n,pptxComponentDefinitionName:()=>qn,pptxComponentRequiresProps:()=>wi,preparePptxDocumentBlockTargets:()=>Sb,presentImageSources:()=>Tb,transformValueError:()=>An,transformValueErrors:()=>tt,validate:()=>PR,validateJsonPptxTheme:()=>zu,validateJsonPresentationDocument:()=>Hu,validatePptxTheme:()=>ss,validatePresentationDocument:()=>as,validateStrict:()=>ER});var $u=n.Partial(Ba),vu=n.Partial(Va),Lu=n.Partial(Ka),Ru=n.Partial(Ga),Nu=n.Partial(qa),ku=n.Partial(Wa),uo=n.Object({text:n.Optional($u),image:n.Optional(vu),shape:n.Optional(Lu),table:n.Optional(Ru),highcharts:n.Optional(Nu),chart:n.Optional(ku)},{additionalProperties:!0});var os=["consulting","dark","default","devportal","minimal","vermilion"],fR=n.Union([n.Number({description:"Margin in inches (all sides)"}),n.Object({top:n.Number({description:"Top margin in inches"}),right:n.Number({description:"Right margin in inches"}),bottom:n.Number({description:"Bottom margin in inches"}),left:n.Number({description:"Left margin in inches"})},{additionalProperties:!1})],{description:"Slide margins in inches"}),hR=n.Union([n.Number({description:"Gutter in inches (both axes)"}),n.Object({column:n.Number({description:"Column gutter in inches"}),row:n.Number({description:"Row gutter in inches"})},{additionalProperties:!1})],{description:"Gaps between grid tracks in inches"}),Fu=n.Object({columns:n.Optional(n.Number({minimum:1,description:"Number of columns (default: 12)"})),rows:n.Optional(n.Number({minimum:1,description:"Number of rows (default: 6)"})),margin:n.Optional(fR),gutter:n.Optional(hR)},{additionalProperties:!1,description:"Grid layout configuration"}),pr=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),ju=n.Object({fontSize:n.Optional(n.Number()),fontFace:n.Optional(Ht),fontColor:n.Optional(Mn),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),align:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),lineSpacing:n.Optional(n.Number()),charSpacing:n.Optional(n.Number()),paraSpaceAfter:n.Optional(n.Number()),paraSpaceBefore:n.Optional(n.Number()),case:n.Optional(Oi)},{additionalProperties:!1,description:"Text style preset"}),Ti=n.Object({...kn,displayName:n.Optional(n.String()),description:n.Optional(n.String({description:"The visual voice: what the theme looks like, in one sentence."})),whenToUse:n.Optional(n.String({description:"The decks the theme suits; discovery and the design guide quote it."})),version:n.Optional(n.String()),name:n.String({description:"Theme name"}),colors:n.Object({primary:pr,secondary:pr,accent:pr,background:pr,text:pr,text2:n.Optional(pr),background2:n.Optional(pr),accent4:n.Optional(pr),accent5:n.Optional(pr),accent6:n.Optional(pr)},{additionalProperties:!1,description:"Theme color palette (10-slot scheme)"}),fonts:n.Object({heading:Ht,body:Ht,mono:n.Optional(Ht),light:n.Optional(Ht)},{additionalProperties:!1,description:"Font families"}),fontRegistry:n.Optional(wr),defaults:n.Object({fontSize:n.Number({description:"Default font size in points"}),fontColor:pr},{additionalProperties:!1,description:"Default text styling"}),styles:n.Optional(n.Partial(n.Object(Object.fromEntries(Xi.map(e=>[e,ju]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:n.Optional(uo)},{additionalProperties:!1,description:"Presentation theme configuration"});function sb(e){return T.Check(Ti,e)}var Et=["pptxgenjs","office-open"],fn="pptxgenjs";function qn(e){return`PptxComponentDefinition_${e}`}function cb(e,t,r){let i=Uu(t),o=il(i);if(r==="pptxgenjs")return e==="slide"&&delete o?.transition,i;switch(e){case"image":for(let a of["svg","sizing","rotate","rounding","hyperlink"])delete o?.[a];break;case"shape":delete o?.flipV;break;case"table":for(let a of["autoPage","autoPageRepeatHeader","margin","borderRadius"])delete o?.[a];gR(i);break}return lb(i),i}function Du(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??fn;if(!Et.includes(r))return[{path:"/renderer",message:`Invalid renderer "${String(r)}". Expected "pptxgenjs" or "office-open".`,code:"invalid_value"}];let i=[],o=(s,c)=>{i.push({path:s,message:`The "${r}" 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(r==="pptxgenjs")s.name==="slide"&&l?.transition!==void 0&&o(`${c}/props/transition`,"slide transitions");else{if(s.name==="chart"&&l?.type==="bubble"&&o(`${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,u]of Object.entries(p))l?.[m]!==void 0&&o(`${c}/props/${m}`,u)}if(s.name==="shape"&&l?.flipV!==void 0&&o(`${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,u]of Object.entries(p))l?.[m]!==void 0&&o(`${c}/props/${m}`,u);Array.isArray(l?.rows)&&l.rows.forEach((m,u)=>{Array.isArray(m)&&m.forEach((f,O)=>{if(!(!f||typeof f!="object"))for(let[S,w]of[["colspan","merged table cells"],["rowspan","merged table cells"],["margin","table insets"]])f[S]!==void 0&&o(`${c}/props/rows/${u}/${O}/${S}`,w)})})}}for(let[p,m]of Object.entries(s))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),i}function gR(e){let i=il(e)?.rows?.items?.items?.anyOf;if(Array.isArray(i))for(let o of i){let a=il(o);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,lb(o))}}function il(e){if(!(!e||typeof e!="object"))return e.properties}function lb(e){let t=il(e),r=e.required;if(!t||!r)return;let i=r.filter(o=>o in t);i.length>0?e.required=i:delete e.required}function Uu(e){if(Array.isArray(e))return e.map(Uu);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Uu(e[r]);return t}var ol=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),yR=n.Object({x:n.Optional(ol("Frame left edge in inches, relative to the enclosing frame or slide","Frame left edge as a percentage of the enclosing width")),y:n.Optional(ol("Frame top edge in inches, relative to the enclosing frame or slide","Frame top edge as a percentage of the enclosing height")),w:n.Optional(ol("Frame width in inches","Frame width as a percentage of the enclosing width")),h:n.Optional(ol("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:n.Optional(rn),gridConfig:n.Optional(n.Object({...Fu.properties},{additionalProperties:!1,description:"Grid used for grid placements of this group\\u2019s descendants, merged over the enclosing grid field by field. Inside a frame the grid spans the frame."})),direction:n.Optional(n.Union([n.Literal("row"),n.Literal("column")],{description:"Distribute the children into cells along this axis: equal cells, or weighted by `weights`. Each child fills its cell unless it states its own offsets; an omitted optional child simply redistributes the rest."})),gap:n.Optional(n.Number({minimum:0,description:"Space between distributed cells, in inches. Default 0."})),weights:n.Optional(n.Array(n.Number({exclusiveMinimum:0}),{minItems:1,description:"Relative cell sizes in child order (e.g. [1.1, 1] for a 1.1 : 1 split). Missing entries count as 1."}))},{additionalProperties:!1,description:"Transparent group. Without a frame, a plain sequence of slide content; with `x`/`y`/`w`/`h` or `grid`, a frame its children position within (numbers are offsets in inches, percentages are fractions of the frame, omitted values fill it); with `direction`, a row or column that distributes its children into cells."}),_u=n.Object({title:n.Optional(n.String({description:"Presentation title metadata"})),author:n.Optional(n.String({description:"Presentation author metadata"})),subject:n.Optional(n.String({description:"Presentation subject metadata"})),company:n.Optional(n.String({description:"Company name metadata"})),theme:n.Optional(n.Union([n.String({description:`Theme name to apply (default: "default"). Built-ins: ${os.join(", ")} (consulting is the house style).`,examples:[...os],default:"default"}),Ti],{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:n.Optional(wr),slideWidth:n.Optional(n.Number({description:"Slide width in inches (default: 10)",default:10})),slideHeight:n.Optional(n.Number({description:"Slide height in inches (default: 7.5)",default:7.5})),rtlMode:n.Optional(n.Boolean({description:"Right-to-left text direction"})),language:n.Optional(n.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:n.Optional(n.Union([n.Literal("9"),n.Literal("09")],{description:\'Format for {PAGE_NUMBER} placeholders: "9" = bare number (default), "09" = zero-padded\',default:"9"})),componentDefaults:n.Optional(uo),grid:n.Optional(Fu),blocks:n.Optional(Xr),qualityProfile:n.Optional(n.String({description:"The quality profile validation judges this deck by when the caller names none \\u2014 a blueprint scaffold writes its archetype\\u2019s profile here. A profile names required structure and content; the theme only paints. Built-ins: consulting-deck, executive-presentation, technical-presentation; an unknown name falls back to the format default.",examples:["consulting-deck","executive-presentation","technical-presentation"]}))},{description:"Presentation container props",additionalProperties:!1}),mb=n.Object({x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'X position as percentage (e.g., "10%")\'})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Y position as percentage (e.g., "10%")\'})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Width as percentage (e.g., "80%")\'})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Height as percentage (e.g., "20%")\'})]))},{description:"Position and size in inches or percentages",additionalProperties:!1}),Mu=n.Object({color:n.Optional(Mn),gradient:n.Optional(eo),image:n.Optional(n.Object({path:n.Optional(n.String({description:"Image file path or URL"})),base64:n.Optional(n.String({description:"Base64-encoded image data"}))},{description:"Background image",additionalProperties:!1}))},{description:"Slide background configuration",additionalProperties:!1}),Bu=n.Object({type:n.Optional(n.Union([n.Literal("fade"),n.Literal("push"),n.Literal("wipe"),n.Literal("zoom"),n.Literal("none")],{description:"Transition effect type"})),speed:n.Optional(n.Union([n.Literal("slow"),n.Literal("medium"),n.Literal("fast")],{description:"Transition speed"}))},{description:"Slide transition configuration",additionalProperties:!1}),Vu=n.Object({meta:n.Optional(n.Object({title:n.Optional(n.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:n.Optional(Mu),transition:n.Optional(Bu),notes:n.Optional(n.String({description:"Speaker notes for this slide"})),hidden:n.Optional(n.Boolean({description:"Hide this slide from presentation"}))},{description:"Slide container props",additionalProperties:!1}),pb=[...tn.map(({name:e})=>e),"block","group"],At=[{name:"pptx",propsSchema:_u,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:Vu,hasChildren:!0,allowedChildren:pb,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."},{name:"group",propsSchema:yR,hasChildren:!0,allowedChildren:pb,category:"layout",description:"Transparent group of slide content; also the inspectable result of block expansion. Give it a frame (x/y/w/h or grid) to position children within it, and a direction to distribute them into equal or weighted cells."},{name:"block",propsSchema:Dn,hasChildren:!1,category:"layout",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine and no coordinates are accepted here."},...tn];function fo(e){return At.find(t=>t.name===e)}function ub(){return At.map(e=>e.name)}function db(e){return At.filter(t=>t.category===e)}function fb(){return At.filter(e=>e.hasChildren)}function hb(){return At.filter(e=>!e.hasChildren)}function gb(e){return At.some(t=>t.name===e)}function Pi(e,t,r){let i={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(i.$schema=n.Optional(n.String({format:"uri"})),i.renderer=r?r.requireDiscriminator?n.Literal(r.renderer,{description:"Renderer backend for this presentation"}):n.Optional(n.Literal(r.renderer,{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'})):n.Optional(n.Union(Et.map(o=>n.Literal(o)),{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'}))),i.props=r?cb(e.name,e.propsSchema,r.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=n.Optional(n.Array(t))),wi(e)||(i.props=n.Optional(i.props)),n.Object(i,{additionalProperties:!1,description:e.description})}function al(e){return At.map(t=>Pi(t,e))}function sl(e,t=[],r){let i=new Map;for(let c of At)c.hasChildren||i.set(c.name,Pi(c,void 0,r));let o=At.filter(c=>c.hasChildren),a=new Map,s=[...o];for(;s.length>0;){let c=s.length;for(let l=s.length-1;l>=0;l--){let p=s[l];if(p.name==="group"){let S=n.Intersect([e,n.Object({name:n.Union([...p.allowedChildren.map(w=>n.Literal(w)),...t.map(w=>w.properties?.name??n.String())])})]);a.set(p.name,Pi(p,S,r)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,Pi(p,e,r)),s.splice(l,1);continue}if(!p.allowedChildren.filter(S=>o.some(w=>w.name===S)).every(S=>a.has(S)))continue;let f=[...p.allowedChildren.map(S=>a.get(S)??i.get(S)).filter(S=>S!==void 0),...t],O=f.length===1?f[0]:n.Union(f);a.set(p.name,Pi(p,O,r)),s.splice(l,1)}if(s.length===c)throw new Error(`Circular allowedChildren among: ${s.map(l=>l.name).join(", ")}`)}return[...a.values(),...i.values()]}function bR(e,t,r,i){let o={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),version:i?n.Optional(n.Literal(t.version)):n.Literal(t.version),props:t.propsSchema};return t.hasChildren&&(o.children=n.Optional(n.Array(r))),n.Object(o,{additionalProperties:!1,description:t.description??e.name})}function yb(e={}){let{customComponents:t=[]}=e,r=Et.map(i=>OR(t,i,i!==fn));return n.Union(r,{description:"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs."})}function OR(e,t,r){return n.Recursive(i=>{let o=[];for(let c of e)if(c.versions.length>0){let l=ut(c.versions.map(m=>m.version)),p=c.versions.map(m=>bR(c,m,i,m.version===l));o.push(...p)}let s=[...sl(i,o,{renderer:t,requireDiscriminator:r}),...o];return s.length===0?n.Object({}):n.Union(s)},{$id:qn(t)})}var bb=n.Union([...al(n.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),cl=n.Recursive(e=>n.Union([...sl(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var Ob=cl,xb={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"};function ll(e){let t=e.definitions??{},r=new Map;for(let o of Et){let a=qn(o);t[a]&&r.set(o,ka(t,a,["pptx","slide"],"pptx"))}let i=o=>{if(!o||typeof o!="object")return;if(Array.isArray(o)){o.forEach(i);return}let a=o;if(a.properties?.name?.const==="pptx"){let s=r.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c))l.properties.body.items=s}Object.values(a).forEach(i)};i(e)}function pl(e){let t=e.anyOf;if(!Array.isArray(t))return;let r=new Map;for(let a of Et){let s=`#/definitions/${qn(a)}`,c=t.find(l=>l&&l.$ref===s);c&&r.set(a,c)}if(r.size!==t.length||!r.has(fn))return;let i=a=>({properties:{renderer:{const:a}},required:["renderer"]}),o=Et.filter(a=>a!==fn&&r.has(a));delete e.anyOf,e.type="object",e.properties={renderer:{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\',anyOf:Et.filter(a=>r.has(a)).map(a=>({const:a,type:"string"}))}},e.allOf=[...o.map(a=>({if:i(a),then:r.get(a)})),{if:{not:{anyOf:o.map(i)}},then:r.get(fn)}]}function Sb(e){let t=e.definitions??{},r=[];for(let i of Et){let o=qn(i),a=t[o];if(!a)continue;let s=`PptxSlotContent_${i}`;if(!t[s]){let p=Qs(a).find(m=>m.properties?.name?.const==="slide")?.properties?.children?.items;p&&(t[s]=JSON.parse(JSON.stringify(p)))}if(!t[s]){r.push({name:o});continue}let c={$ref:`#/definitions/${s}`};r.push({name:o,componentRef:c},{name:s,componentRef:c})}return r}function Ib(e,t={}){return Zs(e,{...t,enrich:r=>{ll(r),pl(r)}})}var wb={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"}},Cb={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"}};var xR=["path","base64","svg"];function Tb(e){if(!e||typeof e!="object")return[];let t=e;return xR.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function Pb(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=Tb(i.props);a.length>1&&t.push({path:`${o}/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(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function Eb(e){let t=[],r=(i,o,a)=>{if(Array.isArray(i)){i.forEach((s,c)=>r(s,`${o}/${c}`,a));return}if(!(!i||typeof i!="object")){if(!a&&i.name==="text"&&i.props&&typeof i.props=="object"){let s=typeof i.props.text=="string",c=Array.isArray(i.props.runs);s&&c?t.push({path:`${o}/props`,message:\'Text component accepts either "text" or "runs", not both. Use exactly one of the two.\',code:"mutually_exclusive"}):!s&&!c&&t.push({path:`${o}/props`,message:\'Text component requires content: set either "text" or "runs".\',code:"required_property"})}for(let s of Object.keys(i))r(i[s],`${o}/${s}`,a||o==="/props"&&s==="blocks")}};return r(e,"",!1),t}var SR=Object.fromEntries(At.map(e=>[e.name,e.propsSchema])),Ku=new Set(At.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),Wu=new Set(["name","id","enabled","props","children"]),IR=new Set([...Wu,"version"]),Ab=new Set([...Wu,"$schema"]);Ab.add("renderer");var wR={id:"string",enabled:"boolean",$schema:"string",version:"string"};function $b(e,t,r,i,o){for(let a of Object.keys(e)){if(!r.has(a)){o.push({path:`${t}/${a}`,message:`Unknown field "${a}" on ${i}`,code:"unknown_field"});continue}let s=wR[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Field "${a}" on ${i} must be a ${s}`,code:"invalid_type"})}}function vb(e,t={}){let r=[];if(!e||typeof e!="object")return r.push({path:"root",message:"Presentation must be an object",code:"invalid_type"}),r;if(!e.name)r.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Ku.has(e.name)){let o=[...Ku].map(a=>`"${a}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}$b(e,"",Ab,"the root component",r);let i=fo(e.name);return"props"in e?Ku.has(e.name)&&r.push(...qu(e.name,e.props,"/props",t)):(!i||wi(i))&&r.push({path:"/props",message:\'Missing required field "props"\',code:"required_property"}),e.children?Array.isArray(e.children)||r.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):r.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),Gu(e,"",t,r),r}function Gu(e,t,r,i){if(!e||typeof e!="object")return;let o=(c,l)=>{if(!c||typeof c!="object"||Array.isArray(c)){i.push({path:l,message:"Component must be an object",code:"invalid_type"});return}if(typeof c.name!="string"||c.name.length===0){i.push({path:`${l}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}let p=r.knownCustomNames?.has(c.name)??!1;if($b(c,l,p?IR:Wu,`component "${c.name}"`,i),p){"props"in c||i.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.`}),Gu(c,l,r,i);return}let u=fo(c.name),f=`${l}/props`;if("props"in c)i.push(...qu(c.name,c.props,f,r));else if(u&&wi(u)){let O=u.propsSchema.required??[];i.push({path:f,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:O.length>0?`Add "props" carrying ${O.map(S=>`"${S}"`).join(", ")}.`:`Add a "props" object holding the content "${c.name}" renders.`})}else i.push(...qu(c.name,{},f,r));if(u&&!u.hasChildren&&c.children!=null){i.push({path:`${l}/children`,message:`Component "${c.name}" does not accept children`,code:"invalid_value"});return}Gu(c,l,r,i)},a=fo(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&fo(c.name)&&!a.allowedChildren.includes(c.name)){let p=a.allowedChildren.map(m=>`"${m}"`).join(", ");i.push({path:`${l}/name`,message:`Component "${c.name}" is not allowed inside "${e.name}". Expected ${p}`,code:"invalid_value"})}};Array.isArray(e.children)?e.children.forEach((c,l)=>{let p=`${t}/children/${l}`;s(c,p),o(c,p)}):e.children!=null&&t!==""&&i.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function qu(e,t,r,i={}){let o=[],a=SR[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=t;if(i.allowUnknownFields&&(s=T.Clean(a,T.Clone(s))),!T.Check(a,s)){let c=[...T.Errors(a,s)];tt(c,{maxErrors:100}).forEach(p=>{let m=p.path==="root"?r:`${r}${p.path.startsWith("/")?p.path:"/"+p.path}`;o.push({...p,path:m})})}return o}function Lb(e,t=[],r={}){let i=vb(e,r),o=t.filter(a=>!CR(a));return TR([...o,...i])}function CR(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let r=e.message||"";return/invalid component configurations?/i.test(r)||/invalid document structure/i.test(r)}function TR(e){let t=new Set,r=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),r.push(i))}return r}function Rb(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 as(e,t={}){let r=Lb(e,[],t);r.push(...Pb(e)),r.push(...Eb(e)),r.push(...Du(e)),r.push(...Ji(e,Qr(e),"pptx",[...t.knownCustomNames??[]]));let i=r.length===0;return{valid:i,errors:r,documentType:"pptx",data:i?e:void 0}}function Hu(e,t={}){let{parsed:r,error:i}=Rb(e);return i?{valid:!1,errors:[i],documentType:"pptx"}:as(r,t)}function ss(e){if(T.Check(Ti,e))return{valid:!0,errors:[],data:e};let t=[...T.Errors(Ti,e)];return{valid:!1,errors:tt(t,{maxErrors:100})}}function zu(e){let{parsed:t,error:r}=Rb(e);return r?{valid:!1,errors:[r]}:ss(t)}var PR={document:e=>as(e),jsonDocument:e=>Hu(e),theme:e=>ss(e),jsonTheme:e=>zu(e),isDocument:e=>as(e).valid,isTheme:e=>ss(e).valid},ER={document:e=>as(e),jsonDocument:e=>Hu(e),theme:e=>ss(e),jsonTheme:e=>zu(e)},AR="1.0.0";function Nb(e,t){let r={exports:{}},i=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)(i,r,r.exports),r.exports}function Yu(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 r=Object.values(t.versions);return r.length>0&&r.some(i=>!!i&&typeof i=="object"&&!!i.propsSchema&&typeof i.propsSchema=="object"&&typeof i.render=="function")}function kb(e){if(Yu(e.default))return e.default;let t=Object.entries(e).filter(([r])=>r.endsWith("Component")||r.endsWith("component")||r.endsWith("Module")||r.endsWith("module"));for(let[,r]of t)if(Yu(r))return r;for(let r of Object.values(e))if(Yu(r))return r;return null}var $R=/^\\d+\\.\\d+\\.\\d+$/;function Fb(e,t,r){let i=[];for(let[o,a]of Object.entries(e.versions)){if(!$R.test(o))throw new Error(`Component "${e.name}": invalid semver key "${o}". Expected format: major.minor.patch`);if(!a||typeof a!="object"||!a.propsSchema)throw new Error(`Component "${e.name}" version "${o}" requires a propsSchema`);if(typeof a.render!="function")throw new Error(`Component "${e.name}" version "${o}" requires a render function`);let s;try{s=JSON.parse(JSON.stringify(a.propsSchema))}catch(c){throw new Error(`Component "${e.name}" version "${o}": propsSchema is not serializable (${c instanceof Error?c.message:String(c)})`)}i.push({version:o,propsSchema:s,hasChildren:a.hasChildren===!0,...typeof a.description=="string"?{description:a.description}:{}})}if(i.length===0)throw new Error(`Component "${e.name}" must have at least one version`);return{name:e.name,format:t,versions:i,latest:ut(i.map(o=>o.version)),examples:r}}function jb(e,t,r){return`import type { TSchema } from \'@sinclair/typebox\';\nimport type { ${t}, ${r} } 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 = ${r};\n\nexport type RenderContext<T> = SharedRenderContext<T, ${r}>;\n\nexport type RenderFunction<\n TProps,\n TComponentDefinition = ${t},\n> = SharedRenderFunction<TProps, TComponentDefinition, ${r}>;\n\nexport type ComponentVersion<\n TComponentDefinition = ${t},\n TPropsSchema extends TSchema = TSchema,\n> = SharedComponentVersion<TComponentDefinition, TPropsSchema, ${r}>;\n\nexport type ComponentVersionMap<TComponentDefinition = ${t}> =\n SharedComponentVersionMap<TComponentDefinition, ${r}>;\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}, ${r} } from \'${e}\';\n`}var Xu=jb("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),Qu=jb("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function ml(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 Z3={"node_modules/@json-to-office/core-docx/package.json":ml("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":Xu,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":Xu,"node_modules/@json-to-office/json-to-docx/package.json":ml("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":Xu,"node_modules/@json-to-office/core-pptx/package.json":ml("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":Qu,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":Qu,"node_modules/@json-to-office/json-to-pptx/package.json":ml("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":Qu},Ub=["@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 Zu="[plugin-network-off]";var ed=globalThis,td=ed.postMessage.bind(ed),vR={createComponent:Vi,createVersion:Bi,resolveComponentVersion:gi,ComponentValidationError:yi,DuplicateComponentError:Ki},LR={"@sinclair/typebox":lp,"@sinclair/typebox/value":Cp,"@json-to-office/shared":hm,"@json-to-office/shared/plugin":gm,"@json-to-office/shared-docx":Au,"@json-to-office/shared-pptx":Ju,...Object.fromEntries(Ub.map(e=>[e,vR]))},RR=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],NR=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function Db(e,t){let r=globalThis;for(;r&&r!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(r,e))try{delete r[e]}catch{}r=Object.getPrototypeOf(r)}try{Object.defineProperty(globalThis,e,{value:t,configurable:!1,writable:!1})}catch{}}function _b(e){let t=`${Zu} ${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(r,i){if(i==="name")return e;throw new Error(t)}})}function kR(e){let t=globalThis.fetch;if(typeof t!="function")return;let r=e.length>0?`This plugin may call: ${e.join(", ")}.`:"This plugin has Network on but no hosts listed, so it may call nothing.",i=async(...o)=>{try{return await t.apply(globalThis,o)}catch(a){let s=String(o[0]instanceof Request?o[0].url:o[0]);throw new Error(`${Zu} fetch("${s}") was refused. ${r} Add the host under Network in the plugin header to allow it.`,{cause:a})}};try{Object.defineProperty(globalThis,"fetch",{value:i,configurable:!1,writable:!1})}catch{}}var Mb=!1;function FR(e,t){if(Mb)return;Mb=!0;for(let i of RR)Db(i);let r=globalThis.navigator;if(r)for(let i of["storage","locks","serviceWorker"])try{Object.defineProperty(r,i,{value:void 0})}catch{}if(!e){for(let i of NR)Db(i,_b(i));if(r)try{Object.defineProperty(r,"sendBeacon",{value:_b("navigator.sendBeacon")})}catch{}return}kR(t)}var Bb=5*1024*1024,cs=null;function jR(e,t){let r=t instanceof Error?t.message:String(t),i={id:e,type:"error",message:r,...t instanceof Error&&t.stack?{stack:t.stack}:{}};td(i)}async function UR(e){if(e.type==="load"){FR(e.allowNetwork,e.networkOrigins??[]);let t=Nb(e.js,LR),r=kb(t);if(!r)throw new Error(\'No component export found. Export the result of createComponent() as the default export or under a name ending in "Component".\');cs=r;let i=Fb(r,e.format,e.examples),o={id:e.id,type:"loaded",metadata:i};td(o);return}if(e.type==="render"){if(!cs)throw new Error("Plugin is not loaded");let t=gi(cs.name,cs.versions,e.version),r=Ln(t.propsSchema,e.props,{componentName:cs.name});if(!r.valid)throw new yi(r.errors??[],e.props);let i=[],o=(m,u)=>{i.push({message:m,...u?{context:u}:{}})},a=await t.render({props:r.data,theme:e.theme,addWarning:o,children:e.children}),s=Array.isArray(a)?a:[a],c=JSON.stringify(s);if(c.length>Bb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${Bb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:i};td(p);return}}ed.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||UR(t).catch(r=>jR(t.id,r))});})();\n';export{e as default};
|
|
2
|
-
//# sourceMappingURL=_virtual_jto-sandbox-runtime-DhfBorPd.js.map
|