@json-to-office/jto 4.5.0 → 5.3.1
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-CSBsGUBL.js → HomePage-PKIVItSZ.js} +4 -4
- package/dist/client/assets/{HomePage-CSBsGUBL.js.map → HomePage-PKIVItSZ.js.map} +1 -1
- package/dist/client/assets/{JsonEditorPage-BHVA2YLP.js → JsonEditorPage-CoRaWJiD.js} +3 -3
- package/dist/client/assets/{JsonEditorPage-BHVA2YLP.js.map → JsonEditorPage-CoRaWJiD.js.map} +1 -1
- package/dist/client/assets/{MonacoPluginProvider-D5aUgKZi.js → MonacoPluginProvider-BRnOmPV0.js} +5 -5
- package/dist/client/assets/{MonacoPluginProvider-D5aUgKZi.js.map → MonacoPluginProvider-BRnOmPV0.js.map} +1 -1
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-gZZSIMe7.js → _virtual_jto-plugin-type-libs-BWCUBp-C.js} +86 -13
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-gZZSIMe7.js.map → _virtual_jto-plugin-type-libs-BWCUBp-C.js.map} +1 -1
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CH8UnjtH.js +2 -0
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CH8UnjtH.js.map +1 -0
- package/dist/client/assets/{editor-Ce9XFPWx.js → editor-Dm1khfnn.js} +2 -2
- package/dist/client/assets/{editor-Ce9XFPWx.js.map → editor-Dm1khfnn.js.map} +1 -1
- package/dist/client/assets/{editor-monaco-json-u3bIh2LA.js → editor-monaco-json-DO_eqGWS.js} +2 -2
- package/dist/client/assets/{editor-monaco-json-u3bIh2LA.js.map → editor-monaco-json-DO_eqGWS.js.map} +1 -1
- package/dist/client/assets/index-BiJMw-wa.js +27 -0
- package/dist/client/assets/index-BiJMw-wa.js.map +1 -0
- package/dist/client/assets/{index-DruKDred.js → index-BjrSy9_x.js} +2 -2
- package/dist/client/assets/{index-DruKDred.js.map → index-BjrSy9_x.js.map} +1 -1
- package/dist/client/assets/{preview-Bjxi6Nq3.js → preview-Dpxghqei.js} +2 -2
- package/dist/client/assets/preview-Dpxghqei.js.map +1 -0
- package/dist/client/assets/{useQualityAnalysis-AZKgMcJ7.js → useQualityAnalysis-DxBTon99.js} +3 -3
- package/dist/client/assets/{useQualityAnalysis-AZKgMcJ7.js.map → useQualityAnalysis-DxBTon99.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/templates/consulting-deck-blocks.pptx.json +1057 -156
- package/dist/client/templates/technical-report-blocks.docx.json +1703 -0
- package/package.json +7 -7
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CVTtmFTd.js +0 -2
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CVTtmFTd.js.map +0 -1
- package/dist/client/assets/index-CHGFn3dH.js +0 -27
- package/dist/client/assets/index-CHGFn3dH.js.map +0 -1
- package/dist/client/assets/preview-Bjxi6Nq3.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e='"use strict";(()=>{var Rb=Object.create;var ss=Object.defineProperty;var kb=Object.getOwnPropertyDescriptor;var Fb=Object.getOwnPropertyNames;var jb=Object.getPrototypeOf,Ub=Object.prototype.hasOwnProperty;var Db=(e,t,n)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rt=(e,t)=>{for(var n in t)ss(e,n,{get:t[n],enumerable:!0})},Mb=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fb(t))!Ub.call(e,o)&&o!==n&&ss(e,o,{get:()=>t[o],enumerable:!(i=kb(t,o))||i.enumerable});return e};var ed=(e,t,n)=>(n=e!=null?Rb(jb(e)):{},Mb(t||!e||!e.__esModule?ss(n,"default",{value:e,enumerable:!0}):n,e));var N=(e,t,n)=>Db(e,typeof t!="symbol"?t+"":t,n);var vp=_b((t6,ph)=>{ph.exports={}});var ap={};rt(ap,{Any:()=>Xt,Argument:()=>Co,Array:()=>Lr,AsyncIterator:()=>Nr,Awaited:()=>Ur,BigInt:()=>Fr,Boolean:()=>Qn,Capitalize:()=>Ko,Clone:()=>se,CloneRest:()=>Wb,CloneType:()=>fn,Composite:()=>ko,Const:()=>Fo,Constructor:()=>Rr,ConstructorParameters:()=>jo,CreateType:()=>y,Date:()=>ri,Enum:()=>Uo,Exclude:()=>Br,ExcludeFromMappedResult:()=>Gl,ExcludeFromTemplateLiteral:()=>Kl,Extends:()=>Mr,ExtendsCheck:()=>_r,ExtendsFromMappedKey:()=>Vl,ExtendsFromMappedResult:()=>Bl,ExtendsResolverError:()=>ws,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>In,Extract:()=>Vr,ExtractFromMappedResult:()=>Wl,ExtractFromTemplateLiteral:()=>ql,FormatRegistry:()=>Ut,FromTypes:()=>ki,Function:()=>yt,Hint:()=>ze,Increment:()=>IO,Index:()=>Zt,IndexFromComputed:()=>Ox,IndexFromMappedKey:()=>vl,IndexFromMappedResult:()=>El,IndexFromPropertyKey:()=>$l,IndexFromPropertyKeys:()=>Ni,IndexPropertyKeys:()=>Xe,InstanceType:()=>Do,Instantiate:()=>Bo,Integer:()=>Vo,Intersect:()=>Ee,IntersectEvaluated:()=>$o,Intrinsic:()=>Vt,IntrinsicFromMappedKey:()=>Jl,IsTemplateLiteralExpressionFinite:()=>xn,IsTemplateLiteralFinite:()=>Eo,Iterator:()=>jr,JavaScriptTypeBuilder:()=>$s,JsonTypeBuilder:()=>Fi,KeyOf:()=>Dr,KeyOfFromMappedResult:()=>kl,KeyOfPattern:()=>ti,KeyOfPropertyEntries:()=>Ro,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>pf,Kind:()=>g,KindGuard:()=>Yt,Literal:()=>j,Lowercase:()=>Go,Mapped:()=>Lo,MappedFunctionReturnType:()=>af,MappedKey:()=>BO,MappedResult:()=>q,Module:()=>zo,Never:()=>k,Not:()=>Jo,Null:()=>ni,Number:()=>Ye,Object:()=>K,Omit:()=>tr,OmitFromMappedKey:()=>Ql,OmitFromMappedResult:()=>Yl,Optional:()=>Ae,OptionalFromMappedResult:()=>Nl,OptionalKind:()=>ve,Parameters:()=>Yo,Partial:()=>Kr,PartialFromMappedResult:()=>rp,PatternBoolean:()=>hs,PatternBooleanExact:()=>wO,PatternNever:()=>Yd,PatternNeverExact:()=>Sl,PatternNumber:()=>Ei,PatternNumberExact:()=>$r,PatternString:()=>gs,PatternStringExact:()=>vr,Pick:()=>rr,PickFromMappedKey:()=>tp,PickFromMappedResult:()=>Zl,Promise:()=>ei,Readonly:()=>Me,ReadonlyFromMappedResult:()=>Ll,ReadonlyKind:()=>vt,ReadonlyOptional:()=>si,Record:()=>li,RecordKey:()=>zl,RecordPattern:()=>_o,RecordValue:()=>Mo,Recursive:()=>Xo,Ref:()=>bt,RegExp:()=>Qo,Required:()=>Gr,RequiredFromMappedResult:()=>np,Rest:()=>Zo,ReturnType:()=>ea,SetComplement:()=>DO,SetDistinct:()=>Il,SetIncludes:()=>ys,SetIntersect:()=>Xd,SetIntersectMany:()=>wl,SetIsSubset:()=>jO,SetUnion:()=>UO,SetUnionMany:()=>Cl,String:()=>Ne,Symbol:()=>ii,TModule:()=>Ts,TemplateLiteral:()=>Zn,TemplateLiteralExpressionGenerate:()=>Li,TemplateLiteralFiniteError:()=>bs,TemplateLiteralGenerate:()=>Xn,TemplateLiteralGenerateError:()=>Os,TemplateLiteralParse:()=>Jn,TemplateLiteralParseExact:()=>Yn,TemplateLiteralParserError:()=>To,TemplateLiteralPattern:()=>Ss,TemplateLiteralPatternError:()=>xs,TemplateLiteralSyntax:()=>Al,TemplateLiteralToUnion:()=>Sn,Transform:()=>ta,TransformDecodeBuilder:()=>As,TransformEncodeBuilder:()=>Es,TransformKind:()=>ue,Tuple:()=>Qe,Type:()=>r,TypeBoxError:()=>$,TypeGuard:()=>d,TypeRegistry:()=>Dt,Uint8Array:()=>ai,Uncapitalize:()=>qo,Undefined:()=>oi,Union:()=>V,UnionEvaluated:()=>Qt,Unknown:()=>ct,Unsafe:()=>ra,Uppercase:()=>Wo,ValueGuard:()=>De,Void:()=>na});var De={};rt(De,{HasPropertyKey:()=>cs,IsArray:()=>Se,IsAsyncIterator:()=>pl,IsBigInt:()=>fo,IsBoolean:()=>ur,IsDate:()=>Wn,IsFunction:()=>ml,IsIterator:()=>ul,IsNull:()=>dl,IsNumber:()=>nt,IsObject:()=>ee,IsRegExp:()=>ho,IsString:()=>ie,IsSymbol:()=>fl,IsUint8Array:()=>Tr,IsUndefined:()=>Ie});function cs(e,t){return t in e}function pl(e){return ee(e)&&!Se(e)&&!Tr(e)&&Symbol.asyncIterator in e}function Se(e){return Array.isArray(e)}function fo(e){return typeof e=="bigint"}function ur(e){return typeof e=="boolean"}function Wn(e){return e instanceof globalThis.Date}function ml(e){return typeof e=="function"}function ul(e){return ee(e)&&!Se(e)&&!Tr(e)&&Symbol.iterator in e}function dl(e){return e===null}function nt(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function ho(e){return e instanceof globalThis.RegExp}function ie(e){return typeof e=="string"}function fl(e){return typeof e=="symbol"}function Tr(e){return e instanceof globalThis.Uint8Array}function Ie(e){return e===void 0}function Bb(e){return e.map(t=>ls(t))}function Vb(e){return new Date(e.getTime())}function Kb(e){return new Uint8Array(e)}function Gb(e){return new RegExp(e.source,e.flags)}function qb(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=ls(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=ls(e[n]);return t}function ls(e){return Se(e)?Bb(e):Wn(e)?Vb(e):Tr(e)?Kb(e):ho(e)?Gb(e):ee(e)?qb(e):e}function se(e){return ls(e)}function Wb(e){return e.map(t=>fn(t))}function fn(e,t){return t===void 0?se(e):se({...t,...e})}function go(e){return L(e)&&globalThis.Symbol.asyncIterator in e}function yo(e){return L(e)&&globalThis.Symbol.iterator in e}function ps(e){return L(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function Hb(e){return L(e)&&!E(e)&&fr(e.constructor)&&e.constructor.name!=="Object"}function bo(e){return e instanceof globalThis.Promise}function Ve(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function hl(e){return e instanceof globalThis.Map}function gl(e){return e instanceof globalThis.Set}function zb(e){return e instanceof globalThis.RegExp}function gt(e){return globalThis.ArrayBuffer.isView(e)}function Jb(e){return e instanceof globalThis.Int8Array}function Hn(e){return e instanceof globalThis.Uint8Array}function Yb(e){return e instanceof globalThis.Uint8ClampedArray}function Xb(e){return e instanceof globalThis.Int16Array}function Qb(e){return e instanceof globalThis.Uint16Array}function Zb(e){return e instanceof globalThis.Int32Array}function eO(e){return e instanceof globalThis.Uint32Array}function tO(e){return e instanceof globalThis.Float32Array}function rO(e){return e instanceof globalThis.Float64Array}function nO(e){return e instanceof globalThis.BigInt64Array}function iO(e){return e instanceof globalThis.BigUint64Array}function A(e,t){return t in e}function L(e){return e!==null&&typeof e=="object"}function E(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 Oo(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 n(s){let c=L(s);return e.AllowArrayObject?c:c&&!E(s)}e.IsObjectLike=n;function i(s){return n(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 oO(e){return globalThis.Object.freeze(e).map(t=>xo(t))}function aO(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=xo(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=xo(e[n]);return globalThis.Object.freeze(t)}function xo(e){return Se(e)?oO(e):Wn(e)?e:Tr(e)?e:ho(e)?e:ee(e)?aO(e):e}function y(e,t){let n=t!==void 0?{...t,...e}:e;switch(Ce.InstanceMode){case"freeze":return xo(n);case"clone":return se(n);default:return n}}var $=class extends Error{constructor(t){super(t)}};var Yt={};rt(Yt,{IsAny:()=>ms,IsArgument:()=>us,IsArray:()=>Lt,IsAsyncIterator:()=>hn,IsBigInt:()=>gn,IsBoolean:()=>gr,IsComputed:()=>Nt,IsConstructor:()=>Rt,IsDate:()=>td,IsFunction:()=>kt,IsImport:()=>sO,IsInteger:()=>Ft,IsIntersect:()=>fe,IsIterator:()=>yn,IsKind:()=>Er,IsKindOf:()=>U,IsLiteral:()=>_e,IsLiteralBoolean:()=>mO,IsLiteralNumber:()=>pO,IsLiteralString:()=>lO,IsLiteralValue:()=>So,IsMappedKey:()=>ot,IsMappedResult:()=>pe,IsNever:()=>Ar,IsNot:()=>rd,IsNull:()=>Ti,IsNumber:()=>jt,IsObject:()=>Oe,IsOptional:()=>Je,IsPromise:()=>bn,IsProperties:()=>cO,IsReadonly:()=>zn,IsRecord:()=>On,IsRecursive:()=>uO,IsRef:()=>ge,IsRegExp:()=>ds,IsSchema:()=>de,IsString:()=>yr,IsSymbol:()=>Ai,IsTemplateLiteral:()=>at,IsThis:()=>nd,IsTransform:()=>z,IsTuple:()=>st,IsUint8Array:()=>id,IsUndefined:()=>br,IsUnion:()=>B,IsUnknown:()=>od,IsUnsafe:()=>ad,IsVoid:()=>sd});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 zn(e){return ee(e)&&e[vt]==="Readonly"}function Je(e){return ee(e)&&e[ve]==="Optional"}function ms(e){return U(e,"Any")}function us(e){return U(e,"Argument")}function Lt(e){return U(e,"Array")}function hn(e){return U(e,"AsyncIterator")}function gn(e){return U(e,"BigInt")}function gr(e){return U(e,"Boolean")}function Nt(e){return U(e,"Computed")}function Rt(e){return U(e,"Constructor")}function td(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function sO(e){return U(e,"Import")}function Ft(e){return U(e,"Integer")}function cO(e){return ee(e)}function fe(e){return U(e,"Intersect")}function yn(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function lO(e){return _e(e)&&ie(e.const)}function pO(e){return _e(e)&&nt(e.const)}function mO(e){return _e(e)&&ur(e.const)}function So(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 rd(e){return U(e,"Not")}function Ti(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function Oe(e){return U(e,"Object")}function bn(e){return U(e,"Promise")}function On(e){return U(e,"Record")}function uO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function ge(e){return U(e,"Ref")}function ds(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 nd(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 id(e){return U(e,"Uint8Array")}function od(e){return U(e,"Unknown")}function ad(e){return U(e,"Unsafe")}function sd(e){return U(e,"Void")}function Er(e){return ee(e)&&g in e&&ie(e[g])}function de(e){return ms(e)||us(e)||Lt(e)||gr(e)||gn(e)||hn(e)||Nt(e)||Rt(e)||td(e)||kt(e)||Ft(e)||fe(e)||yn(e)||_e(e)||ot(e)||pe(e)||Ar(e)||rd(e)||Ti(e)||jt(e)||Oe(e)||bn(e)||On(e)||ge(e)||ds(e)||yr(e)||Ai(e)||at(e)||nd(e)||st(e)||br(e)||B(e)||id(e)||od(e)||ad(e)||sd(e)||Er(e)}var d={};rt(d,{IsAny:()=>md,IsArgument:()=>ud,IsArray:()=>dd,IsAsyncIterator:()=>fd,IsBigInt:()=>hd,IsBoolean:()=>gd,IsComputed:()=>yd,IsConstructor:()=>bd,IsDate:()=>Od,IsFunction:()=>xd,IsImport:()=>bO,IsInteger:()=>Sd,IsIntersect:()=>Id,IsIterator:()=>wd,IsKind:()=>Jd,IsKindOf:()=>D,IsLiteral:()=>wo,IsLiteralBoolean:()=>OO,IsLiteralNumber:()=>Pd,IsLiteralString:()=>Cd,IsLiteralValue:()=>Td,IsMappedKey:()=>Ad,IsMappedResult:()=>Ed,IsNever:()=>$d,IsNot:()=>vd,IsNull:()=>Ld,IsNumber:()=>Nd,IsObject:()=>Rd,IsOptional:()=>yO,IsPromise:()=>kd,IsProperties:()=>fs,IsReadonly:()=>gO,IsRecord:()=>Fd,IsRecursive:()=>xO,IsRef:()=>jd,IsRegExp:()=>Ud,IsSchema:()=>Le,IsString:()=>Dd,IsSymbol:()=>_d,IsTemplateLiteral:()=>Md,IsThis:()=>Bd,IsTransform:()=>Vd,IsTuple:()=>Kd,IsUint8Array:()=>qd,IsUndefined:()=>Gd,IsUnion:()=>xl,IsUnionLiteral:()=>SO,IsUnknown:()=>Wd,IsUnsafe:()=>Hd,IsVoid:()=>zd,TypeGuardUnknownTypeError:()=>yl});var yl=class extends ${},dO=["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 cd(e){try{return new RegExp(e),!0}catch{return!1}}function bl(e){if(!ie(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function ld(e){return Ol(e)||Le(e)}function Io(e){return Ie(e)||fo(e)}function oe(e){return Ie(e)||nt(e)}function Ol(e){return Ie(e)||ur(e)}function re(e){return Ie(e)||ie(e)}function fO(e){return Ie(e)||ie(e)&&bl(e)&&cd(e)}function hO(e){return Ie(e)||ie(e)&&bl(e)}function pd(e){return Ie(e)||Le(e)}function gO(e){return ee(e)&&e[vt]==="Readonly"}function yO(e){return ee(e)&&e[ve]==="Optional"}function md(e){return D(e,"Any")&&re(e.$id)}function ud(e){return D(e,"Argument")&&nt(e.index)}function dd(e){return D(e,"Array")&&e.type==="array"&&re(e.$id)&&Le(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&Ol(e.uniqueItems)&&pd(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function fd(e){return D(e,"AsyncIterator")&&e.type==="AsyncIterator"&&re(e.$id)&&Le(e.items)}function hd(e){return D(e,"BigInt")&&e.type==="bigint"&&re(e.$id)&&Io(e.exclusiveMaximum)&&Io(e.exclusiveMinimum)&&Io(e.maximum)&&Io(e.minimum)&&Io(e.multipleOf)}function gd(e){return D(e,"Boolean")&&e.type==="boolean"&&re(e.$id)}function yd(e){return D(e,"Computed")&&ie(e.target)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))}function bd(e){return D(e,"Constructor")&&e.type==="Constructor"&&re(e.$id)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))&&Le(e.returns)}function Od(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 xd(e){return D(e,"Function")&&e.type==="Function"&&re(e.$id)&&Se(e.parameters)&&e.parameters.every(t=>Le(t))&&Le(e.returns)}function bO(e){return D(e,"Import")&&cs(e,"$defs")&&ee(e.$defs)&&fs(e.$defs)&&cs(e,"$ref")&&ie(e.$ref)&&e.$ref in e.$defs}function Sd(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 fs(e){return ee(e)&&Object.entries(e).every(([t,n])=>bl(t)&&Le(n))}function Id(e){return D(e,"Intersect")&&!(ie(e.type)&&e.type!=="object")&&Se(e.allOf)&&e.allOf.every(t=>Le(t)&&!Vd(t))&&re(e.type)&&(Ol(e.unevaluatedProperties)||pd(e.unevaluatedProperties))&&re(e.$id)}function wd(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 Cd(e){return wo(e)&&ie(e.const)}function Pd(e){return wo(e)&&nt(e.const)}function OO(e){return wo(e)&&ur(e.const)}function wo(e){return D(e,"Literal")&&re(e.$id)&&Td(e.const)}function Td(e){return ur(e)||nt(e)||ie(e)}function Ad(e){return D(e,"MappedKey")&&Se(e.keys)&&e.keys.every(t=>nt(t)||ie(t))}function Ed(e){return D(e,"MappedResult")&&fs(e.properties)}function $d(e){return D(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function vd(e){return D(e,"Not")&&Le(e.not)}function Ld(e){return D(e,"Null")&&e.type==="null"&&re(e.$id)}function Nd(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 Rd(e){return D(e,"Object")&&e.type==="object"&&re(e.$id)&&fs(e.properties)&&ld(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function kd(e){return D(e,"Promise")&&e.type==="Promise"&&re(e.$id)&&Le(e.item)}function Fd(e){return D(e,"Record")&&e.type==="object"&&re(e.$id)&&ld(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let n=Object.getOwnPropertyNames(t.patternProperties);return n.length===1&&cd(n[0])&&ee(t.patternProperties)&&Le(t.patternProperties[n[0]])})(e)}function xO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function jd(e){return D(e,"Ref")&&re(e.$id)&&ie(e.$ref)}function Ud(e){return D(e,"RegExp")&&re(e.$id)&&ie(e.source)&&ie(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function Dd(e){return D(e,"String")&&e.type==="string"&&re(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&fO(e.pattern)&&hO(e.format)}function _d(e){return D(e,"Symbol")&&e.type==="symbol"&&re(e.$id)}function Md(e){return D(e,"TemplateLiteral")&&e.type==="string"&&ie(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Bd(e){return D(e,"This")&&re(e.$id)&&ie(e.$ref)}function Vd(e){return ee(e)&&ue in e}function Kd(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 Gd(e){return D(e,"Undefined")&&e.type==="undefined"&&re(e.$id)}function SO(e){return xl(e)&&e.anyOf.every(t=>Cd(t)||Pd(t))}function xl(e){return D(e,"Union")&&re(e.$id)&&ee(e)&&Se(e.anyOf)&&e.anyOf.every(t=>Le(t))}function qd(e){return D(e,"Uint8Array")&&e.type==="Uint8Array"&&re(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function Wd(e){return D(e,"Unknown")&&re(e.$id)}function Hd(e){return D(e,"Unsafe")}function zd(e){return D(e,"Void")&&e.type==="void"&&re(e.$id)}function Jd(e){return ee(e)&&g in e&&ie(e[g])&&!dO.includes(e[g])}function Le(e){return ee(e)&&(md(e)||ud(e)||dd(e)||gd(e)||hd(e)||fd(e)||yd(e)||bd(e)||Od(e)||xd(e)||Sd(e)||Id(e)||wd(e)||wo(e)||Ad(e)||Ed(e)||$d(e)||vd(e)||Ld(e)||Nd(e)||Rd(e)||kd(e)||Fd(e)||jd(e)||Ud(e)||Dd(e)||_d(e)||Md(e)||Bd(e)||Kd(e)||Gd(e)||xl(e)||qd(e)||Wd(e)||Hd(e)||zd(e)||Jd(e))}function IO(e){return(parseInt(e)+1).toString()}var hs="(true|false)",Ei="(0|[1-9][0-9]*)",gs="(.*)",Yd="(?!.*)",wO=`^${hs}$`,$r=`^${Ei}$`,vr=`^${gs}$`,Sl=`^${Yd}$`;var Ut={};rt(Ut,{Clear:()=>PO,Delete:()=>TO,Entries:()=>CO,Get:()=>$O,Has:()=>AO,Set:()=>EO});var $i=new Map;function CO(){return new Map($i)}function PO(){return $i.clear()}function TO(e){return $i.delete(e)}function AO(e){return $i.has(e)}function EO(e,t){$i.set(e,t)}function $O(e){return $i.get(e)}var Dt={};rt(Dt,{Clear:()=>LO,Delete:()=>NO,Entries:()=>vO,Get:()=>FO,Has:()=>RO,Set:()=>kO});var vi=new Map;function vO(){return new Map(vi)}function LO(){return vi.clear()}function NO(e){return vi.delete(e)}function RO(e){return vi.has(e)}function kO(e,t){vi.set(e,t)}function FO(e){return vi.get(e)}function ys(e,t){return e.includes(t)}function jO(e,t){return e.every(n=>ys(t,n))}function Il(e){return[...new Set(e)]}function Xd(e,t){return e.filter(n=>t.includes(n))}function UO(e,t){return[...e,...t]}function DO(e,t){return e.filter(n=>!t.includes(n))}function _O(e,t){return e.reduce((n,i)=>Xd(n,i),t)}function wl(e){return e.length===1?e[0]:e.length>1?_O(e.slice(1),e[0]):[]}function Cl(e){let t=[];for(let n of e)t.push(...n);return t}function Xt(e){return y({[g]:"Any"},e)}function Lr(e,t){return y({[g]:"Array",type:"array",items:e},t)}function Co(e){return y({[g]:"Argument",index:e})}function Nr(e,t){return y({[g]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function ae(e,t,n){return y({[g]:"Computed",target:e,parameters:t},n)}function MO(e,t){let{[t]:n,...i}=e;return i}function ye(e,t){return t.reduce((n,i)=>MO(n,i),e)}function k(e){return y({[g]:"Never",not:{}},e)}function BO(e){return y({[g]:"MappedKey",keys:e})}function q(e){return y({[g]:"MappedResult",properties:e})}function Rr(e,t,n){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function yt(e,t,n){return y({[g]:"Function",type:"Function",parameters:e,returns:t},n)}function Po(e,t){return y({[g]:"Union",anyOf:e},t)}function VO(e){return e.some(t=>Je(t))}function Qd(e){return e.map(t=>Je(t)?KO(t):t)}function KO(e){return ye(e,[ve])}function GO(e,t){return VO(e)?Ae(Po(Qd(e),t)):Po(Qd(e),t)}function Qt(e,t){return e.length===1?y(e[0],t):e.length===0?k(t):GO(e,t)}function V(e,t){return e.length===0?k(t):e.length===1?y(e[0],t):Po(e,t)}var To=class extends ${};function qO(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Pl(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function kr(e,t){return Pl(e,t,"(")}function Ao(e,t){return Pl(e,t,")")}function Zd(e,t){return Pl(e,t,"|")}function WO(e){if(!(kr(e,0)&&Ao(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(kr(e,n)&&(t+=1),Ao(e,n)&&(t-=1),t===0&&n!==e.length-1)return!1;return!0}function HO(e){return e.slice(1,e.length-1)}function zO(e){let t=0;for(let n=0;n<e.length;n++)if(kr(e,n)&&(t+=1),Ao(e,n)&&(t-=1),Zd(e,n)&&t===0)return!0;return!1}function JO(e){for(let t=0;t<e.length;t++)if(kr(e,t))return!0;return!1}function YO(e){let[t,n]=[0,0],i=[];for(let a=0;a<e.length;a++)if(kr(e,a)&&(t+=1),Ao(e,a)&&(t-=1),Zd(e,a)&&t===0){let s=e.slice(n,a);s.length>0&&i.push(Jn(s)),n=a+1}let o=e.slice(n);return o.length>0&&i.push(Jn(o)),i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"or",expr:i}}function XO(e){function t(o,a){if(!kr(o,a))throw new To("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<o.length;c++)if(kr(o,c)&&(s+=1),Ao(o,c)&&(s-=1),s===0)return[a,c];throw new To("TemplateLiteralParser: Unclosed group parens in expression")}function n(o,a){for(let s=a;s<o.length;s++)if(kr(o,s))return[a,s];return[a,o.length]}let i=[];for(let o=0;o<e.length;o++)if(kr(e,o)){let[a,s]=t(e,o),c=e.slice(a,s+1);i.push(Jn(c)),o=s}else{let[a,s]=n(e,o),c=e.slice(a,s);c.length>0&&i.push(Jn(c)),o=s-1}return i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"and",expr:i}}function Jn(e){return WO(e)?Jn(HO(e)):zO(e)?YO(e):JO(e)?XO(e):{type:"const",const:qO(e)}}function Yn(e){return Jn(e.slice(1,e.length-1))}var bs=class extends ${};function QO(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 ZO(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 ex(e){return e.type==="const"&&e.const===".*"}function xn(e){return QO(e)||ex(e)?!1:ZO(e)?!0:e.type==="and"?e.expr.every(t=>xn(t)):e.type==="or"?e.expr.every(t=>xn(t)):e.type==="const"?!0:(()=>{throw new bs("Unknown expression type")})()}function Eo(e){let t=Yn(e.pattern);return xn(t)}var Os=class extends ${};function*ef(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of ef(e.slice(1)))yield`${t}${n}`}function*tx(e){return yield*ef(e.expr.map(t=>[...Li(t)]))}function*rx(e){for(let t of e.expr)yield*Li(t)}function*nx(e){return yield e.const}function*Li(e){return e.type==="and"?yield*tx(e):e.type==="or"?yield*rx(e):e.type==="const"?yield*nx(e):(()=>{throw new Os("Unknown expression")})()}function Xn(e){let t=Yn(e.pattern);return xn(t)?[...Li(t)]:[]}function j(e,t){return y({[g]:"Literal",const:e,type:typeof e},t)}function Qn(e){return y({[g]:"Boolean",type:"boolean"},e)}function Fr(e){return y({[g]:"BigInt",type:"bigint"},e)}function Ye(e){return y({[g]:"Number",type:"number"},e)}function Ne(e){return y({[g]:"String",type:"string"},e)}function*ix(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield Qn():t==="number"?yield Ye():t==="bigint"?yield Fr():t==="string"?yield Ne():yield(()=>{let n=t.split("|").map(i=>j(i.trim()));return n.length===0?k():n.length===1?n[0]:Qt(n)})()}function*ox(e){if(e[1]!=="{"){let t=j("$"),n=Tl(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let n=ix(e.slice(2,t)),i=Tl(e.slice(t+1));return yield*[...n,...i]}yield j(e)}function*Tl(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let n=j(e.slice(0,t)),i=ox(e.slice(t));return yield*[n,...i]}yield j(e)}function Al(e){return[...Tl(e)]}var xs=class extends ${};function ax(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function tf(e,t){return at(e)?e.pattern.slice(1,e.pattern.length-1):B(e)?`(${e.anyOf.map(n=>tf(n,t)).join("|")})`:jt(e)?`${t}${Ei}`:Ft(e)?`${t}${Ei}`:gn(e)?`${t}${Ei}`:yr(e)?`${t}${gs}`:_e(e)?`${t}${ax(e.const.toString())}`:gr(e)?`${t}${hs}`:(()=>{throw new xs(`Unexpected Kind \'${e[g]}\'`)})()}function Ss(e){return`^${e.map(t=>tf(t,"")).join("")}$`}function Sn(e){let n=Xn(e).map(i=>j(i));return Qt(n)}function Zn(e,t){let n=ie(e)?Ss(Al(e)):Ss(e);return y({[g]:"TemplateLiteral",type:"string",pattern:n},t)}function sx(e){return Xn(e).map(n=>n.toString())}function cx(e){let t=[];for(let n of e)t.push(...Xe(n));return t}function lx(e){return[e.toString()]}function Xe(e){return[...new Set(at(e)?sx(e):B(e)?cx(e.anyOf):_e(e)?lx(e.const):jt(e)?["[number]"]:Ft(e)?["[number]"]:[])]}function px(e,t,n){let i={};for(let o of Object.getOwnPropertyNames(t))i[o]=Zt(e,Xe(t[o]),n);return i}function mx(e,t,n){return px(e,t.properties,n)}function El(e,t,n){let i=mx(e,t,n);return q(i)}function nf(e,t){return e.map(n=>$l(n,t))}function ux(e){return e.filter(t=>!Ar(t))}function dx(e,t){return $o(ux(nf(e,t)))}function fx(e){return e.some(t=>Ar(t))?[]:e}function hx(e,t){return Qt(fx(nf(e,t)))}function gx(e,t){return t in e?e[t]:t==="[number]"?Qt(e):k()}function yx(e,t){return t==="[number]"?e:k()}function bx(e,t){return t in e?e[t]:k()}function $l(e,t){return fe(e)?dx(e.allOf,t):B(e)?hx(e.anyOf,t):st(e)?gx(e.items??[],t):Lt(e)?yx(e.items,t):Oe(e)?bx(e.properties,t):k()}function Ni(e,t){return t.map(n=>$l(e,n))}function rf(e,t){return Qt(Ni(e,t))}function Ox(e,t){return ae("Index",[e,t])}function Zt(e,t,n){if(ge(e)||ge(t)){let i="Index types using Ref parameters require both Type and Key to be of TSchema";if(!de(e)||!de(t))throw new $(i);return ae("Index",[e,t])}return pe(t)?El(e,t,n):ot(t)?vl(e,t,n):y(de(t)?rf(e,Xe(t)):rf(e,t),n)}function xx(e,t,n){return{[t]:Zt(e,[t],se(n))}}function Sx(e,t,n){return t.reduce((i,o)=>({...i,...xx(e,o,n)}),{})}function Ix(e,t,n){return Sx(e,t.keys,n)}function vl(e,t,n){let i=Ix(e,t,n);return q(i)}function jr(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function wx(e){let t=[];for(let n in e)Je(e[n])||t.push(n);return t}function Cx(e,t){let n=wx(e),i=n.length>0?{[g]:"Object",type:"object",properties:e,required:n}:{[g]:"Object",type:"object",properties:e};return y(i,t)}var K=Cx;function ei(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function Px(e){return y(ye(e,[vt]))}function Tx(e){return y({...e,[vt]:"Readonly"})}function Ax(e,t){return t===!1?Px(e):Tx(e)}function Me(e,t){let n=t??!0;return pe(e)?Ll(e,n):Ax(e,n)}function Ex(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Me(e[i],t);return n}function $x(e,t){return Ex(e.properties,t)}function Ll(e,t){let n=$x(e,t);return q(n)}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 of(e,t){return e in t?_t(e,t[e]):q(t)}function vx(e){return{[e]:j(e)}}function Lx(e){let t={};for(let n of e)t[n]=j(n);return t}function Nx(e,t){return ys(t,e)?vx(e):Lx(t)}function Rx(e,t){let n=Nx(e,t);return of(e,n)}function vo(e,t){return t.map(n=>_t(e,n))}function kx(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(t))n[i]=_t(e,t[i]);return n}function _t(e,t){let n={...t};return Je(t)?Ae(_t(e,ye(t,[ve]))):zn(t)?Me(_t(e,ye(t,[vt]))):pe(t)?of(e,t.properties):ot(t)?Rx(e,t.keys):Rt(t)?Rr(vo(e,t.parameters),_t(e,t.returns),n):kt(t)?yt(vo(e,t.parameters),_t(e,t.returns),n):hn(t)?Nr(_t(e,t.items),n):yn(t)?jr(_t(e,t.items),n):fe(t)?Ee(vo(e,t.allOf),n):B(t)?V(vo(e,t.anyOf),n):st(t)?Qe(vo(e,t.items??[]),n):Oe(t)?K(kx(e,t.properties),n):Lt(t)?Lr(_t(e,t.items),n):bn(t)?ei(_t(e,t.item),n):t}function af(e,t){let n={};for(let i of e)n[i]=_t(i,t);return n}function Lo(e,t,n){let i=de(e)?Xe(e):e,o=t({[g]:"MappedKey",keys:i}),a=af(i,o);return K(a,n)}function Fx(e){return y(ye(e,[ve]))}function jx(e){return y({...e,[ve]:"Optional"})}function Ux(e,t){return t===!1?Fx(e):jx(e)}function Ae(e,t){let n=t??!0;return pe(e)?Nl(e,n):Ux(e,n)}function Dx(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Ae(e[i],t);return n}function _x(e,t){return Dx(e.properties,t)}function Nl(e,t){let n=_x(e,t);return q(n)}function No(e,t={}){let n=e.every(o=>Oe(o)),i=de(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return y(t.unevaluatedProperties===!1||de(t.unevaluatedProperties)||n?{...i,[g]:"Intersect",type:"object",allOf:e}:{...i,[g]:"Intersect",allOf:e},t)}function Mx(e){return e.every(t=>Je(t))}function Bx(e){return ye(e,[ve])}function sf(e){return e.map(t=>Je(t)?Bx(t):t)}function Vx(e,t){return Mx(e)?Ae(No(sf(e),t)):No(sf(e),t)}function $o(e,t={}){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(n=>z(n)))throw new Error("Cannot intersect transform types");return Vx(e,t)}function Ee(e,t){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(n=>z(n)))throw new Error("Cannot intersect transform types");return No(e,t)}function bt(...e){let[t,n]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new $("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},n)}function Kx(e,t){return ae("Awaited",[ae(e,t)])}function Gx(e){return ae("Awaited",[bt(e)])}function qx(e){return Ee(cf(e))}function Wx(e){return V(cf(e))}function Hx(e){return Ur(e)}function cf(e){return e.map(t=>Ur(t))}function Ur(e,t){return y(Nt(e)?Kx(e.target,e.parameters):fe(e)?qx(e.allOf):B(e)?Wx(e.anyOf):bn(e)?Hx(e.item):ge(e)?Gx(e.$ref):e,t)}function lf(e){let t=[];for(let n of e)t.push(Ze(n));return t}function zx(e){let t=lf(e);return Cl(t)}function Jx(e){let t=lf(e);return wl(t)}function Yx(e){return e.map((t,n)=>n.toString())}function Xx(e){return["[number]"]}function Qx(e){return globalThis.Object.getOwnPropertyNames(e)}function Zx(e){return Rl?globalThis.Object.getOwnPropertyNames(e).map(n=>n[0]==="^"&&n[n.length-1]==="$"?n.slice(1,n.length-1):n):[]}function Ze(e){return fe(e)?zx(e.allOf):B(e)?Jx(e.anyOf):st(e)?Yx(e.items??[]):Lt(e)?Xx(e.items):Oe(e)?Qx(e.properties):On(e)?Zx(e.patternProperties):[]}var Rl=!1;function ti(e){Rl=!0;let t=Ze(e);return Rl=!1,`^(${t.map(i=>`(${i})`).join("|")})$`}function eS(e,t){return ae("KeyOf",[ae(e,t)])}function tS(e){return ae("KeyOf",[bt(e)])}function rS(e,t){let n=Ze(e),i=pf(n),o=Qt(i);return y(o,t)}function pf(e){return e.map(t=>t==="[number]"?Ye():j(t))}function Dr(e,t){return Nt(e)?eS(e.target,e.parameters):ge(e)?tS(e.$ref):pe(e)?kl(e,t):rS(e,t)}function nS(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Dr(e[i],se(t));return n}function iS(e,t){return nS(e.properties,t)}function kl(e,t){let n=iS(e,t);return q(n)}function Ro(e){let t=Ze(e),n=Ni(e,t);return t.map((i,o)=>[t[o],n[o]])}function oS(e){let t=[];for(let n of e)t.push(...Ze(n));return Il(t)}function aS(e){return e.filter(t=>!Ar(t))}function sS(e,t){let n=[];for(let i of e)n.push(...Ni(i,[t]));return aS(n)}function cS(e,t){let n={};for(let i of t)n[i]=$o(sS(e,i));return n}function ko(e,t){let n=oS(e),i=cS(e,n);return K(i,t)}function ri(e){return y({[g]:"Date",type:"Date"},e)}function ni(e){return y({[g]:"Null",type:"null"},e)}function ii(e){return y({[g]:"Symbol",type:"symbol"},e)}function oi(e){return y({[g]:"Undefined",type:"undefined"},e)}function ai(e){return y({[g]:"Uint8Array",type:"Uint8Array"},e)}function ct(e){return y({[g]:"Unknown"},e)}function lS(e){return e.map(t=>Fl(t,!1))}function pS(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Me(Fl(e[n],!1));return t}function Is(e,t){return t===!0?e:Me(e)}function Fl(e,t){return pl(e)?Is(Xt(),t):ul(e)?Is(Xt(),t):Se(e)?Me(Qe(lS(e))):Tr(e)?ai():Wn(e)?ri():ee(e)?Is(K(pS(e)),t):ml(e)?Is(yt([],ct()),t):Ie(e)?oi():dl(e)?ni():fl(e)?ii():fo(e)?Fr():nt(e)?j(e):ur(e)?j(e):ie(e)?j(e):K({})}function Fo(e,t){return y(Fl(e,!0),t)}function jo(e,t){return Rt(e)?Qe(e.parameters,t):k(t)}function Uo(e,t){if(Ie(e))throw new Error("Enum undefined or empty");let n=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),o=[...new Set(n)].map(a=>j(a));return V(o,{...t,[ze]:"Enum"})}var ws=class extends ${},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 Ri(e){throw new ws(e)}function Pe(e){return d.IsNever(e)||d.IsIntersect(e)||d.IsUnion(e)||d.IsUnknown(e)||d.IsAny(e)}function Te(e,t){return d.IsNever(t)?yf(e,t):d.IsIntersect(t)?Cs(e,t):d.IsUnion(t)?Ml(e,t):d.IsUnknown(t)?Sf(e,t):d.IsAny(t)?_l(e,t):Ri("StructuralRight")}function _l(e,t){return b.True}function mS(e,t){return d.IsIntersect(t)?Cs(e,t):d.IsUnion(t)&&t.anyOf.some(n=>d.IsAny(n)||d.IsUnknown(n))?b.True:d.IsUnion(t)?b.Union:d.IsUnknown(t)||d.IsAny(t)?b.True:b.Union}function uS(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function dS(e,t){return d.IsObject(t)&&Ps(t)?b.True:Pe(t)?Te(e,t):d.IsArray(t)?Mt(ne(e.items,t.items)):b.False}function fS(e,t){return Pe(t)?Te(e,t):d.IsAsyncIterator(t)?Mt(ne(e.items,t.items)):b.False}function hS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsBigInt(t)?b.True:b.False}function hf(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function gS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsBoolean(t)?b.True:b.False}function yS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsConstructor(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((n,i)=>Mt(ne(t.parameters[i],n))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function bS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsDate(t)?b.True:b.False}function OS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsFunction(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((n,i)=>Mt(ne(t.parameters[i],n))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function gf(e,t){return d.IsLiteral(e)&&De.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function xS(e,t){return d.IsInteger(t)||d.IsNumber(t)?b.True:Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):b.False}function Cs(e,t){return t.allOf.every(n=>ne(e,n)===b.True)?b.True:b.False}function SS(e,t){return e.allOf.some(n=>ne(n,t)===b.True)?b.True:b.False}function IS(e,t){return Pe(t)?Te(e,t):d.IsIterator(t)?Mt(ne(e.items,t.items)):b.False}function wS(e,t){return d.IsLiteral(t)&&t.const===e.const?b.True:Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?xf(e,t):d.IsNumber(t)?bf(e,t):d.IsInteger(t)?gf(e,t):d.IsBoolean(t)?hf(e,t):b.False}function yf(e,t){return b.False}function CS(e,t){return b.True}function mf(e){let[t,n]=[e,0];for(;d.IsNot(t);)t=t.not,n+=1;return n%2===0?t:ct()}function PS(e,t){return d.IsNot(e)?ne(mf(e),t):d.IsNot(t)?ne(e,mf(t)):Ri("Invalid fallthrough for Not")}function TS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsNull(t)?b.True:b.False}function bf(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function AS(e,t){return Pe(t)?Te(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 uf(e){return Ps(e)}function df(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 jl(e){return lt(e,0)}function ff(e){return lt(e,0)}function ES(e){return lt(e,0)}function $S(e){return lt(e,0)}function vS(e){return Ps(e)}function LS(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function NS(e){return lt(e,0)}function Ps(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function RS(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 Of(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)&&uf(t)||d.IsLiteralNumber(e)&&jl(t)||d.IsLiteralBoolean(e)&&ff(t)||d.IsSymbol(e)&&df(t)||d.IsBigInt(e)&&ES(t)||d.IsString(e)&&uf(t)||d.IsSymbol(e)&&df(t)||d.IsNumber(e)&&jl(t)||d.IsInteger(e)&&jl(t)||d.IsBoolean(e)&&ff(t)||d.IsUint8Array(e)&&vS(t)||d.IsDate(e)&&$S(t)||d.IsConstructor(e)&&NS(t)||d.IsFunction(e)&&LS(t)?b.True:d.IsRecord(e)&&d.IsString(Ul(e))?t[ze]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Ul(e))?lt(t,0)?b.True:b.False:b.False}function kS(e,t){return Pe(t)?Te(e,t):d.IsRecord(t)?Bt(e,t):d.IsObject(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!d.IsOptional(t.properties[n]))return b.False;if(d.IsOptional(t.properties[n]))return b.True;if(Of(e.properties[n],t.properties[n])===b.False)return b.False}return b.True})():b.False}function FS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)&&RS(t)?b.True:d.IsPromise(t)?Mt(ne(e.item,t.item)):b.False}function Ul(e){return $r in e.patternProperties?Ye():vr in e.patternProperties?Ne():Ri("Unknown record key pattern")}function Dl(e){return $r in e.patternProperties?e.patternProperties[$r]:vr in e.patternProperties?e.patternProperties[vr]:Ri("Unable to get record value schema")}function Bt(e,t){let[n,i]=[Ul(t),Dl(t)];return d.IsLiteralString(e)&&d.IsNumber(n)&&Mt(ne(e,i))===b.True?b.True:d.IsUint8Array(e)&&d.IsNumber(n)||d.IsString(e)&&d.IsNumber(n)||d.IsArray(e)&&d.IsNumber(n)?ne(e,i):d.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(Of(i,e.properties[o])===b.False)return b.False;return b.True})():b.False}function jS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?ne(Dl(e),Dl(t)):b.False}function US(e,t){let n=d.IsRegExp(e)?Ne():e,i=d.IsRegExp(t)?Ne():t;return ne(n,i)}function xf(e,t){return d.IsLiteral(e)&&De.IsString(e.const)||d.IsString(e)?b.True:b.False}function DS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?b.True:b.False}function _S(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsSymbol(t)?b.True:b.False}function MS(e,t){return d.IsTemplateLiteral(e)?ne(Sn(e),t):d.IsTemplateLiteral(t)?ne(e,Sn(t)):Ri("Invalid fallthrough for TemplateLiteral")}function BS(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(n=>ne(n,t.items)===b.True)}function VS(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function KS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)&&Ps(t)||d.IsArray(t)&&BS(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((n,i)=>ne(n,t.items[i])===b.True)?b.True:b.False:b.False}function GS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsUint8Array(t)?b.True:b.False}function qS(e,t){return Pe(t)?Te(e,t):d.IsObject(t)?Ke(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?zS(e,t):d.IsUndefined(t)?b.True:b.False}function Ml(e,t){return t.anyOf.some(n=>ne(e,n)===b.True)?b.True:b.False}function WS(e,t){return e.anyOf.every(n=>ne(n,t)===b.True)?b.True:b.False}function Sf(e,t){return b.True}function HS(e,t){return d.IsNever(t)?yf(e,t):d.IsIntersect(t)?Cs(e,t):d.IsUnion(t)?Ml(e,t):d.IsAny(t)?_l(e,t):d.IsString(t)?xf(e,t):d.IsNumber(t)?bf(e,t):d.IsInteger(t)?gf(e,t):d.IsBoolean(t)?hf(e,t):d.IsArray(t)?uS(e,t):d.IsTuple(t)?VS(e,t):d.IsObject(t)?Ke(e,t):d.IsUnknown(t)?b.True:b.False}function zS(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function JS(e,t){return d.IsIntersect(t)?Cs(e,t):d.IsUnion(t)?Ml(e,t):d.IsUnknown(t)?Sf(e,t):d.IsAny(t)?_l(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)?MS(e,t):d.IsRegExp(e)||d.IsRegExp(t)?US(e,t):d.IsNot(e)||d.IsNot(t)?PS(e,t):d.IsAny(e)?mS(e,t):d.IsArray(e)?dS(e,t):d.IsBigInt(e)?hS(e,t):d.IsBoolean(e)?gS(e,t):d.IsAsyncIterator(e)?fS(e,t):d.IsConstructor(e)?yS(e,t):d.IsDate(e)?bS(e,t):d.IsFunction(e)?OS(e,t):d.IsInteger(e)?xS(e,t):d.IsIntersect(e)?SS(e,t):d.IsIterator(e)?IS(e,t):d.IsLiteral(e)?wS(e,t):d.IsNever(e)?CS(e,t):d.IsNull(e)?TS(e,t):d.IsNumber(e)?AS(e,t):d.IsObject(e)?kS(e,t):d.IsRecord(e)?jS(e,t):d.IsString(e)?DS(e,t):d.IsSymbol(e)?_S(e,t):d.IsTuple(e)?KS(e,t):d.IsPromise(e)?FS(e,t):d.IsUint8Array(e)?GS(e,t):d.IsUndefined(e)?qS(e,t):d.IsUnion(e)?WS(e,t):d.IsUnknown(e)?HS(e,t):d.IsVoid(e)?JS(e,t):Ri(`Unknown left type operand \'${e[g]}\'`)}function _r(e,t){return ne(e,t)}function YS(e,t,n,i,o){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Mr(e[s],t,n,i,se(o));return a}function XS(e,t,n,i,o){return YS(e.properties,t,n,i,o)}function Bl(e,t,n,i,o){let a=XS(e,t,n,i,o);return q(a)}function QS(e,t,n,i){let o=_r(e,t);return o===b.Union?V([n,i]):o===b.True?n:i}function Mr(e,t,n,i,o){return pe(e)?Bl(e,t,n,i,o):ot(e)?y(Vl(e,t,n,i,o)):y(QS(e,t,n,i),o)}function ZS(e,t,n,i,o){return{[e]:Mr(j(e),t,n,i,se(o))}}function eI(e,t,n,i,o){return e.reduce((a,s)=>({...a,...ZS(s,t,n,i,o)}),{})}function tI(e,t,n,i,o){return eI(e.keys,t,n,i,o)}function Vl(e,t,n,i,o){let a=tI(e,t,n,i,o);return q(a)}function rI(e){return e.allOf.every(t=>In(t))}function nI(e){return e.anyOf.some(t=>In(t))}function iI(e){return!In(e.not)}function In(e){return e[g]==="Intersect"?rI(e):e[g]==="Union"?nI(e):e[g]==="Not"?iI(e):e[g]==="Undefined"}function Kl(e,t){return Br(Sn(e),t)}function oI(e,t){let n=e.filter(i=>_r(i,t)===b.False);return n.length===1?n[0]:V(n)}function Br(e,t,n={}){return at(e)?y(Kl(e,t),n):pe(e)?y(Gl(e,t),n):y(B(e)?oI(e.anyOf,t):_r(e,t)!==b.False?k():e,n)}function aI(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Br(e[i],t);return n}function sI(e,t){return aI(e.properties,t)}function Gl(e,t){let n=sI(e,t);return q(n)}function ql(e,t){return Vr(Sn(e),t)}function cI(e,t){let n=e.filter(i=>_r(i,t)!==b.False);return n.length===1?n[0]:V(n)}function Vr(e,t,n){return at(e)?y(ql(e,t),n):pe(e)?y(Wl(e,t),n):y(B(e)?cI(e.anyOf,t):_r(e,t)!==b.False?e:k(),n)}function lI(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Vr(e[i],t);return n}function pI(e,t){return lI(e.properties,t)}function Wl(e,t){let n=pI(e,t);return q(n)}function Do(e,t){return Rt(e)?y(e.returns,t):k(t)}function si(e){return Me(Ae(e))}function ci(e,t,n){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},n)}function Hl(e,t,n){let i={};for(let o of e)i[o]=t;return K(i,{...n,[ze]:"Record"})}function mI(e,t,n){return Eo(e)?Hl(Xe(e),t,n):ci(e.pattern,t,n)}function uI(e,t,n){return Hl(Xe(V(e)),t,n)}function dI(e,t,n){return Hl([e.toString()],t,n)}function fI(e,t,n){return ci(e.source,t,n)}function hI(e,t,n){let i=Ie(e.pattern)?vr:e.pattern;return ci(i,t,n)}function gI(e,t,n){return ci(vr,t,n)}function yI(e,t,n){return ci(Sl,t,n)}function bI(e,t,n){return K({true:t,false:t},n)}function OI(e,t,n){return ci($r,t,n)}function xI(e,t,n){return ci($r,t,n)}function li(e,t,n={}){return B(e)?uI(e.anyOf,t,n):at(e)?mI(e,t,n):_e(e)?dI(e.const,t,n):gr(e)?bI(e,t,n):Ft(e)?OI(e,t,n):jt(e)?xI(e,t,n):ds(e)?fI(e,t,n):yr(e)?hI(e,t,n):ms(e)?gI(e,t,n):Ar(e)?yI(e,t,n):k(n)}function _o(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function zl(e){let t=_o(e);return t===vr?Ne():t===$r?Ye():Ne({pattern:t})}function Mo(e){return e.patternProperties[_o(e)]}function SI(e,t){return t.parameters=ki(e,t.parameters),t.returns=er(e,t.returns),t}function II(e,t){return t.parameters=ki(e,t.parameters),t.returns=er(e,t.returns),t}function wI(e,t){return t.allOf=ki(e,t.allOf),t}function CI(e,t){return t.anyOf=ki(e,t.anyOf),t}function PI(e,t){return Ie(t.items)||(t.items=ki(e,t.items)),t}function TI(e,t){return t.items=er(e,t.items),t}function AI(e,t){return t.items=er(e,t.items),t}function EI(e,t){return t.items=er(e,t.items),t}function $I(e,t){return t.item=er(e,t.item),t}function vI(e,t){let n=kI(e,t.properties);return{...t,...K(n)}}function LI(e,t){let n=er(e,zl(t)),i=er(e,Mo(t)),o=li(n,i);return{...t,...o}}function NI(e,t){return t.index in e?e[t.index]:ct()}function RI(e,t){let n=zn(t),i=Je(t),o=er(e,t);return n&&i?si(o):n&&!i?Me(o):!n&&i?Ae(o):o}function kI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,i)=>({...n,[i]:RI(e,t[i])}),{})}function ki(e,t){return t.map(n=>er(e,n))}function er(e,t){return Rt(t)?SI(e,t):kt(t)?II(e,t):fe(t)?wI(e,t):B(t)?CI(e,t):st(t)?PI(e,t):Lt(t)?TI(e,t):hn(t)?AI(e,t):yn(t)?EI(e,t):bn(t)?$I(e,t):Oe(t)?vI(e,t):On(t)?LI(e,t):us(t)?NI(e,t):t}function Bo(e,t){return er(t,fn(e))}function Vo(e){return y({[g]:"Integer",type:"integer"},e)}function FI(e,t,n){return{[e]:Vt(j(e),t,se(n))}}function jI(e,t,n){return e.reduce((o,a)=>({...o,...FI(a,t,n)}),{})}function UI(e,t,n){return jI(e.keys,t,n)}function Jl(e,t,n){let i=UI(e,t,n);return q(i)}function DI(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}function _I(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}function MI(e){return e.toUpperCase()}function BI(e){return e.toLowerCase()}function VI(e,t,n){let i=Yn(e.pattern);if(!xn(i))return{...e,pattern:If(e.pattern,t)};let s=[...Li(i)].map(p=>j(p)),c=wf(s,t),l=V(c);return Zn([l],n)}function If(e,t){return typeof e=="string"?t==="Uncapitalize"?DI(e):t==="Capitalize"?_I(e):t==="Uppercase"?MI(e):t==="Lowercase"?BI(e):e:e.toString()}function wf(e,t){return e.map(n=>Vt(n,t))}function Vt(e,t,n={}){return ot(e)?Jl(e,t,n):at(e)?VI(e,t,n):B(e)?V(wf(e.anyOf,t),n):_e(e)?j(If(e.const,t),n):y(e,n)}function Ko(e,t={}){return Vt(e,"Capitalize",t)}function Go(e,t={}){return Vt(e,"Lowercase",t)}function qo(e,t={}){return Vt(e,"Uncapitalize",t)}function Wo(e,t={}){return Vt(e,"Uppercase",t)}function KI(e,t,n){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=tr(e[o],t,se(n));return i}function GI(e,t,n){return KI(e.properties,t,n)}function Yl(e,t,n){let i=GI(e,t,n);return q(i)}function qI(e,t){return e.map(n=>Xl(n,t))}function WI(e,t){return e.map(n=>Xl(n,t))}function HI(e,t){let{[t]:n,...i}=e;return i}function zI(e,t){return t.reduce((n,i)=>HI(n,i),e)}function JI(e,t){let n=ye(e,[ue,"$id","required","properties"]),i=zI(e.properties,t);return K(i,n)}function YI(e){let t=e.reduce((n,i)=>So(i)?[...n,j(i)]:n,[]);return V(t)}function Xl(e,t){return fe(e)?Ee(qI(e.allOf,t)):B(e)?V(WI(e.anyOf,t)):Oe(e)?JI(e,t):K({})}function tr(e,t,n){let i=Se(t)?YI(t):t,o=de(t)?Xe(t):t,a=ge(e),s=ge(t);return pe(e)?Yl(e,o,n):ot(t)?Ql(e,t,n):a&&s?ae("Omit",[e,i],n):!a&&s?ae("Omit",[e,i],n):a&&!s?ae("Omit",[e,i],n):y({...Xl(e,o),...n})}function XI(e,t,n){return{[t]:tr(e,[t],se(n))}}function QI(e,t,n){return t.reduce((i,o)=>({...i,...XI(e,o,n)}),{})}function ZI(e,t,n){return QI(e,t.keys,n)}function Ql(e,t,n){let i=ZI(e,t,n);return q(i)}function e0(e,t,n){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=rr(e[o],t,se(n));return i}function t0(e,t,n){return e0(e.properties,t,n)}function Zl(e,t,n){let i=t0(e,t,n);return q(i)}function r0(e,t){return e.map(n=>ep(n,t))}function n0(e,t){return e.map(n=>ep(n,t))}function i0(e,t){let n={};for(let i of t)i in e&&(n[i]=e[i]);return n}function o0(e,t){let n=ye(e,[ue,"$id","required","properties"]),i=i0(e.properties,t);return K(i,n)}function a0(e){let t=e.reduce((n,i)=>So(i)?[...n,j(i)]:n,[]);return V(t)}function ep(e,t){return fe(e)?Ee(r0(e.allOf,t)):B(e)?V(n0(e.anyOf,t)):Oe(e)?o0(e,t):K({})}function rr(e,t,n){let i=Se(t)?a0(t):t,o=de(t)?Xe(t):t,a=ge(e),s=ge(t);return pe(e)?Zl(e,o,n):ot(t)?tp(e,t,n):a&&s?ae("Pick",[e,i],n):!a&&s?ae("Pick",[e,i],n):a&&!s?ae("Pick",[e,i],n):y({...ep(e,o),...n})}function s0(e,t,n){return{[t]:rr(e,[t],se(n))}}function c0(e,t,n){return t.reduce((i,o)=>({...i,...s0(e,o,n)}),{})}function l0(e,t,n){return c0(e,t.keys,n)}function tp(e,t,n){let i=l0(e,t,n);return q(i)}function p0(e,t){return ae("Partial",[ae(e,t)])}function m0(e){return ae("Partial",[bt(e)])}function u0(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Ae(e[n]);return t}function d0(e){let t=ye(e,[ue,"$id","required","properties"]),n=u0(e.properties);return K(n,t)}function Cf(e){return e.map(t=>Pf(t))}function Pf(e){return Nt(e)?p0(e.target,e.parameters):ge(e)?m0(e.$ref):fe(e)?Ee(Cf(e.allOf)):B(e)?V(Cf(e.anyOf)):Oe(e)?d0(e):gn(e)||gr(e)||Ft(e)||_e(e)||Ti(e)||jt(e)||yr(e)||Ai(e)||br(e)?e:K({})}function Kr(e,t){return pe(e)?rp(e,t):y({...Pf(e),...t})}function f0(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Kr(e[i],se(t));return n}function h0(e,t){return f0(e.properties,t)}function rp(e,t){let n=h0(e,t);return q(n)}function g0(e,t){return ae("Required",[ae(e,t)])}function y0(e){return ae("Required",[bt(e)])}function b0(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ye(e[n],[ve]);return t}function O0(e){let t=ye(e,[ue,"$id","required","properties"]),n=b0(e.properties);return K(n,t)}function Tf(e){return e.map(t=>Af(t))}function Af(e){return Nt(e)?g0(e.target,e.parameters):ge(e)?y0(e.$ref):fe(e)?Ee(Tf(e.allOf)):B(e)?V(Tf(e.anyOf)):Oe(e)?O0(e):gn(e)||gr(e)||Ft(e)||_e(e)||Ti(e)||jt(e)||yr(e)||Ai(e)||br(e)?e:K({})}function Gr(e,t){return pe(e)?np(e,t):y({...Af(e),...t})}function x0(e,t){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=Gr(e[i],t);return n}function S0(e,t){return x0(e.properties,t)}function np(e,t){let n=S0(e,t);return q(n)}function I0(e,t){return t.map(n=>ge(n)?ip(e,n.$ref):Ot(e,n))}function ip(e,t){return t in e?ge(e[t])?ip(e,e[t].$ref):Ot(e,e[t]):k()}function w0(e){return Ur(e[0])}function C0(e){return Zt(e[0],e[1])}function P0(e){return Dr(e[0])}function T0(e){return Kr(e[0])}function A0(e){return tr(e[0],e[1])}function E0(e){return rr(e[0],e[1])}function $0(e){return Gr(e[0])}function v0(e,t,n){let i=I0(e,n);return t==="Awaited"?w0(i):t==="Index"?C0(i):t==="KeyOf"?P0(i):t==="Partial"?T0(i):t==="Omit"?A0(i):t==="Pick"?E0(i):t==="Required"?$0(i):k()}function L0(e,t){return Lr(Ot(e,t))}function N0(e,t){return Nr(Ot(e,t))}function R0(e,t,n){return Rr(Ho(e,t),Ot(e,n))}function k0(e,t,n){return yt(Ho(e,t),Ot(e,n))}function F0(e,t){return Ee(Ho(e,t))}function j0(e,t){return jr(Ot(e,t))}function U0(e,t){return K(globalThis.Object.keys(t).reduce((n,i)=>({...n,[i]:Ot(e,t[i])}),{}))}function D0(e,t){let[n,i]=[Ot(e,Mo(t)),_o(t)],o=fn(t);return o.patternProperties[i]=n,o}function _0(e,t){return ge(t)?{...ip(e,t.$ref),[ue]:t[ue]}:t}function M0(e,t){return Qe(Ho(e,t))}function B0(e,t){return V(Ho(e,t))}function Ho(e,t){return t.map(n=>Ot(e,n))}function Ot(e,t){return Je(t)?y(Ot(e,ye(t,[ve])),t):zn(t)?y(Ot(e,ye(t,[vt])),t):z(t)?y(_0(e,t),t):Lt(t)?y(L0(e,t.items),t):hn(t)?y(N0(e,t.items),t):Nt(t)?y(v0(e,t.target,t.parameters)):Rt(t)?y(R0(e,t.parameters,t.returns),t):kt(t)?y(k0(e,t.parameters,t.returns),t):fe(t)?y(F0(e,t.allOf),t):yn(t)?y(j0(e,t.items),t):Oe(t)?y(U0(e,t.properties),t):On(t)?y(D0(e,t)):st(t)?y(M0(e,t.items||[]),t):B(t)?y(B0(e,t.anyOf),t):t}function V0(e,t){return t in e?Ot(e,e[t]):k()}function Ef(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:V0(e,n)}),{})}var Ts=class{constructor(t){let n=Ef(t),i=this.WithIdentifiers(n);this.$defs=i}Import(t,n){let i={...this.$defs,[t]:y(this.$defs[t],n)};return y({[g]:"Import",$defs:i,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,i)=>({...n,[i]:{...t[i],$id:i}}),{})}};function zo(e){return new Ts(e)}function Jo(e,t){return y({[g]:"Not",not:e},t)}function Yo(e,t){return kt(e)?Qe(e.parameters,t):k()}var K0=0;function Xo(e,t={}){Ie(t.$id)&&(t.$id=`T${K0++}`);let n=fn(e({[g]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,y({[ze]:"Recursive",...n},t)}function Qo(e,t){let n=ie(e)?new globalThis.RegExp(e):e;return y({[g]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}function G0(e){return fe(e)?e.allOf:B(e)?e.anyOf:st(e)?e.items??[]:[]}function Zo(e){return G0(e)}function ea(e,t){return kt(e)?y(e.returns,t):k(t)}var As=class{constructor(t){this.schema=t}Decode(t){return new Es(this.schema,t)}},Es=class{constructor(t,n){this.schema=t,this.decode=n}EncodeTransform(t,n){let a={Encode:s=>n[ue].Encode(t(s)),Decode:s=>this.decode(n[ue].Decode(s))};return{...n,[ue]:a}}EncodeSchema(t,n){let i={Decode:this.decode,Encode:t};return{...n,[ue]:i}}Encode(t){return z(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function ta(e){return new As(e)}function ra(e={}){return y({[g]:e[g]??"Unsafe"},e)}function na(e){return y({[g]:"Void",type:"void"},e)}var Fi=class{ReadonlyOptional(t){return si(t)}Readonly(t,n){return Me(t,n??!0)}Optional(t,n){return Ae(t,n??!0)}Any(t){return Xt(t)}Array(t,n){return Lr(t,n)}Boolean(t){return Qn(t)}Capitalize(t,n){return Ko(t,n)}Composite(t,n){return ko(t,n)}Const(t,n){return Fo(t,n)}Enum(t,n){return Uo(t,n)}Exclude(t,n,i){return Br(t,n,i)}Extends(t,n,i,o,a){return Mr(t,n,i,o,a)}Extract(t,n,i){return Vr(t,n,i)}Index(t,n,i){return Zt(t,n,i)}Integer(t){return Vo(t)}Intersect(t,n){return Ee(t,n)}KeyOf(t,n){return Dr(t,n)}Literal(t,n){return j(t,n)}Lowercase(t,n){return Go(t,n)}Mapped(t,n,i){return Lo(t,n,i)}Module(t){return zo(t)}Never(t){return k(t)}Not(t,n){return Jo(t,n)}Null(t){return ni(t)}Number(t){return Ye(t)}Object(t,n){return K(t,n)}Omit(t,n,i){return tr(t,n,i)}Partial(t,n){return Kr(t,n)}Pick(t,n,i){return rr(t,n,i)}Record(t,n,i){return li(t,n,i)}Recursive(t,n){return Xo(t,n)}Ref(...t){return bt(t[0],t[1])}Required(t,n){return Gr(t,n)}Rest(t){return Zo(t)}String(t){return Ne(t)}TemplateLiteral(t,n){return Zn(t,n)}Transform(t){return ta(t)}Tuple(t,n){return Qe(t,n)}Uncapitalize(t,n){return qo(t,n)}Union(t,n){return V(t,n)}Unknown(t){return ct(t)}Unsafe(t){return ra(t)}Uppercase(t,n){return Wo(t,n)}};var op={};rt(op,{Any:()=>Xt,Argument:()=>Co,Array:()=>Lr,AsyncIterator:()=>Nr,Awaited:()=>Ur,BigInt:()=>Fr,Boolean:()=>Qn,Capitalize:()=>Ko,Composite:()=>ko,Const:()=>Fo,Constructor:()=>Rr,ConstructorParameters:()=>jo,Date:()=>ri,Enum:()=>Uo,Exclude:()=>Br,Extends:()=>Mr,Extract:()=>Vr,Function:()=>yt,Index:()=>Zt,InstanceType:()=>Do,Instantiate:()=>Bo,Integer:()=>Vo,Intersect:()=>Ee,Iterator:()=>jr,KeyOf:()=>Dr,Literal:()=>j,Lowercase:()=>Go,Mapped:()=>Lo,Module:()=>zo,Never:()=>k,Not:()=>Jo,Null:()=>ni,Number:()=>Ye,Object:()=>K,Omit:()=>tr,Optional:()=>Ae,Parameters:()=>Yo,Partial:()=>Kr,Pick:()=>rr,Promise:()=>ei,Readonly:()=>Me,ReadonlyOptional:()=>si,Record:()=>li,Recursive:()=>Xo,Ref:()=>bt,RegExp:()=>Qo,Required:()=>Gr,Rest:()=>Zo,ReturnType:()=>ea,String:()=>Ne,Symbol:()=>ii,TemplateLiteral:()=>Zn,Transform:()=>ta,Tuple:()=>Qe,Uint8Array:()=>ai,Uncapitalize:()=>qo,Undefined:()=>oi,Union:()=>V,Unknown:()=>ct,Unsafe:()=>ra,Uppercase:()=>Wo,Void:()=>na});var $s=class extends Fi{Argument(t){return Co(t)}AsyncIterator(t,n){return Nr(t,n)}Awaited(t,n){return Ur(t,n)}BigInt(t){return Fr(t)}ConstructorParameters(t,n){return jo(t,n)}Constructor(t,n,i){return Rr(t,n,i)}Date(t={}){return ri(t)}Function(t,n,i){return yt(t,n,i)}InstanceType(t,n){return Do(t,n)}Instantiate(t,n){return Bo(t,n)}Iterator(t,n){return jr(t,n)}Parameters(t,n){return Yo(t,n)}Promise(t,n){return ei(t,n)}RegExp(t,n){return Qo(t,n)}ReturnType(t,n){return ea(t,n)}Symbol(t){return ii(t)}Undefined(t){return oi(t)}Uint8Array(t){return ai(t)}Void(t){return na(t)}};var r=op;var Sp={};rt(Sp,{Assert:()=>ia,AssertError:()=>Rs,Cast:()=>Di,Check:()=>F,Clean:()=>aa,Clone:()=>W,Convert:()=>la,Create:()=>Kt,Decode:()=>mp,Default:()=>fa,Delete:()=>Wf,Diff:()=>fp,Edit:()=>dp,Encode:()=>gp,Equal:()=>Pn,HasPropertyKey:()=>A,HasTransform:()=>Cn,Hash:()=>pi,Insert:()=>Gf,IsArray:()=>E,IsAsyncIterator:()=>go,IsBigInt:()=>$t,IsBigInt64Array:()=>nO,IsBigUint64Array:()=>iO,IsBoolean:()=>Jt,IsDate:()=>Ve,IsFloat32Array:()=>tO,IsFloat64Array:()=>rO,IsFunction:()=>fr,IsInstanceObject:()=>Hb,IsInt16Array:()=>Xb,IsInt32Array:()=>Zb,IsInt8Array:()=>Jb,IsInteger:()=>Oo,IsIterator:()=>yo,IsMap:()=>hl,IsNull:()=>dr,IsNumber:()=>le,IsObject:()=>L,IsPromise:()=>bo,IsRegExp:()=>zb,IsSet:()=>gl,IsStandardObject:()=>ps,IsString:()=>Q,IsSymbol:()=>hr,IsTypedArray:()=>gt,IsUint16Array:()=>Qb,IsUint32Array:()=>eO,IsUint8Array:()=>Hn,IsUint8ClampedArray:()=>Yb,IsUndefined:()=>ce,IsValueType:()=>it,Mutate:()=>bp,Parse:()=>xp,ParseDefault:()=>Op,ParseError:()=>ba,ParseRegistry:()=>Vs,Patch:()=>hp,TransformDecode:()=>ma,TransformDecodeCheckError:()=>pa,TransformDecodeError:()=>Fs,TransformEncode:()=>da,TransformEncodeCheckError:()=>ua,TransformEncodeError:()=>js,Update:()=>qf,Value:()=>P,ValueCastError:()=>oa,ValueCheckUnknownTypeError:()=>Ls,ValueCreateError:()=>pt,ValueDiffError:()=>ga,ValueErrorIterator:()=>Or,ValueErrorType:()=>h,ValueHashError:()=>vs,ValueMutateError:()=>ya,ValuePointer:()=>Gt});function q0(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 W0=q0;function $f(){return W0}var sp=class extends ${constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function H0(e,t){let n=t.find(i=>i.$id===e.$ref);if(n===void 0)throw new sp(e);return Y(n,t)}function Re(e,t){return!Q(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function Y(e,t){return e[g]==="This"||e[g]==="Ref"?H0(e,t):e}var vs=class extends ${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 ji=BigInt("14695981039346656037"),[z0,J0]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Y0=Array.from({length:256}).map((e,t)=>BigInt(t)),vf=new Float64Array(1),Lf=new DataView(vf.buffer),Nf=new Uint8Array(vf.buffer);function*X0(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function Q0(e){Ge(xt.Array);for(let t of e)Ui(t)}function Z0(e){Ge(xt.Boolean),Ge(e?1:0)}function ew(e){Ge(xt.BigInt),Lf.setBigInt64(0,e);for(let t of Nf)Ge(t)}function tw(e){Ge(xt.Date),Ui(e.getTime())}function rw(e){Ge(xt.Null)}function nw(e){Ge(xt.Number),Lf.setFloat64(0,e);for(let t of Nf)Ge(t)}function iw(e){Ge(xt.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Ui(t),Ui(e[t])}function ow(e){Ge(xt.String);for(let t=0;t<e.length;t++)for(let n of X0(e.charCodeAt(t)))Ge(n)}function aw(e){Ge(xt.Symbol),Ui(e.description)}function sw(e){Ge(xt.Uint8Array);for(let t=0;t<e.length;t++)Ge(e[t])}function cw(e){return Ge(xt.Undefined)}function Ui(e){if(E(e))return Q0(e);if(Jt(e))return Z0(e);if($t(e))return ew(e);if(Ve(e))return tw(e);if(dr(e))return rw(e);if(le(e))return nw(e);if(L(e))return iw(e);if(Q(e))return ow(e);if(hr(e))return aw(e);if(Hn(e))return sw(e);if(ce(e))return cw(e);throw new vs(e)}function Ge(e){ji=ji^Y0[e],ji=ji*z0%J0}function pi(e){return ji=BigInt("14695981039346656037"),Ui(e),ji}var Ls=class extends ${constructor(t){super("Unknown type"),this.schema=t}};function lw(e){return e[g]==="Any"||e[g]==="Unknown"}function _(e){return e!==void 0}function pw(e,t,n){return!0}function mw(e,t,n){return!0}function uw(e,t,n){if(!E(n)||_(e.minItems)&&!(n.length>=e.minItems)||_(e.maxItems)&&!(n.length<=e.maxItems)||!n.every(a=>ke(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let s of n){let c=pi(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=n.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 dw(e,t,n){return go(n)}function fw(e,t,n){return!(!$t(n)||_(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||_(e.maximum)&&!(n<=e.maximum)||_(e.minimum)&&!(n>=e.minimum)||_(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function hw(e,t,n){return Jt(n)}function gw(e,t,n){return ke(e.returns,t,n.prototype)}function yw(e,t,n){return!(!Ve(n)||_(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||_(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||_(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||_(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||_(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function bw(e,t,n){return fr(n)}function Ow(e,t,n){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ke(o,[...t,...i],n)}function xw(e,t,n){return!(!Oo(n)||_(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||_(e.maximum)&&!(n<=e.maximum)||_(e.minimum)&&!(n>=e.minimum)||_(e.multipleOf)&&n%e.multipleOf!==0)}function Sw(e,t,n){let i=e.allOf.every(o=>ke(o,t,n));if(e.unevaluatedProperties===!1){let o=new RegExp(ti(e)),a=Object.getOwnPropertyNames(n).every(s=>o.test(s));return i&&a}else if(de(e.unevaluatedProperties)){let o=new RegExp(ti(e)),a=Object.getOwnPropertyNames(n).every(s=>o.test(s)||ke(e.unevaluatedProperties,t,n[s]));return i&&a}else return i}function Iw(e,t,n){return yo(n)}function ww(e,t,n){return n===e.const}function Cw(e,t,n){return!1}function Pw(e,t,n){return!ke(e.not,t,n)}function Tw(e,t,n){return dr(n)}function Aw(e,t,n){return!(!Ce.IsNumberLike(n)||_(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||_(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||_(e.minimum)&&!(n>=e.minimum)||_(e.maximum)&&!(n<=e.maximum)||_(e.multipleOf)&&n%e.multipleOf!==0)}function Ew(e,t,n){if(!Ce.IsObjectLike(n)||_(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||_(e.maxProperties)&&!(Object.getOwnPropertyNames(n).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,n[o])||(In(a)||lw(a))&&!(o in n))return!1}else if(Ce.IsExactOptionalProperty(n,o)&&!ke(a,t,n[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(n);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(n).every(a=>i.includes(a)||ke(e.additionalProperties,t,n[a])):!0}function $w(e,t,n){return bo(n)}function vw(e,t,n){if(!Ce.IsRecordLike(n)||_(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||_(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[i,o]=Object.entries(e.patternProperties)[0],a=new RegExp(i),s=Object.entries(n).every(([p,m])=>a.test(p)?ke(o,t,m):!0),c=typeof e.additionalProperties=="object"?Object.entries(n).every(([p,m])=>a.test(p)?!0:ke(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(p=>a.test(p)):!0;return s&&c&&l}function Lw(e,t,n){return ke(Y(e,t),t,n)}function Nw(e,t,n){let i=new RegExp(e.source,e.flags);return _(e.minLength)&&!(n.length>=e.minLength)||_(e.maxLength)&&!(n.length<=e.maxLength)?!1:i.test(n)}function Rw(e,t,n){return!Q(n)||_(e.minLength)&&!(n.length>=e.minLength)||_(e.maxLength)&&!(n.length<=e.maxLength)||_(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:_(e.format)?Ut.Has(e.format)?Ut.Get(e.format)(n):!1:!0}function kw(e,t,n){return hr(n)}function Fw(e,t,n){return Q(n)&&new RegExp(e.pattern).test(n)}function jw(e,t,n){return ke(Y(e,t),t,n)}function Uw(e,t,n){if(!E(n)||e.items===void 0&&n.length!==0||n.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,n[i]))return!1;return!0}function Dw(e,t,n){return ce(n)}function _w(e,t,n){return e.anyOf.some(i=>ke(i,t,n))}function Mw(e,t,n){return!(!Hn(n)||_(e.maxByteLength)&&!(n.length<=e.maxByteLength)||_(e.minByteLength)&&!(n.length>=e.minByteLength))}function Bw(e,t,n){return!0}function Vw(e,t,n){return Ce.IsVoidLike(n)}function Kw(e,t,n){return Dt.Has(e[g])?Dt.Get(e[g])(e,n):!1}function ke(e,t,n){let i=_(e.$id)?Re(e,t):t,o=e;switch(o[g]){case"Any":return pw(o,i,n);case"Argument":return mw(o,i,n);case"Array":return uw(o,i,n);case"AsyncIterator":return dw(o,i,n);case"BigInt":return fw(o,i,n);case"Boolean":return hw(o,i,n);case"Constructor":return gw(o,i,n);case"Date":return yw(o,i,n);case"Function":return bw(o,i,n);case"Import":return Ow(o,i,n);case"Integer":return xw(o,i,n);case"Intersect":return Sw(o,i,n);case"Iterator":return Iw(o,i,n);case"Literal":return ww(o,i,n);case"Never":return Cw(o,i,n);case"Not":return Pw(o,i,n);case"Null":return Tw(o,i,n);case"Number":return Aw(o,i,n);case"Object":return Ew(o,i,n);case"Promise":return $w(o,i,n);case"Record":return vw(o,i,n);case"Ref":return Lw(o,i,n);case"RegExp":return Nw(o,i,n);case"String":return Rw(o,i,n);case"Symbol":return kw(o,i,n);case"TemplateLiteral":return Fw(o,i,n);case"This":return jw(o,i,n);case"Tuple":return Uw(o,i,n);case"Undefined":return Dw(o,i,n);case"Union":return _w(o,i,n);case"Uint8Array":return Mw(o,i,n);case"Unknown":return Bw(o,i,n);case"Void":return Vw(o,i,n);default:if(!Dt.Has(o[g]))throw new Ls(o);return Kw(o,i,n)}}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 cp=class extends ${constructor(t){super("Unknown type"),this.schema=t}};function qr(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,n,i,o=[]){return{type:e,schema:t,path:n,value:i,message:$f()({errorType:e,path:n,schema:t,value:i,errors:o}),errors:o}}function*Gw(e,t,n,i){}function*qw(e,t,n,i){}function*Ww(e,t,n,i){if(!E(i))return yield C(h.Array,e,n,i);M(e.minItems)&&!(i.length>=e.minItems)&&(yield C(h.ArrayMinItems,e,n,i)),M(e.maxItems)&&!(i.length<=e.maxItems)&&(yield C(h.ArrayMaxItems,e,n,i));for(let s=0;s<i.length;s++)yield*Fe(e.items,t,`${n}/${s}`,i[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let c of i){let l=pi(c);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield C(h.ArrayUniqueItems,e,n,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,`${n}${l}`,c).next().done===!0?s+1:s,0);a===0&&(yield C(h.ArrayContains,e,n,i)),le(e.minContains)&&a<e.minContains&&(yield C(h.ArrayMinContains,e,n,i)),le(e.maxContains)&&a>e.maxContains&&(yield C(h.ArrayMaxContains,e,n,i))}function*Hw(e,t,n,i){go(i)||(yield C(h.AsyncIterator,e,n,i))}function*zw(e,t,n,i){if(!$t(i))return yield C(h.BigInt,e,n,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.BigIntExclusiveMaximum,e,n,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.BigIntExclusiveMinimum,e,n,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.BigIntMaximum,e,n,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.BigIntMinimum,e,n,i)),M(e.multipleOf)&&i%e.multipleOf!==BigInt(0)&&(yield C(h.BigIntMultipleOf,e,n,i))}function*Jw(e,t,n,i){Jt(i)||(yield C(h.Boolean,e,n,i))}function*Yw(e,t,n,i){yield*Fe(e.returns,t,n,i.prototype)}function*Xw(e,t,n,i){if(!Ve(i))return yield C(h.Date,e,n,i);M(e.exclusiveMaximumTimestamp)&&!(i.getTime()<e.exclusiveMaximumTimestamp)&&(yield C(h.DateExclusiveMaximumTimestamp,e,n,i)),M(e.exclusiveMinimumTimestamp)&&!(i.getTime()>e.exclusiveMinimumTimestamp)&&(yield C(h.DateExclusiveMinimumTimestamp,e,n,i)),M(e.maximumTimestamp)&&!(i.getTime()<=e.maximumTimestamp)&&(yield C(h.DateMaximumTimestamp,e,n,i)),M(e.minimumTimestamp)&&!(i.getTime()>=e.minimumTimestamp)&&(yield C(h.DateMinimumTimestamp,e,n,i)),M(e.multipleOfTimestamp)&&i.getTime()%e.multipleOfTimestamp!==0&&(yield C(h.DateMultipleOfTimestamp,e,n,i))}function*Qw(e,t,n,i){fr(i)||(yield C(h.Function,e,n,i))}function*Zw(e,t,n,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Fe(a,[...t,...o],n,i)}function*eC(e,t,n,i){if(!Oo(i))return yield C(h.Integer,e,n,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.IntegerExclusiveMaximum,e,n,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.IntegerExclusiveMinimum,e,n,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.IntegerMaximum,e,n,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.IntegerMinimum,e,n,i)),M(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.IntegerMultipleOf,e,n,i))}function*tC(e,t,n,i){let o=!1;for(let a of e.allOf)for(let s of Fe(a,t,n,i))o=!0,yield s;if(o)return yield C(h.Intersect,e,n,i);if(e.unevaluatedProperties===!1){let a=new RegExp(ti(e));for(let s of Object.getOwnPropertyNames(i))a.test(s)||(yield C(h.IntersectUnevaluatedProperties,e,`${n}/${s}`,i))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(ti(e));for(let s of Object.getOwnPropertyNames(i))if(!a.test(s)){let c=Fe(e.unevaluatedProperties,t,`${n}/${s}`,i[s]).next();c.done||(yield c.value)}}}function*rC(e,t,n,i){yo(i)||(yield C(h.Iterator,e,n,i))}function*nC(e,t,n,i){i!==e.const&&(yield C(h.Literal,e,n,i))}function*iC(e,t,n,i){yield C(h.Never,e,n,i)}function*oC(e,t,n,i){Fe(e.not,t,n,i).next().done===!0&&(yield C(h.Not,e,n,i))}function*aC(e,t,n,i){dr(i)||(yield C(h.Null,e,n,i))}function*sC(e,t,n,i){if(!Ce.IsNumberLike(i))return yield C(h.Number,e,n,i);M(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.NumberExclusiveMaximum,e,n,i)),M(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.NumberExclusiveMinimum,e,n,i)),M(e.maximum)&&!(i<=e.maximum)&&(yield C(h.NumberMaximum,e,n,i)),M(e.minimum)&&!(i>=e.minimum)&&(yield C(h.NumberMinimum,e,n,i)),M(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.NumberMultipleOf,e,n,i))}function*cC(e,t,n,i){if(!Ce.IsObjectLike(i))return yield C(h.Object,e,n,i);M(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,n,i)),M(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,n,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],`${n}/${qr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield C(h.ObjectAdditionalProperties,e,`${n}/${qr(c)}`,i[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Fe(e.additionalProperties,t,`${n}/${qr(c)}`,i[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Fe(l,t,`${n}/${qr(c)}`,i[c]),In(e)&&!(c in i)&&(yield C(h.ObjectRequiredProperty,l,`${n}/${qr(c)}`,void 0))):Ce.IsExactOptionalProperty(i,c)&&(yield*Fe(l,t,`${n}/${qr(c)}`,i[c]))}}function*lC(e,t,n,i){bo(i)||(yield C(h.Promise,e,n,i))}function*pC(e,t,n,i){if(!Ce.IsRecordLike(i))return yield C(h.Object,e,n,i);M(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,n,i)),M(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,n,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,`${n}/${qr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(i))s.test(c)||(yield*Fe(e.additionalProperties,t,`${n}/${qr(c)}`,l));if(e.additionalProperties===!1){for(let[c,l]of Object.entries(i))if(!s.test(c))return yield C(h.ObjectAdditionalProperties,e,`${n}/${qr(c)}`,l)}}function*mC(e,t,n,i){yield*Fe(Y(e,t),t,n,i)}function*uC(e,t,n,i){if(!Q(i))return yield C(h.String,e,n,i);if(M(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,n,i)),M(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,n,i)),!new RegExp(e.source,e.flags).test(i))return yield C(h.RegExp,e,n,i)}function*dC(e,t,n,i){if(!Q(i))return yield C(h.String,e,n,i);M(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,n,i)),M(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,n,i)),Q(e.pattern)&&(new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,n,i))),Q(e.format)&&(Ut.Has(e.format)?Ut.Get(e.format)(i)||(yield C(h.StringFormat,e,n,i)):yield C(h.StringFormatUnknown,e,n,i))}function*fC(e,t,n,i){hr(i)||(yield C(h.Symbol,e,n,i))}function*hC(e,t,n,i){if(!Q(i))return yield C(h.String,e,n,i);new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,n,i))}function*gC(e,t,n,i){yield*Fe(Y(e,t),t,n,i)}function*yC(e,t,n,i){if(!E(i))return yield C(h.Tuple,e,n,i);if(e.items===void 0&&i.length!==0)return yield C(h.TupleLength,e,n,i);if(i.length!==e.maxItems)return yield C(h.TupleLength,e,n,i);if(e.items)for(let o=0;o<e.items.length;o++)yield*Fe(e.items[o],t,`${n}/${o}`,i[o])}function*bC(e,t,n,i){ce(i)||(yield C(h.Undefined,e,n,i))}function*OC(e,t,n,i){if(F(e,t,i))return;let o=e.anyOf.map(a=>new Or(Fe(a,t,n,i)));yield C(h.Union,e,n,i,o)}function*xC(e,t,n,i){if(!Hn(i))return yield C(h.Uint8Array,e,n,i);M(e.maxByteLength)&&!(i.length<=e.maxByteLength)&&(yield C(h.Uint8ArrayMaxByteLength,e,n,i)),M(e.minByteLength)&&!(i.length>=e.minByteLength)&&(yield C(h.Uint8ArrayMinByteLength,e,n,i))}function*SC(e,t,n,i){}function*IC(e,t,n,i){Ce.IsVoidLike(i)||(yield C(h.Void,e,n,i))}function*wC(e,t,n,i){Dt.Get(e[g])(e,i)||(yield C(h.Kind,e,n,i))}function*Fe(e,t,n,i){let o=M(e.$id)?[...t,e]:t,a=e;switch(a[g]){case"Any":return yield*Gw(a,o,n,i);case"Argument":return yield*qw(a,o,n,i);case"Array":return yield*Ww(a,o,n,i);case"AsyncIterator":return yield*Hw(a,o,n,i);case"BigInt":return yield*zw(a,o,n,i);case"Boolean":return yield*Jw(a,o,n,i);case"Constructor":return yield*Yw(a,o,n,i);case"Date":return yield*Xw(a,o,n,i);case"Function":return yield*Qw(a,o,n,i);case"Import":return yield*Zw(a,o,n,i);case"Integer":return yield*eC(a,o,n,i);case"Intersect":return yield*tC(a,o,n,i);case"Iterator":return yield*rC(a,o,n,i);case"Literal":return yield*nC(a,o,n,i);case"Never":return yield*iC(a,o,n,i);case"Not":return yield*oC(a,o,n,i);case"Null":return yield*aC(a,o,n,i);case"Number":return yield*sC(a,o,n,i);case"Object":return yield*cC(a,o,n,i);case"Promise":return yield*lC(a,o,n,i);case"Record":return yield*pC(a,o,n,i);case"Ref":return yield*mC(a,o,n,i);case"RegExp":return yield*uC(a,o,n,i);case"String":return yield*dC(a,o,n,i);case"Symbol":return yield*fC(a,o,n,i);case"TemplateLiteral":return yield*hC(a,o,n,i);case"This":return yield*gC(a,o,n,i);case"Tuple":return yield*yC(a,o,n,i);case"Undefined":return yield*bC(a,o,n,i);case"Union":return yield*OC(a,o,n,i);case"Uint8Array":return yield*xC(a,o,n,i);case"Unknown":return yield*SC(a,o,n,i);case"Void":return yield*IC(a,o,n,i);default:if(!Dt.Has(a[g]))throw new cp(e);return yield*wC(a,o,n,i)}}function wn(...e){let t=e.length===3?Fe(e[0],e[1],"",e[2]):Fe(e[0],[],"",e[1]);return new Or(t)}var CC=function(e,t,n,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,n):o?o.value=n:t.set(e,n),n},kf=function(e,t,n,i){if(n==="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 n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},lp,Ns,Ff,Rs=class extends ${constructor(t){let n=t.First();super(n===void 0?"Invalid Value":n.message),lp.add(this),Ns.set(this,void 0),CC(this,Ns,t,"f"),this.error=n}Errors(){return new Or(kf(this,lp,"m",Ff).call(this))}};Ns=new WeakMap,lp=new WeakSet,Ff=function*(){this.error&&(yield this.error),yield*kf(this,Ns,"f")};function Rf(e,t,n){if(!F(e,t,n))throw new Rs(wn(e,t,n))}function ia(...e){return e.length===3?Rf(e[0],e[1],e[2]):Rf(e[0],[],e[1])}function PC(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=W(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=W(e[n]);return t}function TC(e){return e.map(t=>W(t))}function AC(e){return e.slice()}function EC(e){return new Map(W([...e.entries()]))}function $C(e){return new Set(W([...e.entries()]))}function vC(e){return new Date(e.toISOString())}function W(e){if(E(e))return TC(e);if(Ve(e))return vC(e);if(gt(e))return AC(e);if(hl(e))return EC(e);if(gl(e))return $C(e);if(L(e))return PC(e);if(it(e))return e;throw new Error("ValueClone: Unable to clone value")}var pt=class extends ${constructor(t,n){super(n),this.schema=t}};function J(e){return fr(e)?e():W(e)}function LC(e,t){return A(e,"default")?J(e.default):{}}function NC(e,t){return{}}function RC(e,t){if(e.uniqueItems===!0&&!A(e,"default"))throw new pt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!A(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(n=>St(e.items,t)):[]}function kC(e,t){return A(e,"default")?J(e.default):async function*(){}()}function FC(e,t){return A(e,"default")?J(e.default):BigInt(0)}function jC(e,t){return A(e,"default")?J(e.default):!1}function UC(e,t){if(A(e,"default"))return J(e.default);{let n=St(e.returns,t);return typeof n=="object"&&!Array.isArray(n)?class{constructor(){for(let[i,o]of Object.entries(n)){let a=this;a[i]=o}}}:class{}}}function DC(e,t){return A(e,"default")?J(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function _C(e,t){return A(e,"default")?J(e.default):()=>St(e.returns,t)}function MC(e,t){let n=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return St(i,[...t,...n])}function BC(e,t){return A(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function VC(e,t){if(A(e,"default"))return J(e.default);{let n=e.allOf.reduce((i,o)=>{let a=St(o,t);return typeof a=="object"?{...i,...a}:a},{});if(!F(e,t,n))throw new pt(e,"Intersect produced invalid value. Consider using a default value.");return n}}function KC(e,t){return A(e,"default")?J(e.default):function*(){}()}function GC(e,t){return A(e,"default")?J(e.default):e.const}function qC(e,t){if(A(e,"default"))return J(e.default);throw new pt(e,"Never types cannot be created. Consider using a default value.")}function WC(e,t){if(A(e,"default"))return J(e.default);throw new pt(e,"Not types must have a default value")}function HC(e,t){return A(e,"default")?J(e.default):null}function zC(e,t){return A(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function JC(e,t){if(A(e,"default"))return J(e.default);{let n=new Set(e.required),i={};for(let[o,a]of Object.entries(e.properties))n.has(o)&&(i[o]=St(a,t));return i}}function YC(e,t){return A(e,"default")?J(e.default):Promise.resolve(St(e.item,t))}function XC(e,t){return A(e,"default")?J(e.default):{}}function QC(e,t){return A(e,"default")?J(e.default):St(Y(e,t),t)}function ZC(e,t){if(A(e,"default"))return J(e.default);throw new pt(e,"RegExp types cannot be created. Consider using a default value.")}function eP(e,t){if(e.pattern!==void 0){if(A(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(A(e,"default"))return J(e.default);throw new pt(e,"String types with formats must specify a default value")}else return A(e,"default")?J(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function tP(e,t){return A(e,"default")?J(e.default):"value"in e?Symbol.for(e.value):Symbol()}function rP(e,t){if(A(e,"default"))return J(e.default);if(!Eo(e))throw new pt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Xn(e)[0]}function nP(e,t){if(jf++>mP)throw new pt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return A(e,"default")?J(e.default):St(Y(e,t),t)}function iP(e,t){return A(e,"default")?J(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((n,i)=>St(e.items[i],t))}function oP(e,t){if(A(e,"default"))return J(e.default)}function aP(e,t){if(A(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 sP(e,t){return A(e,"default")?J(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function cP(e,t){return A(e,"default")?J(e.default):{}}function lP(e,t){if(A(e,"default"))return J(e.default)}function pP(e,t){if(A(e,"default"))return J(e.default);throw new Error("User defined types must specify a default value")}function St(e,t){let n=Re(e,t),i=e;switch(i[g]){case"Any":return LC(i,n);case"Argument":return NC(i,n);case"Array":return RC(i,n);case"AsyncIterator":return kC(i,n);case"BigInt":return FC(i,n);case"Boolean":return jC(i,n);case"Constructor":return UC(i,n);case"Date":return DC(i,n);case"Function":return _C(i,n);case"Import":return MC(i,n);case"Integer":return BC(i,n);case"Intersect":return VC(i,n);case"Iterator":return KC(i,n);case"Literal":return GC(i,n);case"Never":return qC(i,n);case"Not":return WC(i,n);case"Null":return HC(i,n);case"Number":return zC(i,n);case"Object":return JC(i,n);case"Promise":return YC(i,n);case"Record":return XC(i,n);case"Ref":return QC(i,n);case"RegExp":return ZC(i,n);case"String":return eP(i,n);case"Symbol":return tP(i,n);case"TemplateLiteral":return rP(i,n);case"This":return nP(i,n);case"Tuple":return iP(i,n);case"Undefined":return oP(i,n);case"Union":return aP(i,n);case"Uint8Array":return sP(i,n);case"Unknown":return cP(i,n);case"Void":return lP(i,n);default:if(!Dt.Has(i[g]))throw new pt(i,"Unknown type");return pP(i,n)}}var mP=512,jf=0;function Kt(...e){return jf=0,e.length===2?St(e[0],e[1]):St(e[0],[])}var oa=class extends ${constructor(t,n){super(n),this.schema=t}};function Uf(e,t,n){if(e[g]==="Object"&&typeof n=="object"&&!dr(n)){let i=e,o=Object.getOwnPropertyNames(n),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===n[p]?c:0,f=F(m,t,n[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=>Uf(a,t,n));return Math.max(...o)}else return F(e,t,n)?1:0}function uP(e,t,n){let i=e.anyOf.map(s=>Y(s,t)),[o,a]=[i[0],0];for(let s of i){let c=Uf(s,t,n);c>a&&(o=s,a=c)}return o}function dP(e,t,n){if("default"in e)return typeof n=="function"?e.default:W(e.default);{let i=uP(e,t,n);return Di(i,t,n)}}function fP(e,t,n){return F(e,t,n)?W(n):Kt(e,t)}function hP(e,t,n){return F(e,t,n)?n:Kt(e,t)}function gP(e,t,n){if(F(e,t,n))return W(n);let i=E(n)?W(n):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 oa(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function yP(e,t,n){if(F(e,t,n))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)&&n.prototype[a]===void 0||(o.prototype[a]=nr(s,t,n.prototype[a]));return o}function bP(e,t,n){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return nr(o,[...t,...i],n)}function Df(e,t){return L(e)&&!L(t)||!L(e)&&L(t)?e:!L(e)||!L(t)?t:globalThis.Object.getOwnPropertyNames(e).reduce((n,i)=>{let o=i in t?Df(e[i],t[i]):e[i];return{...n,[i]:o}},{})}function OP(e,t,n){if(F(e,t,n))return n;let i=Kt(e,t),o=Df(i,n);return F(e,t,o)?o:i}function xP(e,t,n){throw new oa(e,"Never types cannot be cast")}function SP(e,t,n){if(F(e,t,n))return n;if(n===null||typeof n!="object")return Kt(e,t);let i=new Set(e.required||[]),o={};for(let[a,s]of Object.entries(e.properties))!i.has(a)&&n[a]===void 0||(o[a]=nr(s,t,n[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(n))a.includes(s)||(o[s]=nr(e.additionalProperties,t,n[s]))}return o}function IP(e,t,n){if(F(e,t,n))return W(n);if(n===null||typeof n!="object"||Array.isArray(n)||n 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(n))a[s]=nr(o,t,c);return a}function wP(e,t,n){return nr(Y(e,t),t,n)}function CP(e,t,n){return nr(Y(e,t),t,n)}function PP(e,t,n){return F(e,t,n)?W(n):E(n)?e.items===void 0?[]:e.items.map((i,o)=>nr(i,t,n[o])):Kt(e,t)}function TP(e,t,n){return F(e,t,n)?W(n):dP(e,t,n)}function nr(e,t,n){let i=Q(e.$id)?Re(e,t):t,o=e;switch(e[g]){case"Array":return gP(o,i,n);case"Constructor":return yP(o,i,n);case"Import":return bP(o,i,n);case"Intersect":return OP(o,i,n);case"Never":return xP(o,i,n);case"Object":return SP(o,i,n);case"Record":return IP(o,i,n);case"Ref":return wP(o,i,n);case"This":return CP(o,i,n);case"Tuple":return PP(o,i,n);case"Union":return TP(o,i,n);case"Date":case"Symbol":case"Uint8Array":return fP(e,t,n);default:return hP(o,i,n)}}function Di(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}function AP(e){return Er(e)&&e[g]!=="Unsafe"}function EP(e,t,n){return E(n)?n.map(i=>mt(e.items,t,i)):n}function $P(e,t,n){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return mt(o,[...t,...i],n)}function vP(e,t,n){let i=e.unevaluatedProperties,a=e.allOf.map(c=>mt(c,t,W(n))).reduce((c,l)=>L(l)?{...c,...l}:l,{});if(!L(n)||!L(a)||!Er(i))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(n))s.includes(c)||F(i,t,n[c])&&(a[c]=mt(i,t,n[c]));return a}function LP(e,t,n){if(!L(n)||E(n))return n;let i=e.additionalProperties;for(let o of Object.getOwnPropertyNames(n)){if(A(e.properties,o)){n[o]=mt(e.properties[o],t,n[o]);continue}if(Er(i)&&F(i,t,n[o])){n[o]=mt(i,t,n[o]);continue}delete n[o]}return n}function NP(e,t,n){if(!L(n))return n;let i=e.additionalProperties,o=Object.getOwnPropertyNames(n),[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of o){if(c.test(l)){n[l]=mt(s,t,n[l]);continue}if(Er(i)&&F(i,t,n[l])){n[l]=mt(i,t,n[l]);continue}delete n[l]}return n}function RP(e,t,n){return mt(Y(e,t),t,n)}function kP(e,t,n){return mt(Y(e,t),t,n)}function FP(e,t,n){if(!E(n))return n;if(ce(e.items))return[];let i=Math.min(n.length,e.items.length);for(let o=0;o<i;o++)n[o]=mt(e.items[o],t,n[o]);return n.length>i?n.slice(0,i):n}function jP(e,t,n){for(let i of e.anyOf)if(AP(i)&&F(i,t,n))return mt(i,t,n);return n}function mt(e,t,n){let i=Q(e.$id)?Re(e,t):t,o=e;switch(o[g]){case"Array":return EP(o,i,n);case"Import":return $P(o,i,n);case"Intersect":return vP(o,i,n);case"Object":return LP(o,i,n);case"Record":return NP(o,i,n);case"Ref":return RP(o,i,n);case"This":return kP(o,i,n);case"Tuple":return FP(o,i,n);case"Union":return jP(o,i,n);default:return n}}function aa(...e){return e.length===3?mt(e[0],e[1],e[2]):mt(e[0],[],e[1])}function ks(e){return Q(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function UP(e){return $t(e)||Jt(e)||le(e)}function sa(e){return e===!0||le(e)&&e===1||$t(e)&&e===BigInt("1")||Q(e)&&(e.toLowerCase()==="true"||e==="1")}function ca(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 DP(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 _P(e){return Q(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function MP(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 BP(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 VP(e){return Q(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function KP(e,t){let n=Mf(e);return n===t?n:e}function GP(e,t){let n=Bf(e);return n===t?n:e}function qP(e,t){let n=_f(e);return n===t?n:e}function WP(e,t){return Q(e.const)?KP(t,e.const):le(e.const)?GP(t,e.const):Jt(e.const)?qP(t,e.const):t}function _f(e){return sa(e)?!0:ca(e)?!1:e}function HP(e){let t=n=>n.split(".")[0];return ks(e)?BigInt(t(e)):le(e)?BigInt(Math.trunc(e)):ca(e)?BigInt(0):sa(e)?BigInt(1):e}function Mf(e){return hr(e)&&e.description!==void 0?e.description.toString():UP(e)?e.toString():e}function Bf(e){return ks(e)?parseFloat(e):sa(e)?1:ca(e)?0:e}function zP(e){return ks(e)?parseInt(e):le(e)?Math.trunc(e):sa(e)?1:ca(e)?0:e}function JP(e){return Q(e)&&e.toLowerCase()==="null"?null:e}function YP(e){return Q(e)&&e==="undefined"?void 0:e}function XP(e){return Ve(e)?e:le(e)?new Date(e):sa(e)?new Date(1):ca(e)?new Date(0):ks(e)?new Date(parseInt(e)):_P(e)?new Date(`1970-01-01T${e}.000Z`):DP(e)?new Date(`1970-01-01T${e}`):BP(e)?new Date(`${e}.000Z`):MP(e)?new Date(e):VP(e)?new Date(`${e}T00:00:00.000Z`):e}function QP(e,t,n){return(E(n)?n:[n]).map(o=>ir(e.items,t,o))}function ZP(e,t,n){return HP(n)}function eT(e,t,n){return _f(n)}function tT(e,t,n){return XP(n)}function rT(e,t,n){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ir(o,[...t,...i],n)}function nT(e,t,n){return zP(n)}function iT(e,t,n){return e.allOf.reduce((i,o)=>ir(o,t,i),n)}function oT(e,t,n){return WP(e,n)}function aT(e,t,n){return JP(n)}function sT(e,t,n){return Bf(n)}function cT(e,t,n){if(!L(n))return n;for(let i of Object.getOwnPropertyNames(e.properties))A(n,i)&&(n[i]=ir(e.properties[i],t,n[i]));return n}function lT(e,t,n){if(!L(n))return n;let o=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[o];for(let[s,c]of Object.entries(n))n[s]=ir(a,t,c);return n}function pT(e,t,n){return ir(Y(e,t),t,n)}function mT(e,t,n){return Mf(n)}function uT(e,t,n){return Q(n)||le(n)?Symbol(n):n}function dT(e,t,n){return ir(Y(e,t),t,n)}function fT(e,t,n){return E(n)&&!ce(e.items)?n.map((o,a)=>a<e.items.length?ir(e.items[a],t,o):o):n}function hT(e,t,n){return YP(n)}function gT(e,t,n){for(let i of e.anyOf)if(F(i,t,n))return n;for(let i of e.anyOf){let o=ir(i,t,W(n));if(F(i,t,o))return o}return n}function ir(e,t,n){let i=Re(e,t),o=e;switch(e[g]){case"Array":return QP(o,i,n);case"BigInt":return ZP(o,i,n);case"Boolean":return eT(o,i,n);case"Date":return tT(o,i,n);case"Import":return rT(o,i,n);case"Integer":return nT(o,i,n);case"Intersect":return iT(o,i,n);case"Literal":return oT(o,i,n);case"Null":return aT(o,i,n);case"Number":return sT(o,i,n);case"Object":return cT(o,i,n);case"Record":return lT(o,i,n);case"Ref":return pT(o,i,n);case"String":return mT(o,i,n);case"Symbol":return uT(o,i,n);case"This":return dT(o,i,n);case"Tuple":return fT(o,i,n);case"Undefined":return hT(o,i,n);case"Union":return gT(o,i,n);default:return n}}function la(...e){return e.length===3?ir(e[0],e[1],e[2]):ir(e[0],[],e[1])}var pa=class extends ${constructor(t,n,i){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=n,this.error=i}},Fs=class extends ${constructor(t,n,i,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=n,this.value=i,this.error=o}};function he(e,t,n){try{return z(e)?e[ue].Decode(n):n}catch(i){throw new Fs(e,t,n,i)}}function yT(e,t,n,i){return E(i)?he(e,n,i.map((o,a)=>or(e.items,t,`${n}/${a}`,o))):he(e,n,i)}function bT(e,t,n,i){if(!L(i)||it(i))return he(e,n,i);let o=Ro(e),a=o.map(m=>m[0]),s={...i};for(let[m,u]of o)m in s&&(s[m]=or(u,t,`${n}/${m}`,s[m]));if(!z(e.unevaluatedProperties))return he(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=he(l,`${n}/${m}`,p[m]));return he(e,n,p)}function OT(e,t,n,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...o],n,i);return he(e,n,s)}function xT(e,t,n,i){return he(e,n,or(e.not,t,n,i))}function ST(e,t,n,i){if(!L(i))return he(e,n,i);let o=Ze(e),a={...i};for(let p of o)A(a,p)&&(ce(a[p])&&(!br(e.properties[p])||Ce.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${n}/${p}`,a[p])));if(!de(e.additionalProperties))return he(e,n,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)o.includes(p)||(l[p]=he(c,`${n}/${p}`,l[p]));return he(e,n,l)}function IT(e,t,n,i){if(!L(i))return he(e,n,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,`${n}/${m}`,s[m]));if(!de(e.additionalProperties))return he(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=he(l,`${n}/${m}`,p[m]));return he(e,n,p)}function wT(e,t,n,i){let o=Y(e,t);return he(e,n,or(o,t,n,i))}function CT(e,t,n,i){let o=Y(e,t);return he(e,n,or(o,t,n,i))}function PT(e,t,n,i){return E(i)&&E(e.items)?he(e,n,e.items.map((o,a)=>or(o,t,`${n}/${a}`,i[a]))):he(e,n,i)}function TT(e,t,n,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=or(o,t,n,i);return he(e,n,a)}return he(e,n,i)}function or(e,t,n,i){let o=Re(e,t),a=e;switch(e[g]){case"Array":return yT(a,o,n,i);case"Import":return OT(a,o,n,i);case"Intersect":return bT(a,o,n,i);case"Not":return xT(a,o,n,i);case"Object":return ST(a,o,n,i);case"Record":return IT(a,o,n,i);case"Ref":return wT(a,o,n,i);case"Symbol":return he(a,n,i);case"This":return CT(a,o,n,i);case"Tuple":return PT(a,o,n,i);case"Union":return TT(a,o,n,i);default:return he(a,n,i)}}function ma(e,t,n){return or(e,t,"",n)}var ua=class extends ${constructor(t,n,i){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=i}},js=class extends ${constructor(t,n,i,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=t,this.path=n,this.value=i,this.error=o}};function Be(e,t,n){try{return z(e)?e[ue].Encode(n):n}catch(i){throw new js(e,t,n,i)}}function AT(e,t,n,i){let o=Be(e,n,i);return E(o)?o.map((a,s)=>ar(e.items,t,`${n}/${s}`,a)):o}function ET(e,t,n,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Be(e,n,i);return ar(a,[...t,...o],n,s)}function $T(e,t,n,i){let o=Be(e,n,i);if(!L(i)||it(i))return o;let a=Ro(e),s=a.map(u=>u[0]),c={...o};for(let[u,f]of a)u in c&&(c[u]=ar(f,t,`${n}/${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,`${n}/${u}`,m[u]));return m}function vT(e,t,n,i){return Be(e.not,n,Be(e,n,i))}function LT(e,t,n,i){let o=Be(e,n,i);if(!L(o))return o;let a=Ze(e),s={...o};for(let m of a)A(s,m)&&(ce(s[m])&&(!br(e.properties[m])||Ce.IsExactOptionalProperty(s,m))||(s[m]=ar(e.properties[m],t,`${n}/${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,`${n}/${m}`,p[m]));return p}function NT(e,t,n,i){let o=Be(e,n,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,`${n}/${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,`${n}/${u}`,m[u]));return m}function RT(e,t,n,i){let o=Y(e,t),a=ar(o,t,n,i);return Be(e,n,a)}function kT(e,t,n,i){let o=Y(e,t),a=ar(o,t,n,i);return Be(e,n,a)}function FT(e,t,n,i){let o=Be(e,n,i);return E(e.items)?e.items.map((a,s)=>ar(a,t,`${n}/${s}`,o[s])):[]}function jT(e,t,n,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=ar(o,t,n,i);return Be(e,n,a)}for(let o of e.anyOf){let a=ar(o,t,n,i);if(F(e,t,a))return Be(e,n,a)}return Be(e,n,i)}function ar(e,t,n,i){let o=Re(e,t),a=e;switch(e[g]){case"Array":return AT(a,o,n,i);case"Import":return ET(a,o,n,i);case"Intersect":return $T(a,o,n,i);case"Not":return vT(a,o,n,i);case"Object":return LT(a,o,n,i);case"Record":return NT(a,o,n,i);case"Ref":return RT(a,o,n,i);case"This":return kT(a,o,n,i);case"Tuple":return FT(a,o,n,i);case"Union":return jT(a,o,n,i);default:return Be(a,n,i)}}function da(e,t,n){return ar(e,t,"",n)}function UT(e,t){return z(e)||$e(e.items,t)}function DT(e,t){return z(e)||$e(e.items,t)}function _T(e,t){return z(e)||$e(e.returns,t)||e.parameters.some(n=>$e(n,t))}function MT(e,t){return z(e)||$e(e.returns,t)||e.parameters.some(n=>$e(n,t))}function BT(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(n=>$e(n,t))}function VT(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((o,a)=>[...o,e.$defs[a]],[]),i=e.$defs[e.$ref];return z(e)||$e(i,[...n,...t])}function KT(e,t){return z(e)||$e(e.items,t)}function GT(e,t){return z(e)||$e(e.not,t)}function qT(e,t){return z(e)||Object.values(e.properties).some(n=>$e(n,t))||de(e.additionalProperties)&&$e(e.additionalProperties,t)}function WT(e,t){return z(e)||$e(e.item,t)}function HT(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n];return z(e)||$e(i,t)||de(e.additionalProperties)&&z(e.additionalProperties)}function zT(e,t){return z(e)?!0:$e(Y(e,t),t)}function JT(e,t){return z(e)?!0:$e(Y(e,t),t)}function YT(e,t){return z(e)||!ce(e.items)&&e.items.some(n=>$e(n,t))}function XT(e,t){return z(e)||e.anyOf.some(n=>$e(n,t))}function $e(e,t){let n=Re(e,t),i=e;if(e.$id&&pp.has(e.$id))return!1;switch(e.$id&&pp.add(e.$id),e[g]){case"Array":return UT(i,n);case"AsyncIterator":return DT(i,n);case"Constructor":return _T(i,n);case"Function":return MT(i,n);case"Import":return VT(i,n);case"Intersect":return BT(i,n);case"Iterator":return KT(i,n);case"Not":return GT(i,n);case"Object":return qT(i,n);case"Promise":return WT(i,n);case"Record":return HT(i,n);case"Ref":return zT(i,n);case"This":return JT(i,n);case"Tuple":return YT(i,n);case"Union":return XT(i,n);default:return z(e)}}var pp=new Set;function Cn(e,t){return pp.clear(),$e(e,t)}function mp(...e){let[t,n,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!F(t,n,i))throw new pa(t,i,wn(t,n,i).First());return Cn(t,n)?ma(t,n,i):i}function Wr(e,t){let n=A(e,"default")?e.default:void 0,i=fr(n)?n():W(n);return ce(t)?i:L(t)&&L(i)?Object.assign(i,t):t}function up(e){return Er(e)&&"default"in e}function QT(e,t,n){if(E(n)){for(let o=0;o<n.length;o++)n[o]=et(e.items,t,n[o]);return n}let i=Wr(e,n);if(!E(i))return i;for(let o=0;o<i.length;o++)i[o]=et(e.items,t,i[o]);return i}function ZT(e,t,n){return Ve(n)?n:Wr(e,n)}function eA(e,t,n){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return et(o,[...t,...i],n)}function tA(e,t,n){let i=Wr(e,n);return e.allOf.reduce((o,a)=>{let s=et(a,t,i);return L(s)?{...o,...s}:s},{})}function rA(e,t,n){let i=Wr(e,n);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(!up(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 nA(e,t,n){let i=Wr(e,n);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)&&up(s)&&(i[l]=et(s,t,i[l]));if(!up(o))return i;for(let l of Object.getOwnPropertyNames(i))c.test(l)||(i[l]=et(o,t,i[l]));return i}function iA(e,t,n){return et(Y(e,t),t,Wr(e,n))}function oA(e,t,n){return et(Y(e,t),t,n)}function aA(e,t,n){let i=Wr(e,n);if(!E(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 sA(e,t,n){let i=Wr(e,n);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,n){let i=Re(e,t),o=e;switch(o[g]){case"Array":return QT(o,i,n);case"Date":return ZT(o,i,n);case"Import":return eA(o,i,n);case"Intersect":return tA(o,i,n);case"Object":return rA(o,i,n);case"Record":return nA(o,i,n);case"Ref":return iA(o,i,n);case"This":return oA(o,i,n);case"Tuple":return aA(o,i,n);case"Union":return sA(o,i,n);default:return Wr(o,n)}}function fa(...e){return e.length===3?et(e[0],e[1],e[2]):et(e[0],[],e[1])}var Gt={};rt(Gt,{Delete:()=>lA,Format:()=>ha,Get:()=>mA,Has:()=>pA,Set:()=>cA,ValuePointerRootDeleteError:()=>Ds,ValuePointerRootSetError:()=>Us});var Us=class extends ${constructor(t,n,i){super("Cannot set root value"),this.value=t,this.path=n,this.update=i}},Ds=class extends ${constructor(t,n){super("Cannot delete root value"),this.value=t,this.path=n}};function Vf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*ha(e){if(e==="")return;let[t,n]=[0,0];for(let i=0;i<e.length;i++)e.charAt(i)==="/"?(i===0||(n=i,yield Vf(e.slice(t,n))),t=i+1):n=i;yield Vf(e.slice(t))}function cA(e,t,n){if(t==="")throw new Us(e,t,n);let[i,o,a]=[null,e,""];for(let s of ha(t))o[s]===void 0&&(o[s]={}),i=o,o=o[s],a=s;i[a]=n}function lA(e,t){if(t==="")throw new Ds(e,t);let[n,i,o]=[null,e,""];for(let a of ha(t)){if(i[a]===void 0||i[a]===null)return;n=i,i=i[a],o=a}if(Array.isArray(n)){let a=parseInt(o);n.splice(a,1)}else delete n[o]}function pA(e,t){if(t==="")return!0;let[n,i,o]=[null,e,""];for(let a of ha(t)){if(i[a]===void 0)return!1;n=i,i=i[a],o=a}return Object.getOwnPropertyNames(n).includes(o)}function mA(e,t){if(t==="")return e;let n=e;for(let i of ha(t)){if(n[i]===void 0)return;n=n[i]}return n}function uA(e,t){if(!L(t))return!1;let n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],i=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return n.length!==i.length?!1:n.every(o=>Pn(e[o],t[o]))}function dA(e,t){return Ve(t)&&e.getTime()===t.getTime()}function fA(e,t){return!E(t)||e.length!==t.length?!1:e.every((n,i)=>Pn(n,t[i]))}function hA(e,t){return!gt(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((n,i)=>Pn(n,t[i]))}function gA(e,t){return e===t}function Pn(e,t){if(Ve(e))return dA(e,t);if(gt(e))return hA(e,t);if(E(e))return fA(e,t);if(L(e))return uA(e,t);if(it(e))return gA(e,t);throw new Error("ValueEquals: Unable to compare value")}var Gf=K({type:j("insert"),path:Ne(),value:ct()}),qf=K({type:j("update"),path:Ne(),value:ct()}),Wf=K({type:j("delete"),path:Ne()}),dp=V([Gf,qf,Wf]),ga=class extends ${constructor(t,n){super(n),this.value=t}};function _s(e,t){return{type:"update",path:e,value:t}}function Hf(e,t){return{type:"insert",path:e,value:t}}function zf(e){return{type:"delete",path:e}}function Kf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ga(e,"Cannot diff objects with symbols")}function*yA(e,t,n){if(Kf(t),Kf(n),!ps(n))return yield _s(e,n);let i=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(n);for(let a of o)A(t,a)||(yield Hf(`${e}/${a}`,n[a]));for(let a of i)A(n,a)&&(Pn(t,n)||(yield*Ms(`${e}/${a}`,t[a],n[a])));for(let a of i)A(n,a)||(yield zf(`${e}/${a}`))}function*bA(e,t,n){if(!E(n))return yield _s(e,n);for(let i=0;i<Math.min(t.length,n.length);i++)yield*Ms(`${e}/${i}`,t[i],n[i]);for(let i=0;i<n.length;i++)i<t.length||(yield Hf(`${e}/${i}`,n[i]));for(let i=t.length-1;i>=0;i--)i<n.length||(yield zf(`${e}/${i}`))}function*OA(e,t,n){if(!gt(n)||t.length!==n.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(n).constructor.name)return yield _s(e,n);for(let i=0;i<Math.min(t.length,n.length);i++)yield*Ms(`${e}/${i}`,t[i],n[i])}function*xA(e,t,n){t!==n&&(yield _s(e,n))}function*Ms(e,t,n){if(ps(t))return yield*yA(e,t,n);if(E(t))return yield*bA(e,t,n);if(gt(t))return yield*OA(e,t,n);if(it(t))return yield*xA(e,t,n);throw new ga(t,"Unable to diff value")}function fp(e,t){return[...Ms("",e,t)]}function SA(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function IA(e){return e.length===0}function hp(e,t){if(SA(t))return W(t[0].value);if(IA(t))return W(e);let n=W(e);for(let i of t)switch(i.type){case"insert":{Gt.Set(n,i.path,i.value);break}case"update":{Gt.Set(n,i.path,i.value);break}case"delete":{Gt.Delete(n,i.path);break}}return n}function gp(...e){let[t,n,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Cn(t,n)?da(t,n,i):i;if(!F(t,n,o))throw new ua(t,o,wn(t,n,o).First());return o}function Bs(e){return L(e)&&!E(e)}var ya=class extends ${constructor(t){super(t)}};function wA(e,t,n,i){if(!Bs(n))Gt.Set(e,t,W(i));else{let o=Object.getOwnPropertyNames(n),a=Object.getOwnPropertyNames(i);for(let s of o)a.includes(s)||delete n[s];for(let s of a)o.includes(s)||(n[s]=null);for(let s of a)yp(e,`${t}/${s}`,n[s],i[s])}}function CA(e,t,n,i){if(!E(n))Gt.Set(e,t,W(i));else{for(let o=0;o<i.length;o++)yp(e,`${t}/${o}`,n[o],i[o]);n.splice(i.length)}}function PA(e,t,n,i){if(gt(n)&&n.length===i.length)for(let o=0;o<n.length;o++)n[o]=i[o];else Gt.Set(e,t,W(i))}function TA(e,t,n,i){n!==i&&Gt.Set(e,t,i)}function yp(e,t,n,i){if(E(i))return CA(e,t,n,i);if(gt(i))return PA(e,t,n,i);if(Bs(i))return wA(e,t,n,i);if(it(i))return TA(e,t,n,i)}function Jf(e){return gt(e)||it(e)}function AA(e,t){return Bs(e)&&E(t)||E(e)&&Bs(t)}function bp(e,t){if(Jf(e)||Jf(t))throw new ya("Only object and array types can be mutated at the root level");if(AA(e,t))throw new ya("Cannot assign due type mismatch of assignable values");yp(e,"",e,t)}var ba=class extends ${constructor(t){super(t)}},Vs;(function(e){let t=new Map([["Assert",(a,s,c)=>(ia(a,s,c),c)],["Cast",(a,s,c)=>Di(a,s,c)],["Clean",(a,s,c)=>aa(a,s,c)],["Clone",(a,s,c)=>W(c)],["Convert",(a,s,c)=>la(a,s,c)],["Decode",(a,s,c)=>Cn(a,s)?ma(a,s,c):c],["Default",(a,s,c)=>fa(a,s,c)],["Encode",(a,s,c)=>Cn(a,s)?da(a,s,c):c]]);function n(a){t.delete(a)}e.Delete=n;function i(a,s){t.set(a,s)}e.Set=i;function o(a){return t.get(a)}e.Get=o})(Vs||(Vs={}));var Op=["Clone","Clean","Default","Convert","Assert","Decode"];function EA(e,t,n,i){return e.reduce((o,a)=>{let s=Vs.Get(a);if(ce(s))throw new ba(`Unable to find Parse operation \'${a}\'`);return s(t,n,o)},i)}function xp(...e){let[t,n,i,o]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?E(e[0])?[e[0],e[1],[],e[2]]:[Op,e[0],e[1],e[2]]:e.length===2?[Op,e[0],[],e[1]]:(()=>{throw new ba("Invalid Arguments")})();return EA(t,n,i,o)}var P={};rt(P,{Assert:()=>ia,Cast:()=>Di,Check:()=>F,Clean:()=>aa,Clone:()=>W,Convert:()=>la,Create:()=>Kt,Decode:()=>mp,Default:()=>fa,Diff:()=>fp,Edit:()=>dp,Encode:()=>gp,Equal:()=>Pn,Errors:()=>wn,Hash:()=>pi,Mutate:()=>bp,Parse:()=>xp,Patch:()=>hp,ValueErrorIterator:()=>Or});var pm={};rt(pm,{BLOCK_SLOT_PLACEMENT_PROPS:()=>nm,BLOCK_SLOT_ROLES:()=>Gh,BLUEPRINT_FORMATS:()=>rg,BlockDefinitionsSchema:()=>Yr,BlockEvaluationError:()=>Ea,BlockInvocationPropsSchema:()=>Un,BlockSlotSchema:()=>qh,BlueprintPagesSchema:()=>ng,BlueprintSchema:()=>lm,BlueprintVariantSchema:()=>ig,CANVASES:()=>dh,ChromeSchema:()=>_p,ComponentValidationError:()=>gi,DEFAULT_CHART_THEME_COLORS:()=>WE,DEFAULT_ERROR_CONFIG:()=>Tn,DEFAULT_VISUAL_DPI:()=>$a,DesignSpacingSchema:()=>Dp,DesignSystemProperties:()=>Rn,DesignSystemSchema:()=>fh,DuplicateComponentError:()=>Vi,ERROR_EMOJIS:()=>ui,FONT_URL_ALLOWLIST:()=>Pp,FeatureRequirementCollector:()=>sh,FontFamilyNameSchema:()=>Ht,FontRegistry:()=>DE,FontRegistryEntrySchema:()=>Rp,FontRegistrySchema:()=>wr,FontSourceSchema:()=>Np,JsonBlockDefinitionSchema:()=>Wh,JsonBlockEvaluator:()=>r$,MAX_RASTERIZE_BATCH_SLIDES:()=>gE,MAX_RASTERIZE_FONTS:()=>fE,MAX_RASTERIZE_FONT_BYTES:()=>hE,MAX_VISUAL_DPI:()=>La,MIN_VISUAL_DPI:()=>va,MotifSchema:()=>Mp,POINTS_PER_PIXEL_96DPI:()=>Bh,POPULAR_GOOGLE_FONTS:()=>Uh,PaletteSchema:()=>Fp,REMOTE_EXPORT_WARNING:()=>x$,RENDERER_DEPENDENCY_MISSING:()=>Js,ROLE_SCALE_STEPS:()=>Bp,RendererRegistry:()=>lh,SAFE_FONTS:()=>tc,TYPE_ROLES:()=>qi,TextCaseSchema:()=>bi,TypeRoleNameSchema:()=>kp,TypeRoleSchema:()=>wt,TypeRolesSchema:()=>jp,TypographySchema:()=>Up,UPSTREAM_OVERRIDES:()=>Dh,UnknownPreservedComponentError:()=>Ws,UnsupportedRendererFeatureError:()=>Ap,WEIGHT_LABELS:()=>Fh,applyDocumentBlocksToSchema:()=>u$,applyExportMode:()=>qE,applyFontSubstitution:()=>Zp,assertNever:()=>rh,assertRendererSupports:()=>ch,blockDependencies:()=>cm,blockInvocationExample:()=>tg,blockInvocationPropsSchema:()=>Qh,blockPointerKey:()=>xe,blockReferencesFromDocument:()=>d$,blockSlotBudgets:()=>i$,blockSlotEditorSchema:()=>mc,blockSlotFacts:()=>Jh,blockSlotJsonSchema:()=>pc,blockSlotMarkdown:()=>Yh,blockSlotRoles:()=>o$,blockSlotsEditorSchema:()=>Xh,blockSlotsJsonSchema:()=>am,blockValueAt:()=>jn,blockWordCount:()=>im,buildDefaultSubstitutionMap:()=>Mh,calculatePosition:()=>_i,capsFormatting:()=>bh,chartFamilyResolver:()=>YE,chartFontFaceCss:()=>Kh,chartPointsPerPixel:()=>HE,clampVisualDpi:()=>dE,clearComponentNamesCache:()=>xa,collectFontNamesFromDocx:()=>yE,collectFontNamesFromPptx:()=>bE,compareSemver:()=>fi,composeBlocksWithPlugins:()=>p$,convertToJsonSchema:()=>Xs,createBlockAuthoringSchema:()=>Na,createComponent:()=>Bi,createComponentSchema:()=>Ki,createComponentSchemaObject:()=>Qs,createErrorConfig:()=>Ir,createJsonParseError:()=>di,createVersion:()=>Mi,cssFontFamily:()=>Vh,defaultSubstituteFor:()=>_h,definitionsFor:()=>sg,designCanvas:()=>hh,designColors:()=>Vp,detectFontFormat:()=>Hr,diagnoseUnsupportedFeatures:()=>$p,documentBlockMetadata:()=>n$,documentFontRegistry:()=>xE,exportSchemaToFile:()=>Gi,extractStandardComponentNames:()=>mi,fetchGoogleFontSources:()=>jh,fixSchemaReferences:()=>Ln,formatErrorMessage:()=>xr,formatErrorSummary:()=>Jr,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>Sa,getUpstreamOverride:()=>VE,getValidationSummary:()=>zs,groupErrorsByPath:()=>Ia,instantiateBlueprint:()=>y$,isAllowedFontUrl:()=>Gs,isBlockRecord:()=>H,isBlueprint:()=>f$,isLiteralSchema:()=>zr,isObjectSchema:()=>qt,isPrivateServiceUrl:()=>ug,isSafeFont:()=>yi,isUnionSchema:()=>Oa,isValidSemver:()=>$n,isValidationSuccess:()=>Hs,latestVersion:()=>ut,mergeFontRegistries:()=>SE,mergeWithDefaults:()=>O$,parseSemver:()=>En,partitionDiagnostics:()=>ah,readBlockDefinitions:()=>Xr,registerBlueprints:()=>h$,remoteExportNotice:()=>S$,rendererError:()=>Ep,rendererWarning:()=>oh,resolveBlockSlot:()=>dc,resolveComponentVersion:()=>hi,resolveDesignColor:()=>Kp,resolveTypeRoles:()=>Oh,restructureNameDiscriminatedUnions:()=>wa,rewriteFontFamilyName:()=>wp,selectVariant:()=>ag,slotAt:()=>cg,synthesizeFamilyName:()=>CE,themeFontRegistry:()=>kh,toAuthoredBlockPointer:()=>Fn,transformValueError:()=>An,transformValueErrors:()=>tt,typeScaleSizes:()=>yh,unionBranches:()=>Ys,validateBlockDefinitions:()=>fc,validateBlockInvocations:()=>zi,validateBlueprint:()=>og,validateCustomComponentProps:()=>vn,validateDesignColors:()=>xh,validateFontReferences:()=>wE,valueAt:()=>pg,withChartFontFaceCss:()=>ZE,withChartTypography:()=>XE});var $A=new Set([1,4,6,16]),vA=2981146554;function Yf(e){let t=0,n=e.length,i=n-n%4;for(let o=0;o<i;o+=4)t=t+e.readUInt32BE(o)>>>0;if(i<n){let o=0,a=n-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 LA(e,t){if(e.platformID===1)return Buffer.from(t,"ascii");let n=Buffer.alloc(t.length*2);for(let i=0;i<t.length;i+=1)n.writeUInt16BE(t.charCodeAt(i),i*2);return n}function NA(e){let t=e.length,n=6+t*12,i=0;for(let s of e)i+=s.bytes.length;let o=Buffer.alloc(n+i);o.writeUInt16BE(0,0),o.writeUInt16BE(t,2),o.writeUInt16BE(n,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,n+a),a+=c.bytes.length}return o}function RA(e,t){if(e.length<12)return e;let n=e.readUInt32BE(0);if(!(n===65536||n===1330926671||n===1953658213||n===1954115633))return e;let 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 R=12+I*16,G=e.toString("ascii",R,R+4),qe=e.readUInt32BE(R+4),We=e.readUInt32BE(R+8),He=e.readUInt32BE(R+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 R=6+I*12,G=c.readUInt16BE(R),qe=c.readUInt16BE(R+2),We=c.readUInt16BE(R+4),He=c.readUInt16BE(R+6),te=c.readUInt16BE(R+8),T=c.readUInt16BE(R+10),Z=c.slice(p+T,p+T+te);m.push({platformID:G,encodingID:qe,languageID:We,nameID:He,bytes:Z})}let u=[];for(let I of m){let R=t(I);R.action!=="drop"&&(R.action==="set"&&(I.bytes=LA(I,R.value)),u.push(I))}m.length=0,m.push(...u);let f=NA(m);a[s]={...a[s],data:f,checksum:Yf(f)},a.sort((I,R)=>I.originalOffset-R.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,R)=>I.tag<R.tag?-1:I.tag>R.tag?1:0);for(let I=0;I<x.length;I+=1){let R=x[I],G=12+I*16;w.write(R.tag,G,4,"ascii"),w.writeUInt32BE(R.checksum,G+4),w.writeUInt32BE(R.offset,G+8),w.writeUInt32BE(R.data.length,G+12)}for(let I of a)I.data.copy(w,I.offset);let v=a.find(I=>I.tag==="head");if(v&&v.data.length>=12){w.writeUInt32BE(0,v.offset+8);let I=Yf(w),R=vA-I>>>0;w.writeUInt32BE(R,v.offset+8)}return w}function kA(e,t){if(e.length<12)return null;let n=e.readUInt16BE(4);for(let i=0;i<n;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 Ks(e,t){let n=kA(e,"name");if(!n)return[];let i=n.offset;if(i+6>e.length)return[];let o=Math.min(i+n.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),v;if(u===1)v=x.toString("ascii");else{let I=Buffer.from(x);I.length%2===0&&I.swap16(),v=I.toString("utf16le")}l.push({platformID:u,nameID:f,value:v})}return l}function Ip(e){let t=[];for(let n of Ks(e,FA)){let i=n.value.trim();i.length>0&&!t.includes(i)&&t.push(i)}return t}var FA=new Set([1,16]);function jA(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function wp(e,t,n){let i=n&&n!=="Regular"?n:"",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 RA(e,p=>$A.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 UA={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Cp(e,t){let n=UA[e];return n?{typographic:t?`${n} Italic`:n,legacy:jA(e>=600,t)}:null}var Pp=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function Gs(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:Pp.includes(t.hostname.toLowerCase())}function Hr(e){if(e.length<4)return"unknown";let t=e[0],n=e[1],i=e[2],o=e[3];return t===0&&n===1&&i===0&&o===0||t===116&&n===114&&i===117&&o===101||t===116&&n===121&&i===112&&o===49?"ttf":t===79&&n===84&&i===84&&o===79?"otf":t===119&&n===79&&i===70&&o===70?"woff":t===119&&n===79&&i===70&&o===50?"woff2":e.length>=36&&e[34]===76&&e[35]===80?"eot":t===128&&n===1||e.length>=14&&e.slice(0,14).toString("ascii")==="%!PS-AdobeFont"?"pfb":"unknown"}var qs=new Map;function Oa(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function qt(e){return e.type==="object"&&"properties"in e}function zr(e){return"const"in e}function Sr(e){return qt(e)?Object.keys(e.properties):[]}function It(e){if(zr(e))return e.const}function mi(e){if(qs.has(e))return qs.get(e);let t=[];if("anyOf"in e&&Array.isArray(e.anyOf)){for(let n of e.anyOf)if(qt(n)){let i=n.properties?.name;if(i&&zr(i)){let o=It(i);typeof o=="string"&&t.push(o)}}}else if(qt(e)){let n=e.properties?.name??e.properties?.type;if(n&&zr(n)){let i=It(n);typeof i=="string"&&t.push(i)}}return qs.set(e,t),t}function xa(){qs.clear()}function Sa(e){let t={};return"type"in e&&(t.type=String(e.type)),qt(e)&&(t.properties=Sr(e)),zr(e)&&(t.literal=It(e)),t}function Xf(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function DA(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Xf()}var Tn={includeEmojis:!Xf(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:DA()};function Ir(e){return{...Tn,...e}}var ui={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 _A(e,t){let n=String(e.type||""),i=e.path||"root";return n==="62"||n==="union"?MA(e):e.message?.includes("additionalProperties")?BA(e):e.message?.includes("Required property")?VA(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?KA(e):n==="literal"?GA(e):n==="pattern"||n==="RegExp"?qA(e):`At ${i}: ${e.message}`}function MA(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n)return`Invalid component configuration for \'${n.name}\'. Check that all required fields are present.`;if("children"in n&&Array.isArray(n.children))return"Document is missing required \'name\' field."}return"Invalid document structure. Check required fields."}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function BA(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(n).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 VA(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function KA(e){let t=e.path||"root",n=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 ${n} but got ${i}`}function GA(e){let t=e.path||"root",n=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${i}`}function qA(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,n){let i=Ir(n),o=_A(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=WA(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=_i(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function tt(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=n)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push(An(a,t?.jsonString,void 0)))}return i}function _i(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let o=`"${n[n.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 WA(e,t){let{type:n,path:i}=e,o=String(n);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 Jr(e){if(e.length===0)return"No errors";if(e.length===1)return e[0].message;let t=e.slice(0,3).map(n=>`${n.path}: ${n.message}`).join(", ");return e.length>3?`${t} and ${e.length-3} more...`:t}function Ia(e){let t=new Map;for(let n of e){let i=n.path||"root",o=t.get(i)||[];o.push(n),t.set(i,o)}return t}function di(e,t){let n=e.message.match(/position (\\d+)/),i=n?parseInt(n[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 Qf=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function $n(e){return Qf.test(e)}function En(e){let t=e.match(Qf);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 fi(e,t){let n=En(e),i=En(t);return n.major-i.major||n.minor-i.minor||n.patch-i.patch}function ut(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,n)=>fi(n,t)>0?n:t)}function Mi(e){return e}function Bi(e){if(!e.name)throw new Error("Component name is required");if(!e.versions||typeof e.versions!="object")throw new Error(`Component "${e.name}" requires a versions map`);let t=Object.keys(e.versions);if(t.length===0)throw new Error(`Component "${e.name}" must have at least one version`);for(let n of t){if(!$n(n))throw new Error(`Component "${e.name}": invalid semver key "${n}". Expected format: major.minor.patch`);let i=e.versions[n];if(!i.propsSchema)throw new Error(`Component "${e.name}" version "${n}" requires a propsSchema`);if(!i.render||typeof i.render!="function")throw new Error(`Component "${e.name}" version "${n}" requires a render function`)}return e}function hi(e,t,n){let i=Object.keys(t);if(n){let a=t[n];if(!a)throw new Error(`Component "${e}" does not have version "${n}". Available versions: ${i.join(", ")}`);return a}let o=ut(i);return t[o]}var Vi=class Zf extends Error{constructor(n){super(`Cannot register component "${n}": a component with this name is already registered. Component names must be unique within a document generator.`);N(this,"componentName");N(this,"code","DUPLICATE_COMPONENT");this.name="DuplicateComponentError",this.componentName=n,Error.captureStackTrace&&Error.captureStackTrace(this,Zf)}},Ws=class eh extends Error{constructor(n,i){let o=n.map(s=>`"${s}"`).join(", "),a=i.length?i.map(s=>`"${s}"`).join(", "):"(none)";super(`preserveCustomComponents lists unregistered component name(s): ${o}. Registered components: ${a}.`);N(this,"unknownNames");N(this,"registeredNames");N(this,"code","UNKNOWN_PRESERVED_COMPONENT");this.name="UnknownPreservedComponentError",this.unknownNames=[...n],this.registeredNames=[...i],Error.captureStackTrace&&Error.captureStackTrace(this,eh)}},gi=class extends Error{constructor(t,n){let i=n!==void 0?`\nProps: ${JSON.stringify(n,null,2)}`:"",o=`Document validation failed:\n${t.map(a=>` ${a.path}: ${a.message}`).join(`\n`)}${i}`;super(o);N(this,"errors");N(this,"props");this.name="ComponentValidationError",this.errors=t,this.props=n}};function Tp(e,t,n){try{let i=P.Clone(t);if(n?.applyDefaults&&(i=P.Default(e,i)),n?.clean&&(i=P.Clean(e,i)),!P.Check(e,i)){let o=[...P.Errors(e,i)];return{valid:!1,errors:tt(o,{jsonString:n?.jsonString,maxErrors:n?.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 vn(e,t,n){let i=n?.componentName??"custom";try{let o=Tp(e,t,{...n,clean:n?.clean??!0,applyDefaults:n?.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 Hs(e){return e.valid===!0&&e.data!==void 0}function zs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Jr(e.errors)}function rh(e,t){let n=HA(e);throw new Error(t?`Unhandled variant in ${t}: ${n}`:`Unhandled variant: ${n}`)}function HA(e){if(e===null||typeof e!="object")return String(e);let t=e.kind,n=e.type;if(typeof t=="string")return`kind="${t}"`;if(typeof n=="string")return`type="${n}"`;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}var Ap=class nh extends Error{constructor(n){let{format:i,rendererId:o,diagnostics:a}=n,s=th(a.map(l=>l.feature)),c=th(a.map(l=>l.path));super(JA(i,o,a,s));N(this,"code","UNSUPPORTED_RENDERER_FEATURE");N(this,"format");N(this,"rendererId");N(this,"features");N(this,"paths");N(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,nh)}},zA=class ih extends Error{constructor(n,i,o){let a=o.map(s=>`"${s}"`).join(", ");super(`Unknown ${n} renderer "${i}". Available renderers: ${a}.`);N(this,"code","UNKNOWN_RENDERER");N(this,"format");N(this,"rendererId");N(this,"availableIds");this.name="UnknownRendererError",this.format=n,this.rendererId=i,this.availableIds=[...o],Error.captureStackTrace&&Error.captureStackTrace(this,ih)}};function th(e){return[...new Set(e)]}function JA(e,t,n,i){let o=i.map(s=>`"${s}"`).join(", "),a=n.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 Ep(e,t,n){return{feature:e,path:t,severity:"error",message:n}}function oh(e,t,n){return{feature:e,path:t,severity:"warning",message:n}}function ah(e){let t=[],n=[];for(let i of e)i.severity==="error"?t.push(i):n.push(i);return{errors:t,warnings:n}}var sh=class{constructor(){N(this,"requirements",[]);N(this,"seen",new Set)}require(e,t,n){let i=`${e}\\0${t}`;this.seen.has(i)||(this.seen.add(i),this.requirements.push(n===void 0?{feature:e,path:t}:{feature:e,path:t,detail:n}))}list(){return this.requirements}features(){return[...new Set(this.requirements.map(e=>e.feature))]}isEmpty(){return this.requirements.length===0}};function $p(e,t,n){let i=[];for(let o of e)t.has(o.feature)||i.push(Ep(o.feature,o.path,YA(o,n)));return i}function YA(e,t){let n=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${n} (${e.detail})`:n}function ch(e,t){let n=$p(e,t.capabilities,t.id);if(n.length!==0)throw new Ap({format:t.format,rendererId:t.id,diagnostics:n})}var lh=class{constructor(e,t){N(this,"renderers",new Map);N(this,"statusCache");this.format=e,this.defaultId=t}register(e,t){this.renderers.set(e,t),this.statusCache=void 0}ids(){return[...this.renderers.keys()]}getDefaultId(){return this.defaultId}has(e){return this.renderers.has(e)}async resolve(e){let t=e??this.defaultId,n=this.renderers.get(t);if(!n)throw new zA(this.format,t,this.ids());try{return await n()}catch(i){throw XA(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(n){let o=n instanceof Error&&n.name===Js&&n instanceof Error?n.packageName:void 0;return{...t,available:!1,reason:n instanceof Error?n.message:String(n),...o?{installHint:`pnpm add ${o}`}:{}}}}))}};function XA(e,t,n){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=QA(i),s=a??`the "${n}" backend`,c=new Error(`The "${n}" ${t} renderer requires ${s}, which is not installed. Install it with: pnpm add ${s}\nOriginal error: ${i}`);return c.name=Js,a&&(c.packageName=a),c}var Js="RendererDependencyMissingError";function QA(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var ZA="Sheet1";var Yq=`<?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="${ZA}" sheetId="1" r:id="rId1"/></sheets></workbook>`;function mh(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 eE(e){return typeof e.properties?.version?.const=="string"}function tE(e){return Array.isArray(e.required)&&e.required.includes("name")}function rE(e){let t=new Map;for(let n of e){let i=mh(n),o=t.get(i);o?o.push(n):t.set(i,[n])}return t}function nE(e,t){let n=t.find(i=>!eE(i)&&typeof i.description=="string")??t.find(i=>typeof i.description=="string");return{const:e,type:"string",...n?{description:n.description}:{}}}function wa(e){let t=new WeakSet;function n(i){if(typeof i!="object"||i===null||t.has(i))return;if(t.add(i),Array.isArray(i)){i.forEach(n);return}let o=i,a=o.anyOf,c=Array.isArray(a)&&a.length>=2&&a.every(l=>mh(l)!==void 0&&tE(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")?rE(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])=>nE(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))n(l)}n(e)}function Ys(e){if(typeof e!="object"||e===null)return[];let t=e;return Array.isArray(t.anyOf)?t.anyOf.filter(n=>typeof n=="object"&&n!==null):Array.isArray(t.allOf)?t.allOf.flatMap(n=>{let i=n?.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 Lp(e,t,n){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(i=>{typeof i=="object"&&i!==null&&Lp(i,t,n)});return}e.$ref===t&&(e.$ref=n);for(let i of Object.values(e))typeof i=="object"&&i!==null&&Lp(i,t,n)}}function Ln(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),i=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&n.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 Xs(e,t={}){let{$schema:n="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,Lp(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 v=x.$id;if(O!==`definitions.${v}`){let{$id:I,...R}=x;p[v]=R,f[S]={$ref:`#/definitions/${v}`},m(R,`definitions.${v}`);continue}}m(w,O?`${O}.${S}`:S)}}}m(l);let u={$schema:n};return i&&(u.$id=i),Object.assign(u,l),u.$schema=n,i&&(u.$id=i),o!==void 0&&(u.title=o),a!==void 0&&(u.description=a),Object.keys(p).length>0&&(u.definitions=p),Ln(u),c?.(u),wa(u),u}function Ki(e,t,n,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 n.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))})),Ln(a,o),a.additionalProperties=!1,a}async function Gi(e,t,n={}){let{prettyPrint:i=!0}=n,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>ed(vp(),1))).writeFile(t,o,"utf-8")}function Qs(e,t){let n={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(n.$schema=r.Optional(r.String({format:"uri"}))),n.props=e.propsSchema,e.hasChildren&&t&&(n.children=r.Optional(r.Array(t))),r.Object(n,{additionalProperties:!1})}var tc=["Arial","Calibri","Cambria","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","Helvetica","Helvetica Neue","Menlo","Monaco"];function yi(e){let t=e.toLowerCase();return tc.some(n=>n.toLowerCase()===t)}var Ht=r.String({description:"Font family name. Prefer a SAFE_FONTS entry (Arial, Calibri, Cambria, Consolas, Courier New, Georgia, Segoe UI, Tahoma, Times New Roman, Trebuchet MS, Verdana, Helvetica, Helvetica Neue, Menlo, Monaco) for zero-setup rendering. For any other font, register it in props.fontRegistry[] and reference it here by family. Unregistered non-safe names render with a host fallback.",examples:["Arial","Calibri","Georgia","Inter","Roboto"]}),Ca=r.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),rc=r.Boolean({description:"Whether this source is italic. Default false."}),iE=r.Object({kind:r.Literal("safe"),family:r.String({description:"A SAFE_FONTS name \\u2014 installed with Office."})},{additionalProperties:!1,description:"Office-installed font \\u2014 no embedding"}),oE=r.Object({kind:r.Literal("google"),family:r.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:r.Optional(r.Array(Ca,{description:"Weights to fetch. Default [400, 700]."})),italics:r.Optional(r.Boolean({description:"Include italic variants. Default false."}))},{additionalProperties:!1,description:"Google Fonts \\u2014 auto-fetched and embedded"}),aE=r.Object({kind:r.Literal("file"),path:r.String({description:"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file."}),weight:r.Optional(Ca),italic:r.Optional(rc)},{additionalProperties:!1,description:"Local font file to embed"}),sE=r.Object({kind:r.Literal("url"),url:r.String({description:"HTTPS URL of a TTF or OTF file."}),weight:r.Optional(Ca),italic:r.Optional(rc)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),cE=r.Object({kind:r.Literal("variable"),url:r.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:Ca,italic:r.Optional(rc),axes:r.Optional(r.Record(r.String(),r.Number(),{description:"Additional axis pin values (e.g. `{ ital: 1, opsz: 14 }`) merged on top of the derived `wght` pin. Uncommon \\u2014 the `weight` field is usually enough."}))},{additionalProperties:!1,description:"Variable-font instancer. The fetcher pins `wght` to `weight` (plus any `axes` overrides) and emits a clean static TTF, bypassing upstream distributions that collapse multiple static weights onto the same glyph geometry."}),lE=r.Object({kind:r.Literal("data"),data:r.String({description:"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size."}),weight:r.Optional(Ca),italic:r.Optional(rc)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Np=r.Union([iE,oE,aE,lE,sE,cE],{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.\'}),pE=r.Union([r.Literal("sans"),r.Literal("serif"),r.Literal("mono"),r.Literal("display"),r.Literal("handwriting")],{description:"Broad category used for fallback selection"}),Rp=r.Object({id:r.String({description:\'Registry key. By convention, match the display family name ("Inter", "Roboto Slab").\'}),family:r.String({description:"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id."}),category:r.Optional(pE),sources:r.Array(Np,{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=r.Array(Rp,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),qi=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],kp=r.Union(qi.map(e=>r.Literal(e))),dh=["a4","letter","wide169","standard43"],bi=r.Union([r.Literal("none"),r.Literal("upper"),r.Literal("smallCaps")]),Wt=r.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."}),Fp=r.Object({rule:r.Optional(Wt),textMuted:r.Optional(Wt),onPrimary:r.Optional(Wt),surfaceInverse:r.Optional(Wt),positive:r.Optional(Wt),negative:r.Optional(Wt),chart:r.Optional(r.Array(Wt,{minItems:1,maxItems:12}))},{additionalProperties:!1}),wt=r.Object({face:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),weight:r.Optional(r.Integer({minimum:100,maximum:900})),size:r.Optional(r.Number({minimum:5,maximum:200,description:"Explicit size in points; takes precedence over the canvas scale."})),lineHeight:r.Optional(r.Number({minimum:.5,maximum:3})),tracking:r.Optional(r.Number({description:"Tracking in hundredths of an em."})),case:r.Optional(bi),color:r.Optional(Wt),spaceBefore:r.Optional(r.Number({minimum:0})),spaceAfter:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1}),jp=r.Object({eyebrow:r.Optional(wt),display:r.Optional(wt),stat:r.Optional(wt),quote:r.Optional(wt),label:r.Optional(wt),footer:r.Optional(wt),tableHeader:r.Optional(wt),tableCell:r.Optional(wt),chartLabel:r.Optional(wt),tracker:r.Optional(wt),source:r.Optional(wt)},{additionalProperties:!1}),Zs=r.Object({base:r.Number({minimum:5,maximum:200}),ratio:r.Optional(r.Number({minimum:1,maximum:2})),baselinePt:r.Optional(r.Number({exclusiveMinimum:0,maximum:24}))},{additionalProperties:!1}),Up=r.Object({roles:r.Optional(jp),scale:r.Optional(r.Object({a4:r.Optional(Zs),letter:r.Optional(Zs),wide169:r.Optional(Zs),standard43:r.Optional(Zs)},{additionalProperties:!1}))},{additionalProperties:!1}),ec=r.Object({safeAreaIn:r.Optional(r.Number({minimum:0})),gutterIn:r.Optional(r.Number({minimum:0})),columns:r.Optional(r.Integer({minimum:1,maximum:100})),rows:r.Optional(r.Integer({minimum:1,maximum:100}))},{additionalProperties:!1}),Dp=r.Object({basePt:r.Optional(r.Number({exclusiveMinimum:0})),blockGap:r.Optional(r.Object({tight:r.Optional(r.Number({minimum:0})),normal:r.Optional(r.Number({minimum:0})),loose:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),canvas:r.Optional(r.Object({a4:r.Optional(ec),letter:r.Optional(ec),wide169:r.Optional(ec),standard43:r.Optional(ec)},{additionalProperties:!1}))},{additionalProperties:!1}),Nn=r.Object({type:r.Optional(kp),color:r.Optional(Wt),fill:r.Optional(Wt),rule:r.Optional(r.Object({weightPt:r.Optional(r.Number({minimum:0})),color:r.Optional(Wt)},{additionalProperties:!1})),padPt:r.Optional(r.Number({minimum:0})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")]))},{additionalProperties:!1}),_p=r.Object({runningHead:r.Optional(Nn),tracker:r.Optional(Nn),actionTitle:r.Optional(Nn),keyTakeaways:r.Optional(Nn),sourceLine:r.Optional(Nn),confidentialFooter:r.Optional(Nn),logoSlot:r.Optional(Nn),cover:r.Optional(Nn)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),Mp=r.Object({kind:r.Union([r.Literal("none"),r.Literal("rule"),r.Literal("corner"),r.Literal("band")]),color:r.Optional(Wt),weightPt:r.Optional(r.Number({minimum:0})),placement:r.Optional(r.Union([r.Literal("top"),r.Literal("bottom"),r.Literal("left"),r.Literal("right"),r.Literal("topLeft"),r.Literal("topRight"),r.Literal("bottomLeft"),r.Literal("bottomRight")]))},{additionalProperties:!1,description:"At most one motif. Rendering consumers land in #361."}),Rn={palette:r.Optional(Fp),typography:r.Optional(Up),spacing:r.Optional(Dp),chrome:r.Optional(_p),motif:r.Optional(Mp)},fh=r.Object(Rn,{additionalProperties:!1});function hh(e,t){if(e==="docx")return t==="LETTER"?"letter":"a4";let n=typeof t=="object"?t.width/t.height:4/3;return Math.abs(n-16/9)<Math.abs(n-4/3)?"wide169":"standard43"}var Bp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function gh(e,t){if(t===0)return e.base;let n=e.baselinePt??4,i=e.base*(e.ratio??1.25)**t;return Math.max(5,Math.min(200,Math.round(i/n)*n))}var uh={from:-2,to:5};function yh(e){let t=new Set;for(let n=uh.from;n<=uh.to;n+=1)t.add(gh(e,n));return[...t].sort((n,i)=>n-i)}function mE(e){let t={};for(let[n,i]of Object.entries(e??{}))typeof i=="string"&&(t[n]=i);return t}function bh(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function Oh(e,t,n){let i=e.typography?.scale?.[t],o={};for(let a of qi){let s=e.typography?.roles?.[a];s&&(o[a]={...s,size:s.size??(i?gh(i,Bp[a]):n)})}return o}function Vp(e,t){return{...e,...mE(t)}}function Kp(e,t){let n=new Set,i=e;for(;i!==void 0&&!n.has(i);)if(!i.startsWith("#")&&Object.hasOwn(t,i))n.add(i),i=t[i];else return/^#?[0-9a-f]{6}$/i.test(i)?i.replace(/^#/,""):void 0}function xh(e,t){let n=Vp(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&&!Kp(a,n))throw new Error(`Unresolvable theme color at ${o}: "${a}" (unknown token or cycle)`)}function nc(e){return/^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(e)}var uE=[{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 s6=uE.map(e=>e.id);var $a=200,va=36,La=600;function dE(e){return typeof e!="number"||!Number.isFinite(e)?$a:Math.min(La,Math.max(va,Math.round(e)))}var fE=32,hE=8*1024*1024,gE=32,vh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),Lh=new Set(["heading","body","mono","light"]),Nh=new Set(["fontRegistry"]);function Qp(e,t,n){if(e!=null){if(typeof e=="string"){if(n&&(vh.has(n)||Lh.has(n))){let i=e.trim();i.length>0&&t.add(i)}return}if(Array.isArray(e)){for(let i of e)Qp(i,t,n);return}if(typeof e=="object"){let i=e.fonts;if(n==="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))Nh.has(o)||Qp(a,t,o)}}}function Hi(e){let t=new Set;return Qp(e,t),t}var yE=Hi,bE=Hi;function OE(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 Rh(e,t){if(!e||typeof e!="object")return[];let n=e[t];return Array.isArray(n)?n.filter(OE):[]}function xE(e){return!e||typeof e!="object"?[]:Rh(e.props,"fontRegistry")}function kh(e){return Rh(e,"fontRegistry")}function SE(...e){let t=[];for(let n of e)for(let i of n??[]){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 IE(e){let t=new Set;for(let n of e??[])t.add(n.family.toLowerCase()),t.add(n.id.toLowerCase());return t}function wE(e){let t=IE(e.registeredEntries),n=[],i=[],o=[];for(let a of e.referencedNames){if(yi(a)||t.has(a.toLowerCase())){n.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: ${tc.join(", ")}.`})}return{resolved:n,unresolved:i,warnings:o}}var Fh={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function CE(e,t,n){if(t==null)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===400)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===700)return{family:e,bold:!0,italic:n,nonCanonicalWeight:!1};let i=Fh[t];if(!i)return{family:e,bold:t>=600,italic:n,nonCanonicalWeight:!0};let o=n?` ${i} Italic`:` ${i}`;return{family:`${e}${o}`,bold:!1,italic:!1,nonCanonicalWeight:!1}}var ic=5*1024*1024;function PE(e){let t=e.data.trim(),n;if(t.startsWith("data:")){let s=t.indexOf(",");if(s<0)throw new Error("Invalid data URL: no payload separator");if(!t.slice(5,s).includes(";base64"))throw new Error("Data URL must be base64-encoded");n=t.slice(s+1)}else n=t;if(Math.floor(n.length*3/4)>ic)throw new Error(`Font data payload exceeds ${ic} byte limit`);let o=Buffer.from(n,"base64");if(o.length===0)throw new Error("Decoded font buffer is empty");if(o.length>ic)throw new Error(`Font data payload exceeds ${ic} byte limit`);let a=Hr(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 TE="Mozilla/4.0";async function Sh(e,t){let n=new AbortController,i=setTimeout(()=>n.abort(),t.timeoutMs??5e3);try{return await(t.fetcher??fetch)(e,{headers:t.headers,signal:n.signal})}finally{clearTimeout(i)}}function AE(e,t,n){let i=encodeURIComponent(e).replace(/%20/g,"+"),o=[...t].sort((s,c)=>s-c);if(n){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 EE(e){let t=[],n=/@font-face\\s*\\{([^}]*)\\}/g,i;for(;(i=n.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 Ih(e,t,n){return`google|${e}|${t}|${n?"i":"r"}`}async function jh(e){let t=e.weights?.length?e.weights:[400,700],n=e.italics??!1,i=[],o=[],a=[];for(let m of t)a.push({weight:m,italic:!1}),n&&a.push({weight:m,italic:!0});let s=[];for(let m of a){let u=Ih(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){o.push({data:f,weight:m.weight,italic:m.italic,format:Hr(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:Hr(O)});continue}s.push(m)}if(s.length===0)return{sources:o,warnings:i};let c=s.some(m=>m.italic),l=AE(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await Sh(l,{headers:{"User-Agent":TE},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=EE(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 Sh(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=Ih(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:Hr(S)})}catch(f){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:o,warnings:i}}function $E(e,t,n){return`url|${e}|${t}|${n?"i":"r"}`}async function vE(e){if(!Gs(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=$E(e.url,e.weight,e.italic),n=e.memoryCache?.get(t);if(n)return{source:{data:n,weight:e.weight,italic:e.italic,format:Hr(n)},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:Hr(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(!Gs(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=Hr(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 wh=12,Ch=16;function LE(e,t){if(e.length<wh)return null;let n=e.readUInt32BE(0);if(n!==65536&&n!==1330926671)return null;let i=e.readUInt16BE(4);for(let o=0;o<i;o++){let a=wh+o*Ch;if(a+Ch>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 NE(e){let t=LE(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function RE(e,t,n,i){let o=[],a=NE(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=Ip(e);s.length>0&&!s.includes(i.trim())&&o.push({code:"FAMILY_MISMATCH",message:`Font "${i}" weight ${t}${n?" italic":""}: name table declares ${s.map(u=>`"${u}"`).join(" / ")}, not "${i}". Referencing runs will not resolve this face.`});let c=Cp(t,n);if(!c)return o;let l=c.typographic,p=c.legacy,m=Ks(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}${n?" 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}${n?" italic":""}: name record (platform ${u.platformID}) nameID 2 = "${u.value}", expected "${p}".`});return o}var kE=new Set([65536,1330926671,1953658213,1954115633]),Gp=12,Ph=16;function FE(e,t,n,i){let o=`Font "${i}" weight ${t}${n?" italic":""}`,a=f=>({code:"FONT_UNREADABLE",message:`${o}: ${f} The face will not resolve; text referencing it renders in a fallback.`});if(e.length<Gp)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!kE.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=Gp+c*Ph;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=Gp+f*Ph,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 ").\'):Ks(e).length===0?a(\'its "name" table carries no readable records.\'):null}var jE=class{constructor(e={}){N(this,"store",new Map);N(this,"bytes",0);N(this,"maxBytes");this.maxBytes=e.maxBytes??20*1024*1024}get(e){let t=this.store.get(e);if(t)return this.store.delete(e),this.store.set(e,t),t}set(e,t){let n=this.store.get(e);for(n&&(this.bytes-=n.byteLength),this.store.set(e,t),this.bytes+=t.byteLength;this.bytes>this.maxBytes&&this.store.size>0;){let 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 UE(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let n=Ip(e.data);if(n.length===0||n.includes(t))return e;let i=Cp(e.weight,e.italic)?.legacy;return{...e,data:wp(e.data,t,i)}}var DE=class{constructor(e={}){N(this,"index");N(this,"cache");N(this,"opts");N(this,"memoryCache");N(this,"diskCache");N(this,"fileLoader");N(this,"variableLoader");this.opts=e.opts??{},this.index=new Map,this.cache=new Map,this.memoryCache=new jE,this.diskCache=e.diskCache,this.fileLoader=e.fileLoader,this.variableLoader=e.variableLoader;for(let t of this.opts.extraEntries??[])this.addEntry(t)}addEntry(e){this.index.set(e.family.toLowerCase(),e),this.index.set(e.id.toLowerCase(),e)}async resolveMany(e){let t=[];for(let n of e)t.push(await this.resolve(n));return t}async resolve(e){let t=e.toLowerCase(),n=this.cache.get(t);if(n)return n;let i=this.index.get(t),o;return i?o=await this.materializeEntry(i):yi(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=[],n=[];for(let i of e.sources)try{let o=await this.materializeSource(i,n);for(let a of o){let s=a.format==="ttf"||a.format==="otf",c=s?FE(a.data,a.weight,a.italic,e.family):null;if(c){n.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=UE(a,e.family);if(s)for(let p of RE(l.data,l.weight,l.italic,e.family))n.push(`[FONT_METADATA_DEFECT:${p.code}] ${p.message}`);t.push(l)}}catch(o){n.push(`Font "${e.family}" source (${i.kind}) failed: ${o.message}`)}return{family:e.family,sources:t,warnings:n}}async materializeSource(e,t){switch(e.kind){case"safe":return[];case"file":return this.fileLoader?[await this.fileLoader({path:e.path,weight:e.weight,italic:e.italic,baseDir:this.opts.baseDir})]:(t.push(`kind:"file" source for "${e.path}" requires a fileLoader (Node-only); skipping.`),[]);case"data":return[PE({data:e.data,weight:e.weight,italic:e.italic})];case"google":{let n=this.opts.googleFonts;if(n?.enabled===!1)return t.push(`Google Fonts fetch disabled \\u2014 skipping "${e.family}".`),[];let{sources:i,warnings:o}=await jh({family:e.family,weights:e.weights??[400,700],italics:e.italics??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return t.push(...o),i}case"url":{let n=this.opts.googleFonts,{source:i,warnings:o}=await vE({url:e.url,weight:e.weight??400,italic:e.italic??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.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 n=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:n?.fetchTimeoutMs});return o&&t.push(...o),i?[i]:[]}default:throw new Error(`Unknown font source kind: ${e.kind}`)}}},Uh=[{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}],_E="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",ME="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function BE(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(i=>({kind:"variable",url:_E,weight:i,italic:!1})),n=e.map(i=>({kind:"variable",url:ME,weight:i,italic:!0}));return[...t,...n]}var Dh={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:BE()}};function VE(e){return Dh[e.toLowerCase()]}function Zp(e,t){let n=new Map,i=cc(e,t,n),o=[];for(let[a,s]of n)o.push({from:a,to:s});return{doc:i,substitutions:o}}function cc(e,t,n,i){if(e==null)return e;if(typeof e=="string")return i&&(vh.has(i)||Lh.has(i))?qp(e,t,n):e;if(Array.isArray(e))return e.map(o=>cc(o,t,n,i));if(typeof e=="object"){let o={};for(let[a,s]of Object.entries(e)){if(Nh.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]=qp(p,t,n);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:qp(m,t,n)}:cc(p,t,n,l)}else c[l]=p;o[a]=c;continue}o[a]=cc(s,t,n,a)}return o}return e}function qp(e,t,n){let i=e.trim();if(i.length===0||yi(i))return e;let o=i.toLowerCase();for(let[a,s]of Object.entries(t))if(a.toLowerCase()===o)return n.set(i,s),s;return e}var KE={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"},GE={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function _h(e){let t=e.trim();for(let[i,o]of Object.entries(KE))if(i.toLowerCase()===t.toLowerCase())return o;let n=Uh.find(i=>i.family.toLowerCase()===t.toLowerCase());if(n){let i=GE[n.category];if(i)return i}return"Calibri"}function Mh(e){let t={};for(let n of e){let i=n.trim();i.length!==0&&(yi(i)||t[i]||(t[i]=_h(i)))}return t}function qE(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...Hi(e.doc),...Hi(e.theme)])].filter(f=>!yi(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 n=new Set([...Hi(e.doc),...Hi(e.theme)]),o={...Mh(n),...e.fonts?.substitution??{}},a=Zp(e.doc,o),s=Zp(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 WE=["primary","secondary","accent","accent4","accent5","accent6"],Bh=.75;function HE(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?Bh:t/e}var zE=new Set(["georgia","times new roman","cambria"]),JE=new Set(["consolas","courier new","menlo","monaco"]);function Vh(e,t){let n=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&zE.has(e.toLowerCase())?"serif":t===void 0&&JE.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${n}`}function YE(e){let t=new Map(kh(e).map(n=>[n.family.toLowerCase(),n.category]));return n=>Vh(n,t.get(n.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 n=Pa(e)?{...e}:{};for(let[i,o]of Object.entries(t)){if(o===void 0)continue;let a=n[i];a===void 0?n[i]=Pa(o)?sr(void 0,o):o:Pa(a)&&Pa(o)&&(n[i]=sr(a,o))}return n}function Th(e,t){return Array.isArray(e)?e.map(n=>sr(n,t)):sr(e,t)}function Ah(e){return e===void 0?void 0:String(e)}function XE(e,t,n){let i=m=>`${Math.round(m/n*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:Ah(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:Ah(t.titleWeight),color:t.textColor}}),subtitle:sr(e.subtitle,{style:s}),caption:sr(e.caption,{style:c}),xAxis:Th(e.xAxis,p),yAxis:Th(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 QE={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 Kh(e,t){let n=new Set(t.map(i=>i.toLowerCase()));return e.filter(i=>n.has(i.family.toLowerCase())).map(i=>{let{mime:o,format:a}=QE[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 ZE(e,t,n){let i=Kh(t,n);if(!i)return e;let o=e.resources?.css;return{...e,resources:{...e.resources,css:o?`${i}\n${o}`:i}}}var Gh=["actionTitle","takeaway","source","tracker","footer"],qh=r.Recursive(e=>r.Object({type:r.Union(["string","number","integer","boolean","object","array","component"].map(t=>r.Literal(t)),{description:"Content type accepted by this slot. Use component for a document component or registered plugin."}),description:r.Optional(r.String({description:"Explain this slot\\u2019s content and purpose to authors."})),required:r.Optional(r.Boolean({description:"Require a value when no default is provided. Defaults to false."})),default:r.Optional(r.Unknown({description:"Value used when the caller omits this slot. Must satisfy the slot\\u2019s type and constraints."})),enum:r.Optional(r.Array(r.Union([r.String(),r.Number(),r.Boolean()]),{minItems:1,description:"Allowed scalar values for this slot."})),minItems:r.Optional(r.Integer({minimum:0,description:"Minimum number of array entries, inclusive."})),maxItems:r.Optional(r.Integer({minimum:0,description:"Maximum number of array entries, inclusive."})),minLength:r.Optional(r.Integer({minimum:0,description:"Minimum string length in characters, inclusive."})),maxLength:r.Optional(r.Integer({minimum:0,description:"Maximum string length in characters, inclusive."})),minimum:r.Optional(r.Number({description:"Minimum numeric value, inclusive."})),maximum:r.Optional(r.Number({description:"Maximum numeric value, inclusive."})),maxWords:r.Optional(r.Integer({minimum:1,description:"Maximum whitespace-separated word count. Exceeding it fails validation."})),oneLine:r.Optional(r.Boolean({description:"Reject newline characters in string values. Does not prevent visual line wrapping."})),items:r.Optional({...e,description:"Slot type and constraints for each array entry."}),properties:r.Optional(r.Record(r.String(),e,{description:"Named child slots accepted by an object slot. Undeclared properties are rejected."})),role:r.Optional(r.Union(Gh.map(t=>r.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"}),Wh=r.Unsafe(r.Object({description:r.Optional(r.String({description:"Describe what this reusable block renders and when to use it."})),slots:r.Record(r.String(),qh,{description:"Named inputs and their types, defaults and constraints. Use an empty object for a block with no inputs."}),body:r.Array(r.Unknown(),{description:"Components and binding directives expanded in order when this block is invoked."}),section:r.Optional(r.Object({tracker:r.Optional(r.Unknown({description:"Section tracker value or binding, available to headers and footers through $context at /section/tracker."})),header:r.Optional(r.Array(r.Unknown(),{description:"Header component templates. Explicit header settings on the section take precedence."})),footer:r.Optional(r.Array(r.Unknown(),{description:"Footer component templates. Explicit footer settings on the section take precedence."})),pageBreak:r.Optional(r.Boolean({description:"Start the containing section on a new page. An explicit section pageBreak setting takes precedence."})),scope:r.Optional(r.Union([r.Literal("section"),r.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:r.Optional(r.Object({background:r.Optional(r.Unknown({description:"Slide background (color, gradient or image) or a binding. A background the slide states itself takes precedence."})),grid:r.Optional(r.Unknown({description:"Grid configuration merged over the presentation grid when resolving grid placements in this block\\u2019s body."})),notes:r.Optional(r.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})),Yr=r.Record(r.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),Wh,{description:"Document-local JSON block definitions. Names are not built into the engine."}),Un=r.Object({ref:r.String({minLength:1,description:"Name in this document\\u2019s props.blocks."}),slots:r.Optional(r.Record(r.String(),r.Unknown(),{description:"Input values keyed by the slot names declared in the referenced block definition."}))},{additionalProperties:!1});function pc(e){let{oneLine:t,properties:n,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:pc(i)},...n&&{properties:Object.fromEntries(Object.entries(n).map(([s,c])=>[s,pc(c)])),required:Object.entries(n).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var tm={$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"}},rm=["$item","$slot","$context"],Ea=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 jn(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let n=e;for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(!H(n)&&!Array.isArray(n)||!Ct(n,o))return;n=n[o]}return n}function Fn(e,t){let n;for(let i of Object.keys(e))(t===i||t.startsWith(`${i}/`))&&(n===void 0||i.length>n.length)&&(n=i);return n===void 0?t:`${e[n]}${t.slice(n.length)}`}var nm=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],im=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,Wp=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),kn=(e,t,n)=>{throw new Ea([{path:e,code:t,message:n}])};function dc(e,t,n,i){let o=t===void 0&&e.default!==void 0?structuredClone(e.default):t;if(o===void 0){e.required&&i.push({path:n,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:n,code:"block_slot_type",message:`Expected ${e.type}.`}),o;let s=l=>i.push({path:n,code:"block_slot_budget",message:l}),c=typeof o=="string"&&nc(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&&im(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)=>dc(e.items,l,`${n}/${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 nm)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,n)}return e.type==="object"&&H(o)&&e.properties?om(e.properties,o,n,i):o}function om(e,t,n,i){let o={};for(let a of Object.keys(t))Ct(e,a)||i.push({path:`${n}/${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=dc(s,Ct(t,a)?t[a]:void 0,`${n}/${xe(a)}`,i);c!==void 0&&Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}var e$=Object.fromEntries(Object.entries(tm).map(([e,t])=>[e,t.keys]));function t$(e,t){let n={type:"object",properties:e};for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(n?.type==="object"){if(!n.properties)return{type:"object"};n=Ct(n.properties,o)?n.properties[o]:void 0}else if(n?.type==="array"&&/^(0|[1-9]\\d*)$/.test(o))n=n.items??{type:"object"};else return n?.type==="component"?{type:"object"}:void 0}return n}var em=["$if","$each","$count"],Eh=e=>typeof e=="string"&&(e===""||e.startsWith("/"));function Hh(e,t){if(Eh(e))return{root:em.includes(t)?"$slot":t,pointer:e};if(!em.includes(t)||!H(e))return;let n=Object.keys(e),i=rm.find(o=>o===n[0]);if(!(n.length!==1||!i||!Eh(e[i])))return{root:i,pointer:e[i]}}function Ta(e,t,n,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)=>Ta(c,`${t}/${l}`,n,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=e$[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=Hh(e[c],c);if(!p)i.push({path:t,code:"block_invalid_binding",message:em.includes(c)?`${c} takes a slot pointer such as /items, or one reference: ${rm.map(m=>`{ "${m}": ... }`).join(", ")}.`:"Bindings use JSON Pointers, e.g. /title."});else if(p.root==="$slot"){let m=t$(n,p.pointer);m?["$each","$count"].includes(c)&&m.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"||Ta(l,`${t}/${xe(c)}`,n,i,o||Ct(e,"$each"),a+1)}function Xr(e){return(H(e)&&H(e.props)?e.props.blocks:void 0)??{}}function fc(e,t,n=[]){if(!P.Check(Yr,e))return[...P.Errors(Yr,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)}`;n.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&&dc(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)}`);Ta(a.body,`${s}/body`,a.slots,i),a.section&&Ta(a.section,`${s}/section`,a.slots,i),a.slide&&Ta(a.slide,`${s}/slide`,a.slots,i)}return i}function zi(e,t,n,i=[]){let o=fc(t,n,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))&&om(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 r$=class{constructor(e,t){N(this,"sourceMap",{});N(this,"blocks",[]);N(this,"blockSources",new Set);N(this,"nodes",0);this.definitions=e,this.options=t;let n=fc(e,t.format,t.reservedNames);if(n.length)throw new Ea(n)}guard(e,t){(t>64||++this.nodes>5e4)&&kn(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}operand(e,t,n){let{root:i,pointer:o}=Hh(e,t),{value:a,source:s}=this.reference(i,o,n);return{value:a,source:s,element:c=>this.reference(i,`${o}/${c}`,n).source}}reference(e,t,n){if(e==="$item")return{value:jn(n.item,t),source:`${n.itemSource??n.source}${t}`};if(e==="$context"){let i=Fn(n.contextSources??{},t);return{value:jn(n.context,t),source:i===t?n.source:i}}return e==="$theme"?{value:jn(this.options.theme,t),source:n.source}:{value:jn(n.slots,t),source:n.slotSources?Fn(n.slotSources,t):`${n.source}/props/slots${t}`}}evaluate(e,t,n,i,o=0){if(this.guard(t.source,o),this.sourceMap[n]=t.source,Array.isArray(e)){let s=[];return e.forEach((c,l)=>{let p=this.evaluate(c,t,`${n}/${s.length}`,`${i}/${l}`,o+1);if(p!==void 0)if(H(c)&&("$if"in c||"$each"in c)&&Array.isArray(p)){let m=`${n}/${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[`${n}/${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(u=>u in e),c=e[s],{value:l,source:p}=this.reference(s,c,t);this.sourceMap[n]=p;let m=l!==void 0?structuredClone(l):void 0;if(m===void 0&&Ct(e,"default")&&(m=this.evaluate(e.default,t,n,`${i}/default`,o+1)),m===void 0&&s==="$theme")return kn(i,"block_unknown_theme_binding",`Theme value \'${c}\' is missing; declare a fallback or use an existing token.`);if((s==="$slot"||s==="$item")&&Ct(e,"props")&&H(m)&&typeof m.name=="string"){let u=this.sourceMap[n],f=this.evaluate(e.props,t,`${n}/props`,`${i}/props`,o+1),O=H(m.props)?m.props:{};for(let S of Object.keys(O)){let w=`${n}/props/${xe(S)}`;for(let x of Object.keys(this.sourceMap))(x===w||x.startsWith(`${w}/`))&&delete this.sourceMap[x];this.sourceMap[w]=`${u}/props/${xe(S)}`}m={...m,props:{...H(f)?f:{},...O}}}return m}if("$if"in e){let s=this.operand(e.$if,"$if",t),c=Wp(s.value)?e.then:e.else,l=this.evaluate(c,t,n,i,o+1);return(!H(c)||!Object.keys(c).some(m=>m.startsWith("$")))&&this.sourceMap[n]===t.source&&(this.sourceMap[n]=s.source),l}if("$count"in e){let s=this.operand(e.$count,"$count",t);return Array.isArray(s.value)?s.value.length:kn(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 kn(s.source,"block_slot_type","$each requires an array.");let l=[];return c.forEach((p,m)=>{let u=`${n}/${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,`${n}/${p}`,`${i}/$join/${p}`,o+1)),c=s.findIndex(Wp);return c>=0&&(this.sourceMap[n]=this.sourceMap[`${n}/${c}`]),(e.keepEmpty===!0?s:s.filter(Wp)).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):kn(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,`${n}/${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="",n=0){if(this.guard(t,n),Array.isArray(e))return e.map((o,a)=>this.expand(o,`${t}/${a}`,n+1));if(!H(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!H(e.props)||typeof e.props.ref!="string")return kn(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 kn(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 kn(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=Fn(this.sourceMap,t),c=`${t}/props/slots`,l=om(o.slots,e.props.slots??{},c,a);if(a.length)throw new Ea(a.map(f=>({...f,path:Fn(this.sourceMap,f.path)})));let p=Object.fromEntries([["",Fn(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`,n+1);return{name:"group",...e.id!==void 0&&{id:e.id},children:this.expand(u,`${t}/children`,n+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)}`,n+1),enumerable:!0,configurable:!0,writable:!0});return i}};function am(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,n])=>[t,pc(n)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function n$(e){let t=Xr(e);if(!P.Check(Yr,t))return{definitions:[],invocations:[],invalidDefinitions:!0};let n=[],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"&&n.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:am(a)})),invocations:n,invalidDefinitions:!1}}function zh(e,t,n){let i=Xr(e);for(let o of t){let a=jn(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(n(s,p,m,u,f),H(m)&&p.properties)for(let[O,S]of Object.entries(p.properties))l(S,jn(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=jn(a.props.slots,`/${xe(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${o}/props/slots/${xe(p)}`,p)}}}function i$(e,t){let n=[];return zh(e,t,(i,o,a,s,c)=>{typeof a=="string"&&o.maxWords!==void 0&&!nc(a)&&n.push({block:i,slot:c,path:s,words:im(a),maxWords:o.maxWords})}),n}function o$(e,t){let n=[];return zh(e,t,(i,o,a,s,c)=>{o.role&&n.push({block:i,invocation:s.replace(/\\/props\\/slots\\/.*$/,""),slot:c,role:o.role,path:s,value:a})}),n}var Hp=["null","boolean","number","string","array","object"],Wi=(e,t)=>new Set([...e].filter(n=>t.has(n))),a$=e=>new Set(e.flatMap(t=>[...t])),$h=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function Aa(e,t,n=new Set){if(e===!1)return new Set;if(e===!0||n.has(e))return new Set(Hp);let i=e.not;if(i===!0||i&&typeof i=="object"&&Object.keys(i).length===0)return new Set;let o=new Set(n).add(e),a=new Set(Hp);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=Wi(a,new Set(Hp.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=Wi(a,new Set([$h(e.const)]))),Array.isArray(e.enum)&&(a=Wi(a,new Set(e.enum.map($h)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=Wi(a,Aa(s,t,o)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=Wi(a,a$(e[s].map(c=>Aa(c,t,o)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=Wi(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 lc(e,t,n=new Set){if(e===!1)return!1;if(e===!0||n.has(e))return{};let i=new Set(n).add(e),o=[];if(typeof e.$ref=="string"){let a=t(e.$ref);a!==void 0&&o.push(lc(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=>lc(s,t,i))});return Array.isArray(e.allOf)&&o.push(...e.allOf.map(a=>lc(a,t,i))),o.length===0?{}:o.length===1?o[0]:{allOf:o}}var Oi=(e,t)=>({type:"object",properties:e,required:t,additionalProperties:!1}),zp=e=>({type:"string",pattern:"^(|/.*)$",description:e}),s$=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. 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."}),c$=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."},oc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),Jp=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},l$=e=>({type:"object",required:[e]}),ac=Object.keys(tm);function Na(e,t,n=[],i="docx"){let o=`BlockTemplate_${t}`,a=s$(i),s=c$(i),c=T=>({description:T,anyOf:[zp(T),...rm.map(Z=>Oi({[Z]:zp(a[Z])},[Z]))]}),l=`${o}_Body`,p=T=>({$ref:`#/definitions/${T}`});if(e[l])return p(l);let m={...e},u=m[t];m[t]={...u,anyOf:(u.anyOf??[u]).filter(T=>!n.includes(T.properties?.name?.const))};let f=T=>{if(!T.startsWith("#/definitions/"))return;let Z=m;for(let je of T.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),v=new Map,I=T=>{let Z=JSON.stringify(T),je=v.get(Z);return je||(je=`${o}_Shared${w++}`,v.set(Z,je),e[je]=T),p(je)},R=Object.fromEntries(ac.map(T=>[T,I(l$(T))])),G=I({anyOf:Object.values(R)}),qe=[...new Set(["",...ac.flatMap(T=>Array.from({length:T.length-1},(Z,je)=>T.slice(0,je+1)))])],We=I({type:"object",propertyNames:{pattern:`^(?:${qe.map(T=>T.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})$`}});function He(T){if(typeof T=="boolean")return T;let Z=JSON.stringify(T),je=S.get(Z);if(je)return{...p(je),...Jp(T)};let Ue=`${o}_Literal${w++}`;S.set(Z,Ue),e[Ue]={};let ht={...T};if(typeof T.$ref=="string"){let me=f(T.$ref);if(me!==void 0){let we=He(me);typeof we=="object"?ht.$ref=we.$ref:(delete ht.$ref,we||(ht.not={}))}}T.properties&&(ht.properties=Object.fromEntries(Object.entries(T.properties).map(([me,we])=>[me,["name","version"].includes(me)&&typeof we=="object"&&typeof we.const=="string"?we:te(we)]))),T.patternProperties&&(ht.patternProperties=Object.fromEntries(Object.entries(T.patternProperties).map(([me,we])=>[me,te(we)]))),T.items!==void 0&&(ht.items=Array.isArray(T.items)?T.items.map(me=>te(me,!0)):te(T.items,!0));for(let me of["additionalProperties","additionalItems"])typeof T[me]=="object"&&(ht[me]=te(T[me],me==="additionalItems"));for(let me of["anyOf","oneOf","allOf"])Array.isArray(T[me])&&(ht[me]=T[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"])T[me]!==void 0&&(ht[me]=He(T[me]));return e[Ue]=ht,{...p(Ue),...Jp(T)}}function te(T,Z=!1){if(T===!1)return!1;let je=Jp(T),Ue=typeof T=="object"?{...T}:T;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),Xu=Aa(Ue,f);if(Xu.size===0)return e[we]={allOf:[He(Ue)]},zt;let Qu=()=>Z?te(Ue):zt,Zu=()=>Z?{anyOf:[zt,{type:"array",items:zt}]}:zt,Nb=()=>Z?Qu():te(lc(Ue,f)),mr={};for(let be of ac){let qn=tm[be].result;if(!(qn!=="dynamic"&&!Xu.has(qn)&&!(Z&&qn==="array")))switch(be){case"$slot":case"$item":case"$theme":case"$context":mr[be]=Oi({[be]:zp(a[be]),default:oc(Qu(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...be==="$slot"||be==="$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."}}:{}},[be]);break;case"$if":mr[be]=Oi({$if:c(\'Test a slot by JSON Pointer, e.g. /subtitle, or a reference such as { "$item": "/numeric" }. Missing, null, false, empty text and empty arrays select else; zero selects then.\'),then:oc(Zu(),"Value or components to emit when the slot tested by $if is present."),else:oc(Zu(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":mr[be]=Oi({$each:c(\'Repeat template for each entry in an array slot, e.g. /items, or in an array of the current entry, { "$item": "/cells" }. Read the current entry with $item.\'),template:oc(Nb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":mr[be]=Oi({$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[be]=Oi({$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[be]=Oi({$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 ll=be;throw new Error(`Missing authoring schema for directive ${ll}`)}}}return e[we]={allOf:[{if:G,then:{allOf:ac.map(be=>({if:R[be],then:mr[be]?I({...mr[be],properties:Object.fromEntries(Object.entries(mr[be].properties).map(([qn,ll])=>[qn,I(ll)]))}):!1}))},else:He(Ue)},{if:We,then:{properties:Object.fromEntries(Object.entries(mr).map(([be,qn])=>[be,I(qn.properties[be])]))}}]},{...zt,...je}}return e[l]=te(x,!0),p(l)}async function p$(e,t,n){let i=n.preserve??new Set,o=0,a=async(s,c,l)=>{if(l>64||++o>1e5)throw new Ea([{path:Fn(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"&&n.plugins.has(s.name)){let u=Fn(e.sourceMap,c),f=await n.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 m$="^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$",sm=e=>JSON.parse(JSON.stringify(e));function Yp(e,t,n){if(e!==void 0&&t!==void 0)return e===t?`${e} ${n}`:`${e}\\u2013${t} ${n}`;if(e!==void 0)return`at least ${e} ${n}`;if(t!==void 0)return`at most ${t} ${n}`}function Jh(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 n=Yp(e.minLength,e.maxLength,"characters");n&&t.push(n),e.maxWords!==void 0&&t.push(`at most ${e.maxWords} words`),e.oneLine&&t.push("one line");let i=Yp(e.minimum,e.maximum,"");i&&t.push(i.trim());let o=Yp(e.minItems,e.maxItems,"entries");return o&&t.push(o),e.role&&t.push(`Role: ${e.role}`),t}function Yh(e){return[e.description,Jh(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function mc(e,t){let n;if(e.type==="component")n=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...nm]},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(n={...c},c.minLength!==void 0||c.maxLength!==void 0||c.enum!==void 0){let{minLength:l,maxLength:p,enum:m,...u}=c;n={...u,anyOf:[{...l!==void 0&&{minLength:l},...p!==void 0&&{maxLength:p},...m!==void 0&&{enum:m}},{type:"string",pattern:m$}]}}o&&(n.pattern="^[^\\\\r\\\\n]*$"),s&&(n.items=mc(s,t)),a&&(n.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,mc(p,t)])),n.required=Object.entries(a).filter(([,l])=>l.required&&l.default===void 0).map(([l])=>l),n.additionalProperties=!1)}e.description&&(n.description=e.description);let i=Yh(e);return i&&(n.markdownDescription=i),n}function Xh(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(([n,i])=>[n,mc(i,t)])),required:Object.entries(e.slots).filter(([,n])=>n.required&&n.default===void 0).map(([n])=>n)}}function Qh(e,t){let n=Object.keys(e),i={type:"object",additionalProperties:!1,required:["ref"],properties:{ref:{type:"string",minLength:1,description:"Name in this document\\u2019s props.blocks.",...n.length&&{anyOf:n.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 n.length&&(i.allOf=n.map(o=>({if:{properties:{ref:{const:o}},required:["ref"]},then:{properties:{slots:Xh(e[o],t)}}}))),i}function u$(e,t,n){for(let i of n){let o=e.definitions?.[i.name];if(!o)continue;let a=Qh(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=sm(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(o)}}function uc(e,t){if(Array.isArray(e)){e.forEach(n=>uc(n,t));return}if(H(e)){e.name==="block"&&H(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let n of Object.values(e))uc(n,t)}}function cm(e,t){let n=[],i=new Set([t]),o=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&uc([s.body,s.section,s.slide],c=>{i.has(c)||(i.add(c),Object.prototype.hasOwnProperty.call(e,c)&&(o(c),n.push(c)))})};return o(t),n}function Zh(e,t,n){if(e.default!==void 0)return sm(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)=>Zh(o,`${t} ${s+1}`,n))}case"object":return eg(e.properties??{},n);case"component":return n==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function eg(e,t){return Object.fromEntries(Object.entries(e).filter(([,n])=>n.required&&n.default===void 0||n.role).map(([n,i])=>[n,Zh(i,n,t)]))}function tg(e,t,n){let i;if(H(n.document)){let o=Object.fromEntries(Object.entries(n.document).filter(([a])=>a!=="props"));uc(o,(a,s)=>{if(i||a!==e)return;let c=s.props;i={name:"block",props:{ref:a,...H(c.slots)&&{slots:sm(c.slots)}}}})}return i??{name:"block",props:{ref:e,slots:eg(t.slots,n.format)}}}function d$(e,t){let n=Xr(e);return!P.Check(Yr,n)||fc(n,t.format).length>0?[]:Object.entries(n).map(([i,o])=>({name:i,format:t.format,template:t.template,definitionPointer:`/props/blocks/${xe(i)}`,description:o.description??"",definition:o,slotsSchema:am(o),example:tg(i,o,{document:e,format:t.format}),dependencies:cm(n,i)}))}var rg=["docx","pptx"],Xp=r.String({pattern:"^[a-z][a-z0-9]*(-[a-z0-9]+)*$",description:"Kebab-case identifier."}),ng=r.Object({min:r.Integer({minimum:1}),max:r.Integer({minimum:1})},{additionalProperties:!1,description:"Expected length once filled: pages for a document, slides for a deck."}),ig=r.Object({description:r.String({minLength:1}),whenToUse:r.String({minLength:1}),pages:ng,metadata:r.Optional(r.Record(r.String(),r.String(),{description:"Document metadata the scaffold writes; a value may be a scaffold marker."})),children:r.Array(r.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}),lm=r.Object({id:Xp,format:r.Union(rg.map(e=>r.Literal(e))),title:r.String({minLength:1}),description:r.String({minLength:1}),whenToUse:r.String({minLength:1}),theme:r.String({minLength:1,description:"Recommended theme. Any theme renders the scaffold; this one is the archetype\\u2019s house look."}),profile:Xp,definitions:r.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:r.Union([r.Literal("none"),r.Literal("sections")],{description:"Whether section openers carry numbers the reader cites (01, 02, \\u2026)."}),toc:r.Boolean({description:"Whether the scaffold places a table of contents."}),variants:r.Record(Xp,ig,{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 og(e){let t=[...P.Errors(lm,e)].map(n=>({path:n.path,message:n.message}));if(t.length>0)return t;for(let[n,i]of Object.entries(e.variants))i.pages.min>i.pages.max&&t.push({path:`/variants/${n}/pages`,message:`min (${i.pages.min}) exceeds max (${i.pages.max})`});return t}function f$(e){return P.Check(lm,e)}function h$(e,t){let n={};for(let i of t){let o=og(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(n[a.id])throw new Error(`Two bundled blueprints share the id "${a.id}"; the later one would silently replace the earlier.`);n[a.id]=a}return n}var g$=/^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;function ag(e,t,n){if(e.format!==t)throw new Error(`Blueprint ${e.id} is a ${e.format} blueprint; this instantiates ${t.toUpperCase()} ones.`);let i=n??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 y$(e,t,n){let{id:i,variant:o}=ag(e,n.format,t.variant),a=structuredClone(o.children),s=sg(a,t.definitions,e),c={...o.metadata,...t.metadata},l={theme:t.theme??e.theme,qualityProfile:e.profile,...n.props,...Object.keys(s).length>0&&{blocks:s},...n.metadataPointer==="/props"?c:{metadata:c}},p={name:n.format,props:l,children:a};return{document:p,fillMap:b$(p,s,n),variant:i}}function sg(e,t,n){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 ${n.id} invokes "${s}", which ${n.definitions} does not define.`);for(let c of[...cm(t,s),s])a[c]??(a[c]=structuredClone(t[c]))}return a}function b$(e,t,n){let i=`${n.metadataPointer}/`;return n.markers(e).map(o=>{let a=o.text.match(g$)?.[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=cg(e,o.path,t);return c?{...s,kind:"slot",...c}:{...s,kind:"text"}})}function cg(e,t,n){let i=t.lastIndexOf("/props/slots/");if(i<0)return;let a=pg(e,t.slice(0,i))?.props?.ref;if(typeof a!="string"||!n[a])return;let s=t.slice(i+13).split("/").map(lg),c=n[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 lg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function pg(e,t){if(t==="")return e;let n=e;for(let i of t.split("/").slice(1).map(lg))if(Array.isArray(n))n=n[Number(i)];else if(n&&typeof n=="object")n=n[i];else return;return n}function sc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mg(e,t){let n={...e};return sc(e)&&sc(t)&&Object.keys(t).forEach(i=>{sc(t[i])?!(i in e)||!sc(e[i])?n[i]=t[i]:n[i]=mg(e[i],t[i]):n[i]=t[i]}),n}function O$(e,t){return mg(t,e)}function ug(e){let t;try{t=new URL(/^https?:\\/\\//i.test(e.trim())?e.trim():`http://${e.trim()}`).hostname.toLowerCase()}catch{return!1}let n=t.replace(/^\\[|\\]$/g,"").replace(/\\.$/,"");if(n==="localhost"||n.endsWith(".localhost")||n==="::1"||/^f[cd][0-9a-f]{2}:/.test(n)||/^fe[89ab][0-9a-f]:/.test(n))return!0;let i=/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/.exec(n);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(n)}var x$="W_HIGHCHARTS_REMOTE_EXPORT";function S$(e,t){if(!ug(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 mm={};rt(mm,{ComponentValidationError:()=>gi,DuplicateComponentError:()=>Vi,UnknownPreservedComponentError:()=>Ws,createComponent:()=>Bi,createVersion:()=>Mi,getValidationSummary:()=>zs,isValidationSuccess:()=>Hs,resolveComponentVersion:()=>hi,validateAgainstSchema:()=>Tp,validateCustomComponentProps:()=>vn});var wu={};rt(wu,{AlignmentSchema:()=>Zr,BASE_SCHEMA_METADATA:()=>ey,BUILT_IN_DOCX_THEME_NAMES:()=>Ha,BaseComponentPropsSchema:()=>yg,BlockInvocationPropsSchema:()=>Un,BorderSchema:()=>hg,COMPONENT_METADATA:()=>Zg,ChartPropsSchema:()=>Jm,ColumnsPropsSchema:()=>pn,CommentReplySchema:()=>Um,CommentSchema:()=>to,ComponentDefinitionSchema:()=>ft,CustomComponentDefinitionSchema:()=>Pr,DEFAULT_DOCX_RENDERER_ID:()=>Wa,DEFAULT_ERROR_CONFIG:()=>Tn,DOCX_RENDERER_IDS:()=>Cr,DividerPropsSchema:()=>Hm,ERROR_EMOJIS:()=>ui,ERROR_TEMPLATES:()=>by,EndnotesSchema:()=>_m,FootnotesSchema:()=>Dm,GenerateDocumentRequestSchema:()=>jy,GenerateDocumentResponseSchema:()=>Dy,GroupPropsSchema:()=>Gm,HeadingLevelSchema:()=>gc,HeadingPropsSchema:()=>nn,HighchartsPropsSchema:()=>zm,ImagePropsSchema:()=>an,IndentSchema:()=>Dn,JSON_SCHEMA_URLS:()=>By,JsonComponentDefinitionSchema:()=>My,JsonDocumentParser:()=>Su,JsonParsingError:()=>lo,JsonValidationError:()=>po,JustifiedAlignmentSchema:()=>ka,LineSpacingSchema:()=>Fa,ListMarkerFontSchema:()=>Vm,ListPropsSchema:()=>mn,MarginsSchema:()=>fg,NATIVE_RENDER_MODE:()=>Ac,NATIVE_VISUAL_ELEMENT_NAMES:()=>Ag,NativeVisualCanvasSchema:()=>Am,NativeVisualElementSchema:()=>Tm,NativeVisualImagePropsSchema:()=>Pm,NativeVisualShapePropsSchema:()=>Cm,NativeVisualTextPropsSchema:()=>wm,NoteSchema:()=>vc,NumberingSchema:()=>gg,ParagraphIndentSchema:()=>ja,ParagraphPropsSchema:()=>on,ReportPropsSchema:()=>un,RevisionMarkSchema:()=>jm,RevisionSchema:()=>eo,RevisionSegmentSchema:()=>Fm,SHARED_DOCX_VERSION:()=>DL,STANDARD_COMPONENTS:()=>Yy,STANDARD_COMPONENTS_REGISTRY:()=>dt,STANDARD_COMPONENTS_SET:()=>wL,SectionPropsSchema:()=>ln,SpacingSchema:()=>Pt,StandardComponentDefinitionSchema:()=>jc,StatisticPropsSchema:()=>sn,THEME_SCHEMA_METADATA:()=>ty,TabStopLeaderSchema:()=>gm,TabStopSchema:()=>ym,TabStopTypeSchema:()=>hm,TabStopsSchema:()=>yc,TablePropsSchema:()=>cn,TextBoxPropsSchema:()=>qm,TextSpaceAfterComponentSchema:()=>Xm,TextSpaceAfterPropsSchema:()=>Ym,ThemeConfigSchema:()=>no,ThemeOverridesSchema:()=>Rc,TocPropsSchema:()=>Wm,ValidateDocumentRequestSchema:()=>Uy,ValidateDocumentResponseSchema:()=>_y,VisualCanvasBackgroundSchema:()=>Em,VisualCanvasSchema:()=>$m,VisualNativePropsSchema:()=>Lm,VisualPropsSchema:()=>Tc,VisualRasterPropsSchema:()=>vm,calculatePosition:()=>_i,clearComponentNamesCache:()=>xa,collectDocxRendererErrors:()=>$c,collectIndentConflicts:()=>iu,collectNoteRevisionConflicts:()=>ou,collectTextBoxShapeConflicts:()=>au,compareSemver:()=>fi,componentValidator:()=>ao,comprehensiveValidateDocument:()=>cu,convertDocxToJsonSchema:()=>Yg,convertToJsonSchema:()=>Yg,createComponentSchema:()=>Ki,createComponentValidator:()=>Gc,createDocumentValidator:()=>_c,createDocxComponentSchema:()=>Xg,createErrorConfig:()=>Ir,createJsonParseError:()=>di,createJsonValidator:()=>ly,createMinimalTheme:()=>Wg,createThemeValidator:()=>Kc,createValidatedComponent:()=>SL,createValidator:()=>cy,deepValidateDocument:()=>su,diffDocuments:()=>sL,diffWords:()=>Xc,documentValidator:()=>oo,docxComponentDefinitionName:()=>rn,docxDocumentBlockTargets:()=>Lg,exportDocxSchemaToFile:()=>Qg,exportSchemaToFile:()=>Gi,extractStandardComponentNames:()=>mi,fixDocxSchemaReferences:()=>Fc,fixSchemaReferences:()=>Ln,formatErrorMessage:()=>xr,formatErrorReport:()=>es,formatErrorSummary:()=>Jr,formatValidationError:()=>yL,formatValidationErrorStrings:()=>bL,formatValidationErrors:()=>pL,generateUnifiedDocumentSchema:()=>ry,getAllStandardComponentNames:()=>Hg,getErrorSummary:()=>Jy,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>Sa,getStandardComponent:()=>za,getThemeName:()=>Sy,getValidationContext:()=>gL,getValidationErrors:()=>dL,getValidationSummary:()=>my,groupErrorsByPath:()=>Ia,hasCriticalErrors:()=>ts,isColumnsComponent:()=>TL,isColumnsProps:()=>Ey,isCustomComponentProps:()=>Ry,isHeadingComponent:()=>AL,isHeadingProps:()=>Ty,isHighchartsComponent:()=>FL,isImageComponent:()=>$L,isImageProps:()=>$y,isListComponent:()=>RL,isListProps:()=>Ny,isLiteralSchema:()=>zr,isNativeVisualProps:()=>$g,isObjectSchema:()=>qt,isParagraphComponent:()=>EL,isParagraphProps:()=>Ay,isReportComponent:()=>CL,isReportProps:()=>Cy,isSectionComponent:()=>PL,isSectionProps:()=>Py,isStandardComponentName:()=>co,isStatisticComponent:()=>LL,isStatisticProps:()=>vy,isTableComponent:()=>NL,isTableProps:()=>Ly,isTextBoxComponent:()=>vL,isTextSpaceAfterComponent:()=>UL,isThemeConfig:()=>Iy,isTocComponent:()=>kL,isUnionSchema:()=>Oa,isValidComponent:()=>IL,isValidDocument:()=>fy,isValidSemver:()=>$n,isValidTheme:()=>xy,isValidThemeConfig:()=>qg,isValidThemeJson:()=>xy,isValidationSuccess:()=>py,isVisualComponent:()=>jL,latestVersion:()=>ut,parseJsonComponent:()=>cL,parseJsonWithLineNumbers:()=>lL,parseSemver:()=>En,safeValidateComponentDefinition:()=>uL,safeValidateComponentProps:()=>mL,sharedCreateComponentSchemaObject:()=>Qs,strictComponentValidator:()=>Bc,strictDocumentValidator:()=>Ja,strictThemeValidator:()=>Mc,stripMarkdown:()=>Qa,themeValidator:()=>Ya,transformAndValidate:()=>xL,transformDocxValueError:()=>ru,transformDocxValueErrors:()=>nu,transformValueError:()=>An,transformValueErrors:()=>tt,validate:()=>ky,validateAgainstSchema:()=>Tt,validateBatch:()=>ay,validateComponent:()=>el,validateComponentDefinition:()=>Iu,validateComponentProps:()=>so,validateComponents:()=>OL,validateCustomComponentProps:()=>uu,validateDocument:()=>Uc,validateDocumentWithSchema:()=>yy,validateJson:()=>io,validateJsonComponent:()=>Dc,validateJsonComponentDoc:()=>gy,validateJsonDocument:()=>Dc,validateStrict:()=>Fy,validateTheme:()=>Vc,validateThemeJson:()=>lu,validateThemeWithEnhancement:()=>pu,validateWithEnhancement:()=>sy});var X=r.String({pattern:"^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix (e.g. "#000000") or theme color name\'}),um=r.String({pattern:"^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix, theme color name, or "transparent"\'}),dm=r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'BCP-47 language tag for spell/grammar checking (e.g. "en-US", "fr-FR", "de-DE")\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]}),fm=r.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),Ra=r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.",examples:[["Wiseair","json-to-office","pptx"]]}),hc=r.Object({case:r.Optional(bi),size:r.Optional(r.Number({minimum:8,maximum:1638})),color:r.Optional(X),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Any integer accepted; renderer picks the closest embedded variant via CSS font-matching. `bold: true` is shorthand for `fontWeight: 700`; if both are set, `fontWeight` wins."})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),lineSpacing:r.Optional(r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead."}))},{additionalProperties:!1})),spacing:r.Optional(r.Object({before:r.Optional(r.Number({minimum:0})),after:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),characterSpacing:r.Optional(r.Object({type:r.Union([r.Literal("condensed"),r.Literal("expanded")]),value:r.Number()},{additionalProperties:!1})),scale:r.Optional(r.Number({minimum:1,maximum:600,description:"Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115)."}))},{additionalProperties:!1}),Qr=r.Object({family:Ht,...hc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var Zr=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Text alignment options"}),ka=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Text alignment options including justify"}),gc=r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)],{description:"Heading level (1-6)"}),Pt=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before element in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after element in points"}))},{description:"Spacing configuration",additionalProperties:!1}),dg=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before list in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after list in points"})),item:r.Optional(r.Number({minimum:0,description:"Spacing between list items in points"}))},{description:"List spacing configuration with item spacing",additionalProperties:!1}),fg=r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0}))},{description:"Margin configuration",additionalProperties:!1}),hg=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{description:"Border configuration",additionalProperties:!1}),Fa=r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. `exactly` has no floor of its own \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so a box smaller than the text it holds is accepted here and clips it."}))},{description:"Line spacing configuration",additionalProperties:!1}),Dn=r.Object({left:r.Optional(r.Number({minimum:0,description:"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in points \\u2014 how far the marker sits left of the text. Omit for the 18pt default."}))},{description:"Indentation configuration, in points",additionalProperties:!1}),ja=r.Object({left:r.Optional(r.Number({description:"Left indentation in twips (1/20 of a point)"})),right:r.Optional(r.Number({description:"Right indentation in twips (1/20 of a point)"})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine."})),firstLine:r.Optional(r.Number({minimum:0,description:"First-line indent in twips: only the first line is indented. Mutually exclusive with hanging."}))},{description:"Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.",additionalProperties:!1}),hm=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("decimal"),r.Literal("bar")],{description:"Tab stop alignment type"}),gm=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("underscore"),r.Literal("middleDot"),r.Literal("none")],{description:"Leader character filling the space before the tab stop"}),ym=r.Object({type:hm,position:r.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:r.Optional(gm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var yc=r.Array(ym,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),I$=r.Union([r.Literal("character"),r.Literal("column"),r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Horizontal position relative to"}),w$=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("paragraph"),r.Literal("line"),r.Literal("text")],{description:"Vertical position relative to"}),C$=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Horizontal alignment"}),P$=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Vertical alignment"}),T$=r.Union([r.Literal("none"),r.Literal("square"),r.Literal("topAndBottom"),r.Literal("around"),r.Literal("tight"),r.Literal("through")],{description:"Text wrapping type"}),A$=r.Union([r.Literal("bothSides"),r.Literal("left"),r.Literal("right"),r.Literal("largest")],{description:"Text wrapping side"}),xi=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(I$),align:r.Optional(C$),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(w$),align:r.Optional(P$),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:T$,side:r.Optional(A$),margins:r.Optional(r.Object({top:r.Optional(r.Union([r.Number({description:"Top margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Top margin as percentage of page height"})])),bottom:r.Optional(r.Union([r.Number({description:"Bottom margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Bottom margin as percentage of page height"})])),left:r.Optional(r.Union([r.Number({description:"Left margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Left margin as percentage of page width"})])),right:r.Optional(r.Union([r.Number({description:"Right margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Right margin as percentage of page width"})]))},{description:"Distance from text margins",additionalProperties:!1}))},{description:"Text wrapping configuration",additionalProperties:!1})),allowOverlap:r.Optional(r.Boolean({description:"Allow element to overlap with other elements"})),behindDocument:r.Optional(r.Boolean({description:"Place element behind document text"})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),layoutInCell:r.Optional(r.Boolean({description:"Layout element within table cell"})),zIndex:r.Optional(r.Number({minimum:0,description:"Z-order for overlapping elements (must be non-negative)"})),rotation:r.Optional(r.Number({description:"Rotation angle in degrees"})),visibility:r.Optional(r.Union([r.Literal("hidden"),r.Literal("inherit")],{description:"Visibility of the floating element"}))},{description:"Floating element properties",additionalProperties:!1}),gg=r.Object({start:r.Optional(r.Number({minimum:1})),style:r.Optional(r.Union([r.Literal("decimal"),r.Literal("lowerLetter"),r.Literal("upperLetter"),r.Literal("lowerRoman"),r.Literal("upperRoman")])),separator:r.Optional(r.String())},{description:"Numbering configuration for lists",additionalProperties:!1}),E$={},yg=r.Object(E$,{description:"Base component props",additionalProperties:!0});var $$=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Oc=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],xc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],_n=r.Union([$$,...Oc.map(e=>r.Literal(e)),...xc.map(e=>r.Literal(e))],{description:"Hex color or semantic theme color name"}),Yi=["title","subtitle","heading1","heading2","heading3","body","caption",...qi],Ua=r.Union(Yi.map(e=>r.Literal(e)),{description:"Predefined style name"}),Da=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Horizontal alignment options"}),Si=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical alignment options"}),Xi=r.Object({type:r.Optional(r.Union([r.Literal("outer"),r.Literal("inner")],{description:"Shadow type"})),color:r.Optional(_n),blur:r.Optional(r.Number({description:"Shadow blur radius in points"})),offset:r.Optional(r.Number({description:"Shadow offset in points"})),angle:r.Optional(r.Number({description:"Shadow angle in degrees"})),opacity:r.Optional(r.Number({minimum:0,maximum:1,description:"Shadow opacity (0-1)"}))},{description:"Shadow configuration",additionalProperties:!1}),tn=r.Object({column:r.Number({minimum:0,description:"Starting column (0-indexed)"}),row:r.Number({minimum:0,description:"Starting row (0-indexed)"}),columnSpan:r.Optional(r.Number({minimum:1,description:"Number of columns to span (default: 1)"})),rowSpan:r.Optional(r.Number({minimum:1,description:"Number of rows to span (default: 1)"}))},{additionalProperties:!1,description:"Grid-based positioning"}),Sc=r.Object({text:r.String({description:"Run text content"}),color:r.Optional(r.String({description:"Run color (hex without # or semantic theme name)"})),bold:r.Optional(r.Boolean({description:"Bold run"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Overrides `bold` when set \\u2014 renderer picks the closest embedded variant via CSS font-matching."})),italic:r.Optional(r.Boolean({description:"Italic run"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough run"})),fontSize:r.Optional(r.Number({minimum:1,description:"Run font size in points"})),fontFace:r.Optional(r.String({description:"Run font family"})),superscript:r.Optional(r.Boolean({description:"Render run as superscript"})),subscript:r.Optional(r.Boolean({description:"Render run as subscript"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"})),breakLine:r.Optional(r.Boolean({description:"Insert line break after this run"}))},{description:"A styled text run. Run options override component-level defaults.",additionalProperties:!1}),_a=r.Object({text:r.Optional(r.String({description:"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two."})),runs:r.Optional(r.Array(Sc,{minItems:1,description:"Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` \\u2014 set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position\\u2026) still apply to the whole block."})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fit:r.Optional(r.Object({maxLines:r.Optional(r.Integer({minimum:1,description:"Lines the text may occupy, estimated with the width model at the effective font size."})),shrink:r.Optional(r.Array(r.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:r.Optional(r.Number({minimum:1,description:"Font size in points"})),fontFace:r.Optional(Ht),color:r.Optional(r.String({description:\'Text color (hex without #, e.g., "FF0000")\'})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough text"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Language tag (BCP-47, e.g. "en-US", "fr-FR") for spell-checking this text. Overrides the presentation default.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),align:r.Optional(Da),valign:r.Optional(Si),breakLine:r.Optional(r.Boolean({description:"Add line break after text"})),bullet:r.Optional(r.Union([r.Boolean({description:"Enable default bullet"}),r.Object({type:r.Optional(r.Union([r.Literal("bullet"),r.Literal("number")])),style:r.Optional(r.String({description:"Bullet character or style"})),startAt:r.Optional(r.Number({description:"Starting number for numbered lists"}))},{additionalProperties:!1})])),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{description:"Margins as [top, right, bottom, left] in points",minItems:4,maxItems:4})])),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),shadow:r.Optional(Xi),fill:r.Optional(r.Object({color:r.String({description:"Fill color (hex without #)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"}))},{additionalProperties:!1})),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),lineSpacing:r.Optional(r.Number({description:"Line spacing in points"})),lineSpacingMultiple:r.Optional(r.Number({minimum:.1,maximum:10,description:"Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing."})),charSpacing:r.Optional(r.Number({description:"Character spacing in points (positive = wider, negative = tighter)"})),paraSpaceBefore:r.Optional(r.Number({description:"Space before paragraph in points"})),paraSpaceAfter:r.Optional(r.Number({description:"Space after paragraph in points"})),grid:r.Optional(tn),style:r.Optional(Ua)},{description:"Text component props",additionalProperties:!1}),Ma=r.Object({path:r.Optional(r.String({description:"Image file path or URL (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:"Base64-encoded image data in data URI format (mutually exclusive with path and svg)"})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.\'})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"Image sizing strategy"}),w:r.Optional(r.Number({description:"Target width in inches"})),h:r.Optional(r.Number({description:"Target height in inches"}))},{description:"Image sizing options",additionalProperties:!1})),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),rounding:r.Optional(r.Boolean({description:"Apply rounded corners to image"})),shadow:r.Optional(Xi),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),grid:r.Optional(tn)},{description:"PPTX image component props",additionalProperties:!1}),Qi=r.Union([r.Literal("rect"),r.Literal("roundRect"),r.Literal("ellipse"),r.Literal("triangle"),r.Literal("diamond"),r.Literal("pentagon"),r.Literal("hexagon"),r.Literal("star5"),r.Literal("star6"),r.Literal("line"),r.Literal("arc"),r.Literal("pie"),r.Literal("blockArc"),r.Literal("chord"),r.Literal("arrow"),r.Literal("chevron"),r.Literal("cloud"),r.Literal("heart"),r.Literal("lightning")],{description:"Shape type"}),Og=r.Object({text:r.String(),fontSize:r.Optional(r.Number({minimum:1})),fontFace:r.Optional(r.String()),color:r.Optional(r.String({description:"Segment color (hex without # or semantic name)"})),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),breakLine:r.Optional(r.Boolean({description:"Insert line break after this segment"})),spaceBefore:r.Optional(r.Number({minimum:0,description:"Space before paragraph in points"})),spaceAfter:r.Optional(r.Number({minimum:0,description:"Space after paragraph in points"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"}))},{additionalProperties:!1}),Ic=["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"],wc=r.Object({color:r.String({description:"Stop color (hex without # or semantic theme name)"}),pos:r.Number({minimum:0,maximum:100,description:"Stop position along the gradient (0-100)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Stop transparency (0-100)"}))},{additionalProperties:!1,description:"Gradient color stop"}),Zi=r.Object({type:r.Union([r.Literal("linear"),r.Literal("radial")],{description:"Gradient type"}),angle:r.Optional(r.Number({minimum:0,maximum:360,description:"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0."})),stops:r.Array(wc,{minItems:2,description:"Gradient color stops (at least 2)"}),focus:r.Optional(r.Union([r.Literal("center"),r.Literal("topLeft"),r.Literal("topRight"),r.Literal("bottomLeft"),r.Literal("bottomRight")],{description:\'Focus point for radial gradients (default: "center")\'}))},{additionalProperties:!1,description:"Gradient fill configuration"}),Cc=r.Object({preset:r.Union(Ic.map(e=>r.Literal(e)),{description:"OOXML pattern preset name (a:pattFill prst value)"}),foreground:r.String({description:"Pattern foreground color (hex without # or semantic name)"}),background:r.String({description:"Pattern background color (hex without # or semantic name)"})},{additionalProperties:!1,description:"Pattern fill configuration"}),Ba=r.Object({type:Qi,x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fill:r.Optional(r.Object({color:r.Optional(r.String({description:"Fill color (hex without #)"})),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"})),gradient:r.Optional(Zi),pattern:r.Optional(Cc)},{additionalProperties:!1})),line:r.Optional(r.Object({color:r.Optional(r.String({description:"Line color (hex without #)"})),width:r.Optional(r.Number({minimum:0,description:"Line width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")]))},{additionalProperties:!1})),text:r.Optional(r.Union([r.String({description:"Plain text"}),r.Array(Og,{description:"Rich text segments with per-segment formatting"})],{description:"Text content inside the shape"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size for shape text"})),fontFace:r.Optional(r.String({description:"Font family for shape text"})),fontColor:r.Optional(r.String({description:"Font color for shape text (hex without #)"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points for shape text"})),bold:r.Optional(r.Boolean({description:"Bold shape text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-shape weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic shape text"})),align:r.Optional(Da),valign:r.Optional(Si),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),angleRange:r.Optional(r.Array(r.Number(),{minItems:2,maxItems:2,description:"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"})),flipH:r.Optional(r.Boolean({description:"Flip shape horizontally"})),flipV:r.Optional(r.Boolean({description:"Flip shape vertically"})),shadow:r.Optional(Xi),rectRadius:r.Optional(r.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:r.Optional(tn),style:r.Optional(Ua)},{description:"Shape component props",additionalProperties:!1}),v$=r.Union([r.String({description:"Simple text cell"}),r.Object({text:r.String({description:"Cell text content"}),color:r.Optional(r.String({description:"Text color (hex without #)"})),fill:r.Optional(r.String({description:"Cell background color (hex without #)"})),fontSize:r.Optional(r.Number({description:"Font size in points"})),fontFace:r.Optional(r.String({description:"Font family"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),align:r.Optional(Da),valign:r.Optional(Si),colspan:r.Optional(r.Number({minimum:1,description:"Column span"})),rowspan:r.Optional(r.Number({minimum:1,description:"Row span"})),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})]))},{additionalProperties:!1})]),Va=r.Object({rows:r.Array(r.Array(v$,{description:"Row of cells"}),{description:"Table rows (array of arrays)",minItems:1}),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),colW:r.Optional(r.Union([r.Number({description:"Uniform column width in inches"}),r.Array(r.Number(),{description:"Individual column widths in inches"})])),rowH:r.Optional(r.Union([r.Number({description:"Uniform row height in inches"}),r.Array(r.Number(),{description:"Individual row heights in inches"})])),border:r.Optional(r.Object({type:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")])),pt:r.Optional(r.Number({minimum:0,description:"Border width in points"})),color:r.Optional(r.String({description:"Border color (hex without #)"}))},{additionalProperties:!1})),fill:r.Optional(r.String({description:"Table background color (hex without #)"})),fontSize:r.Optional(r.Number({minimum:1,description:"Default font size for all cells"})),fontFace:r.Optional(r.String({description:"Default font family for all cells"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Default weight for all cells (100\\u2013900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out."})),color:r.Optional(r.String({description:"Default text color for all cells (hex without #)"})),align:r.Optional(Da),valign:r.Optional(Si),headerRow:r.Optional(r.Boolean({description:"Style the first row as a header \\u2014 bold, on the theme\'s secondary background. Cells that state their own `bold`, `fill` or `color` keep it. Unlike the DOCX table, which declares its headers structurally, a PPTX table is rows of cells and the first one is a header only because you say so."})),autoPage:r.Optional(r.Boolean({description:"Auto-paginate table across multiple slides when content overflows"})),autoPageRepeatHeader:r.Optional(r.Boolean({description:"Repeat first row as header on each auto-paged slide"})),margin:r.Optional(r.Union([r.Number({description:"Cell margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})])),borderRadius:r.Optional(r.Number({minimum:0,description:"Rounded corner radius in inches. Renders a roundRect shape behind the table."})),grid:r.Optional(tn)},{description:"PPTX table component props",additionalProperties:!1}),Ka=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),grid:r.Optional(tn)},{description:"PPTX Highcharts component props",additionalProperties:!1}),bc=(e,t)=>r.Union([r.Number({description:e}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),L$=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("bar3D"),r.Literal("bubble"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),N$=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."})),sizes:r.Optional(r.Array(r.Number(),{description:"Bubble sizes (bubble charts only)"}))},{additionalProperties:!1}),bg=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")],{description:"Grid line style"})),size:r.Optional(r.Number({minimum:0,description:"Grid line width (points)"})),color:r.Optional(r.String({description:"Grid line color (hex or semantic)"}))},{additionalProperties:!1,description:"Axis grid line styling"}),Ga=r.Object({type:L$,data:r.Array(N$,{description:"Chart data series",minItems:1}),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),showTitle:r.Optional(r.Boolean({description:"Show chart title"})),showValue:r.Optional(r.Boolean({description:"Show data values"})),showPercent:r.Optional(r.Boolean({description:"Show percentages (pie/doughnut)"})),showLabel:r.Optional(r.Boolean({description:"Show category labels on data points"})),showSerName:r.Optional(r.Boolean({description:"Show series name on data points"})),title:r.Optional(r.String({description:"Chart title text"})),titleFontSize:r.Optional(r.Number({description:"Title font size (points)"})),titleColor:r.Optional(r.String({description:"Title color (hex or semantic)"})),titleFontFace:r.Optional(r.String({description:"Title font face"})),titleFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to theme palette."})),dataBorder:r.Optional(r.Object({pt:r.Number({minimum:0,description:"Border width (points)"}),color:r.String({description:"Border color (hex or semantic)"})},{additionalProperties:!1,description:"Outline on data elements (bars, slices, areas)"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),legendFontSize:r.Optional(r.Number({description:"Legend font size"})),legendFontFace:r.Optional(r.String({description:"Legend font face"})),legendFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Legend weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns)."})),legendColor:r.Optional(r.String({description:"Legend text color"})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),catAxisHidden:r.Optional(r.Boolean({description:"Hide category axis"})),catAxisLabelRotate:r.Optional(r.Number({description:"Category axis label rotation (degrees)"})),catAxisLabelFontSize:r.Optional(r.Number({description:"Category axis label font size"})),catAxisLabelColor:r.Optional(r.String({description:"Category axis label color (hex or semantic)"})),catAxisLabelFontFace:r.Optional(r.String({description:"Category axis label font face"})),catAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),catGridLine:r.Optional(bg),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),valAxisHidden:r.Optional(r.Boolean({description:"Hide value axis"})),valAxisMinVal:r.Optional(r.Number({description:"Value axis minimum"})),valAxisMaxVal:r.Optional(r.Number({description:"Value axis maximum"})),valAxisLabelFormatCode:r.Optional(r.String({description:\'Value axis label format (e.g. "$0.00", "#%")\'})),valAxisMajorUnit:r.Optional(r.Number({description:"Value axis major unit / tick interval"})),valAxisLabelColor:r.Optional(r.String({description:"Value axis label color (hex or semantic)"})),valAxisLabelFontFace:r.Optional(r.String({description:"Value axis label font face"})),valAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),valAxisLabelFontSize:r.Optional(r.Number({description:"Value axis label font size"})),valGridLine:r.Optional(bg),catAxisLineShow:r.Optional(r.Boolean({description:"Show the category axis line"})),valAxisLineShow:r.Optional(r.Boolean({description:"Show the value axis line"})),barDir:r.Optional(r.Union([r.Literal("bar"),r.Literal("col")],{description:\'Bar direction: "bar" (horizontal) or "col" (vertical, default)\'})),barGrouping:r.Optional(r.Union([r.Literal("clustered"),r.Literal("stacked"),r.Literal("percentStacked")],{description:"Bar grouping style"})),barGapWidthPct:r.Optional(r.Number({minimum:0,maximum:500,description:"Bar gap width (0-500%)"})),barOverlapPct:r.Optional(r.Number({minimum:-100,maximum:100,description:"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."})),lineSmooth:r.Optional(r.Boolean({description:"Smooth lines"})),lineDataSymbol:r.Optional(r.Union([r.Literal("circle"),r.Literal("dash"),r.Literal("diamond"),r.Literal("dot"),r.Literal("none"),r.Literal("square"),r.Literal("triangle")],{description:"Line data point marker symbol"})),lineSize:r.Optional(r.Number({description:"Line width (points)"})),lineDataSymbolSize:r.Optional(r.Number({minimum:2,maximum:72,description:"Line data point marker size (points)"})),firstSliceAng:r.Optional(r.Number({minimum:0,maximum:359,description:"Angle of first slice (degrees)"})),holeSize:r.Optional(r.Number({minimum:10,maximum:90,description:"Doughnut hole size (%)"})),radarStyle:r.Optional(r.Union([r.Literal("standard"),r.Literal("marker"),r.Literal("filled")],{description:"Radar chart style"})),dataLabelColor:r.Optional(r.String({description:"Data label text color"})),dataLabelFontSize:r.Optional(r.Number({description:"Data label font size"})),dataLabelFontFace:r.Optional(r.String({description:"Data label font face"})),dataLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:\'Data label weight (100\\u2013900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family ("Inter" at 300 \\u2192 "Inter Light") \\u2014 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.\'})),dataLabelFontBold:r.Optional(r.Boolean({description:"Bold data labels"})),dataLabelPosition:r.Optional(r.Union([r.Literal("b"),r.Literal("bestFit"),r.Literal("ctr"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("inEnd"),r.Literal("outEnd")],{description:"Data label position"})),x:r.Optional(bc("X position in inches","X as percentage")),y:r.Optional(bc("Y position in inches","Y as percentage")),w:r.Optional(bc("Width in inches","Width as percentage")),h:r.Optional(bc("Height in inches","Height as percentage")),grid:r.Optional(tn)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function Ii(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var en=[{name:"text",propsSchema:_a,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:Ma,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Ba,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:Va,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:Ka,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Ga,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 Ji(e){return r.Object({name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:Ii(e)?e.propsSchema:r.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var qa=r.Union([Ji(en[0]),Ji(en[1]),Ji(en[2]),Ji(en[3]),Ji(en[4]),Ji(en[5])],{$id:"PptxSlideContent",discriminator:{propertyName:"name"},description:"A single PPTX slide content element (text, image, shape, table, highcharts, or chart)."});var Mn=r.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex colour ("#0F172A" or "0F172A") or a docx theme colour name (e.g. "primary")\'}),R$="^-?\\\\d+(\\\\.\\\\d+)?%$",k$="^\\\\d+(\\\\.\\\\d+)?%$",xg=r.Union([r.Number({description:"Inches from the canvas origin"}),r.String({pattern:R$,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Sg=r.Union([r.Number({minimum:0,description:"Size in inches"}),r.String({pattern:k$,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),Im={x:r.Optional(xg),y:r.Optional(xg),w:r.Optional(Sg),h:r.Optional(Sg),rotate:r.Optional(r.Number({description:"Clockwise rotation in degrees"}))},Ig=r.Union([r.Boolean({description:"Single underline in the text colour"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")],{description:\'Underline style (default "sng")\'})),color:r.Optional(Mn)},{additionalProperties:!1})],{description:"Underline: true for a single line, or a style/colour object"}),Pc={fontFace:r.Optional(r.String({description:"Font family name"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size in points"})),bold:r.Optional(r.Boolean()),italic:r.Optional(r.Boolean())},F$=r.Object({text:r.String({description:"Run text"}),color:r.Optional(Mn),...Pc,underline:r.Optional(Ig),strike:r.Optional(r.Boolean({description:"Strikethrough"})),breakLine:r.Optional(r.Boolean({description:"Start a new line after this run"}))},{additionalProperties:!1,description:"A formatted run inside a native visual text element"}),j$=r.Object({text:r.String({description:"Segment text"}),color:r.Optional(Mn),...Pc,breakLine:r.Optional(r.Boolean({description:"Start a new line after this segment"}))},{additionalProperties:!1,description:"A formatted segment of a native visual shape\\u2019s text"}),wg=r.Object({color:r.Optional(Mn),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency, 0 (opaque) to 100 (invisible)"}))},{additionalProperties:!1,description:"Solid fill. Omit the whole property for no fill; gradients and patterns are raster-only."}),U$=r.Object({color:r.Optional(Mn),width:r.Optional(r.Number({minimum:0,description:"Outline width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")],{description:\'Outline dash pattern (default "solid")\'}))},{additionalProperties:!1,description:"Shape outline"}),Cg=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),Pg=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),Tg=r.Union([r.Number({minimum:0,description:"Inset on every side, in points"}),r.Array(r.Number({minimum:0}),{minItems:4,maxItems:4,description:"Insets as [top, right, bottom, left], in points"})],{description:"Text insets in points"}),wm=r.Object({text:r.Optional(r.String({description:"Plain text content"})),runs:r.Optional(r.Array(F$,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...Im,color:r.Optional(Mn),...Pc,underline:r.Optional(Ig),strike:r.Optional(r.Boolean({description:"Strikethrough"})),align:r.Optional(Cg),valign:r.Optional(Pg),margin:r.Optional(Tg),fill:r.Optional(wg)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),Cm=r.Object({type:Qi,...Im,fill:r.Optional(wg),line:r.Optional(U$),text:r.Optional(r.Union([r.String(),r.Array(j$,{minItems:1})],{description:"Text drawn inside the shape"})),...Pc,fontColor:r.Optional(Mn),align:r.Optional(Cg),valign:r.Optional(Pg),margin:r.Optional(Tg),flipH:r.Optional(r.Boolean({description:"Mirror horizontally"})),flipV:r.Optional(r.Boolean({description:"Mirror vertically"}))},{additionalProperties:!1,description:"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group"}),Pm=r.Object({path:r.Optional(r.String({description:"File path or http(s) URL"})),base64:r.Optional(r.String({description:"Base64 data URI"})),svg:r.Optional(r.String({description:"Raw SVG markup"})),...Im,sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"How the image fills its box"}),w:r.Optional(r.Number({minimum:0,description:\'Box width in inches; overrides the element\\u2019s own "w"\'})),h:r.Optional(r.Number({minimum:0,description:\'Box height in inches; overrides the element\\u2019s own "h"\'}))},{additionalProperties:!1,description:\'How the image fills its box. "w"/"h" state the box itself, taking precedence over the element\\u2019s "w"/"h", as they do in raster mode.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"}))},{additionalProperties:!1,description:"Native visual image element \\u2014 becomes a native picture inside the drawing group"}),Ag=["text","shape","image"];function bm(e,t,n){return r.Object({name:r.Literal(e),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this element is filtered out and not drawn. Defaults to true."})),props:t},{additionalProperties:!1,description:n})}var Tm=r.Union([bm("text",wm,"Text element - a native Word text box drawn on the visual canvas."),bm("shape",Cm,"Shape element - a native preset-geometry shape, optionally holding text."),bm("image",Pm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),Am=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches"}),height:r.Number({minimum:.1,description:"Canvas height in inches"}),background:r.Optional(r.Object({color:r.Optional(Mn),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1,description:"Canvas background. A colour becomes the bottom-most rectangle; an image becomes the bottom-most picture."}))},{additionalProperties:!1,description:"Drawing canvas for a native visual"}),Em=r.Object({color:r.Optional(r.String({description:\'Background color (hex like "#FFFFFF" or a theme color name)\'})),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1}),$m=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches (pptx slideWidth)"}),height:r.Number({minimum:.1,description:"Canvas height in inches (pptx slideHeight)"}),theme:r.Optional(r.String({description:"pptx theme name applied to the slide"})),background:r.Optional(Em)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),Eg={width:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered width as percentage (e.g. "90%")\'})],{description:"Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size."})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered height as percentage (e.g. "90%")\'})])),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(Pt),floating:r.Optional(xi),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},vm=r.Object({renderMode:r.Optional(r.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:$m,elements:r.Optional(r.Array(qa,{description:"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches"})),dpi:r.Optional(r.Number({minimum:va,maximum:La,default:$a,description:`Raster resolution in DPI (default ${$a}, range ${va}-${La}). Higher = sharper + larger.`})),serverUrl:r.Optional(r.String({description:"Rasterization service URL override (default from services.pptx)"})),...Eg},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),Lm=r.Object({renderMode:r.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:Am,elements:r.Optional(r.Array(Tm,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...Eg},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),Tc=r.Union([vm,Lm],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Ac="native";function $g(e){return!!e&&e.renderMode===Ac}var Cr=["docxjs","office-open"],Wa="docxjs",D$=new Set(["text","shape","image"]);function rn(e){return`ComponentDefinition_${e}`}function Ec(e,t,n){let i=Sm(t);return xm(i,rn(n)),e==="visual"&&n!=="office-open"?M$(i)??i:(n==="office-open"&&Om(i),i)}function $c(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??Wa;if(!Cr.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "docxjs" or "office-open".`,code:"invalid_value"}];let i=[],o=n==="office-open",a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s;if(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"&&_$(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 _$(e,t,n,i){let o=e.props;if(!o||typeof o!="object"||Array.isArray(o))return;let a=o;if(a.renderMode!==Ac)return;if(!n){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"||D$.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 M$(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Om(e){if(Array.isArray(e)){e.forEach(Om);return}if(!e||typeof e!="object")return;let t=e,n=t.properties;if(n?.text&&n?.author&&(n.replies||n.resolved)&&typeof t.description=="string"&&t.description.includes("Word review comment")){delete n.replies,delete n.resolved;let i=t.required;i&&(t.required=i.filter(o=>o!=="replies"&&o!=="resolved"))}for(let i of Reflect.ownKeys(t))Om(t[i])}function xm(e,t){if(Array.isArray(e)){e.forEach(i=>xm(i,t));return}if(!e||typeof e!="object")return;let n=e;n.type==="array"&&n.items&&typeof n.items=="object"&&Object.keys(n.items).length===0&&n.items[g]==="Any"&&(n.items={$ref:t});for(let i of Reflect.ownKeys(n))xm(n[i],t)}function Sm(e){if(Array.isArray(e))return e.map(Sm);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=Sm(e[n]);return t}function vg(e){let t=e.definitions??{},n=new Map;for(let o of Cr){let a=rn(o);t[a]&&n.set(o,Na(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=n.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 Lg(e){let t=e.definitions??{};return Cr.filter(n=>t[rn(n)]).map(n=>{let i=rn(n);return{name:i,componentRef:{$ref:`#/definitions/${i}`}}})}var Fm=r.Object({type:r.Union([r.Literal("equal"),r.Literal("insert"),r.Literal("delete")],{description:"Segment kind: \'equal\' renders as normal text, \'insert\' as a tracked insertion, \'delete\' as a tracked deletion"}),text:r.String({description:"Literal text of this segment (rendered without markdown)"})},{description:"A contiguous run of text sharing one revision state",additionalProperties:!1}),eo=r.Object({author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"})),segments:r.Array(Fm,{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}),jm=r.Object({type:r.Union([r.Literal("insert"),r.Literal("delete")],{description:"Whether the element was inserted or deleted"}),author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},{description:"Structural tracked change: the element itself was inserted or deleted",additionalProperties:!1}),Rg={text:r.String({minLength:1,description:"Comment body. Newlines split it into separate paragraphs in the comment pane."}),author:r.Optional(r.String({description:\'Comment author shown in Word (default: "json-to-office")\'})),initials:r.Optional(r.String({description:"Author initials shown on the comment bubble (derived from the author when omitted)"})),date:r.Optional(r.String({format:"date-time",description:"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},Um=r.Object(Rg,{description:"A reply within a comment thread",additionalProperties:!1}),to=r.Object({...Rg,replies:r.Optional(r.Array(Um,{minItems:1,description:"Replies, in order. They anchor to the same text and Word shows them as one thread."})),resolved:r.Optional(r.Boolean({description:"Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply."}))},{description:"A Word review comment anchored to this component\'s text",additionalProperties:!1}),nn=r.Object({text:r.String({description:"Heading text (required)"}),level:r.Optional(gc),font:r.Optional(r.Partial(Qr)),language:r.Optional(dm),noProof:r.Optional(fm),noProofWords:r.Optional(Ra),alignment:r.Optional(ka),spacing:r.Optional(Pt),indent:r.Optional(ja),lineSpacing:r.Optional(r.Union([r.Number({minimum:0}),Fa],{description:"A bare number is a multiple of single spacing. Takes precedence over `font.lineSpacing`. An `exactly` box smaller than the heading it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE."})),pageBreak:r.Optional(r.Boolean({description:"Insert page break before heading"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before heading"})),numbering:r.Optional(r.Boolean({description:"Number this heading with the document\'s multilevel heading numbering (1., 1.1., 1.1.1.). Set globally via componentDefaults.heading.numbering; false opts a single heading out."})),keepNext:r.Optional(r.Boolean({description:"Keep heading with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of heading together on same page"})),revision:r.Optional(eo),comment:r.Optional(to)},{description:"Heading component props",additionalProperties:!1}),vc=r.Object({id:r.String({minLength:1,pattern:"^[^\\\\]\\\\s]+$",description:\'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".\'}),text:r.String({minLength:1,description:"Note body. Newlines split it into separate paragraphs where the note is placed."})},{description:"A note body bound to an inline `[^id]` marker",additionalProperties:!1}),Dm=r.Array(vc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),_m=r.Array(vc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),B$=r.Union([r.Literal("around"),r.Literal("none"),r.Literal("notBeside"),r.Literal("through"),r.Literal("tight"),r.Literal("auto")],{description:"Frame text wrapping type"}),Ng=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Frame anchor type"}),V$=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Frame horizontal alignment"}),K$=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Frame vertical alignment"}),G$=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(Ng),align:r.Optional(V$),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(Ng),align:r.Optional(K$),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:B$},{description:"Text wrapping configuration",additionalProperties:!1})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),width:r.Optional(r.Number({minimum:1,description:"Frame width in twips (DXA units)"})),height:r.Optional(r.Number({minimum:1,description:"Frame height in twips (DXA units)"}))},{description:"Floating text frame properties",additionalProperties:!1}),q$=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Paragraph text alignment"}),on=r.Object({text:r.String({description:"Text content (required)"}),font:r.Optional(r.Partial(Qr)),themeStyle:r.Optional(r.String()),language:r.Optional(dm),noProof:r.Optional(fm),noProofWords:r.Optional(Ra),boldColor:r.Optional(X),spacing:r.Optional(Pt),alignment:r.Optional(q$),indent:r.Optional(ja),tabStops:r.Optional(yc),pageBreak:r.Optional(r.Boolean({description:"Insert page break before paragraph"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before paragraph"})),floating:r.Optional(G$),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"})),id:r.Optional(r.String({description:"Unique identifier for internal linking (bookmark anchor)"})),revision:r.Optional(eo),comment:r.Optional(to),footnotes:r.Optional(Dm),endnotes:r.Optional(_m)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),an=r.Object({path:r.Optional(r.String({description:"Image source URL or file path (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:\'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)\'})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Renders as a vector image (Word 2016+); intrinsic size taken from the SVG viewBox/width/height when width/height omitted.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)\'})],{description:\'Image width in pixels (number) or as percentage string (e.g., "90%")\',default:"100%"})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)\'})],{description:\'Image height in pixels (number) or as percentage string (e.g., "90%")\'})),widthRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for width percentages: content (page width minus margins) or page (full page width)",default:"content"})),heightRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for height percentages: content (page height minus margins) or page (full page height)",default:"content"})),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:r.Optional(Pt),floating:r.Optional(xi),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:"Image component props",additionalProperties:!1}),sn=r.Object({number:r.String({description:"Statistic number/value (required)"}),description:r.String({description:"Statistic description (required)"}),unit:r.Optional(r.String({description:"Unit of measurement"})),format:r.Optional(r.String({description:"Number format pattern"})),trend:r.Optional(r.Union([r.Literal("up"),r.Literal("down"),r.Literal("neutral")])),trendValue:r.Optional(r.Union([r.String(),r.Number()])),alignment:r.Optional(Zr),spacing:r.Optional(Pt),size:r.Optional(r.Union([r.Literal("small"),r.Literal("medium"),r.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),W$=r.Recursive(e=>r.Union([r.String(),r.Object({name:r.String(),props:r.Object({},{additionalProperties:!0}),children:r.Optional(r.Array(e))},{additionalProperties:!1})])),kg=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),Fg=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical cell alignment"}),jg=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:0,description:"Font size in points"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Boolean({description:"Underlined text"})),lineSpacing:r.Optional(r.Object({...Fa.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}),Rm=r.Union([r.String({description:"Border color for all sides (hex without #)"}),r.Object({bottom:r.Optional(r.String({description:"Bottom border color (hex without #)"})),top:r.Optional(r.String({description:"Top border color (hex without #)"})),right:r.Optional(r.String({description:"Right border color (hex without #)"})),left:r.Optional(r.String({description:"Left border color (hex without #)"}))},{additionalProperties:!1})]),km=r.Union([r.Number({minimum:0,description:"Border size for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom border size in points"})),top:r.Optional(r.Number({minimum:0,description:"Top border size in points"})),right:r.Optional(r.Number({minimum:0,description:"Right border size in points"})),left:r.Optional(r.Number({minimum:0,description:"Left border size in points"}))},{additionalProperties:!1})]),H$=r.Union([r.Boolean({description:"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border"}),r.Object({bottom:r.Optional(r.Boolean({description:"Hide bottom border"})),top:r.Optional(r.Boolean({description:"Hide top border"})),right:r.Optional(r.Boolean({description:"Hide right border"})),left:r.Optional(r.Boolean({description:"Hide left border"})),insideHorizontal:r.Optional(r.Boolean({description:"Hide horizontal borders between rows"})),insideVertical:r.Optional(r.Boolean({description:"Hide vertical borders between columns"}))},{description:"Selectively hide specific borders",additionalProperties:!1})]),Ug=r.Union([r.Number({minimum:0,description:"Padding for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom padding in points"})),top:r.Optional(r.Number({minimum:0,description:"Top padding in points"})),right:r.Optional(r.Number({minimum:0,description:"Right padding in points"})),left:r.Optional(r.Number({minimum:0,description:"Left padding in points"}))},{additionalProperties:!1})]),Nm=r.Object({color:r.Optional(X),backgroundColor:r.Optional(um),horizontalAlignment:r.Optional(kg),verticalAlignment:r.Optional(Fg),font:r.Optional(jg),borderColor:r.Optional(Rm),borderSize:r.Optional(km),padding:r.Optional(Ug),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function Mm(e){let t=r.Union([r.String(),e]),n={color:r.Optional(X),backgroundColor:r.Optional(um),horizontalAlignment:r.Optional(kg),verticalAlignment:r.Optional(Fg),font:r.Optional(jg),borderColor:r.Optional(Rm),borderSize:r.Optional(km),padding:r.Optional(Ug),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"})),comment:r.Optional(to),revision:r.Optional(eo)},i=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),o=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),a=r.Object({width:r.Optional(r.Union([r.Number({minimum:0,description:"Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns."}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "40%")\'})])),cellDefaults:r.Optional(Nm),header:r.Optional(i),cells:r.Optional(r.Array(o))},{additionalProperties:!1});return r.Object({borderColor:r.Optional(Rm),borderSize:r.Optional(km),hideBorders:r.Optional(H$),cellDefaults:r.Optional(Nm),headerCellDefaults:r.Optional(Nm),width:r.Optional(r.Number({minimum:0,maximum:100,description:"Table width in percentage (0-100)"})),columns:r.Array(a,{description:"Table columns with headers and cells",minItems:1}),rows:r.Optional(r.Array(r.Object({revision:r.Optional(jm),cantSplit:r.Optional(r.Boolean({description:"Keep this row on one page"})),tableHeader:r.Optional(r.Boolean({description:"Repeat this row as a header on each page"}))},{additionalProperties:!1}),{description:"Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here."})),keepInOnePage:r.Optional(r.Boolean({description:"Keep table rows together on the same page by setting keepNext on all paragraphs"})),keepNext:r.Optional(r.Boolean({description:"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."})),repeatHeaderOnPageBreak:r.Optional(r.Boolean({description:"Repeat the header row on each page when the table spans multiple pages. Defaults to true.",default:!0}))},{description:"Table component props with column-based structure",additionalProperties:!1})}var cn=Mm(W$),Bm=e=>r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this section, shown in editors and outlines. Never rendered \\u2014 add a heading child for a visible title."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the document."})),header:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section header components"}),r.Literal("linkToPrevious",{description:"Link header to previous section"})])),footer:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section footer components"}),r.Literal("linkToPrevious",{description:"Link footer to previous section"})])),pageBreak:r.Optional(r.Boolean({description:"Insert page break before section",default:!0})),spacing:r.Optional(Pt),page:r.Optional(r.Object({size:r.Optional(r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})})])),margins:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),header:r.Optional(r.Number({minimum:0})),footer:r.Optional(r.Number({minimum:0})),gutter:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1}))},{description:"Page configuration override for this section (overrides theme page settings)",additionalProperties:!1}))},{description:"Section component props",additionalProperties:!1}),ln=Bm(),z$=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Column width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "30%")\'}),r.Literal("auto",{description:"Auto width: consume remaining space after fixed widths and gaps"})])),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Gap after this column in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Gap after this column as percentage of available width (e.g., "5%")\'})]))},{additionalProperties:!1}),pn=r.Object({columns:r.Union([r.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),r.Array(z$,{minItems:1,description:"List of columns in order; width and gap can be points, percentages, or auto width"})]),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Default gap applied after each column except the last (points)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Default gap applied after each column except the last as percentage of available width (e.g., "5%")\'})]))},{description:"Columns component props",additionalProperties:!1}),Dg=r.Union([r.Literal("decimal"),r.Literal("upperRoman"),r.Literal("lowerRoman"),r.Literal("upperLetter"),r.Literal("lowerLetter"),r.Literal("bullet"),r.Literal("ordinal"),r.Literal("cardinalText"),r.Literal("ordinalText"),r.Literal("hex"),r.Literal("chicago"),r.Literal("ideographDigital"),r.Literal("japaneseCounting"),r.Literal("aiueo"),r.Literal("iroha"),r.Literal("decimalFullWidth"),r.Literal("decimalHalfWidth"),r.Literal("japaneseLegal"),r.Literal("japaneseDigitalTenThousand"),r.Literal("decimalEnclosedCircle"),r.Literal("decimalFullWidth2"),r.Literal("aiueoFullWidth"),r.Literal("irohaFullWidth"),r.Literal("decimalZero"),r.Literal("ganada"),r.Literal("chosung"),r.Literal("decimalEnclosedFullstop"),r.Literal("decimalEnclosedParen"),r.Literal("decimalEnclosedCircleChinese"),r.Literal("ideographEnclosedCircle"),r.Literal("ideographTraditional"),r.Literal("ideographZodiac"),r.Literal("ideographZodiacTraditional"),r.Literal("taiwaneseCounting"),r.Literal("ideographLegalTraditional"),r.Literal("taiwaneseCountingThousand"),r.Literal("taiwaneseDigital"),r.Literal("chineseCounting"),r.Literal("chineseLegalSimplified"),r.Literal("chineseCountingThousand"),r.Literal("koreanDigital"),r.Literal("koreanCounting"),r.Literal("koreanLegal"),r.Literal("koreanDigital2"),r.Literal("vietnameseCounting"),r.Literal("russianLower"),r.Literal("russianUpper"),r.Literal("none"),r.Literal("numberInDash"),r.Literal("hebrew1"),r.Literal("hebrew2"),r.Literal("arabicAlpha"),r.Literal("arabicAbjad"),r.Literal("hindiVowels"),r.Literal("hindiConsonants"),r.Literal("hindiNumbers"),r.Literal("hindiCounting"),r.Literal("thaiLetters"),r.Literal("thaiNumbers"),r.Literal("thaiCounting")],{description:"Number or bullet format for list levels"}),Vm=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:1,description:"Marker size in points"})),color:r.Optional(X),bold:r.Optional(r.Boolean({description:"Bold marker"})),italic:r.Optional(r.Boolean({description:"Italic marker"})),underline:r.Optional(r.Boolean({description:"Underlined marker"}))},{description:"Styling for the number/bullet glyph only. The list text is unaffected.",additionalProperties:!1}),J$=r.Object({level:r.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:r.Optional(Dg),text:r.Optional(r.String({description:\'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)\'})),alignment:r.Optional(r.Union([r.Literal("start"),r.Literal("end"),r.Literal("left"),r.Literal("right"),r.Literal("center")],{description:"Alignment of the numbering/bullet"})),indent:r.Optional(Dn),start:r.Optional(r.Number({minimum:1,description:"Starting number for this level (default: 1)"})),font:r.Optional(Vm)},{description:"Configuration for a single list level",additionalProperties:!1}),mn=r.Object({items:r.Array(r.Union([r.String(),r.Object({text:r.String(),level:r.Optional(r.Number({minimum:0,maximum:8,description:"Nesting level for this item"})),id:r.Optional(r.String({description:"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])"})),revision:r.Optional(eo)},{additionalProperties:!1})]),{description:"List items (required)",minItems:1}),reference:r.Optional(r.String({description:"Unique reference ID for this numbering configuration (auto-generated if not provided)"})),levels:r.Optional(r.Array(J$,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:r.Optional(r.Union([Dg,r.Literal("numbered"),r.Literal("none")],{description:"Format for level 0 (simplified option when levels not specified)"})),bullet:r.Optional(r.String({description:"Custom bullet character (simplified option when levels not specified)"})),start:r.Optional(r.Number({minimum:1,description:"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."})),font:r.Optional(r.Partial(Qr)),spacing:r.Optional(dg),alignment:r.Optional(ka),keepNext:r.Optional(r.Boolean({description:"Keep every item with what follows, so the list stays with the text that introduces it"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of each item together on the same page"})),indent:r.Optional(r.Union([r.Number({minimum:0}),Dn])),comment:r.Optional(to)},{description:"List component props",additionalProperties:!1}),Km=["revision","comment","footnotes","endnotes"],Y$=r.Partial(r.Omit(nn,Km)),X$=r.Partial(r.Omit(on,Km)),Q$=r.Partial(an),Z$=r.Partial(sn),ev=r.Partial(r.Omit(cn,["rows"])),tv=r.Partial(ln),rv=r.Partial(pn),nv=r.Partial(r.Omit(mn,Km)),Lc=r.Object({heading:r.Optional(Y$),paragraph:r.Optional(X$),image:r.Optional(Q$),statistic:r.Optional(Z$),table:r.Optional(ev),section:r.Optional(tv),columns:r.Optional(rv),list:r.Optional(nv)},{additionalProperties:!0});var Ha=["consulting","devportal","minimal","vermilion"],iv=r.Object({top:r.Number({minimum:0}),bottom:r.Number({minimum:0}),left:r.Number({minimum:0}),right:r.Number({minimum:0}),header:r.Number({minimum:0}),footer:r.Number({minimum:0}),gutter:r.Number({minimum:0})},{additionalProperties:!1,description:"Document margin configuration"}),EW=r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),ov=r.Object({size:r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1})],{description:"Standard page size or custom dimensions"}),margins:iv},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),_g=r.Object({heading:Qr,body:Qr,mono:Qr,light:Qr},{additionalProperties:!1,description:"Font definitions for different text types"}),av=r.Union([r.Literal("single"),r.Literal("dashDotStroked"),r.Literal("dashed"),r.Literal("dashSmallGap"),r.Literal("dotDash"),r.Literal("dotDotDash"),r.Literal("dotted"),r.Literal("double"),r.Literal("doubleWave"),r.Literal("inset"),r.Literal("nil"),r.Literal("none"),r.Literal("outset"),r.Literal("thick"),r.Literal("thickThinLargeGap"),r.Literal("thickThinMediumGap"),r.Literal("thickThinSmallGap"),r.Literal("thinThickLargeGap"),r.Literal("thinThickMediumGap"),r.Literal("thinThickSmallGap"),r.Literal("thinThickThinLargeGap"),r.Literal("thinThickThinMediumGap"),r.Literal("thinThickThinSmallGap"),r.Literal("threeDEmboss"),r.Literal("threeDEngrave"),r.Literal("triple"),r.Literal("wave")],{description:"Paragraph border style"}),Mg={style:av,size:r.Number({minimum:0,description:"Width in eighths of a point (docx sz)"}),color:X,space:r.Optional(r.Number({minimum:0,description:"Space between text and border in points"}))},Nc=r.Object(Mg,{additionalProperties:!1,description:"Paragraph border side definition"}),sv=r.Object(Mg,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),Bg=r.Object({top:r.Optional(Nc),bottom:r.Optional(Nc),left:r.Optional(Nc),right:r.Optional(Nc),between:r.Optional(sv)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),Vg=r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),cr=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...hc.properties,alignment:Vg,priority:r.Optional(r.Number()),baseStyle:r.Optional(r.String()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(Bg),indent:r.Optional(Dn)},{additionalProperties:!1}),cv=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("middleDot"),r.Literal("none"),r.Literal("underscore")],{description:"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore"}),lv=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("bar"),r.Literal("clear"),r.Literal("decimal"),r.Literal("end"),r.Literal("num"),r.Literal("start")],{description:"Tab stop alignment type"}),pv=r.Object({type:lv,position:r.Union([r.Number({description:"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin"}),r.Literal("max",{description:"Use maximum position (TabStopPosition.MAX = 9026 twips)"})]),leader:r.Optional(cv)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),ro=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...hc.properties,alignment:Vg,tabStops:r.Optional(r.Array(pv,{description:"Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.",default:[{type:"right",position:"max",leader:"none"}]})),priority:r.Optional(r.Number()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(Bg),indent:r.Optional(Dn)},{additionalProperties:!1}),Kg=r.Object({normal:r.Optional(cr),heading1:r.Optional(cr),heading2:r.Optional(cr),heading3:r.Optional(cr),heading4:r.Optional(cr),heading5:r.Optional(cr),heading6:r.Optional(cr),title:r.Optional(cr),subtitle:r.Optional(cr),TOC1:r.Optional(ro),TOC2:r.Optional(ro),TOC3:r.Optional(ro),TOC4:r.Optional(ro),TOC5:r.Optional(ro),TOC6:r.Optional(ro)},{additionalProperties:cr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),$W=r.Object({level:r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)]),...cr.properties},{additionalProperties:!1}),Gg=r.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:r.Optional(X),accent5:r.Optional(X),accent6:r.Optional(X)},{additionalProperties:!1}),Rc=r.Object({...Rn,colors:r.Optional(r.Partial(Gg)),fonts:r.Optional(r.Partial(_g)),styles:r.Optional(Kg)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),no=r.Object({...Rn,$schema:r.Optional(r.String()),name:r.String(),displayName:r.String(),description:r.String({description:"The visual voice: what the theme looks like, in one sentence."}),whenToUse:r.Optional(r.String({description:"The documents the theme suits; discovery and the design guide quote it."})),version:r.String(),colors:Gg,fonts:_g,fontRegistry:r.Optional(wr),page:ov,styles:r.Optional(Kg),componentDefaults:r.Optional(Lc),noProofWords:r.Optional(r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive)."}))},{additionalProperties:!1,description:"Theme configuration"});function qg(e){return P.Check(no,e)}function Wg(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 Gm=r.Object({},{additionalProperties:!1}),mv=e=>r.Object({blocks:r.Optional(Yr),theme:r.Optional(r.String({description:`Theme name to apply (default: "minimal"). Built-ins: ${Ha.join(", ")} (consulting is the house style).`,examples:[...Ha],default:"minimal"})),themeOverrides:r.Optional(Rc),qualityProfile:r.Optional(r.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:r.Optional(wr),componentDefaults:r.Optional(Lc),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:`Default document language (BCP-47 tag, e.g. "en-US"). Sets Word\'s default proofing/spell-check language; individual components can override it locally.`,examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),noProofWords:r.Optional(Ra),trackRevisions:r.Optional(r.Boolean({description:"Open the document in track-changes mode: Word marks any further edits as revisions. Set automatically on redline documents produced by the diff engine"})),metadata:r.Optional(r.Object({title:r.Optional(r.String({description:"Document title",examples:["Annual Report 2024","Technical Documentation"]})),subtitle:r.Optional(r.String({description:"Document subtitle"})),description:r.Optional(r.String()),author:r.Optional(r.String()),company:r.Optional(r.String({description:"Company name, written to docProps/custom.xml (Word has no core-property slot for it)"})),date:r.Optional(r.String({description:"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)"})),version:r.Optional(r.String({description:"Document version, written to docProps/custom.xml",examples:["1.0","2024.3"]})),tags:r.Optional(r.Array(r.String()))},{description:"Document metadata (title, author, company, version, etc.). Package timestamps (dcterms:created/modified) are not part of this object: they come from the `generatedAt` generation option so repeated builds stay byte-identical.",additionalProperties:!1}))},{description:"Report component props",additionalProperties:!1}),un=mv(),qm=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Text box width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box width as percentage (e.g., "50%") relative to content width\'})],{description:\'Text box width in pixels (number) or as percentage string (e.g., "50%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Text box height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box height as percentage (e.g., "50%") relative to content height\'})],{description:\'Text box height in pixels (number) or as percentage string (e.g., "50%")\'})),renderAs:r.Optional(r.Union([r.Literal("table"),r.Literal("shape")],{description:"Rendering strategy. \'table\' (default): borderless one-cell table \\u2014 height auto-fits content, per-side borders and percentage widths resolve in Word. \'shape\': native Word text box (WPS shape) \\u2014 real wrap modes and z-order, but requires explicit width and height (no autofit), a single uniform border, and eagerly-resolved percentage sizes."})),floating:r.Optional(xi),style:r.Optional(r.Object({padding:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),border:r.Optional(r.Object({top:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),right:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),bottom:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),left:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1}))},{additionalProperties:!1})),shading:r.Optional(r.Object({fill:r.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"]}}}]))}}}}}}]}),uv=r.Union([r.Literal("numeric"),r.Literal("bullet"),r.Literal("none")],{description:"TOC numbering style \\u2014 accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation"}),dv=r.Union([r.Literal("document"),r.Literal("section")],{description:"TOC scope: document-wide or section-only"}),fv=r.Object({styleId:r.String({description:"Custom style ID matching a key in theme.styles"}),level:r.Number({minimum:1,maximum:6,description:"TOC level (1-6) to assign to this style"})},{description:"Mapping of custom style to TOC level",additionalProperties:!1}),GW=r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify at least one of "from" or "to".\',additionalProperties:!1}),Wm=r.Object({pageBreak:r.Optional(r.Boolean({description:"Insert page break before TOC block"})),depth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify "from", "to", or both. Defaults: from=1, to=3\',additionalProperties:!1,default:{to:3}})),pageNumbersDepth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to show page numbers. Specify "from", "to", or both. When specified, page numbers are hidden for entries outside this range.\',additionalProperties:!1})),numberingStyle:r.Optional(uv),title:r.Optional(r.String({description:"TOC heading title"})),includePageNumbers:r.Optional(r.Boolean({default:!0,description:"Show page numbers next to entries"})),numberSeparator:r.Optional(r.Boolean({default:!0,description:\'Use tab separator between entry and page number. True applies "\\\\t" (default), false applies " "\'})),scope:r.Optional(r.Union([dv,r.Literal("auto")],{default:"auto",description:\'TOC scope: "document" for entire document, "section" for parent section only, "auto" for automatic detection (section if inside section, otherwise document)\'})),styles:r.Optional(r.Array(fv,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),Hm=r.Object({thickness:r.Optional(r.Number({minimum:.25,maximum:12,description:"Line weight in points (default 1). OOXML measures a border in eighths of a point and Word stops at 12pt, so this is the whole usable range."})),color:r.Optional(X),style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double")],{description:\'Line style (default "solid"). `double` draws two lines and is measured per line, so it reads about twice as tall as its thickness.\'})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Divider width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Divider width as a percentage of the text measure (e.g. "40%")\'})],{description:"How far the line runs (default: the full text measure). A percentage or a point width is turned into paragraph indents, resolved against the theme page \\u2014 so a partial divider inside a column or a re-margined section is measured against the page, while the default full-measure divider is exact everywhere."})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:\'Which end of the measure a partial divider sits at (default "left"). Ignored at full width.\'})),spacing:r.Optional(Pt)},{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=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to content width\'})],{description:\'Rendered image width in pixels (number) or as percentage string (e.g., "90%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to content height\'})],{description:\'Rendered image height in pixels (number) or as percentage string (e.g., "90%")\'}))}),hv=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("column"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),gv=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."}))},{additionalProperties:!1}),Jm=r.Object({type:hv,data:r.Array(gv,{description:"Chart data series",minItems:1}),title:r.Optional(r.String({description:"Chart title text"})),showTitle:r.Optional(r.Boolean({description:"Show the chart title. Defaults to true when `title` is set."})),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to the theme palette."})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),width:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart width in inches. Defaults to the content width."})),height:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart height in inches. Defaults to 3."})),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Chart caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(Pt),floating:r.Optional(xi),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\',additionalProperties:!1}),dt=[{name:"docx",propsSchema:un,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:ln,createPropsSchema:Bm,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:pn,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:qm,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:nn,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:on,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:an,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:sn,hasChildren:!1,category:"content",description:"Statistic display - shows a number with description. Perfect for KPIs and metrics."},{name:"block",propsSchema:Un,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:Gm,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:cn,createPropsSchema:Mm,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:mn,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:Wm,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:Hm,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:Jm,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:Tc,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 za(e){return dt.find(t=>t.name===e)}function Hg(){return dt.map(e=>e.name)}function zg(){return dt.filter(e=>e.hasChildren)}function yv(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function wi(e,t,n,i){let o={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion."}))};e.special?.hasSchemaField&&(o.$schema=r.Optional(r.String({format:"uri"})),o.renderer=i?i.requireDiscriminator?r.Literal(i.renderer,{description:"Renderer backend for this document"}):r.Optional(r.Literal(i.renderer,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})):r.Optional(r.Union(Cr.map(c=>r.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&n?e.createPropsSchema(n):e.propsSchema,s=i?Ec(e.name,a,i.renderer):a;return o.props=yv(s)?s:r.Optional(s),e.hasChildren&&t&&(o.children=e.special?.hasSchemaField?r.Array(t):r.Optional(r.Array(t))),r.Object(o,{additionalProperties:!1,description:e.description})}function Jg(e){return dt.map(t=>wi(t,e))}function kc(e,t=[],n){let i=p=>!n||!p.renderers||p.renderers.includes(n.renderer),o=new Map;for(let p of dt)i(p)&&(p.hasChildren||o.set(p.name,wi(p,void 0,e,n)));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=r.Intersect([e,r.Object({name:r.Union([...u.allowedChildren.map(v=>r.Literal(v)),...t.map(v=>v.properties.name)])})]);s.set(u.name,wi(u,x,e,n)),c.splice(m,1);continue}if(!u.allowedChildren){s.set(u.name,wi(u,e,e,n)),c.splice(m,1);continue}if(!u.allowedChildren.filter(x=>a.some(v=>v.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]:r.Union(S);s.set(u.name,wi(u,w,e,n)),c.splice(m,1)}if(c.length===p)throw new Error(`Circular allowedChildren among: ${c.map(m=>m.name).join(", ")}`)}let l=new Map([...s,...o]);return{schemas:[...l.values()],byName:l}}function Fc(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),i=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&n.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 Yg(e,t={}){let{$schema:n="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:v,...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:n};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),Fc(m),vg(m),wa(m),m}function Xg(e,t,n,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(zg().map(s=>s.name).includes(e)&&(o.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${i}`}},n&&(o.definitions={[i]:JSON.parse(JSON.stringify(n))})),t.enhanceForRichContent&&e==="table"){let s=o;s.definitions||(s.definitions={}),n&&(s.definitions[i]=JSON.parse(JSON.stringify(n)));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 Fc(o,i),o.additionalProperties=!1,o}async function Qg(e,t,n={}){let{prettyPrint:i=!0}=n,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>ed(vp(),1))).writeFile(t,o,"utf-8")}var Zg={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"\'}},ey={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"}},ty={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function ry(e={}){return r.Union(Cr.map(t=>bv(e,t,t!==Wa)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function bv(e,t,n){let{includeStandardComponents:i=!0,customComponents:o=[],title:a="JSON Report Definition",description:s="JSON report definition with TypeBox schemas"}=e,c=[],l=[],p=rn(t),m=r.Recursive(f=>{let O=[];for(let I of o)if(I.versionedProps&&I.versionedProps.length>0){let R=I.versionedProps,G=ut(R.map(te=>te.version));for(let te of R){let T=te.description||I.description,Z={name:r.Literal(I.name),id:r.Optional(r.String()),version:T?r.Literal(te.version,{description:T}):r.Literal(te.version),props:te.propsSchema};te.hasChildren&&(Z.children=r.Optional(r.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(r.Object(Z,{additionalProperties:!1,description:je}))}let qe=R.find(te=>te.version===G),We={name:r.Literal(I.name),id:r.Optional(r.String()),props:qe.propsSchema};qe.hasChildren&&(We.children=r.Optional(r.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(r.Object(We,{additionalProperties:!1,description:He}))}else{let R=!!I.hasChildren,G={name:r.Literal(I.name),id:r.Optional(r.String()),props:I.propsSchema};R&&(G.children=r.Optional(r.Array(f))),O.push(r.Object(G,{additionalProperties:!1,...I.description?{description:I.description}:{}}))}let{schemas:S,byName:w}=i?kc(f,O,{renderer:t,requireDiscriminator:n}):{schemas:[],byName:new Map};c=["section",...za("section")?.allowedChildren??[]].map(I=>w.get(I)).filter(I=>I!==void 0),l=O;let v=[...S,...O];if(v.length===0)return r.Any();if(v.length===1)return v[0];{let I=o.length>0?"Component definition with discriminated union including custom components":"Component definition with discriminated union";return r.Union(v,{discriminator:{propertyName:"name"},description:I})}},{$id:p}),u=za("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 r.Object({name:r.Literal("docx"),id:r.Optional(r.String()),$schema:r.Optional(r.String({format:"uri"})),renderer:n?r.Literal(t,{description:"Renderer backend for this document"}):r.Optional(r.Literal(t,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})),props:r.Optional(Ec(u.name,u.propsSchema,t)),children:r.Array(r.Union([...c,...l],{discriminator:{propertyName:"name"}}))},{additionalProperties:!1,title:a,description:s,definitions:{[p]:m}})}var jc=r.Union([...Jg(r.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),ft=r.Recursive(e=>r.Union([...kc(e).schemas],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"}));var Ym=r.Object({content:r.String({description:"Text content (required)"}),spaceAfter:r.Optional(r.Number({minimum:0,description:"Spacing after text in points"})),fontSize:r.Optional(r.Number({minimum:1})),fontFamily:r.Optional(r.String()),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),color:r.Optional(r.String({pattern:"^#[0-9A-Fa-f]{6}$"})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")]))}),Xm=r.Object({name:r.Literal("text-space-after"),id:r.Optional(r.String()),props:Ym}),Pr=Xm;function Ov(e,t){let n=String(e.type||""),i=e.path||"root";return n==="62"||n==="union"?xv(e):e.message?.includes("additionalProperties")?Sv(e):e.message?.includes("Required property")?Iv(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?wv(e):n==="literal"?Cv(e):n==="pattern"||n==="RegExp"?Pv(e):`At ${i}: ${e.message}`}function xv(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n){let o=n.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=n;if("children"in n&&Array.isArray(i.children))return`Document is missing required \'name\' field. Add "name": "docx" at the root level.`;if("name"in n||"styles"in n)return"This appears to be a theme configuration. Use --type theme or ensure proper document structure."}return\'Invalid document structure. Expected a document with name="docx" or a theme configuration.\'}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function Sv(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(n).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 Iv(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory for this configuration.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function wv(e){let t=e.path||"root",n=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 ${n} but got ${i}`}function Cv(e){let t=e.path||"root",n=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${i}`}function Pv(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 ru(e,t,n){let i=Ir(n),o=Ov(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=Av(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=Tv(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function nu(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=n)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push(ru(a,t?.jsonString,void 0)))}return i}function Tv(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let o=`"${n[n.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 Av(e,t){let{type:n,path:i,value:o}=e,a=String(n);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?`${ui.FIX} ${s}`:s}if("props"in o&&typeof o.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${Sr(un).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 Ev=Object.fromEntries([...dt.map(e=>[e.name,e.propsSchema]),["custom",Pr]]),$v=new Map(dt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),Qm=new Set(dt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),vv=new Map(dt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),Lv={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function iy(e,t,n,i){let o=typeof e.name=="string"?vv.get(e.name):void 0;if(o)for(let a of Object.keys(e)){if(!o.has(a)){if(n.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=Lv[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 Nv=["path","base64","svg"];function Rv(e){if(!e||typeof e!="object")return[];let t=e;return Nv.filter(n=>{let i=t[n];return typeof i=="string"&&i.trim().length>0})}function kv(e){let t=[],n=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>n(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=Rv(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))n(i[a],`${o}/${a}`)}};return n(e,""),t}var Fv=new Set(["paragraph","heading"]);function iu(e){let t=[],n=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>n(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(Fv.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))n(i[a],`${o}/${a}`)}};return n(e,""),t}function ou(e){let t=[],n=(i,o)=>{if(Array.isArray(i)){i.forEach((s,c)=>n(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))n(i[s],`${o}/${s}`)};return n(e,""),t}var jv=new Set(["dashed","dotted","double"]);function au(e){let t=[],n=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>n(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"&&jv.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))n(i[a],`${o}/${a}`)}};return n(e,""),t}function su(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Document must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Qm.has(e.name)){let i=[...Qm].map(o=>`"${o}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}if(iy(e,"",t,n),Qm.has(e.name)&&"props"in e){let i=eu(e.name,e.props,"/props",t);n.push(...i)}return e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),oy(e,"",t,n),n}function oy(e,t,n,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}n.knownCustomNames?.has(s.name)||(iy(s,c,n,i),"props"in s?i.push(...eu(s.name,s.props,`${c}/props`,n)):s.name!=="custom"&&i.push(...eu(s.name,{},`${c}/props`,n)),oy(s,c,n,i))},a=typeof e.name=="string"?$v.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)Zm(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 Zm(e,t,n,i){if(t.length===0){i(e,n);return}if(!e||typeof e!="object")return;let[o,...a]=t;if(o==="*"){if(!Array.isArray(e))return;e.forEach((s,c)=>Zm(s,a,`${n}/${c}`,i));return}Zm(e[o],a,`${n}/${o}`,i)}function eu(e,t,n,i={}){let o=[],a=Ev[e];if(!a)return o.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=Uv(a,t),c=i.allowUnknownFields?P.Clean(s,P.Clone(t)):t;if(!P.Check(s,c)){let l=[...P.Errors(s,c)];nu(l,{maxErrors:100}).forEach(m=>{let u=m.path==="root"?n:`${n}${m.path.startsWith("/")?m.path:"/"+m.path}`;o.push({...m,path:u})})}return o}function Uv(e,t){let n=e.anyOf;if(!Array.isArray(n)||n.length===0)return e;let i=n.filter(c=>Dv(c,t));if(i.length===1)return i[0];let o=i.length>1?i:n,a=o[0],s=Number.POSITIVE_INFINITY;for(let c of o){let l=[...P.Errors(c,t)].length;l<s&&(s=l,a=c)}return a}function Dv(e,t){let n=e.properties;if(!n)return!1;let i=new Set(e.required??[]),o=t??{};for(let[a,s]of Object.entries(n)){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 cu(e,t=[],n={}){let i=su(e,n),o=t.filter(a=>!_v(a));return Mv([...o,...i])}function _v(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function Mv(e){let t=new Set,n=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),n.push(i))}return n}function Tt(e,t,n){try{if(!P.Check(e,t)){let o=[...P.Errors(e,t)];return{valid:!1,errors:tt(o,{jsonString:n?.jsonString,maxErrors:n?.maxErrors||100})}}let i=t;return n?.clean&&(i=P.Clean(e,P.Clone(i))),n?.applyDefaults&&(i=P.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 io(e,t,n){if(typeof t=="string"){if(!t.trim())return{valid:!1,errors:[{path:"root",message:"Input must be a non-empty string",code:"empty_input"}],isJsonError:!0};let o;try{o=JSON.parse(t)}catch(s){return s instanceof Error?{valid:!1,errors:[di(s,t)],isJsonError:!0}:{valid:!1,errors:[{path:"root",message:"Failed to parse JSON",code:"json_parse_error"}],isJsonError:!0}}return{...Tt(e,o,{...n,jsonString:t,calculatePosition:!0}),parsed:o,isJsonError:!1}}return{...Tt(e,t,n),parsed:t,isJsonError:!1}}function ay(e,t,n){let i=[],o=[],a=!1;for(let s=0;s<t.length;s++){let c=Tt(e,t[s],n);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(n?.maxErrors&&o.length>=n.maxErrors)break}return a?{valid:!1,errors:o.slice(0,n?.maxErrors)}:{valid:!0,data:i}}function sy(e,t,n,i){let o=Tt(e,t,i);return!o.valid&&o.errors&&(o.errors=n(o.errors)),o}function cy(e,t){return(n,i)=>Tt(e,n,{...t,...i})}function ly(e,t){return(n,i)=>io(e,n,{...t,...i})}function py(e){return e.valid===!0&&e.data!==void 0}function my(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Jr(e.errors)}var Bv=ft,Vv=[{why:"image source mutual-exclusivity",collect:kv},{why:"indent hanging/firstLine mutual-exclusivity",collect:iu},{why:"notes on a revised paragraph",collect:ou},{why:"a text box asking for a shape rendering a shape cannot give it",collect:au},{why:"renderer profile compatibility",collect:$c}];function uy(e){return Vv.flatMap(({collect:t})=>t(e))}function tu(e,t){if(Array.isArray(e))return e.some(i=>tu(i,t));if(!e||typeof e!="object")return!1;let n=e;return typeof n.name=="string"&&t.has(n.name)?!0:Object.values(n).some(i=>tu(i,t))}var ny;function Kv(){return ny??(ny=r.Recursive(e=>r.Union(dt.map(t=>wi(t,e,e))))),ny}function Gv(e,t,n){return n?.allowUnknownFields===!0||n?.knownCustomNames!==void 0&&n.knownCustomNames.size>0&&tu(e,n.knownCustomNames)||P.Check(Kv(),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 dy(e,t,n){let i=cu(e,t,{allowUnknownFields:n?.allowUnknownFields,knownCustomNames:n?.knownCustomNames});return i.length===0?Gv(e,t,n):{valid:!1,errors:i}}function Uc(e,t){let n=Tt(ft,e,t),i=n.errors||[],o=n.valid;!n.valid&&e&&({valid:o,errors:i}=dy(e,n.errors||[],t));let a=[...uy(e),...zi(e,Xr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=n.data??(o?e:void 0),c={...n,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=>!hy(m.name));c.hasCustomComponents=p}}return c}function Dc(e,t){let n=io(Bv,e,t),i=n.errors||[],o=n.valid;!n.valid&&n.parsed&&({valid:o,errors:i}=dy(n.parsed,n.errors||[],t));let a=[...uy(n.parsed),...zi(n.parsed,Xr(n.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=n.data??(o?n.parsed:void 0),c={...n,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=>!hy(m.name));c.hasCustomComponents=p}}return c}function fy(e){return e.valid===!0&&e.data!==void 0}function qv(){return mi(jc)}function hy(e){return qv().includes(e)}function _c(e){return{validate:(t,n)=>Uc(t,{...e,...n}),validateJson:(t,n)=>Dc(t,{...e,...n})}}var oo=_c({clean:!0,applyDefaults:!0,maxErrors:100}),Ja=_c({clean:!1,applyDefaults:!1,maxErrors:100}),gy=Dc,yy=Uc;function Wv(){return{includeEmojis:!Oy(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:Hv()}}var vH=Wv(),by={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 Oy(){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 Hv(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Oy()}function Vc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let n=Tt(no,e,t),i={...n};if(n.valid&&n.data){let o=n.data;o.name&&(i.themeName=o.name)}return i}function lu(e,t){let n=io(no,e,t),i={...n};if(n.valid&&n.data){let o=n.data;typeof o=="object"&&!o.$schema&&(o.$schema="./json-schemas/theme.schema.json"),o.name&&(i.themeName=o.name)}return i}function pu(e,t){let n=Vc(e,t);return!n.valid&&n.errors&&(n.errors=n.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))),n}function xy(e){return e.valid===!0&&e.data!==void 0}function Kc(e){return{validate:(t,n)=>Vc(t,{...e,...n}),validateJson:(t,n)=>lu(t,{...e,...n}),validateWithEnhancement:(t,n)=>pu(t,{...e,...n})}}var Ya=Kc({clean:!0,applyDefaults:!0}),Mc=Kc({clean:!1,applyDefaults:!1,maxErrors:10});function Sy(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 Iy(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var wy={report:un,section:ln,heading:nn,paragraph:on,columns:pn,image:an,statistic:sn,table:cn,list:mn,custom:Pr};function so(e,t,n){let i=wy[e];if(!i){let a=Tt(Pr,t,n);return{...a,success:a.valid,componentName:e,isCustomComponent:!0}}let o=Tt(i,t,n);return{...o,success:o.valid,componentName:e,isCustomComponent:e==="custom"}}function mu(e,t){let n=Tt(ft,e,t),i={...n};if(n.valid&&n.data){let o=n.data;i.componentName=o.name,i.isCustomComponent=!co(o.name)}return i}function uu(e,t,n){return vn(e,t,n)}function co(e){return e in wy}function Cy(e){return P.Check(un,e)}function Py(e){return P.Check(ln,e)}function Ty(e){return P.Check(nn,e)}function Ay(e){return P.Check(on,e)}function Ey(e){return P.Check(pn,e)}function $y(e){return P.Check(an,e)}function vy(e){return P.Check(sn,e)}function Ly(e){return P.Check(cn,e)}function Ny(e){return P.Check(mn,e)}function Ry(e){return P.Check(Pr,e)}function Gc(e){return{validate:(t,n,i)=>co(t)?so(t,n,{...e,...i}):so("custom",n,{...e,...i}),validateDefinition:(t,n)=>mu(t,{...e,...n}),validateCustom:(t,n,i)=>uu(t,n,{...e,...i})}}var ao=Gc({clean:!0,applyDefaults:!0}),Bc=Gc({clean:!1,applyDefaults:!1,maxErrors:10}),ky={document:e=>oo.validate(e),jsonDocument:e=>oo.validateJson(e),theme:e=>Ya.validate(e),jsonTheme:e=>Ya.validateJson(e),component:(e,t)=>ao.validate(e,t),componentDefinition:e=>ao.validateDefinition(e),components:e=>e.map(t=>ao.validate(t.name,t.props)),isDocument:e=>oo.validate(e).valid,isTheme:e=>Ya.validate(e).valid,isComponent:(e,t)=>ao.validate(e,t).valid},Fy={document:e=>Ja.validate(e),jsonDocument:e=>Ja.validateJson(e),theme:e=>Mc.validate(e),jsonTheme:e=>Mc.validateJson(e),component:(e,t)=>Bc.validate(e,t),componentDefinition:e=>Bc.validateDefinition(e)};var jy=r.Object({definition:ft,format:r.Optional(r.Union([r.Literal("docx"),r.Literal("pdf"),r.Literal("html")])),options:r.Optional(r.Object({includeMetadata:r.Optional(r.Boolean()),includeComments:r.Optional(r.Boolean({deprecated:!0,description:"Deprecated and ignored. Comments are authored per component via the `comment` prop."})),trackChanges:r.Optional(r.Boolean())},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation request"}),Uy=r.Object({definition:r.Unknown(),strict:r.Optional(r.Boolean())},{additionalProperties:!1,description:"Document validation request"}),Dy=r.Object({success:r.Boolean(),documentId:r.Optional(r.String()),downloadUrl:r.Optional(r.String()),error:r.Optional(r.String()),metadata:r.Optional(r.Object({pageCount:r.Optional(r.Number()),wordCount:r.Optional(r.Number()),generatedAt:r.Optional(r.String({format:"date-time"}))},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation response"}),_y=r.Object({valid:r.Boolean(),errors:r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})),warnings:r.Optional(r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})))},{additionalProperties:!1,description:"Document validation response"});var My=ft,By={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 zv=1e6;function Vy(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function qc(e){let t=[];for(let n of e){if(!n.text)continue;let i=t[t.length-1];i&&i.type===n.type?i.text+=n.text:t.push({...n})}return t}function Jv(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 n=[],i=0;for(;i<t.length;){if(t[i].type==="equal"){n.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&&n.push({type:"delete",text:o}),a&&n.push({type:"insert",text:a})}return qc(n)}function Xc(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let n=Vy(e),i=Vy(t);if(n.length===0)return qc([{type:"insert",text:t}]);if(i.length===0)return qc([{type:"delete",text:e}]);if(n.length*i.length>zv)return qc([{type:"delete",text:e},{type:"insert",text:t}]);let o=n.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]=n[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;)n[l]===i[p]?(c.push({type:"equal",text:n[l]}),l++,p++):s[l+1][p]>=s[l][p+1]?(c.push({type:"delete",text:n[l]}),l++):(c.push({type:"insert",text:i[p]}),p++);for(;l<o;)c.push({type:"delete",text:n[l]}),l++;for(;p<a;)c.push({type:"insert",text:i[p]}),p++;return Jv(c)}function Qa(e){return e.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g,"$1").replace(/(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,(t,n,i,o,a,s,c)=>i??a??c??"")}var bu=new Set(["paragraph","heading"]);function lr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Bn(e,t){return{...e.author&&{author:e.author},...e.date&&{date:e.date},segments:t}}function Xa(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Wc(e){return Qa(Xa(e))}var Yv=/\\{[^}]+\\}/;function Hc(e){return e.enabled!==!1}function rs(e,t,n,i){e.some(o=>o.type!=="equal"&&Yv.test(o.text))&&i.summary.untracked.push({path:t,kind:"modified",component:n,detail:"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline"})}function Vn(e,...t){let n={...e||{}};for(let i of t)delete n[i];return n}var Xv=4e6;function Ou(e,t,n){let i=e.map(n),o=t.map(n),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>Xv){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 v=u-1;v>=0;v--)O[x][v]=i[a+x]===o[a+v]?O[x+1][v+1]+1:Math.max(O[x+1][v],O[x][v+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 xu(e,t,n){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]&&n(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 Qv(e,t,n,i){let o=Wc(e),a=Wc(t),s=!lr(Vn(e.props,"text","revision","comment"),Vn(t.props,"text","revision","comment"));if(s&&i.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"formatting/props changed (not expressible as a tracked change); new version rendered"}),o===a)return Xa(e)!==Xa(t)?i.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or link target changed (markdown-only); new version rendered without a tracked change"}):s||i.summary.unchangedBlocks++,t;i.summary.tracked.modified++;let c=Xc(o,a);return rs(c,n,t.name,i),(Xa(e)!==o||Xa(t)!==a)&&i.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or links flattened to plain text in the redline (revision segments render literally)"}),{...t,props:{...Qc(t,n,i),text:a,revision:Bn(i,c)}}}function Qc(e,t,n){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 n.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 Zv(e,t,n){n.summary.tracked.inserted++;let i=Wc(e),o=[{type:"insert",text:i}];return rs(o,t,e.name,n),{...e,props:{...Qc(e,t,n),text:i,revision:Bn(n,o)}}}function eL(e,t,n){n.summary.tracked.deleted++;let o=[{type:"delete",text:Wc(e)}];return rs(o,t,e.name,n),{...e,props:{...Qc(e,t,n),text:"",revision:Bn(n,o)}}}function du(e){return(e.props?.items||[]).map(n=>{let i=typeof n=="string"?n:n.text,o=typeof n=="string"?0:n.level||0;return{raw:i,text:Qa(i.normalize("NFC")),level:o}})}function tL(e,t,n,i){let o=!lr(Vn(e.props,"items"),Vn(t.props,"items"));o&&i.summary.untracked.push({path:n,kind:"modified",component:"list",detail:"list configuration changed (format/levels/spacing); new version rendered"});let a=du(e),s=du(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:n,kind:"modified",component:"list",detail:"inline formatting or link target changed in list items (markdown-only); new version rendered without a tracked change"}),t;let l=Ou(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}=xu(O,S,(x,v)=>x.level===v.level);for(let x of w)if(m=!0,x.kind==="paired"){let v=Xc(x.oldItem.text,x.newItem.text);rs(v,n,"list",i),p.push({text:x.newItem.text,level:x.newItem.level,revision:Bn(i,v)})}else x.kind==="inserted"?p.push({text:x.newItem.text,level:x.newItem.level,revision:Bn(i,[{type:"insert",text:x.newItem.text}])}):p.push({text:"",level:x.oldItem.level,revision:Bn(i,[{type:"delete",text:x.oldItem.text}])})}return m&&i.summary.tracked.modified++,{...t,props:{...t.props,items:p}}}function Gy(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let i=du(e).map(o=>({text:t==="insert"?o.text:"",level:o.level,revision:Bn(n,[{type:t,text:o.text}])}));return{...e,props:{...e.props,items:i}}}function fu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return Qa(t.normalize("NFC"));if(t&&typeof t=="object"){let i=t.props?.text;if(typeof i=="string")return Qa(i.normalize("NFC"))}return""}function hu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return t.normalize("NFC");if(t&&typeof t=="object"){let n=t.props?.text;if(typeof n=="string")return n.normalize("NFC")}return""}function Ky(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function gu(e){let t=e.props?.columns??[],n=t.reduce((o,a)=>Math.max(o,a.cells?.length??0),0),i=e.props?.rows??[];return Array.from({length:n},(o,a)=>{let s=t.map(c=>c.cells?.[a]);return{cells:s,key:s.map(fu).join("\\0"),rawKey:s.map(hu).join("\\0"),rowProps:i[a]}})}function qy(e,t,n){let i=e.props?.columns??[],o=t.map((a,s)=>({...a.rowProps??{},...n[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 zc(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function rL(e,t,n,i,o,a){let s=Xc(n,i);rs(s,o,"table",a),(hu(t)!==n||hu(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:nL(c.content,i,o,a),revision:Bn(a,s)}}function nL(e,t,n,i){if(!e||typeof e!="object")return t;let o=e;return{...o,props:{...Qc(o,n,i),text:t}}}function iL(e,t,n,i){let o=gu(e),a=gu(t),s=e.props?.columns??[],c=t.props?.columns??[];if(s.length!==c.length)return i.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table column count changed (columns are not expressible as a tracked change); new version rendered"}),t;let l=!lr(Vn(e.props,"columns","rows"),Vn(t.props,"columns","rows"));l&&i.summary.untracked.push({path:n,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:n,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:n,kind:"modified",component:"table",detail:"inline formatting or link target changed in table cells (markdown-only); new version rendered without a tracked change"}),t;let m=Ou(o,a,x=>x.key),u=[],f=[],O=!1,S=(x,v)=>{u.push(x),f.push(v)},w=0;for(;w<m.length;){let x=m[w];if(x.op==="equal"){S(x.newItem,{}),w++;continue}let v=[],I=[];for(;w<m.length&&m[w].op!=="equal";){let G=m[w];G.op==="delete"?v.push(G.oldItem):G.op==="insert"&&I.push(G.newItem),w++}let{plan:R}=xu(v,I,(G,qe)=>G.cells.length===qe.cells.length&&G.cells.every(Ky)&&qe.cells.every(Ky));for(let G of R)if(O=!0,G.kind==="paired"){let qe=G.newItem.cells.map((We,He)=>{let te=fu(G.oldItem.cells[He]),T=fu(We);return te===T?We??{content:""}:rL(We,G.oldItem.cells[He],te,T,n,i)});S({...G.newItem,cells:qe},{})}else G.kind==="inserted"?(i.summary.tracked.inserted++,S(G.newItem,{revision:yu(i,"insert")})):(i.summary.tracked.deleted++,S(G.oldItem,{revision:yu(i,"delete")}))}return O&&i.summary.tracked.modified++,qy(t,u,f)}function Wy(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let i=gu(e);return qy(e,i,i.map(()=>({revision:yu(n,t)})))}function yu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function Jc(e){return Array.isArray(e.children)}function oL(e,t){return e.name===t.name}function aL(e,t,n,i){let o=Hc(e),a=Hc(t);return!o&&!a?(i.summary.unchangedBlocks++,t):!o&&a?Hy(t,n,i):o&&!a?zy(e,n,i)??t:bu.has(t.name)?Qv(e,t,n,i):t.name==="list"?tL(e,t,n,i):t.name==="table"&&zc(e)&&zc(t)?iL(e,t,n,i):Jc(t)||Jc(e)?(!lr(e.props,t.props)&&i.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:Zc(e.children||[],t.children||[],`${n}/children`,i)}):(i.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:`"${t.name}" changed (no native tracked-change support); new version rendered`}),t)}function Hy(e,t,n){return Hc(e)?bu.has(e.name)?Zv(e,t,n):e.name==="list"?Gy(e,"insert",n):e.name==="table"&&zc(e)?Wy(e,"insert",n):Jc(e)?(typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" title rendered without insertion mark (titles are props, not text blocks)`}),{...e,children:Zc([],e.children||[],`${t}/children`,n)}):(n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" added (rendered, but not marked as a tracked insertion)`}),e):e}function zy(e,t,n){if(!Hc(e))return null;if(bu.has(e.name))return eL(e,t,n);if(e.name==="list")return Gy(e,"delete",n);if(e.name==="table"&&zc(e))return Wy(e,"delete",n);if(Jc(e)){typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" title still rendered without deletion mark (titles are props, not text blocks)`});let i=Zc(e.children||[],[],`${t}/children`,n);return{...e,children:i}}return n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" removed (dropped from the redline; Word cannot mark it as a tracked deletion)`}),null}function Zc(e,t,n,i){let o=Ou(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}=xu(p,m,oL);for(let f of u)if(f.kind==="paired")a.push(aL(f.oldItem,f.newItem,`${n}/${c}`,i)),c++;else if(f.kind==="inserted")a.push(Hy(f.newItem,`${n}/${c}`,i)),c++;else{let O=zy(f.oldItem,`${n}/${c}`,i);O&&a.push(O)}}return a}function sL(e,t,n={}){if(!e||e.name!=="docx")throw new Error(\'Old document: top-level component must be "docx"\');if(!t||t.name!=="docx")throw new Error(\'New document: top-level component must be "docx"\');let i={tracked:{modified:0,inserted:0,deleted:0},untracked:[],unchangedBlocks:0,notes:[]},o={author:n.author,date:n.date,summary:i};!lr(Vn(e.props,"trackRevisions"),Vn(t.props,"trackRevisions"))&&i.untracked.push({path:"/props",kind:"modified",component:"docx",detail:"document props changed (theme/metadata/defaults); new version used"});let s=Zc(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 Su=class{constructor(){N(this,"schema",ft)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(n){throw new lo("Invalid JSON syntax",this.extractJSONSyntaxError(n,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new po(\'Invalid document structure: Document must be a docx component with name="docx"\',[{path:"name",message:\'Document must be a docx component with name="docx"\',code:"INVALID_STRUCTURE"}]);if(!P.Check(this.schema,t)){let n=[...P.Errors(this.schema,t)];throw new po("JSON validation failed",this.formatTypeBoxErrors(n,typeof e=="string"?e:JSON.stringify(e,null,2)))}return t}validate(e){try{return this.parse(e),{valid:!0,errors:[],warnings:[]}}catch(t){return t instanceof lo||t instanceof po?{valid:!1,errors:t.validationErrors,warnings:[]}:{valid:!1,errors:[{path:"",message:t instanceof Error?t.message:"Unknown validation error",code:"UNEXPECTED_ERROR"}],warnings:[]}}}parseWithLineNumbers(e){let t=e.split(`\n`);try{return this.parse(e)}catch(n){if(n instanceof lo||n instanceof po){let i=n.validationErrors.map(o=>({...o,...this.findLineNumber(o.path,e,t)}));throw n instanceof lo?new lo(n.message,i):new po(n.message,i)}throw n}}extractJSONSyntaxError(e,t){let n=e.message,i=n.match(/position\\s+(\\d+)/i)||n.match(/at\\s+(\\d+)/i)||n.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: ${n}`,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(n=>{let i=n.path||"",o=this.findLineNumber(i,t);return{path:i,message:this.formatTypeBoxErrorMessage(n),code:this.getErrorCode(n),line:o.line,column:o.column,suggestions:this.generateSuggestions(n)}})}formatTypeBoxErrorMessage(e){let t=e.path?`at "${e.path}"`:"",n=e.message;return n.includes("Expected")?`${n} ${t}`:n.includes("Required property")?`${n} ${t}`:n.includes("Unexpected property")?`${n} ${t}`:n.includes("minimum")?`Value is too small ${t}. ${n}`:n.includes("maximum")?`Value is too big ${t}. ${n}`:`${n} ${t}`}getErrorCode(e){let t=String(e.type||"VALIDATION_ERROR").toUpperCase(),n=e.path?e.path.replace(/\\//g,"_").toUpperCase():"";return n?`${t}_${n}`:t}generateSuggestions(e){let t=[],n=e.message;if(n.includes("Expected string"))t.push("Ensure the value is wrapped in quotes");else if(n.includes("Expected number"))t.push("Remove quotes around numeric values");else if(n.includes("Expected array"))t.push("Use square brackets [] for arrays");else if(n.includes("Expected object"))t.push("Use curly braces {} for objects");else if(n.includes("Expected literal")){let i=n.match(/Expected literal (.+)/);i&&t.push(`Use the exact value: ${i[1]}`)}else if(n.includes("Unexpected property"))t.push("Remove unknown properties or check spelling"),t.push("Refer to the JSON schema documentation for valid properties");else if(n.includes("Expected union")){t.push("Check that the value matches one of the allowed formats");let i=e.path??"";(/\\/children\\/\\d+$/.test(i)||i.endsWith("/name"))&&t.push("Verify the component name is spelled correctly")}else if(n.includes("minimum")){let i=n.match(/minimum.*?(\\d+)/);i&&(n.includes("Array")?t.push(`Array must have at least ${i[1]} items`):t.push(`Value must be at least ${i[1]}`))}else n.includes("format")&&n.includes("uri")&&t.push("Ensure the URL is valid and starts with http:// or https://");return t.length===0&&(t.push("Check the JSON schema documentation for valid values"),t.push("Verify the property name and value format")),t}findLineNumber(e,t,n){if(!e)return{};let i=n||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{}}},lo=class extends Error{constructor(t,n){super(t);N(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=n}},po=class extends Error{constructor(t,n){super(t);N(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=n}};function cL(e){return new Su().parse(e)}function lL(e){return new Su().parseWithLineNumbers(e)}function pL(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;let n=t.path?`${t.path}: `:"",i=t.message||"Validation error";return`${n}${i}`}):[]}function mL(e,t){let n=co(e)?e:"custom",i=so(n,t);return i.valid?{success:!0,data:i.data}:{success:!1,error:i.errors||[]}}function uL(e){let t=mu(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function dL(e,t){let n=t&&co(t)?t:"custom",i=so(n,e);return i.valid?[]:(i.errors||[]).map(o=>o.path?`${o.path}: ${o.message}`:o.message)}function fL(e){let t=e.path||"root",n=e.message,i,o,a,s;if(n.includes("Expected")){let c=n.match(/Expected (.+) but received (.+)/);c&&(o=c[1],a=c[2],i=hL(o,a))}if(n.includes("Required property")){let c=n.match(/Required property \'(.+)\'/);c&&(n=`Missing required field: ${c[1]}`,i=`Add the required field: ${c[1]}`)}if(n.includes("Unexpected property")){let c=n.match(/Unexpected property \'(.+)\'/);c&&(n=`Unknown property: ${c[1]}`,i=`Remove the unknown property: ${c[1]}`)}if(n.includes("Expected union")&&(n="Value does not match any of the expected types",i="Check the documentation for valid format options"),n.includes("Expected literal")){let c=n.match(/Expected literal (.+)/);c&&(o=c[1],n=`Expected value: ${o}`,i=`Use the exact value: ${o}`)}if(n.includes("String length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`String must be at least ${c[1]} characters long`,i=`Add more characters to meet the minimum length of ${c[1]}`):l&&(n=`String must be at most ${l[1]} characters long`,i=`Reduce to ${l[1]} characters or less`)}if(n.includes("Expected number")){let c=n.match(/minimum value of ([\\d.]+)/),l=n.match(/maximum value of ([\\d.]+)/);c?(n=`Number must be greater than or equal to ${c[1]}`,i=`Use a value of ${c[1]} or higher`):l&&(n=`Number must be less than or equal to ${l[1]}`,i=`Use a value of ${l[1]} or lower`)}if(n.includes("Array length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`Array must have at least ${c[1]} items`,i=`Add more items to meet the minimum of ${c[1]}`):l&&(n=`Array must have at most ${l[1]} items`,i=`Remove items to meet the maximum of ${l[1]}`)}return n.includes("format")&&(n.includes("email")?(n="Invalid email address format",i="Use a valid email format like user@example.com"):n.includes("uri")||n.includes("url")?(n="Invalid URL format",i="Use a valid URL format like https://example.com"):n.includes("date-time")&&(n="Invalid date-time format",i="Use ISO 8601 format like 2024-01-01T00:00:00Z")),n.includes("pattern")&&(n="String does not match the required pattern",i="Check the format requirements for this field"),{path:t,message:n,code:String(e.type||"validation_error"),suggestion:i,expected:o,received:a,options:s}}function hL(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 Kn(e){return e.map(fL)}function Za(e){return Kn(e).map(t=>{let n=`${t.path}: ${t.message}`;return t.suggestion&&(n+=` (Suggestion: ${t.suggestion})`),n})}function Jy(e){let t=new Map;for(let n of Kn(e)){let i=t.get(n.path)||[];i.push(n),t.set(n.path,i)}return t}function es(e){let t=Kn(e),n=Jy(e),i=`Validation failed with ${t.length} error${t.length>1?"s":""}:\n\n`;for(let[o,a]of n){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 ts(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 gL(e){if(!e||e==="root")return"document root";let t=e.split(".");if(t.includes("children")){let n=t.indexOf("children");if(t.length>n+1)return`component at index ${t[n+1]}`}return t.includes("props")?"props section":t.includes("theme")?"theme configuration":t.join(" > ")}var yL=Kn,bL=Za,Yc={report:un,section:ln,heading:nn,paragraph:on,columns:pn,image:an,statistic:sn,table:cn,list:mn};function el(e,t,n){let i=Yc[e];if(!i){if(P.Check(Pr,t))return{success:!0,data:t};let s=[...P.Errors(Pr,t)];return{success:!1,errors:Kn(s),errorStrings:Za(s),report:n?.includeReport?es(s):void 0,hasCriticalErrors:n?.checkCritical?ts(s):void 0}}if(P.Check(i,t))return{success:!0,data:t};let o=[...P.Errors(i,t)];return{success:!1,errors:Kn(o),errorStrings:Za(o),report:n?.includeReport?es(o):void 0,hasCriticalErrors:n?.checkCritical?ts(o):void 0}}function Iu(e,t){let n=t?.maxDepth??10,i=t?.currentDepth??0;if(i>n)return{success:!1,errors:[{path:"children",message:`Maximum nesting depth (${n}) exceeded`,code:"custom",suggestion:"Reduce the nesting level of components"}],errorStrings:[`Maximum nesting depth (${n}) exceeded`],hasCriticalErrors:!0};if(P.Check(ft,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=Iu(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=[...P.Errors(ft,e)];return{success:!1,errors:Kn(o),errorStrings:Za(o),report:t?.includeReport?es(o):void 0,hasCriticalErrors:t?.checkCritical?ts(o):void 0}}function OL(e,t){let n=[],i=0;for(let{name:s,props:c}of e){let l=s in Yc?el(s,c,t):Iu(c,t);if(n.push(l),l.hasCriticalErrors&&i++,!l.success&&t?.stopOnFirst)break}let o=n.filter(s=>s.success).length,a=n.length-o;return{success:a===0,results:n,summary:{total:n.length,valid:o,invalid:a,criticalErrors:i}}}function xL(e,t,n){try{let i=n?n(t):t;return el(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 SL(e,t){let n=Yc[e];if(!n)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(Yc).join(", ")}`}],errorStrings:[`Unknown component name: ${e}`],hasCriticalErrors:!0};if(P.Check(n,t))return{success:!0,data:t};let i=[...P.Errors(n,t)];return{success:!1,errors:Kn(i),errorStrings:Za(i),report:es(i),hasCriticalErrors:ts(i)}}function IL(e,t){return el(e,t).success}var Yy=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],wL=new Set(Yy);function CL(e){return e.name==="docx"}function PL(e){return e.name==="section"}function TL(e){return e.name==="columns"}function AL(e){return e.name==="heading"}function EL(e){return e.name==="paragraph"}function $L(e){return e.name==="image"}function vL(e){return e.name==="text-box"}function LL(e){return e.name==="statistic"}function NL(e){return e.name==="table"}function RL(e){return e.name==="list"}function kL(e){return e.name==="toc"}function FL(e){return e.name==="highcharts"}function jL(e){return e.name==="visual"}function UL(e){return e.name==="text-space-after"}var DL="1.0.0";var Gu={};rt(Gu,{BUILT_IN_PPTX_THEME_NAMES:()=>ns,ChartComponentDefaultsSchema:()=>$u,ColorValueSchema:()=>_n,DEFAULT_ERROR_CONFIG:()=>Tn,DEFAULT_PPTX_RENDERER_ID:()=>dn,GradientFillSchema:()=>Zi,GradientStopSchema:()=>wc,HighchartsComponentDefaultsSchema:()=>Eu,ImageComponentDefaultsSchema:()=>Pu,PATTERN_FILL_PRESETS:()=>Ic,PPTX_BASE_SCHEMA_METADATA:()=>fb,PPTX_COMPONENT_METADATA:()=>db,PPTX_JSON_SCHEMA_URLS:()=>pb,PPTX_RENDERER_IDS:()=>At,PPTX_SHARED_VERSION:()=>ZL,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>Et,PatternFillSchema:()=>Cc,PositionSchema:()=>tb,PptxChartPropsSchema:()=>Ga,PptxComponentDefaultsSchema:()=>mo,PptxComponentDefinitionSchema:()=>ol,PptxHighchartsPropsSchema:()=>Ka,PptxImagePropsSchema:()=>Ma,PptxJsonComponentDefinitionSchema:()=>lb,PptxSlideContentSchema:()=>qa,PptxStandardComponentDefinitionSchema:()=>cb,PptxTablePropsSchema:()=>Va,PresentationPropsSchema:()=>ku,SEMANTIC_COLOR_ALIASES:()=>xc,SEMANTIC_COLOR_NAMES:()=>Oc,STYLE_NAMES:()=>Yi,ShadowSchema:()=>Xi,ShapeComponentDefaultsSchema:()=>Tu,ShapePropsSchema:()=>Ba,ShapeTypeSchema:()=>Qi,SlideBackgroundSchema:()=>Fu,SlidePropsSchema:()=>Uu,StyleNameSchema:()=>Ua,TableComponentDefaultsSchema:()=>Au,TextComponentDefaultsSchema:()=>Cu,TextPropsSchema:()=>_a,TextRunSchema:()=>Sc,TextStyleSchema:()=>Lu,ThemeConfigSchema:()=>Ci,TransitionSchema:()=>ju,VerticalAlignmentSchema:()=>Si,addPptxBlockAuthoringSchemas:()=>al,collectImageSourceConflicts:()=>gb,collectPptxRendererErrors:()=>Ru,collectTextContentConflicts:()=>yb,compareSemver:()=>fi,comprehensiveValidatePresentation:()=>Sb,convertToJsonSchema:()=>ub,createAllPptxComponentSchemas:()=>nl,createComponentSchema:()=>Ki,createErrorConfig:()=>Ir,createPptxComponentSchemaObject:()=>Pi,deepValidatePresentation:()=>xb,dispatchPptxRootByRenderer:()=>sl,exportSchemaToFile:()=>Gi,fixSchemaReferences:()=>Ln,generateUnifiedDocumentSchema:()=>sb,getAllPptxComponentNames:()=>rb,getPptxComponentsByCategory:()=>nb,getPptxContainerComponents:()=>ib,getPptxContentComponents:()=>ob,getPptxStandardComponent:()=>uo,isPptxStandardComponent:()=>ab,isValidSemver:()=>$n,isValidThemeConfig:()=>Xy,latestVersion:()=>ut,parseSemver:()=>En,pptxComponentDefinitionName:()=>Gn,pptxComponentRequiresProps:()=>Ii,preparePptxDocumentBlockTargets:()=>mb,presentImageSources:()=>hb,transformValueError:()=>An,transformValueErrors:()=>tt,validate:()=>XL,validateJsonPptxTheme:()=>Ku,validateJsonPresentationDocument:()=>Vu,validatePptxTheme:()=>os,validatePresentationDocument:()=>is,validateStrict:()=>QL});var Cu=r.Partial(_a),Pu=r.Partial(Ma),Tu=r.Partial(Ba),Au=r.Partial(Va),Eu=r.Partial(Ka),$u=r.Partial(Ga),mo=r.Object({text:r.Optional(Cu),image:r.Optional(Pu),shape:r.Optional(Tu),table:r.Optional(Au),highcharts:r.Optional(Eu),chart:r.Optional($u)},{additionalProperties:!0});var ns=["consulting","dark","default","devportal","minimal","vermilion"],_L=r.Union([r.Number({description:"Margin in inches (all sides)"}),r.Object({top:r.Number({description:"Top margin in inches"}),right:r.Number({description:"Right margin in inches"}),bottom:r.Number({description:"Bottom margin in inches"}),left:r.Number({description:"Left margin in inches"})},{additionalProperties:!1})],{description:"Slide margins in inches"}),ML=r.Union([r.Number({description:"Gutter in inches (both axes)"}),r.Object({column:r.Number({description:"Column gutter in inches"}),row:r.Number({description:"Row gutter in inches"})},{additionalProperties:!1})],{description:"Gaps between grid tracks in inches"}),vu=r.Object({columns:r.Optional(r.Number({minimum:1,description:"Number of columns (default: 12)"})),rows:r.Optional(r.Number({minimum:1,description:"Number of rows (default: 6)"})),margin:r.Optional(_L),gutter:r.Optional(ML)},{additionalProperties:!1,description:"Grid layout configuration"}),pr=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Lu=r.Object({fontSize:r.Optional(r.Number()),fontFace:r.Optional(Ht),fontColor:r.Optional(_n),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),align:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),lineSpacing:r.Optional(r.Number()),charSpacing:r.Optional(r.Number()),paraSpaceAfter:r.Optional(r.Number()),paraSpaceBefore:r.Optional(r.Number()),case:r.Optional(bi)},{additionalProperties:!1,description:"Text style preset"}),Ci=r.Object({...Rn,displayName:r.Optional(r.String()),description:r.Optional(r.String({description:"The visual voice: what the theme looks like, in one sentence."})),whenToUse:r.Optional(r.String({description:"The decks the theme suits; discovery and the design guide quote it."})),version:r.Optional(r.String()),name:r.String({description:"Theme name"}),colors:r.Object({primary:pr,secondary:pr,accent:pr,background:pr,text:pr,text2:r.Optional(pr),background2:r.Optional(pr),accent4:r.Optional(pr),accent5:r.Optional(pr),accent6:r.Optional(pr)},{additionalProperties:!1,description:"Theme color palette (10-slot scheme)"}),fonts:r.Object({heading:Ht,body:Ht,mono:r.Optional(Ht),light:r.Optional(Ht)},{additionalProperties:!1,description:"Font families"}),fontRegistry:r.Optional(wr),defaults:r.Object({fontSize:r.Number({description:"Default font size in points"}),fontColor:pr},{additionalProperties:!1,description:"Default text styling"}),styles:r.Optional(r.Partial(r.Object(Object.fromEntries(Yi.map(e=>[e,Lu]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:r.Optional(mo)},{additionalProperties:!1,description:"Presentation theme configuration"});function Xy(e){return P.Check(Ci,e)}var At=["pptxgenjs","office-open"],dn="pptxgenjs";function Gn(e){return`PptxComponentDefinition_${e}`}function Qy(e,t,n){let i=Nu(t),o=tl(i);if(n==="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];BL(i);break}return Zy(i),i}function Ru(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??dn;if(!At.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "pptxgenjs" or "office-open".`,code:"invalid_value"}];let i=[],o=(s,c)=>{i.push({path:s,message:`The "${n}" renderer does not support ${c}.`,code:"unsupported_renderer_feature"})},a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s.props;if(n==="pptxgenjs")s.name==="slide"&&l?.transition!==void 0&&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 BL(e){let i=tl(e)?.rows?.items?.items?.anyOf;if(Array.isArray(i))for(let o of i){let a=tl(o);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,Zy(o))}}function tl(e){if(!(!e||typeof e!="object"))return e.properties}function Zy(e){let t=tl(e),n=e.required;if(!t||!n)return;let i=n.filter(o=>o in t);i.length>0?e.required=i:delete e.required}function Nu(e){if(Array.isArray(e))return e.map(Nu);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=Nu(e[n]);return t}var rl=(e,t)=>r.Union([r.Number({description:e}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),VL=r.Object({x:r.Optional(rl("Frame left edge in inches, relative to the enclosing frame or slide","Frame left edge as a percentage of the enclosing width")),y:r.Optional(rl("Frame top edge in inches, relative to the enclosing frame or slide","Frame top edge as a percentage of the enclosing height")),w:r.Optional(rl("Frame width in inches","Frame width as a percentage of the enclosing width")),h:r.Optional(rl("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:r.Optional(tn),gridConfig:r.Optional(r.Object({...vu.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:r.Optional(r.Union([r.Literal("row"),r.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:r.Optional(r.Number({minimum:0,description:"Space between distributed cells, in inches. Default 0."})),weights:r.Optional(r.Array(r.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."}),ku=r.Object({title:r.Optional(r.String({description:"Presentation title metadata"})),author:r.Optional(r.String({description:"Presentation author metadata"})),subject:r.Optional(r.String({description:"Presentation subject metadata"})),company:r.Optional(r.String({description:"Company name metadata"})),theme:r.Optional(r.Union([r.String({description:`Theme name to apply (default: "default"). Built-ins: ${ns.join(", ")} (consulting is the house style).`,examples:[...ns],default:"default"}),Ci],{description:\'Theme to apply: a built-in/custom theme name (default: "default"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:r.Optional(wr),slideWidth:r.Optional(r.Number({description:"Slide width in inches (default: 10)",default:10})),slideHeight:r.Optional(r.Number({description:"Slide height in inches (default: 7.5)",default:7.5})),rtlMode:r.Optional(r.Boolean({description:"Right-to-left text direction"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Default presentation language (BCP-47 tag, e.g. "en-US"). Sets the spell-check language for all text; individual text components can override it.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),pageNumberFormat:r.Optional(r.Union([r.Literal("9"),r.Literal("09")],{description:\'Format for {PAGE_NUMBER} placeholders: "9" = bare number (default), "09" = zero-padded\',default:"9"})),componentDefaults:r.Optional(mo),grid:r.Optional(vu),blocks:r.Optional(Yr),qualityProfile:r.Optional(r.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}),tb=r.Object({x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'X position as percentage (e.g., "10%")\'})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Y position as percentage (e.g., "10%")\'})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Width as percentage (e.g., "80%")\'})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Height as percentage (e.g., "20%")\'})]))},{description:"Position and size in inches or percentages",additionalProperties:!1}),Fu=r.Object({color:r.Optional(_n),gradient:r.Optional(Zi),image:r.Optional(r.Object({path:r.Optional(r.String({description:"Image file path or URL"})),base64:r.Optional(r.String({description:"Base64-encoded image data"}))},{description:"Background image",additionalProperties:!1}))},{description:"Slide background configuration",additionalProperties:!1}),ju=r.Object({type:r.Optional(r.Union([r.Literal("fade"),r.Literal("push"),r.Literal("wipe"),r.Literal("zoom"),r.Literal("none")],{description:"Transition effect type"})),speed:r.Optional(r.Union([r.Literal("slow"),r.Literal("medium"),r.Literal("fast")],{description:"Transition speed"}))},{description:"Slide transition configuration",additionalProperties:!1}),Uu=r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this slide, shown in editors and outlines. Never rendered \\u2014 slide content is unaffected."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the presentation."})),background:r.Optional(Fu),transition:r.Optional(ju),notes:r.Optional(r.String({description:"Speaker notes for this slide"})),hidden:r.Optional(r.Boolean({description:"Hide this slide from presentation"}))},{description:"Slide container props",additionalProperties:!1}),eb=[...en.map(({name:e})=>e),"block","group"],Et=[{name:"pptx",propsSchema:ku,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:Uu,hasChildren:!0,allowedChildren:eb,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:VL,hasChildren:!0,allowedChildren:eb,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:Un,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."},...en];function uo(e){return Et.find(t=>t.name===e)}function rb(){return Et.map(e=>e.name)}function nb(e){return Et.filter(t=>t.category===e)}function ib(){return Et.filter(e=>e.hasChildren)}function ob(){return Et.filter(e=>!e.hasChildren)}function ab(e){return Et.some(t=>t.name===e)}function Pi(e,t,n){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(i.$schema=r.Optional(r.String({format:"uri"})),i.renderer=n?n.requireDiscriminator?r.Literal(n.renderer,{description:"Renderer backend for this presentation"}):r.Optional(r.Literal(n.renderer,{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'})):r.Optional(r.Union(At.map(o=>r.Literal(o)),{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'}))),i.props=n?Qy(e.name,e.propsSchema,n.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=r.Optional(r.Array(t))),Ii(e)||(i.props=r.Optional(i.props)),r.Object(i,{additionalProperties:!1,description:e.description})}function nl(e){return Et.map(t=>Pi(t,e))}function il(e,t=[],n){let i=new Map;for(let c of Et)c.hasChildren||i.set(c.name,Pi(c,void 0,n));let o=Et.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=r.Intersect([e,r.Object({name:r.Union([...p.allowedChildren.map(w=>r.Literal(w)),...t.map(w=>w.properties?.name??r.String())])})]);a.set(p.name,Pi(p,S,n)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,Pi(p,e,n)),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]:r.Union(f);a.set(p.name,Pi(p,O,n)),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 KL(e,t,n,i){let o={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),version:i?r.Optional(r.Literal(t.version)):r.Literal(t.version),props:t.propsSchema};return t.hasChildren&&(o.children=r.Optional(r.Array(n))),r.Object(o,{additionalProperties:!1,description:t.description??e.name})}function sb(e={}){let{customComponents:t=[]}=e,n=At.map(i=>GL(t,i,i!==dn));return r.Union(n,{description:"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs."})}function GL(e,t,n){return r.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=>KL(c,m,i,m.version===l));o.push(...p)}let s=[...il(i,o,{renderer:t,requireDiscriminator:n}),...o];return s.length===0?r.Object({}):r.Union(s)},{$id:Gn(t)})}var cb=r.Union([...nl(r.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),ol=r.Recursive(e=>r.Union([...il(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var lb=ol,pb={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 al(e){let t=e.definitions??{},n=new Map;for(let o of At){let a=Gn(o);t[a]&&n.set(o,Na(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=n.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 sl(e){let t=e.anyOf;if(!Array.isArray(t))return;let n=new Map;for(let a of At){let s=`#/definitions/${Gn(a)}`,c=t.find(l=>l&&l.$ref===s);c&&n.set(a,c)}if(n.size!==t.length||!n.has(dn))return;let i=a=>({properties:{renderer:{const:a}},required:["renderer"]}),o=At.filter(a=>a!==dn&&n.has(a));delete e.anyOf,e.type="object",e.properties={renderer:{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\',anyOf:At.filter(a=>n.has(a)).map(a=>({const:a,type:"string"}))}},e.allOf=[...o.map(a=>({if:i(a),then:n.get(a)})),{if:{not:{anyOf:o.map(i)}},then:n.get(dn)}]}function mb(e){let t=e.definitions??{},n=[];for(let i of At){let o=Gn(i),a=t[o];if(!a)continue;let s=`PptxSlotContent_${i}`;if(!t[s]){let p=Ys(a).find(m=>m.properties?.name?.const==="slide")?.properties?.children?.items;p&&(t[s]=JSON.parse(JSON.stringify(p)))}if(!t[s]){n.push({name:o});continue}let c={$ref:`#/definitions/${s}`};n.push({name:o,componentRef:c},{name:s,componentRef:c})}return n}function ub(e,t={}){return Xs(e,{...t,enrich:n=>{al(n),sl(n)}})}var db={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"}},fb={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 qL=["path","base64","svg"];function hb(e){if(!e||typeof e!="object")return[];let t=e;return qL.filter(n=>{let i=t[n];return typeof i=="string"&&i.trim().length>0})}function gb(e){let t=[],n=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>n(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=hb(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))n(i[a],`${o}/${a}`)}};return n(e,""),t}function yb(e){let t=[],n=(i,o,a)=>{if(Array.isArray(i)){i.forEach((s,c)=>n(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))n(i[s],`${o}/${s}`,a||o==="/props"&&s==="blocks")}};return n(e,"",!1),t}var WL=Object.fromEntries(Et.map(e=>[e.name,e.propsSchema])),Du=new Set(Et.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),Bu=new Set(["name","id","enabled","props","children"]),HL=new Set([...Bu,"version"]),bb=new Set([...Bu,"$schema"]);bb.add("renderer");var zL={id:"string",enabled:"boolean",$schema:"string",version:"string"};function Ob(e,t,n,i,o){for(let a of Object.keys(e)){if(!n.has(a)){o.push({path:`${t}/${a}`,message:`Unknown field "${a}" on ${i}`,code:"unknown_field"});continue}let s=zL[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Field "${a}" on ${i} must be a ${s}`,code:"invalid_type"})}}function xb(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Presentation must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Du.has(e.name)){let o=[...Du].map(a=>`"${a}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}Ob(e,"",bb,"the root component",n);let i=uo(e.name);return"props"in e?Du.has(e.name)&&n.push(...Mu(e.name,e.props,"/props",t)):(!i||Ii(i))&&n.push({path:"/props",message:\'Missing required field "props"\',code:"required_property"}),e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),_u(e,"",t,n),n}function _u(e,t,n,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=n.knownCustomNames?.has(c.name)??!1;if(Ob(c,l,p?HL:Bu,`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.`}),_u(c,l,n,i);return}let u=uo(c.name),f=`${l}/props`;if("props"in c)i.push(...Mu(c.name,c.props,f,n));else if(u&&Ii(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(...Mu(c.name,{},f,n));if(u&&!u.hasChildren&&c.children!=null){i.push({path:`${l}/children`,message:`Component "${c.name}" does not accept children`,code:"invalid_value"});return}_u(c,l,n,i)},a=uo(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&uo(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 Mu(e,t,n,i={}){let o=[],a=WL[e];if(!a)return o.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=t;if(i.allowUnknownFields&&(s=P.Clean(a,P.Clone(s))),!P.Check(a,s)){let c=[...P.Errors(a,s)];tt(c,{maxErrors:100}).forEach(p=>{let m=p.path==="root"?n:`${n}${p.path.startsWith("/")?p.path:"/"+p.path}`;o.push({...p,path:m})})}return o}function Sb(e,t=[],n={}){let i=xb(e,n),o=t.filter(a=>!JL(a));return YL([...o,...i])}function JL(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function YL(e){let t=new Set,n=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),n.push(i))}return n}function Ib(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 is(e,t={}){let n=Sb(e,[],t);n.push(...gb(e)),n.push(...yb(e)),n.push(...Ru(e)),n.push(...zi(e,Xr(e),"pptx",[...t.knownCustomNames??[]]));let i=n.length===0;return{valid:i,errors:n,documentType:"pptx",data:i?e:void 0}}function Vu(e,t={}){let{parsed:n,error:i}=Ib(e);return i?{valid:!1,errors:[i],documentType:"pptx"}:is(n,t)}function os(e){if(P.Check(Ci,e))return{valid:!0,errors:[],data:e};let t=[...P.Errors(Ci,e)];return{valid:!1,errors:tt(t,{maxErrors:100})}}function Ku(e){let{parsed:t,error:n}=Ib(e);return n?{valid:!1,errors:[n]}:os(t)}var XL={document:e=>is(e),jsonDocument:e=>Vu(e),theme:e=>os(e),jsonTheme:e=>Ku(e),isDocument:e=>is(e).valid,isTheme:e=>os(e).valid},QL={document:e=>is(e),jsonDocument:e=>Vu(e),theme:e=>os(e),jsonTheme:e=>Ku(e)},ZL="1.0.0";function wb(e,t){let n={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,n,n.exports),n.exports}function qu(e){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.name!="string"||t.name.length===0||!t.versions||typeof t.versions!="object")return!1;let n=Object.values(t.versions);return n.length>0&&n.some(i=>!!i&&typeof i=="object"&&!!i.propsSchema&&typeof i.propsSchema=="object"&&typeof i.render=="function")}function Cb(e){if(qu(e.default))return e.default;let t=Object.entries(e).filter(([n])=>n.endsWith("Component")||n.endsWith("component")||n.endsWith("Module")||n.endsWith("module"));for(let[,n]of t)if(qu(n))return n;for(let n of Object.values(e))if(qu(n))return n;return null}var eN=/^\\d+\\.\\d+\\.\\d+$/;function Pb(e,t,n){let i=[];for(let[o,a]of Object.entries(e.versions)){if(!eN.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:n}}function Tb(e,t,n){return`import type { TSchema } from \'@sinclair/typebox\';\nimport type { ${t}, ${n} } from \'${e}\';\nimport type {\n RenderContext as SharedRenderContext,\n RenderFunction as SharedRenderFunction,\n ComponentVersion as SharedComponentVersion,\n ComponentVersionMap as SharedComponentVersionMap,\n CustomComponent as SharedCustomComponent,\n} from \'@json-to-office/shared/plugin\';\n\n/** The resolved theme handed to \\`render\\`. */\nexport type ThemeConfig = ${n};\n\nexport type RenderContext<T> = SharedRenderContext<T, ${n}>;\n\nexport type RenderFunction<\n TProps,\n TComponentDefinition = ${t},\n> = SharedRenderFunction<TProps, TComponentDefinition, ${n}>;\n\nexport type ComponentVersion<\n TComponentDefinition = ${t},\n TPropsSchema extends TSchema = TSchema,\n> = SharedComponentVersion<TComponentDefinition, TPropsSchema, ${n}>;\n\nexport type ComponentVersionMap<TComponentDefinition = ${t}> =\n SharedComponentVersionMap<TComponentDefinition, ${n}>;\n\nexport type CustomComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n> = SharedCustomComponent<TComponentDefinition, TVersions, TName>;\n\n/** Create one semver version entry with full type inference for its props. */\nexport declare function createVersion<\n TPropsSchema extends TSchema,\n TComponentDefinition = ${t},\n>(\n version: ComponentVersion<TComponentDefinition, TPropsSchema>\n): ComponentVersion<TComponentDefinition, TPropsSchema>;\n\n/** Create a custom component with semver-keyed versions. */\nexport declare function createComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n>(\n component: CustomComponent<TComponentDefinition, TVersions, TName>\n): CustomComponent<TComponentDefinition, TVersions, TName>;\n\nexport {\n resolveComponentVersion,\n ComponentValidationError,\n DuplicateComponentError,\n} from \'@json-to-office/shared/plugin\';\nexport type { ${t}, ${n} } from \'${e}\';\n`}var Wu=Tb("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),Hu=Tb("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function cl(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 C3={"node_modules/@json-to-office/core-docx/package.json":cl("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":Wu,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":Wu,"node_modules/@json-to-office/json-to-docx/package.json":cl("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":Wu,"node_modules/@json-to-office/core-pptx/package.json":cl("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":Hu,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":Hu,"node_modules/@json-to-office/json-to-pptx/package.json":cl("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":Hu},Ab=["@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 Ju=globalThis,Yu=Ju.postMessage.bind(Ju),tN={createComponent:Bi,createVersion:Mi,resolveComponentVersion:hi,ComponentValidationError:gi,DuplicateComponentError:Vi},rN={"@sinclair/typebox":ap,"@sinclair/typebox/value":Sp,"@json-to-office/shared":pm,"@json-to-office/shared/plugin":mm,"@json-to-office/shared-docx":wu,"@json-to-office/shared-pptx":Gu,...Object.fromEntries(Ab.map(e=>[e,tN]))},nN=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],iN=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function Eb(e,t){let n=globalThis;for(;n&&n!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(n,e))try{delete n[e]}catch{}n=Object.getPrototypeOf(n)}try{Object.defineProperty(globalThis,e,{value:t,configurable:!1,writable:!1})}catch{}}function $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(n,i){if(i==="name")return e;throw new Error(t)}})}function oN(e){let t=globalThis.fetch;if(typeof t!="function")return;let n=e.length>0?`This plugin may call: ${e.join(", ")}.`:"This plugin has Network on but no hosts listed, so it may call nothing.",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. ${n} 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 vb=!1;function aN(e,t){if(vb)return;vb=!0;for(let i of nN)Eb(i);let n=globalThis.navigator;if(n)for(let i of["storage","locks","serviceWorker"])try{Object.defineProperty(n,i,{value:void 0})}catch{}if(!e){for(let i of iN)Eb(i,$b(i));if(n)try{Object.defineProperty(n,"sendBeacon",{value:$b("navigator.sendBeacon")})}catch{}return}oN(t)}var Lb=5*1024*1024,as=null;function sN(e,t){let n=t instanceof Error?t.message:String(t),i={id:e,type:"error",message:n,...t instanceof Error&&t.stack?{stack:t.stack}:{}};Yu(i)}async function cN(e){if(e.type==="load"){aN(e.allowNetwork,e.networkOrigins??[]);let t=wb(e.js,rN),n=Cb(t);if(!n)throw new Error(\'No component export found. Export the result of createComponent() as the default export or under a name ending in "Component".\');as=n;let i=Pb(n,e.format,e.examples),o={id:e.id,type:"loaded",metadata:i};Yu(o);return}if(e.type==="render"){if(!as)throw new Error("Plugin is not loaded");let t=hi(as.name,as.versions,e.version),n=vn(t.propsSchema,e.props,{componentName:as.name});if(!n.valid)throw new gi(n.errors??[],e.props);let i=[],o=(m,u)=>{i.push({message:m,...u?{context:u}:{}})},a=await t.render({props:n.data,theme:e.theme,addWarning:o,children:e.children}),s=Array.isArray(a)?a:[a],c=JSON.stringify(s);if(c.length>Lb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${Lb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:i};Yu(p);return}}Ju.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||cN(t).catch(n=>sN(t.id,n))});})();\n';export{e as default};
|
|
2
|
+
//# sourceMappingURL=_virtual_jto-sandbox-runtime-CH8UnjtH.js.map
|