@json-to-office/jto 6.4.0 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/client/assets/{HomePage-DgyrBIGY.js → HomePage-DdKO7Rz8.js} +4 -4
  3. package/dist/client/assets/{HomePage-DgyrBIGY.js.map → HomePage-DdKO7Rz8.js.map} +1 -1
  4. package/dist/client/assets/{JsonEditorPage-BGctWRXE.js → JsonEditorPage-CIB7kfUW.js} +3 -3
  5. package/dist/client/assets/{JsonEditorPage-BGctWRXE.js.map → JsonEditorPage-CIB7kfUW.js.map} +1 -1
  6. package/dist/client/assets/{MonacoPluginProvider-DbBCCotq.js → MonacoPluginProvider-Cql9aylS.js} +5 -5
  7. package/dist/client/assets/{MonacoPluginProvider-DbBCCotq.js.map → MonacoPluginProvider-Cql9aylS.js.map} +1 -1
  8. package/dist/client/assets/{_virtual_jto-plugin-type-libs-BpQu9aDr.js → _virtual_jto-plugin-type-libs-BJgH7I8Z.js} +32 -9
  9. package/dist/client/assets/{_virtual_jto-plugin-type-libs-BpQu9aDr.js.map → _virtual_jto-plugin-type-libs-BJgH7I8Z.js.map} +1 -1
  10. package/dist/client/assets/_virtual_jto-sandbox-runtime-BFXK15tx.js +2 -0
  11. package/dist/client/assets/_virtual_jto-sandbox-runtime-BFXK15tx.js.map +1 -0
  12. package/dist/client/assets/{editor-DnPnx_0M.js → editor-Dl0mPZWB.js} +2 -2
  13. package/dist/client/assets/{editor-DnPnx_0M.js.map → editor-Dl0mPZWB.js.map} +1 -1
  14. package/dist/client/assets/{editor-monaco-json-B_U6hHbA.js → editor-monaco-json-BWLlWM6o.js} +2 -2
  15. package/dist/client/assets/{editor-monaco-json-B_U6hHbA.js.map → editor-monaco-json-BWLlWM6o.js.map} +1 -1
  16. package/dist/client/assets/{index-2S58SOrb.js → index-1Vg-Jg2R.js} +4 -4
  17. package/dist/client/assets/index-1Vg-Jg2R.js.map +1 -0
  18. package/dist/client/assets/{index-CWzQeme_.js → index-Db2WFiF0.js} +2 -2
  19. package/dist/client/assets/{index-CWzQeme_.js.map → index-Db2WFiF0.js.map} +1 -1
  20. package/dist/client/assets/{preview-Bdmil0FT.js → preview-BXysnPth.js} +2 -2
  21. package/dist/client/assets/{preview-Bdmil0FT.js.map → preview-BXysnPth.js.map} +1 -1
  22. package/dist/client/assets/{useQualityAnalysis-B0tasjoU.js → useQualityAnalysis-Dr3UHxyN.js} +2 -2
  23. package/dist/client/assets/{useQualityAnalysis-B0tasjoU.js.map → useQualityAnalysis-Dr3UHxyN.js.map} +1 -1
  24. package/dist/client/index.html +1 -1
  25. package/package.json +10 -10
  26. package/dist/client/assets/_virtual_jto-sandbox-runtime-CySzPJ5n.js +0 -2
  27. package/dist/client/assets/_virtual_jto-sandbox-runtime-CySzPJ5n.js.map +0 -1
  28. package/dist/client/assets/index-2S58SOrb.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"mappings":";stEAgBMA,GAAmC,CACvC,MAAO,SACP,SAAU,IAAM,KAChB,cAAe,OACjB,EAEMC,GAAuBC,iBAAkCF,EAAY,EAEpE,SAASG,GAAc,CAC5B,SAAAC,EACA,aAAAC,EAAe,SACf,WAAAC,EAAa,gBACb,GAAGC,CACL,EAAuB,CACrB,KAAM,CAACC,EAAOC,CAAQ,EAAIC,YACxB,IAAO,aAAa,QAAQJ,CAAU,GAAeD,CAAA,EAIjDM,EACJH,IAAU,SACN,OAAO,WAAW,8BAA8B,EAAE,QAChD,OACA,QACDA,EAEPI,aAAU,IAAM,CACd,MAAMC,EAAO,OAAO,SAAS,gBAI7B,GAFAA,EAAK,UAAU,OAAO,QAAS,MAAM,EAEjCL,IAAU,SAAU,CACtB,MAAMM,EAAc,OAAO,WAAW,8BAA8B,EACjE,QACC,OACA,QAEJD,EAAK,UAAU,IAAIC,CAAW,EAC9B,MACF,CAEAD,EAAK,UAAU,IAAIL,CAAK,CAC1B,EAAG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,EACvC,MAAOA,EAAM,SACXA,EAAM,OAAO,CACX,YAAa,gDACrB,CAAO,CACP,EACI,KAAMA,EAAM,SAASA,EAAM,QAAO,CAAE,EACpC,WAAYA,EAAM,SAASA,EAAM,QAAQ,CAAE,QAAS,IAAK,QAAS,GAAG,CAAE,CAAC,EACxE,OAAQA,EAAM,SAASA,EAAM,QAAO,CAAE,EACtC,UAAWA,EAAM,SACfA,EAAM,QAAQ,CAAE,YAAa,sCAAsC,CAAE,CAC3E,EACI,YAAaA,EAAM,SACjBA,EAAM,OAAO,CACX,QAAS,EACT,YAAa,kCACrB,CAAO,CACP,EACI,WAAYA,EAAM,SAChBA,EAAM,OAAO,CACX,QAAS,EACT,YAAa,iCACrB,CAAO,CACP,EACI,YAAaA,EAAM,SACjBA,EAAM,OAAO,CAAE,YAAa,6BAA6B,CAAE,CACjE,CACA,EACE,CAAE,qBAAsB,EAAK,CAC/B,EACIE,GAAuB,CACzB,OACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,OACA,OACA,SACA,SACA,SACA,SACA,UACA,UACA,WACA,WACA,QACA,SACA,SACA,WACA,WACA,WACA,WACA,WACA,WACA,aACA,aACA,YACA,UACA,UACA,SACA,SACA,UACA,aACA,aACA,YACA,YACA,YACA,WACA,UACA,QACA,SACA,QACA,QACA,UACA,OACA,UACA,QACF,EACIC,GAAqBH,EAAM,OAC7B,CACE,MAAOA,EAAM,OAAO,CAClB,YAAa,mDACnB,CAAK,EACD,IAAKA,EAAM,OAAO,CAChB,QAAS,EACT,QAAS,IACT,YAAa,0CACnB,CAAK,EACD,aAAcA,EAAM,SAClBA,EAAM,OAAO,CACX,QAAS,EACT,QAAS,IACT,YAAa,2BACrB,CAAO,CACP,CACA,EACE,CAAE,qBAAsB,GAAO,YAAa,qBAAqB,CACnE,EACII,GAAqBJ,EAAM,OAC7B,CACE,KAAMA,EAAM,MAAM,CAACA,EAAM,QAAQ,QAAQ,EAAGA,EAAM,QAAQ,Q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N,QAAS,EACT,YACE,4DAEJ,CACE,KAAM,gBACN,KAAM,SACN,QAAS,EACT,YACE,sEACJ,CACF,EAEF,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,qBACV,gBAAiB,UACjB,YACE,2EACF,WAAY,CACV,CACE,KAAM,cACN,KAAM,SACN,QAAS,GACT,YACE,0EACJ,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,QACV,gBAAiB,UACjB,YAAa,iDACb,WAAY,CACV,CACE,KAAM,kBACN,KAAM,SACN,QAAS,EACT,YACE,sEACJ,CACF,EAEF,CACE,GAAI,yBACJ,MAAO,oBACP,SAAU,QACV,gBAAiB,OACjB,YAAa,uDACb,WAAY,EAAC,EAEf,CACE,GAAI,uBACJ,MAAO,kBACP,SAAU,cACV,gBAAiB,UACjB,YACE,wHACF,WAAY,CACV,CACE,KAAM,WACN,KAAM,cACN,QAAS,GACT,YACE,uGACJ,CACF,EAEF,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,cACV,gBAAiB,UACjB,YACE,kGACF,WAAY,CACV,CACE,KAAM,WACN,KAAM,cACN,QAAS,GACT,YACE,mFAEJ,CACE,KAAM,cACN,KAAM,SACN,QAAS,EACT,YACE,oGACJ,CACF,EAEF,CACE,GAAI,wBACJ,MAAO,mBACP,SAAU,cACV,gBAAiB,UACjB,YACE,mIACF,WAAY,CACV,CACE,KAAM,kBACN,KAAM,SACN,QAAS,EACT,YACE,+FACJ,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,4IACF,WAAY,EAAC,EAEf,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,gHACF,WAAY,CACV,CACE,KAAM,eACN,KAAM,SACN,QAAS,EACT,YACE,oFACJ,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,8IACF,WAAY,EAAC,EAEf,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,aACV,gBAAiB,UACjB,YACE,yGACF,WAAY,CACV,CACE,KAAM,oBACN,KAAM,SACN,QAAS,GACT,YACE,4DAEJ,CACE,KAAM,oBACN,KAAM,SACN,QAAS,GACT,YACE,0DACJ,CACF,EAEF,CACE,GAAI,uBACJ,MAAO,kBACP,SAAU,YACV,gBAAiB,UACjB,YACE,4HACF,WAAY,CACV,CACE,KAAM,yBACN,KAAM,SACN,QAAS,GACT,YAAa,wDACf,CACF,EAEF,CACE,GAAI,yBACJ,MAAO,oBACP,SAAU,YACV,gBAAiB,UACjB,YACE,8KACF,WAAY,EAAC,EAEf,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,gBACV,gBAAiB,UACjB,YACE,0GACF,WAAY,EAAC,EAEf,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,YACV,gBAAiB,UACjB,YACE,sGACF,WAAY,CACV,CACE,KAAM,YACN,KAAM,SACN,QAAS,IACT,YACE,oEACJ,CACF,EAEF,CACE,GAAI,wBACJ,MAAO,mBACP,SAAU,YACV,gBAAiB,OACjB,YACE,0EACF,WAAY,CACV,CACE,KAAM,kBACN,KAAM,SACN,QAAS,EACT,YACE,4EACJ,CACF,CACF,EAEF,KAAM,CACJ,CACE,GAAI,cACJ,MAAO,SACP,SAAU,cACV,gBAAiB,OACjB,YACE,wFACF,WAAY,EAAC,EAEf,CACE,GAAI,yBACJ,MAAO,oBACP,SAAU,aACV,gBAAiB,UACjB,YAAa,mDACb,WAAY,CACV,CACE,KAAM,gBACN,KAAM,SACN,QAAS,EACT,YACE,2EACJ,CACF,EAEF,CACE,GAAI,gBACJ,MAAO,WACP,SAAU,YACV,gBAAiB,OACjB,YACE,yEACF,WAAY,CACV,CACE,KAAM,uBACN,KAAM,SACN,QAAS,IACT,YACE,6IAEJ,CACE,KAAM,iBACN,KAAM,SACN,QAAS,EACT,YAAa,kDACf,CACF,EAEF,CACE,GAAI,qBACJ,MAAO,gBACP,SAAU,qBACV,gBAAiB,UACjB,YAAa,6BACb,WAAY,CACV,CACE,KAAM,mBACN,KAAM,SACN,QAAS,IACT,YACE,gFACJ,CACF,EAEF,CACE,GAAI,qBACJ,MAAO,gBACP,SAAU,gBACV,gBAAiB,UACjB,YACE,mGACF,WAAY,CACV,CACE,KAAM,cACN,KAAM,SACN,QAAS,IACT,YAAa,4CAEf,CACE,KAAM,aACN,KAAM,SACN,QAAS,EACT,YAAa,2CAEf,CACE,KAAM,cACN,KAAM,SACN,QAAS,GACT,YAAa,+CAEf,CACE,KAAM,kBACN,KAAM,SACN,QAAS,GACT,YAAa,mDACf,CACF,EAEF,CACE,GAAI,wBACJ,MAAO,mBACP,SAAU,YACV,gBAAiB,UACjB,YAAa,sDACb,WAAY,EAAC,EAEf,CACE,GAAI,mBACJ,MAAO,cACP,SAAU,YACV,gBAAiB,OACjB,YACE,+GACF,WAAY,CACV,CACE,KAAM,mBACN,KAAM,SACN,QAAS,EACT,YACE,wEAEJ,CACE,KAAM,mBACN,KAAM,SACN,QAAS,IACT,YACE,kEACJ,CACF,EAEF,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,qBACV,gBAAiB,UACjB,YACE,8FACF,WAAY,CACV,CACE,KAAM,gBACN,KAAM,SACN,QAAS,EACT,YACE,4DAEJ,CACE,KAAM,gBACN,KAAM,SACN,QAAS,EACT,YACE,sEACJ,CACF,EAEF,CACE,GAAI,oBACJ,MAAO,eACP,SAAU,qBACV,gBAAiB,UACjB,YACE,2EACF,WAAY,CACV,CACE,KAAM,cACN,KAAM,SACN,QAAS,GACT,YACE,+DACJ,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,QACV,gBAAiB,UACjB,YAAa,6CACb,WAAY,CACV,CACE,KAAM,kBACN,KAAM,SACN,QAAS,EACT,YACE,kEACJ,CACF,EAEF,CACE,GAAI,yBACJ,MAAO,oBACP,SAAU,QACV,gBAAiB,OACjB,YAAa,uDACb,WAAY,EAAC,EAEf,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,YACV,gBAAiB,UACjB,YAAa,6CACb,WAAY,CACV,CACE,KAAM,cACN,KAAM,SACN,QAAS,EACT,YAAa,sDAEf,CACE,KAAM,uBACN,KAAM,SACN,QAAS,IACT,YACE,8EACJ,CACF,EAEF,CACE,GAAI,mBACJ,MAAO,cACP,SAAU,cACV,gBAAiB,UACjB,YAAa,6DACb,WAAY,EAAC,EAEf,CACE,GAAI,uBACJ,MAAO,kBACP,SAAU,cACV,gBAAiB,UACjB,YACE,wHACF,WAAY,CACV,CACE,KAAM,WACN,KAAM,cACN,QAAS,GACT,YACE,uGACJ,CACF,EAEF,CACE,GAAI,oBACJ,MAAO,sBACP,SAAU,YACV,gBAAiB,UACjB,YACE,uFACF,WAAY,CACV,CACE,KAAM,WACN,KAAM,SACN,QAAS,EACT,YACE,sFACJ,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,4IACF,WAAY,EAAC,EAEf,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,gHACF,WAAY,CACV,CACE,KAAM,eACN,KAAM,SACN,QAAS,EACT,YAAa,0CACf,CACF,EAEF,CACE,GAAI,kBACJ,MAAO,aACP,SAAU,cACV,gBAAiB,UACjB,YACE,0IACF,WAAY,EAAC,EAEf,CACE,GAAI,mBACJ,MAAO,cACP,SAAU,cACV,gBAAiB,UACjB,YACE,0IACF,WAAY,CACV,CACE,KAAM,cACN,KAAM,cACN,QAAS,CAAC,OAAO,EACjB,YACE,iGAEJ,CACE,KAAM,cACN,KAAM,SACN,QAAS,EACT,YACE,uEACJ,CACF,EAEF,CACE,GAAI,sBACJ,MAAO,iBACP,SAAU,qBACV,gBAAiB,UACjB,YACE,2FACF,WAAY,CACV,CACE,KAAM,iBACN,KAAM,SACN,QAAS,EACT,YAAa,oDAEf,CACE,KAAM,wBACN,KAAM,SACN,QAAS,EACT,YACE,4DACJ,CACF,EAEF,CACE,GAAI,iBACJ,MA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AK,OAAO8N,MAACkE,GAAA,EAAI,CAAE","names":["initialState","ThemeProviderContext","createContext","ThemeProvider","children","defaultTheme","storageKey","props","theme","setTheme","useState","resolvedTheme","useEffect","root","systemTheme","value","useTheme","context","useContext","CLASS_PART_SEPARATOR","createClassGroupUtils","config","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","className","classParts","getGroupRecursive","getGroupIdForArbitraryProperty","classGroupId","hasPostfixModifier","conflicts","classPartObject","currentClassPart","nextClassPartObject","classGroupFromNextClassPart","classRest","_a","validator","arbitraryPropertyRegex","arbitraryPropertyClassName","property","classGroups","processClassesRecursively","classGroup","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","key","path","currentClassPartObject","pathPart","func","createLruCache","maxCacheSize","cacheSize","cache","previousCache","update","IMPORTANT_MODIFIER","MODIFIER_SEPARATOR","MODIFIER_SEPARATOR_LENGTH","createParseClassName","prefix","experimentalParseClassName","parseClassName","modifiers","bracketDepth","parenDepth","modifierStart","postfixModifierPosition","index","currentCharacter","baseClassNameWithImportantModifier","baseClassName","stripImportantModifier","hasImportantModifier","maybePostfixModifierPosition","fullPrefix","parseClassNameOriginal","createSortModifiers","orderSensitiveModifiers","modifier","sortedModifiers","unsortedModifiers","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","getClassGroupId","getConflictingClassGroupIds","sortModifiers","classGroupsInConflict","classNames","result","originalClassName","isExternal","variantModifier","modifierId","classId","conflictGroups","i","group","twJoin","argument","resolvedValue","string","toValue","mix","k","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fromTheme","themeGetter","arbitraryValueRegex","arbitraryVariableRegex","fractionRegex","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isFraction","isNumber","isInteger","isPercent","isTshirtSize","isAny","isLengthOnly","isNever","isShadow","isImage","isAnyNonArbitrary","isArbitraryValue","isArbitraryVariable","isArbitrarySize","getIsArbitraryValue","isLabelSize","isArbitraryLength","isLabelLength","isArbitraryNumber","isLabelNumber","isArbitraryPosition","isLabelPosition","isArbitraryImage","isLabelImage","isArbitraryShadow","isArbitraryVariableLength","getIsArbitraryVariable","isArbitraryVariableFamilyName","isLabelFamilyName","isArbitraryVariablePosition","isArbitraryVariableSize","isArbitraryVariableImage","isArbitraryVariableShadow","isLabelShadow","testLabel","testValue","shouldMatchNoLabel","label","imageLabels","sizeLabels","getDefaultConfig","themeColor","themeFont","themeText","themeFontWeight","themeTracking","themeLeading","themeBreakpoint","themeContainer","themeSpacing","themeRadius","themeShadow","themeInsetShadow","themeDropShadow","themeBlur","themePerspective","themeAspect","themeEase","themeAnimate","scaleBreak","scalePosition","scaleOverflow","scaleOverscroll","scaleInset","scaleGridTemplateColsRows","scaleGridColRowStartAndEnd","scaleGridColRowStartOrEnd","scaleGridAutoColsRows","scaleGap","scaleAlignPrimaryAxis","scaleAlignSecondaryAxis","scaleUnambiguousSpacing","scalePadding","scaleMargin","scaleSizing","scaleColor","scaleGradientStopPosition","scaleRadius","scaleBorderWidth","scaleLineStyle","scaleBlendMode","scaleBlur","scaleOrigin","scaleRotate","scaleScale","scaleSkew","scaleTranslate","twMerge","cn","inputs","clsx","TooltipProvider","TooltipPrimitive.Provider","Tooltip","TooltipPrimitive.Root","TooltipTrigger","TooltipPrimitive.Trigger","TooltipContent","React.forwardRef","sideOffset","ref","jsx","TooltipPrimitive.Portal","jsxs","TooltipPrimitive.Content","TooltipPrimitive.Arrow","Toast","variant","_title","_description","_action","_open","_onOpenChange","ToastAction","ToastClose","ToastTitle","ToastDescription","ToastViewport","TOAST_LIMIT","TOAST_REMOVE_DELAY","count","genId","toastTimeouts","addToRemoveQueue","toastId","timeout","dispatch","reducer","state","action","t","toast","listeners","memoryState","listener","id","dismiss","open","useToast","setState","React.useState","React.useEffect","Toaster","toasts","title","description","e","RootLayout","Outlet","Spinner","size","sizeClasses","variantClasses","HomePage","lazy","__vitePreload","n","module","JsonEditorPage","NotFoundPage","LazyLoadWrapper","Suspense","routes","Router","useRoutes","queryClient","QueryClient","App","QueryClientProvider","BrowserRouter","IsAsyncIterator","IsObject","IsArray","IsUint8Array","IsBigInt","IsBoolean","IsDate","IsFunction","IsIterator","IsNull","IsNumber","IsRegExp","IsString","IsSymbol","IsUndefined","ArrayType","Visit","DateType","Uint8ArrayType","RegExpType","ObjectType","ValueGuard.IsArray","ValueGuard.IsDate","ValueGuard.IsUint8Array","ValueGuard.IsRegExp","ValueGuard.IsObject","Clone","CloneType","schema","options","IsPromise","IsMap","IsSet","IsTypedArray","HasPropertyKey","IsInteger","IsValueType","TypeSystemPolicy","IsExactOptionalProperty","IsObjectLike","isObject","IsRecordLike","IsNumberLike","IsVoidLike","isUndefined","ImmutableArray","Immutable","ImmutableObject","CreateType","TypeBoxError","message","TransformKind","ReadonlyKind","OptionalKind","Hint","Kind","IsReadonly","IsOptional","IsAny","IsKindOf","IsArgument","IsComputed","IsConstructor","IsIntersect","kind","IsLiteralValue","ValueGuard.IsBoolean","ValueGuard.IsNumber","ValueGuard.IsString","IsLiteral","IsMappedKey","IsMappedResult","IsNever","IsNot","IsRecord","IsRef","IsTemplateLiteral","IsThis","IsTransform","IsTuple","IsUnion","IsUnknown","IsUnsafe","IsVoid","IsKind","IsSchema","KnownTypes","IsPattern","IsControlCharacterFree","code","IsAdditionalProperties","IsOptionalBoolean","IsOptionalBigInt","ValueGuard.IsUndefined","ValueGuard.IsBigInt","IsOptionalNumber","IsOptionalString","IsOptionalPattern","IsOptionalFormat","IsOptionalSchema","IsProperties","IsLiteralString","IsLiteralNumber","IsLiteralBoolean","keys","PatternBoolean","PatternNumber","PatternString","PatternNever","PatternNumberExact","PatternStringExact","PatternNeverExact","map","Has","format","Set","Get","SetIncludes","T","S","SetDistinct","SetIntersect","L","SetIntersectManyResolve","Init","Acc","SetIntersectMany","SetUnionMany","Any","Array","items","Argument","AsyncIterator","Computed","target","parameters","DiscardKey","_","rest","Discard","acc","Never","MappedResult","properties","Constructor","returns","Function","UnionCreate","IsUnionOptional","types","type","RemoveOptionalFromRest","left","RemoveOptionalFromType","ResolveUnion","Optional","UnionEvaluated","Union","TemplateLiteralParserError","Unescape","pattern","IsNonEscaped","char","IsOpenParen","IsCloseParen","IsSeparator","IsGroup","InGroup","IsPrecedenceOr","IsPrecedenceAnd","Or","start","expressions","range","TemplateLiteralParse","And","Group","scan","Range","end","TemplateLiteralParseExact","TemplateLiteralFiniteError","IsNumberExpression","expression","IsBooleanExpression","IsStringExpression","IsTemplateLiteralExpressionFinite","expr","IsTemplateLiteralFinite","TemplateLiteralGenerateError","GenerateReduce","buffer","right","GenerateAnd","TemplateLiteralExpressionGenerate","GenerateOr","GenerateConst","TemplateLiteralGenerate","Literal","Boolean","BigInt","Number","String","FromUnion","syntax","trim","literals","literal","FromTerminal","R","FromSyntax","TemplateLiteralSyntax","TemplateLiteralPatternError","Escape","TemplateLiteralPattern","kinds","TemplateLiteralToUnion","TemplateLiteral","unresolved","FromTemplateLiteral","templateLiteral","IndexPropertyKeys","FromLiteral","literalValue","FromProperties","K2","Index","FromMappedResult","mappedResult","IndexFromMappedResult","FromRest","IndexFromPropertyKey","FromIntersectRest","FromIntersect","IntersectEvaluated","FromUnionRest","FromTuple","FromArray","FromProperty","propertyKey","IndexFromPropertyKeys","propertyKeys","FromSchema","error","IndexFromMappedKey","MappedIndexPropertyKey","MappedIndexPropertyKeys","MappedIndexProperties","mappedKey","Iterator","RequiredKeys","_Object","required","schematic","Object","Promise","item","RemoveReadonly","AddReadonly","ReadonlyWithFlag","F","Readonly","enable","ReadonlyFromMappedResult","K","P","Tuple","FromSchemaType","MappedKeyToKnownMappedResultProperties","MappedKeyToUnknownMappedResultProperties","MappedKeyToMappedResultProperties","FromMappedKey","FunctionType","Intersect","MappedFunctionReturnType","Mapped","RT","RemoveOptional","AddOptional","OptionalWithFlag","OptionalFromMappedResult","IntersectCreate","allObjects","clonedUnevaluatedProperties","IsIntersectOptional","ResolveIntersect","Ref","args","$ref","FromComputed","FromRef","FromPromise","Awaited","KeyOfPropertyKeys","propertyKeysArray","indexer","FromPatternProperties","patternProperties","includePatternProperties","KeyOfPattern","KeyOfFromType","propertyKeyTypes","KeyOfPropertyKeysToRest","KeyOf","KeyOfFromMappedResult","CompositeKeys","FilterNever","CompositeProperty","CompositeProperties","Composite","Date","Null","Symbol","Undefined","Uint8Array","Unknown","FromValue","ConditionalReadonly","Const","ConstructorParameters","KindGuard.IsConstructor","Enum","values1","anyOf","ExtendsResolverError","ExtendsResult","IntoBooleanResult","Throw","IsStructuralRight","TypeGuard.IsNever","TypeGuard.IsIntersect","TypeGuard.IsUnion","TypeGuard.IsUnknown","TypeGuard.IsAny","StructuralRight","FromNeverRight","FromIntersectRight","FromUnionRight","FromUnknownRight","FromAnyRight","FromAny","FromArrayRight","TypeGuard.IsObject","IsObjectArrayLike","TypeGuard.IsArray","FromAsyncIterator","TypeGuard.IsAsyncIterator","FromBigInt","FromObjectRight","TypeGuard.IsRecord","FromRecordRight","TypeGuard.IsBigInt","FromBooleanRight","TypeGuard.IsLiteralBoolean","TypeGuard.IsBoolean","FromBoolean","FromConstructor","TypeGuard.IsConstructor","FromDate","TypeGuard.IsDate","FromFunction","TypeGuard.IsFunction","FromIntegerRight","TypeGuard.IsLiteral","TypeGuard.IsNumber","TypeGuard.IsInteger","FromInteger","FromIterator","TypeGuard.IsIterator","TypeGuard.IsString","FromStringRight","FromNumberRight","FromNever","UnwrapTNot","current","depth","TypeGuard.IsNot","FromNot","FromNull","TypeGuard.IsNull","TypeGuard.IsLiteralNumber","FromNumber","IsObjectPropertyCount","IsObjectStringLike","IsObjectSymbolLike","TypeGuard.IsUndefined","IsObjectNumberLike","IsObjectBooleanLike","IsObjectBigIntLike","IsObjectDateLike","IsObjectUint8ArrayLike","IsObjectFunctionLike","length","IsObjectConstructorLike","IsObjectPromiseLike","then","Property","TypeGuard.IsOptional","TypeGuard.IsLiteralString","TypeGuard.IsSymbol","TypeGuard.IsUint8Array","RecordKey","FromObject","TypeGuard.IsPromise","RecordValue","Key","Value","FromRecord","FromRegExp","TypeGuard.IsRegExp","FromString","FromSymbol","TypeGuard.IsTemplateLiteral","IsArrayOfTuple","FromTupleRight","TypeGuard.IsTuple","FromUint8Array","FromUndefined","TypeGuard.IsVoid","FromVoidRight","FromUnknown","FromVoid","ExtendsCheck","Right","True","False","Extends","Left","ExtendsFromMappedResult","ExtendsResolve","trueType","falseType","ExtendsFromMappedKey","FromPropertyKey","U","FromPropertyKeys","LK","ExtendsUndefinedCheck","Not","ExcludeFromTemplateLiteral","Exclude","ExcludeRest","excluded","inner","ExcludeFromMappedResult","ExtractFromTemplateLiteral","Extract","ExtractRest","extracted","ExtractFromMappedResult","InstanceType","ReadonlyOptional","RecordCreateFromPattern","RecordCreateFromKeys","FromTemplateLiteralKey","FromUnionKey","FromLiteralKey","FromRegExpKey","FromStringKey","FromAnyKey","FromNeverKey","_key","FromBooleanKey","FromIntegerKey","FromNumberKey","Record","RecordPattern","record","FromTypes","FromType","mappedProperties","mappedValue","FromArgument","isReadonly","KindGuard.IsReadonly","isOptional","KindGuard.IsOptional","mapped","KindGuard.IsFunction","KindGuard.IsIntersect","KindGuard.IsUnion","KindGuard.IsTuple","KindGuard.IsArray","KindGuard.IsAsyncIterator","KindGuard.IsIterator","KindGuard.IsPromise","KindGuard.IsObject","KindGuard.IsRecord","KindGuard.IsArgument","Instantiate","Integer","MappedIntrinsicPropertyKey","M","Intrinsic","MappedIntrinsicPropertyKeys","MappedIntrinsicProperties","IntrinsicFromMappedKey","ApplyUncapitalize","first","ApplyCapitalize","ApplyUppercase","ApplyLowercase","mode","FromLiteralValue","union","Capitalize","Lowercase","Uncapitalize","Uppercase","Omit","OmitFromMappedResult","OmitResolve","omittedProperties","UnionFromPropertyKeys","typeKey","IsArrayValue","isTypeRef","isKeyRef","OmitFromMappedKey","Pick","PickFromMappedResult","PickResolve","PickFromMappedKey","leftKey","partialProperties","PartialResolve","KindGuard.IsComputed","KindGuard.IsRef","KindGuard.IsBigInt","KindGuard.IsBoolean","KindGuard.IsInteger","KindGuard.IsLiteral","KindGuard.IsNull","KindGuard.IsNumber","KindGuard.IsString","KindGuard.IsSymbol","KindGuard.IsUndefined","Partial","KindGuard.IsMappedResult","PartialFromMappedResult","requiredProperties","RequiredResolve","Required","RequiredFromMappedResult","DereferenceParameters","moduleProperties","Dereference","FromAwaited","FromIndex","FromKeyOf","FromPartial","FromOmit","FromPick","FromRequired","dereferenced","instanceType","returnType","FromTransform","transform","KindGuard.IsTransform","ComputeType","ComputeModuleProperties","TModule","$defs","computed","identified","Module","Parameters","Ordinal","Recursive","callback","thisType","RegExp","RestResolve","Rest","ReturnType","TransformDecodeBuilder","decode","TransformEncodeBuilder","encode","Codec","Transform","Unsafe","Void","Type","TypeBuilder","SAFE_FONTS","isSafeFont","name","lower","f","FontFamilyNameSchema","FontWeightSchema","FontItalicSchema","SafeFontSourceSchema","GoogleFontSourceSchema","FileFontSourceSchema","UrlFontSourceSchema","VariableFontSourceSchema","DataFontSourceSchema","FontSourceSchema","FontCategorySchema","FontRegistryEntrySchema","FontRegistrySchema","TYPE_ROLES","TypeRoleNameSchema","Type2","TextCaseSchema","ColorTokenSchema","PaletteSchema","TypeRoleSchema","TypeRolesSchema","ScaleSchema","TypographySchema","CanvasSpacingSchema","DesignSpacingSchema","RecipeSchema","ChromeSchema","MotifSchema","DesignSystemProperties","HexColorSchema","SEMANTIC_COLOR_NAMES","SEMANTIC_COLOR_ALIASES","ColorValueSchema","STYLE_NAMES","StyleNameSchema","PptxAlignmentSchema","VerticalAlignmentSchema","ShadowSchema","GridPositionSchema","TextRunSchema","Type3","TextPropsSchema","PptxImagePropsSchema","Type4","ShapeTypeSchema","Type5","TextSegmentSchema","PATTERN_FILL_PRESETS","GradientStopSchema","GradientFillSchema","PatternFillSchema","p","ShapePropsSchema","PptxTableCellSchema","Type6","PptxTablePropsSchema","PptxHighchartsPropsSchema","Type7","positionValue","inches","percent","Type8","ChartTypeSchema","ChartDataSeriesSchema","ChartGridLineSchema","PptxChartPropsSchema","pptxComponentRequiresProps","component","PPTX_SLIDE_CONTENT_COMPONENTS","createSlideContentComponentSchema","Type9","PptxSlideContentSchema","TextComponentDefaultsSchema","ImageComponentDefaultsSchema","ShapeComponentDefaultsSchema","TableComponentDefaultsSchema","HighchartsComponentDefaultsSchema","ChartComponentDefaultsSchema","PptxComponentDefaultsSchema","DefaultErrorFunction","ValueErrorType","errorFunction","GetErrorFunction","TypeDereferenceError","Resolve","references","Deref","Pushref","ValueHashError","ByteMarker","Accumulator","Prime","Size","Bytes","F64","F64In","F64Out","NumberToBytes","byteCount","FNV1A64","BooleanType","BigIntType","byte","NullType","NumberType","StringType","SymbolType","UndefinedType","Hash","ValueCheckUnknownTypeError","IsAnyOrUnknown","IsDefined","set","element","hashed","containsSchema","containsCount","FromImport","definitions","check1","keyPattern","check2","keyCheck","knownKeys","knownKey","valueKeys","valueKey","patternKey","patternSchema","regex","check3","FormatRegistry.Has","FormatRegistry.Get","FromThis","FromKind","TypeRegistry.Has","TypeRegistry.Get","references_","schema_","Check","ValueErrorsUnknownTypeError","EscapeKey","ValueErrorIterator","iterator","next","Create","errorType","errors","hasError","requiredKeys","unknownKeys","requiredKey","propertyValue","Errors","FromTypedArray","FromMap","FromSet","ValueOrDefault","defaultValue","clone","HasDefaultProperty","defaulted","knownPropertyKeys","additionalPropertiesSchema","propertyKeyPattern","propertySchema","knownPropertyKey","max","Default","isCI","define_process_env_default","hasColorSupport","SEMVER_RE","parseSemver","version","match","compareSemver","a","b","pa","pb","latestVersion","versions","latest","v","branchNameConst","branch","isVersionedBranch","branchRequiresName","groupByName","branches","groups","nameEntry","source","restructureNameDiscriminatedUnions","visited","walk","node","obj","unionBranches","entry","replaceRefs","replacement","fixSchemaReferences","rootDefinitionName","definitionNames","definitionRef","isBareDefinitionRef","traverse","currentPath","schemaValue","convertToJsonSchema","$schema","$id","enrich","schemaJson","recursiveId","extractedDefinitions","extractRecursiveSchemas","definitionName","_id","schemaWithoutId","jsonSchema","PATTERNS","DEFAULT_VISUAL_DPI","MIN_VISUAL_DPI","MAX_VISUAL_DPI","FONT_NAME_KEYS","THEME_FONT_KEYS","FONT_DECLARATION_KEYS","collect","out","parentKey","trimmed","maybeFonts","fam","collectFontNames","doc","collectFontNamesFromDocx","collectFontNamesFromPptx","WEIGHT_LABELS","BLOCK_SLOT_ROLES","BlockSlotSchema","Self","role","JsonBlockDefinitionSchema","BlockDefinitionsSchema","BlockInvocationPropsSchema","BLOCK_DIRECTIVES","BLOCK_OPERAND_ROOTS","isBlockRecord","BLOCK_SLOT_PLACEMENT_PROPS","directive","allTypes","intersection","sets","typeOf","possibleValueTypes","resolve","seen","negated","declared","arrayItemSchema","constraints","object","pointer","pointerChain","referenceDescriptions","measureDescriptions","describe","metadata","hasKey","directiveNames","createBlockAuthoringSchema","componentDefinition","excludedComponents","measure","operand","bodyName","originals","_b","pointer2","decoded","values","nextId","componentRef","shared","share","presence","anyDirective","starterPrefixes","starterObject","cached","transformed","key2","author","input","sequence","annotations","self","specs","exhaustive","spec","SCAFFOLD_MARKER_SCHEMA_PATTERN","minimum","maximum","unit","blockSlotFacts","slot","facts","bounds","entries","blockSlotMarkdown","blockSlotEditorSchema","oneLine","minLength","maxLength","choices","unbounded","markdown","blockSlotsEditorSchema","definition","blockInvocationPropsSchema","names","applyDocumentBlocksToSchema","targets","child","invocations","visit","exampleValue","exampleSlots","slots","blockInvocationExample","found","authored","invocation","BLUEPRINT_FORMATS","Identifier","BlueprintPagesSchema","BlueprintVariantSchema","BUILT_IN_PPTX_THEME_NAMES","GridMarginSchema","GridGutterSchema","GridConfigSchema","TextStyleSchema","ThemeConfigSchema","PPTX_RENDERER_IDS","DEFAULT_PPTX_RENDERER_ID","pptxComponentDefinitionName","renderer","pptxPropsSchemaForRenderer","componentName","copy","cloneSchema","objectProperties","pruneOfficeOpenTableCells","syncRequired","rows","cellUnion","Coord","PptxGroupPropsSchema","PresentationPropsSchema","SlideBackgroundSchema","TransitionSchema","SlidePropsSchema","SLIDE_CHILDREN","PPTX_STANDARD_COMPONENTS_REGISTRY","createPptxComponentSchemaObject","recursiveRef","profile","createAllPptxComponentSchemas","createAllPptxComponentSchemasNarrowed","selfRef","pluginSchemas","leafSchemas","comp","containers","resolved","pending","before","content","c","d","allChildSchemas","s","childrenType","createPluginVersionSchema","custom","isLatest","fields","generateUnifiedDocumentSchema","customComponents","generateRendererSchema","requireDiscriminator","componentSchemas","This","addPptxBlockAuthoringSchemas","bodies","body","_c","blocks","_f","_e","_d","block","dispatchPptxRootByRenderer","refs","named","others","preparePptxDocumentBlockTargets","contentName","slide","convertSharedToJsonSchema","json","COMPONENT_OBJECT_KEYS","ROOT_OBJECT_KEYS","HexColorOrTransparentSchema","LanguageSchema","NoProofSchema","NoProofWordsSchema","TextFormattingPropertiesSchema","FontDefinitionSchema","AlignmentSchema","JustifiedAlignmentSchema","HeadingLevelSchema","SpacingSchema","ListSpacingSchema","LineSpacingSchema","IndentSchema","ParagraphIndentSchema","TabStopTypeSchema","TabStopLeaderSchema","TabStopSchema","TabStopsSchema","HorizontalPositionRelativeFromSchema","VerticalPositionRelativeFromSchema","HorizontalPositionAlignSchema","VerticalPositionAlignSchema","TextWrappingTypeSchema","TextWrappingSideSchema","FloatingPropertiesSchema","BaseComponentFields","NativeVisualColorSchema","SIGNED_PERCENT_PATTERN","PERCENT_PATTERN","NativeVisualOffsetSchema","NativeVisualExtentSchema","FrameProps","NativeVisualUnderlineSchema","InlineTextProps","NativeVisualTextRunSchema","NativeVisualTextSegmentSchema","NativeVisualFillSchema","NativeVisualLineSchema","NativeVisualAlignmentSchema","NativeVisualVerticalAlignmentSchema","NativeVisualMarginSchema","NativeVisualTextPropsSchema","NativeVisualShapePropsSchema","NativeVisualImagePropsSchema","nativeElement","propsSchema","NativeVisualElementSchema","NativeVisualCanvasSchema","VisualCanvasBackgroundSchema","VisualCanvasSchema","PlacementProps","VisualRasterPropsSchema","VisualNativePropsSchema","VisualPropsSchema","DOCX_RENDERER_IDS","DEFAULT_DOCX_RENDERER_ID","docxComponentDefinitionName","docxFlowDefinitionName","docxPropsSchemaForRenderer","nameComponentPlaceholders","firstUnionBranch","pruneThreadFields","addDocxBlockAuthoringSchemas","part","docxDocumentBlockTargets","RevisionSegmentSchema","RevisionSchema","RevisionMarkSchema","CommentBodyFields","CommentReplySchema","CommentSchema","HeadingPropsSchema","NoteSchema","FootnotesSchema","EndnotesSchema","FrameWrapTypeSchema","FrameAnchorTypeSchema","FrameHorizontalAlignSchema","FrameVerticalAlignSchema","FloatingFramePropertiesSchema","AlignmentSchema2","ParagraphPropsSchema","ImagePropsSchema","StatisticPropsSchema","CellContentSchema","HorizontalAlignmentSchema","FontConfigSchema","BorderColorSchema","BorderSizeSchema","HideBordersSchema","PaddingSchema","CellDefaultsSchema","createTablePropsSchema","cellContent","cellFields","headerSchema","cellSchema","columnSchema","TablePropsSchema","createSectionPropsSchema","SectionPropsSchema","ColumnDescriptorSchema","Type10","ColumnsPropsSchema","LevelFormatSchema","Type11","ListMarkerFontSchema","ListLevelPropsSchema","ListPropsSchema","PER_INSTANCE_PROPS","HeadingComponentDefaultsSchema","Type12","ParagraphComponentDefaultsSchema","StatisticComponentDefaultsSchema","SectionComponentDefaultsSchema","ColumnsComponentDefaultsSchema","ListComponentDefaultsSchema","ComponentDefaultsSchema","BUILT_IN_DOCX_THEME_NAMES","DocumentMarginsSchema","PageSchema","FontsSchema","BorderStyleSchema","BorderDefinitionFields","BorderDefinitionSchema","BetweenBorderSchema","BordersSchema","StylePropertiesSchema","TabStopDefinitionSchema","TocStylePropertiesSchema","StyleDefinitionsSchema","ThemeColorsSchema","ThemeOverridesSchema","createMinimalTheme","word","GroupPropsSchema","createReportPropsSchema","_componentRef","ReportPropsSchema","TextBoxPropsSchema","side","TocStyleSchema","TocScopeSchema","TocStyleMappingSchema","TocPropsSchema","DividerPropsSchema","HighchartsPropsSchema","ChartPropsSchema","FLOW_CHILDREN","STANDARD_COMPONENTS_REGISTRY","BlockInvocationPropsSchema2","getStandardComponent","demandsProps","createComponentSchemaObject","basePropsSchema","createAllComponentSchemas","sameNames","createAllComponentSchemasNarrowed","drawnHere","components","inFlow","byName","resolveContainers","flowRef","flow","Flow","members","schemas","roots","generateRendererDocumentSchema","includeStandardComponents","capturedRootChildSchemas","capturedPluginSchemas","ComponentDefinition","customComponent","versionEntries","versionLiteralDesc","versionDesc","latestEntry","fallbackSchema","fallbackDesc","hasChildren","standardSchemas","sectionComponent","componentDescription","reportComponent","ComponentDefinitionSchema","TextSpaceAfterPropsSchema","TextSpaceAfterComponentSchema","CustomComponentDefinitionSchema","FormatRegistry.Set","STANDARD_COMPONENTS","EnvSchema","validateAndTransformEnv","rawEnv","withDefaults","Value.Default","Value.Check","Value.Errors","FORMATS","injectedFormat","injected","FORMAT","FORMAT_LABEL","FORMAT_EXT","generateDocxDocumentSchema","unified","generateDocxSchema","convertDocxToJsonSchema","enhancedSchema","enhanceSchemaDescriptions","generatePptxDocumentSchema","generatePptxSchema","convertPptxToJsonSchema","generateReportDefinitionSchema","generateThemeConfigSchema","DocxThemeConfigSchema","PptxThemeConfigSchema","cleanupTypeBoxIds","createReportSchemaConfig","filePatterns","createThemeSchemaConfig","componentType","getComponentDescription","enhancePropsDescriptions","descriptions","prop","desc","hasDefinitions","API_BASE_URL","FORMAT_API","API_ENDPOINTS","SchemaService","__publicField","pluginNames","browserComponents","browserKey","cacheKey","epoch","promise","response","url","params","firstKey","tabType","timestamp","schemaService","ANYWHERE_KEYS","UNDER_FONTS_KEYS","scanFontLenses","text","stack","pos","pathStack","isWS","skipWS","readString","hex","skipPrimitive","top","isLensTarget","parseValue","parseObjectBody","parseArrayBody","frame","useFontPickerStore","create","contextual","CODELENS_COMMAND_ID","providerDisposable","commandDisposable","registerFontCodeLens","monaco","_accessor","currentValue","model","lens","startPos","endPos","_model","codeLens","MONACO_THEME_LIGHT","MONACO_THEME_DARK","LIGHT","DARK","chrome","registered","registerMonacoThemes","monacoThemeFor","QUALITY_RULES","rulesForFormat","QUALITY_POLICY_MODEL_PATH","QUALITY_POLICY_SCHEMA_URI","SEVERITY","createQualityPolicySchemaConfig","rules","ruleProperties","rule","parameter","useEditorRefsStore","get","documentName","editor","toStorageValue","collapse","flushPendingSave","newEditors","RETRY_AFTER_MS","catalog","loadBlockReferences","createScanner","ignoreTrivia","len","tokenOffset","token","lineNumber","lineStartOffset","tokenLineStartOffset","prevTokenLineStartOffset","scanError","scanHexDigits","exact","digits","ch","setPosition","newPosition","scanNumber","isDigit","scanString","ch3","isLineBreak","scanNext","isWhiteSpace","safeLength","commentClosed","isUnknownContentCharacter","scanNextNonTrivia","CharacterCodes","maxCachedValues","ParseOptions","getLocation","position","segments","earlyReturnException","previousNode","previousNodeInst","isAtPropertyKey","setPreviousNode","offset","getNodeType","sep","last","parse","currentProperty","currentParent","previousParents","onValue","array","parseTree","ensurePropertyComplete","endOffset","valueNode","findNodeAtLocation","segment","propertyNode","getNodeValue","contains","includeRightBound","findNodeAtOffset","visitor","_scanner","_jsonPath","suppressedCallbacks","toNoArgVisit","visitFunction","toOneArgVisit","arg","toOneArgVisitWithPath","toBeginVisit","toEndVisit","onObjectBegin","onObjectProperty","onObjectEnd","onArrayBegin","onArrayEnd","onLiteralValue","onSeparator","onComment","onError","disallowComments","allowTrailingComma","handleError","skipUntilAfter","skipUntil","parseString","isValue","parseLiteral","tokenValue","parseProperty","parseObject","needsComma","parseArray","isFirstElement","ScanError","SyntaxKind","parser.getLocation","parser.parse","parser.parseTree","parser.findNodeAtLocation","parser.findNodeAtOffset","parser.getNodeValue","ParseErrorCode","CONTENT_OWNERS","objectNameAt","isSingleLine","parseTolerant","blockCompletionContext","location","elementDepth","owner","escapeSnippet","invocationSnippet","example","stops","marker","_match","indentUnit","lineIndent","indentLines","indent","line","insertBlockDefinitions","existing","base","at","level","list","definitionsToInsert","reference","present","candidate","blockSnippets","lead","snippet","detail","documentation","insertText","additionalEdits","edits","document","local","remote","readDocumentBlockDefinitions","blockDefinitionsSignature","isConfigured","completionDisposable","lastCustomThemeNames","lastBrowserComponents","schemaGeneration","baseDocumentSchema","lastDocumentBlocks","lastDocumentBlocksSignature","DOCUMENT_SCHEMA_URI","configureMonaco","loader","configureMonacoInstance","removeTrailingCommas","jsonStr","cleanedText","parsed","formatted","registerJsonCompletionProvider","reportSchema","stripDiscriminator","installDocumentSchema","documentBlockTargets","injectCustomThemeNames","updateMonacoDocumentBlocks","signature","resetMonacoConfig","themeNames","inject","themeProp","deref","_i","_h","_g","lspToMonacoKind","lspKind","getWorker","completionList","suggestions","r","wordInfo","suggestion","expanded","toRange","span","edit","updateMonacoWithPlugins","customThemeNames","generation","cachedSchema","documentSchema","models","validationSuccess","modelError","rootElement","createRoot"],"ignoreList":[1,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,130,131,132,133,134,135,136,177,178,179,180],"sources":["../../../src/client/components/theme-provider.tsx","../../../../../node_modules/.pnpm/tailwind-merge@3.0.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs","../../../src/client/lib/utils.ts","../../../src/client/components/ui/tooltip.tsx","../../../src/client/components/ui/toast.tsx","../../../src/client/components/ui/use-toast.tsx","../../../src/client/components/ui/toaster.tsx","../../../src/client/layouts/RootLayout.tsx","../../../src/client/components/ui/spinner.tsx","../../../src/client/routes/index.tsx","../../../src/client/Router.tsx","../../../src/client/App.tsx","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/system/policy.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs","../../../../shared/dist/chunk-7ZEN5H5R.js","../../../../shared/dist/schemas/slide-content.js","../../../../shared-pptx/dist/chunk-Z6NUHS34.js","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/errors/function.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/check/check.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/errors/errors.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs","../../../../../node_modules/.pnpm/@sinclair+typebox@0.34.38/node_modules/@sinclair/typebox/build/esm/value/default/default.mjs","../../../../shared/dist/chunk-LLBCT7WL.js","../../../../shared/dist/chunk-244MHDOZ.js","../../../../shared/dist/chunk-LFHU4EOV.js","../../../../quality/dist/index.js","../../../../shared/dist/index.js","../../../../shared-pptx/dist/chunk-UUQ2XPUB.js","../../../../shared-pptx/dist/chunk-Y2ODB5VW.js","../../../../shared-pptx/dist/chunk-WUU5BXQJ.js","../../../../shared-pptx/dist/chunk-BYXJ2AOZ.js","../../../../shared-pptx/dist/chunk-WFJI4YP3.js","../../../../shared-pptx/dist/chunk-4FGNUZM3.js","../../../../shared-pptx/dist/chunk-AD6NRP7M.js","../../../../shared-pptx/dist/index.js","../../../../shared-docx/dist/chunk-XRVPNHNS.js","../../../../shared-docx/dist/chunk-FYJOHPU2.js","../../../../shared-docx/dist/chunk-HDFGXHUB.js","../../../../shared-docx/dist/chunk-N3KCALAB.js","../../../../shared-docx/dist/chunk-W6KB2SMK.js","../../../../shared-docx/dist/chunk-OVL4RTD7.js","../../../../shared-docx/dist/chunk-E5DT5YTY.js","../../../../shared-docx/dist/chunk-SGESROO2.js","../../../../shared-docx/dist/chunk-7AXWLBH5.js","../../../../shared-docx/dist/chunk-AVONZSC5.js","../../../../shared-docx/dist/chunk-7GGTZ4TA.js","../../../../shared-docx/dist/chunk-AT4X3CGA.js","../../../../shared-docx/dist/chunk-BDAYHIDQ.js","../../../../shared-docx/dist/chunk-WLSSJVKC.js","../../../../shared-docx/dist/index.js","../../../src/client/lib/env.ts","../../../src/client/lib/json-schema-generator.ts","../../../src/client/config/api.ts","../../../src/client/lib/schema-service.ts","../../../src/client/lib/font-lens-scan.ts","../../../src/client/store/font-picker-store.ts","../../../src/client/lib/monaco-fonts-codelens.ts","../../../src/client/lib/monaco-theme.ts","../../../src/client/lib/quality-rules.ts","../../../src/client/lib/quality-policy-schema.ts","../../../src/client/store/editor-refs-store.ts","../../../src/client/lib/block-references.ts","../../../../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js","../../../../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js","../../../../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js","../../../../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js","../../../src/client/lib/block-snippets.ts","../../../src/client/lib/document-blocks.ts","../../../src/client/lib/monaco-config.ts","../../../src/client/main.tsx"],"sourcesContent":["import { createContext, useContext, useEffect, useState } from 'react';\n\ntype Theme = 'dark' | 'light' | 'system';\n\ntype ThemeProviderProps = {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n};\n\ntype ThemeProviderState = {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n resolvedTheme: 'dark' | 'light';\n};\n\nconst initialState: ThemeProviderState = {\n theme: 'system',\n setTheme: () => null,\n resolvedTheme: 'light',\n};\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState);\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'vite-ui-theme',\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(\n () => (localStorage.getItem(storageKey) as Theme) || defaultTheme\n );\n\n // Compute resolved theme\n const resolvedTheme: 'dark' | 'light' =\n theme === 'system'\n ? window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n : (theme as 'dark' | 'light');\n\n useEffect(() => {\n const root = window.document.documentElement;\n\n root.classList.remove('light', 'dark');\n\n if (theme === 'system') {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n\n root.classList.add(systemTheme);\n return;\n }\n\n root.classList.add(theme);\n }, [theme]);\n\n const value = {\n theme,\n resolvedTheme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme);\n setTheme(theme);\n },\n };\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport const useTheme = () => {\n const context = useContext(ThemeProviderContext);\n\n if (context === undefined)\n throw new Error('useTheme must be used within a ThemeProvider');\n\n return context;\n};\n","const CLASS_PART_SEPARATOR = '-';\nconst createClassGroupUtils = config => {\n const classMap = createClassMap(config);\n const {\n conflictingClassGroups,\n conflictingClassGroupModifiers\n } = config;\n const getClassGroupId = className => {\n const classParts = className.split(CLASS_PART_SEPARATOR);\n // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.\n if (classParts[0] === '' && classParts.length !== 1) {\n classParts.shift();\n }\n return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);\n };\n const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {\n const conflicts = conflictingClassGroups[classGroupId] || [];\n if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {\n return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];\n }\n return conflicts;\n };\n return {\n getClassGroupId,\n getConflictingClassGroupIds\n };\n};\nconst getGroupRecursive = (classParts, classPartObject) => {\n if (classParts.length === 0) {\n return classPartObject.classGroupId;\n }\n const currentClassPart = classParts[0];\n const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);\n const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;\n if (classGroupFromNextClassPart) {\n return classGroupFromNextClassPart;\n }\n if (classPartObject.validators.length === 0) {\n return undefined;\n }\n const classRest = classParts.join(CLASS_PART_SEPARATOR);\n return classPartObject.validators.find(({\n validator\n }) => validator(classRest))?.classGroupId;\n};\nconst arbitraryPropertyRegex = /^\\[(.+)\\]$/;\nconst getGroupIdForArbitraryProperty = className => {\n if (arbitraryPropertyRegex.test(className)) {\n const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];\n const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));\n if (property) {\n // I use two dots here because one dot is used as prefix for class groups in plugins\n return 'arbitrary..' + property;\n }\n }\n};\n/**\n * Exported for testing only\n */\nconst createClassMap = config => {\n const {\n theme,\n classGroups\n } = config;\n const classMap = {\n nextPart: new Map(),\n validators: []\n };\n for (const classGroupId in classGroups) {\n processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);\n }\n return classMap;\n};\nconst processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {\n classGroup.forEach(classDefinition => {\n if (typeof classDefinition === 'string') {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n return;\n }\n if (typeof classDefinition === 'function') {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n classPartObject.validators.push({\n validator: classDefinition,\n classGroupId\n });\n return;\n }\n Object.entries(classDefinition).forEach(([key, classGroup]) => {\n processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);\n });\n });\n};\nconst getPart = (classPartObject, path) => {\n let currentClassPartObject = classPartObject;\n path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {\n if (!currentClassPartObject.nextPart.has(pathPart)) {\n currentClassPartObject.nextPart.set(pathPart, {\n nextPart: new Map(),\n validators: []\n });\n }\n currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);\n });\n return currentClassPartObject;\n};\nconst isThemeGetter = func => func.isThemeGetter;\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nconst createLruCache = maxCacheSize => {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = new Map();\n let previousCache = new Map();\n const update = (key, value) => {\n cache.set(key, value);\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = new Map();\n }\n };\n return {\n get(key) {\n let value = cache.get(key);\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value);\n } else {\n update(key, value);\n }\n }\n };\n};\nconst IMPORTANT_MODIFIER = '!';\nconst MODIFIER_SEPARATOR = ':';\nconst MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;\nconst createParseClassName = config => {\n const {\n prefix,\n experimentalParseClassName\n } = config;\n /**\n * Parse class name into parts.\n *\n * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n */\n let parseClassName = className => {\n const modifiers = [];\n let bracketDepth = 0;\n let parenDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n for (let index = 0; index < className.length; index++) {\n let currentCharacter = className[index];\n if (bracketDepth === 0 && parenDepth === 0) {\n if (currentCharacter === MODIFIER_SEPARATOR) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + MODIFIER_SEPARATOR_LENGTH;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') {\n bracketDepth++;\n } else if (currentCharacter === ']') {\n bracketDepth--;\n } else if (currentCharacter === '(') {\n parenDepth++;\n } else if (currentCharacter === ')') {\n parenDepth--;\n }\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);\n const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);\n const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n };\n };\n if (prefix) {\n const fullPrefix = prefix + MODIFIER_SEPARATOR;\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {\n isExternal: true,\n modifiers: [],\n hasImportantModifier: false,\n baseClassName: className,\n maybePostfixModifierPosition: undefined\n };\n }\n if (experimentalParseClassName) {\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => experimentalParseClassName({\n className,\n parseClassName: parseClassNameOriginal\n });\n }\n return parseClassName;\n};\nconst stripImportantModifier = baseClassName => {\n if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {\n return baseClassName.substring(0, baseClassName.length - 1);\n }\n /**\n * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.\n * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864\n */\n if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {\n return baseClassName.substring(1);\n }\n return baseClassName;\n};\n\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nconst createSortModifiers = config => {\n const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true]));\n const sortModifiers = modifiers => {\n if (modifiers.length <= 1) {\n return modifiers;\n }\n const sortedModifiers = [];\n let unsortedModifiers = [];\n modifiers.forEach(modifier => {\n const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier];\n if (isPositionSensitive) {\n sortedModifiers.push(...unsortedModifiers.sort(), modifier);\n unsortedModifiers = [];\n } else {\n unsortedModifiers.push(modifier);\n }\n });\n sortedModifiers.push(...unsortedModifiers.sort());\n return sortedModifiers;\n };\n return sortModifiers;\n};\nconst createConfigUtils = config => ({\n cache: createLruCache(config.cacheSize),\n parseClassName: createParseClassName(config),\n sortModifiers: createSortModifiers(config),\n ...createClassGroupUtils(config)\n});\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nconst mergeClassList = (classList, configUtils) => {\n const {\n parseClassName,\n getClassGroupId,\n getConflictingClassGroupIds,\n sortModifiers\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = [];\n const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);\n let result = '';\n for (let index = classNames.length - 1; index >= 0; index -= 1) {\n const originalClassName = classNames[index];\n const {\n isExternal,\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = parseClassName(originalClassName);\n if (isExternal) {\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n let hasPostfixModifier = !!maybePostfixModifierPosition;\n let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n if (!classGroupId) {\n if (!hasPostfixModifier) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n hasPostfixModifier = false;\n }\n const variantModifier = sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.includes(classId)) {\n // Tailwind class omitted due to conflict\n continue;\n }\n classGroupsInConflict.push(classId);\n const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);\n for (let i = 0; i < conflictGroups.length; ++i) {\n const group = conflictGroups[i];\n classGroupsInConflict.push(modifierId + group);\n }\n // Tailwind class not in conflict\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n }\n return result;\n};\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)\n */\nfunction twJoin() {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < arguments.length) {\n if (argument = arguments[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nconst toValue = mix => {\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nfunction createTailwindMerge(createConfigFirst, ...createConfigRest) {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall = initTailwindMerge;\n function initTailwindMerge(classList) {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n }\n function tailwindMerge(classList) {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n }\n return function callTailwindMerge() {\n return functionToCall(twJoin.apply(null, arguments));\n };\n}\nconst fromTheme = key => {\n const themeGetter = theme => theme[key] || [];\n themeGetter.isThemeGetter = true;\n return themeGetter;\n};\nconst arbitraryValueRegex = /^\\[(?:(\\w[\\w-]*):)?(.+)\\]$/i;\nconst arbitraryVariableRegex = /^\\((?:(\\w[\\w-]*):)?(.+)\\)$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nconst isFraction = value => fractionRegex.test(value);\nconst isNumber = value => Boolean(value) && !Number.isNaN(Number(value));\nconst isInteger = value => Boolean(value) && Number.isInteger(Number(value));\nconst isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));\nconst isTshirtSize = value => tshirtUnitRegex.test(value);\nconst isAny = () => true;\nconst isLengthOnly = value =>\n// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n// For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\nlengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\nconst isNever = () => false;\nconst isShadow = value => shadowRegex.test(value);\nconst isImage = value => imageRegex.test(value);\nconst isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);\nconst isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);\nconst isArbitraryValue = value => arbitraryValueRegex.test(value);\nconst isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);\nconst isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);\nconst isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);\nconst isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);\nconst isArbitraryShadow = value => getIsArbitraryValue(value, isNever, isShadow);\nconst isArbitraryVariable = value => arbitraryVariableRegex.test(value);\nconst isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);\nconst isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);\nconst isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);\nconst isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);\nconst isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);\nconst isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);\n// Helpers\nconst getIsArbitraryValue = (value, testLabel, testValue) => {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n};\nconst getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {\n const result = arbitraryVariableRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return shouldMatchNoLabel;\n }\n return false;\n};\n// Labels\nconst isLabelPosition = label => label === 'position';\nconst imageLabels = /*#__PURE__*/new Set(['image', 'url']);\nconst isLabelImage = label => imageLabels.has(label);\nconst sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);\nconst isLabelSize = label => sizeLabels.has(label);\nconst isLabelLength = label => label === 'length';\nconst isLabelNumber = label => label === 'number';\nconst isLabelFamilyName = label => label === 'family-name';\nconst isLabelShadow = label => label === 'shadow';\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isAnyNonArbitrary,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isArbitraryVariable,\n isArbitraryVariableFamilyName,\n isArbitraryVariableImage,\n isArbitraryVariableLength,\n isArbitraryVariablePosition,\n isArbitraryVariableShadow,\n isArbitraryVariableSize,\n isFraction,\n isInteger,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nconst getDefaultConfig = () => {\n /**\n * Theme getters for theme variable namespaces\n * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces\n */\n /***/\n const themeColor = fromTheme('color');\n const themeFont = fromTheme('font');\n const themeText = fromTheme('text');\n const themeFontWeight = fromTheme('font-weight');\n const themeTracking = fromTheme('tracking');\n const themeLeading = fromTheme('leading');\n const themeBreakpoint = fromTheme('breakpoint');\n const themeContainer = fromTheme('container');\n const themeSpacing = fromTheme('spacing');\n const themeRadius = fromTheme('radius');\n const themeShadow = fromTheme('shadow');\n const themeInsetShadow = fromTheme('inset-shadow');\n const themeDropShadow = fromTheme('drop-shadow');\n const themeBlur = fromTheme('blur');\n const themePerspective = fromTheme('perspective');\n const themeAspect = fromTheme('aspect');\n const themeEase = fromTheme('ease');\n const themeAnimate = fromTheme('animate');\n /**\n * Helpers to avoid repeating the same scales\n *\n * We use functions that create a new array every time they're called instead of static arrays.\n * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.\n */\n /***/\n const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const scalePosition = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];\n const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const scaleOverscroll = () => ['auto', 'contain', 'none'];\n const scaleInset = () => [isFraction, 'px', 'full', 'auto', isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartAndEnd = () => ['auto', {\n span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]\n }, isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];\n const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];\n const scaleGap = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline'];\n const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch'];\n const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scalePadding = () => ['px', ...scaleUnambiguousSpacing()];\n const scaleMargin = () => ['px', 'auto', ...scaleUnambiguousSpacing()];\n const scaleSizing = () => [isFraction, 'auto', 'px', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];\n const scaleGradientStopPosition = () => [isPercent, isArbitraryLength];\n const scaleRadius = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];\n const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];\n const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];\n const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];\n const scaleBlur = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];\n const scaleOrigin = () => ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryVariable, isArbitraryValue];\n const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleTranslate = () => [isFraction, 'full', 'px', isArbitraryVariable, isArbitraryValue, themeSpacing];\n return {\n cacheSize: 500,\n theme: {\n animate: ['spin', 'ping', 'pulse', 'bounce'],\n aspect: ['video'],\n blur: [isTshirtSize],\n breakpoint: [isTshirtSize],\n color: [isAny],\n container: [isTshirtSize],\n 'drop-shadow': [isTshirtSize],\n ease: ['in', 'out', 'in-out'],\n font: [isAnyNonArbitrary],\n 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],\n 'inset-shadow': [isTshirtSize],\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],\n perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],\n radius: [isTshirtSize],\n shadow: [isTshirtSize],\n spacing: [isNumber],\n text: [isTshirtSize],\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']\n },\n classGroups: {\n // --------------\n // --- Layout ---\n // --------------\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n * @deprecated since Tailwind CSS v4.0.0\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': scaleBreak()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': scaleBreak()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Screen Reader Only\n * @see https://tailwindcss.com/docs/display#screen-reader-only\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: [...scalePosition(), isArbitraryValue, isArbitraryVariable]\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: scaleOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': scaleOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': scaleOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: scaleOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': scaleOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': scaleOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: scaleInset()\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': scaleInset()\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': scaleInset()\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: scaleInset()\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: scaleInset()\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: scaleInset()\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: scaleInset()\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: scaleInset()\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: scaleInset()\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------------\n // --- Flexbox and Grid ---\n // ------------------------\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: [isFraction, 'full', 'auto', isArbitraryVariable, isArbitraryValue, themeContainer, themeSpacing]\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['nowrap', 'wrap', 'wrap-reverse']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': scaleGridAutoColsRows()\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': scaleGridAutoColsRows()\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: scaleGap()\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': scaleGap()\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': scaleGap()\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: [...scaleAlignPrimaryAxis(), 'normal']\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...scaleAlignPrimaryAxis()]\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: [...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', ...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': scaleAlignPrimaryAxis()\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: scalePadding()\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: scalePadding()\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: scalePadding()\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: scalePadding()\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: scalePadding()\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: scalePadding()\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: scalePadding()\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: scalePadding()\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: scalePadding()\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: scaleMargin()\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: scaleMargin()\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: scaleMargin()\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: scaleMargin()\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: scaleMargin()\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: scaleMargin()\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: scaleMargin()\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: scaleMargin()\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: scaleMargin()\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x': [{\n 'space-x': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y': [{\n 'space-y': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y-reverse': ['space-y-reverse'],\n // --------------\n // --- Sizing ---\n // --------------\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n /**\n * Size\n * @see https://tailwindcss.com/docs/width#setting-both-width-and-height\n */\n size: [{\n size: scaleSizing()\n }],\n w: [{\n w: [themeContainer, 'screen', ...scaleSizing()]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'none', ...scaleSizing()]\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n {\n screen: [themeBreakpoint]\n }, ...scaleSizing()]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: ['screen', ...scaleSizing()]\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': ['screen', 'none', ...scaleSizing()]\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': ['screen', ...scaleSizing()]\n }],\n // ------------------\n // --- Typography ---\n // ------------------\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Font Stretch\n * @see https://tailwindcss.com/docs/font-stretch\n */\n 'font-stretch': [{\n 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: [isArbitraryVariable, isArbitraryValue, /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n themeLeading, themeSpacing]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://v3.tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: scaleColor()\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: scaleColor()\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...scaleLineStyle(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: scaleColor()\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: ['px', ...scaleUnambiguousSpacing()]\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // -------------------\n // --- Backgrounds ---\n // -------------------\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition]\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: ['no-repeat', {\n repeat: ['', 'x', 'y', 'space', 'round']\n }]\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize]\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n linear: [{\n to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isInteger, isArbitraryVariable, isArbitraryValue],\n radial: ['', isArbitraryVariable, isArbitraryValue],\n conic: [isInteger, isArbitraryVariable, isArbitraryValue]\n }, isArbitraryVariableImage, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: scaleColor()\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: scaleColor()\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: scaleColor()\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: scaleColor()\n }],\n // ---------------\n // --- Borders ---\n // ---------------\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: scaleRadius()\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': scaleRadius()\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': scaleRadius()\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': scaleRadius()\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': scaleRadius()\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': scaleRadius()\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': scaleRadius()\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': scaleRadius()\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': scaleRadius()\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': scaleRadius()\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': scaleRadius()\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': scaleRadius()\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': scaleRadius()\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': scaleRadius()\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': scaleRadius()\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: scaleBorderWidth()\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': scaleBorderWidth()\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': scaleBorderWidth()\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': scaleBorderWidth()\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': scaleBorderWidth()\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': scaleBorderWidth()\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': scaleBorderWidth()\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': scaleBorderWidth()\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': scaleBorderWidth()\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x': [{\n 'divide-x': scaleBorderWidth()\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y': [{\n 'divide-y': scaleBorderWidth()\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style\n */\n 'divide-style': [{\n divide: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: scaleColor()\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': scaleColor()\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': scaleColor()\n }],\n /**\n * Border Color S\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-s': [{\n 'border-s': scaleColor()\n }],\n /**\n * Border Color E\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-e': [{\n 'border-e': scaleColor()\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': scaleColor()\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': scaleColor()\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': scaleColor()\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': scaleColor()\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: scaleColor()\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: [...scaleLineStyle(), 'none', 'hidden']\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: [themeColor]\n }],\n // ---------------\n // --- Effects ---\n // ---------------\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color\n */\n 'shadow-color': [{\n shadow: scaleColor()\n }],\n /**\n * Inset Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow\n */\n 'inset-shadow': [{\n 'inset-shadow': ['none', isArbitraryVariable, isArbitraryValue, themeInsetShadow]\n }],\n /**\n * Inset Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color\n */\n 'inset-shadow-color': [{\n 'inset-shadow': scaleColor()\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring\n */\n 'ring-w': [{\n ring: scaleBorderWidth()\n }],\n /**\n * Ring Width Inset\n * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color\n */\n 'ring-color': [{\n ring: scaleColor()\n }],\n /**\n * Ring Offset Width\n * @see https://v3.tailwindcss.com/docs/ring-offset-width\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-w': [{\n 'ring-offset': [isNumber, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://v3.tailwindcss.com/docs/ring-offset-color\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-color': [{\n 'ring-offset': scaleColor()\n }],\n /**\n * Inset Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring\n */\n 'inset-ring-w': [{\n 'inset-ring': scaleBorderWidth()\n }],\n /**\n * Inset Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color\n */\n 'inset-ring-color': [{\n 'inset-ring': scaleColor()\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': scaleBlendMode()\n }],\n // ---------------\n // --- Filters ---\n // ---------------\n /**\n * Filter\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: scaleBlur()\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeDropShadow, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Filter\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': scaleBlur()\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n // --------------\n // --- Tables ---\n // --------------\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': scaleUnambiguousSpacing()\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // ---------------------------------\n // --- Transitions and Animation ---\n // ---------------------------------\n /**\n * Transition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Behavior\n * @see https://tailwindcss.com/docs/transition-behavior\n */\n 'transition-behavior': [{\n transition: ['normal', 'discrete']\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------\n // --- Transforms ---\n // ------------------\n /**\n * Backface Visibility\n * @see https://tailwindcss.com/docs/backface-visibility\n */\n backface: [{\n backface: ['hidden', 'visible']\n }],\n /**\n * Perspective\n * @see https://tailwindcss.com/docs/perspective\n */\n perspective: [{\n perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Perspective Origin\n * @see https://tailwindcss.com/docs/perspective-origin\n */\n 'perspective-origin': [{\n 'perspective-origin': scaleOrigin()\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: scaleRotate()\n }],\n /**\n * Rotate X\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-x': [{\n 'rotate-x': scaleRotate()\n }],\n /**\n * Rotate Y\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-y': [{\n 'rotate-y': scaleRotate()\n }],\n /**\n * Rotate Z\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-z': [{\n 'rotate-z': scaleRotate()\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: scaleScale()\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': scaleScale()\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': scaleScale()\n }],\n /**\n * Scale Z\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-z': [{\n 'scale-z': scaleScale()\n }],\n /**\n * Scale 3D\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-3d': ['scale-3d'],\n /**\n * Skew\n * @see https://tailwindcss.com/docs/skew\n */\n skew: [{\n skew: scaleSkew()\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': scaleSkew()\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': scaleSkew()\n }],\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: scaleOrigin()\n }],\n /**\n * Transform Style\n * @see https://tailwindcss.com/docs/transform-style\n */\n 'transform-style': [{\n transform: ['3d', 'flat']\n }],\n /**\n * Translate\n * @see https://tailwindcss.com/docs/translate\n */\n translate: [{\n translate: scaleTranslate()\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': scaleTranslate()\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': scaleTranslate()\n }],\n /**\n * Translate Z\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-z': [{\n 'translate-z': scaleTranslate()\n }],\n /**\n * Translate None\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-none': ['translate-none'],\n // ---------------------\n // --- Interactivity ---\n // ---------------------\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: scaleColor()\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: scaleColor()\n }],\n /**\n * Color Scheme\n * @see https://tailwindcss.com/docs/color-scheme\n */\n 'color-scheme': [{\n scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Field Sizing\n * @see https://tailwindcss.com/docs/field-sizing\n */\n 'field-sizing': [{\n 'field-sizing': ['fixed', 'content']\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['auto', 'none']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', '', 'y', 'x']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]\n }],\n // -----------\n // --- SVG ---\n // -----------\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: ['none', ...scaleColor()]\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: ['none', ...scaleColor()]\n }],\n // ---------------------\n // --- Accessibility ---\n // ---------------------\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n translate: ['translate-x', 'translate-y', 'translate-none'],\n 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n },\n orderSensitiveModifiers: ['before', 'after', 'placeholder', 'file', 'marker', 'selection', 'first-line', 'first-letter', 'backdrop', '*', '**']\n };\n};\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nconst mergeConfigs = (baseConfig, {\n cacheSize,\n prefix,\n experimentalParseClassName,\n extend = {},\n override = {}\n}) => {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName);\n overrideConfigProperties(baseConfig.theme, override.theme);\n overrideConfigProperties(baseConfig.classGroups, override.classGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);\n overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers);\n mergeConfigProperties(baseConfig.theme, extend.theme);\n mergeConfigProperties(baseConfig.classGroups, extend.classGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);\n mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers');\n return baseConfig;\n};\nconst overrideProperty = (baseObject, overrideKey, overrideValue) => {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n};\nconst overrideConfigProperties = (baseObject, overrideObject) => {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n};\nconst mergeConfigProperties = (baseObject, mergeObject) => {\n if (mergeObject) {\n for (const key in mergeObject) {\n mergeArrayProperties(baseObject, mergeObject, key);\n }\n }\n};\nconst mergeArrayProperties = (baseObject, mergeObject, key) => {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;\n }\n};\nconst extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '@/lib/utils';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, children, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n // The same floating surface every other overlay uses — popover,\n // dropdown, select, hover card. A tooltip on the brand colour was the\n // loudest thing on screen for the least important thing on it.\n 'bg-popover text-popover-foreground border shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit text-balance rounded-md px-3 py-1.5 text-xs',\n className\n )}\n {...props}\n >\n {children}\n {/* No border on the tail: it is a rotated square whose inner half sits\n over the content, so an outline would draw a stray hairline inside\n the tooltip. It interrupts the card's own border instead. */}\n <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","import * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nexport interface ToastProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n variant?: 'default' | 'destructive';\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactElement;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport type ToastActionElement = React.ReactElement;\n\nconst Toast = React.forwardRef<HTMLDivElement, ToastProps>(\n (\n {\n className,\n variant = 'default',\n title: _title,\n description: _description,\n action: _action,\n open: _open,\n onOpenChange: _onOpenChange,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-lg border p-6 pr-8 shadow-lg transition-all',\n variant === 'default' && 'border bg-background text-foreground',\n variant === 'destructive' &&\n 'destructive group border-destructive bg-destructive text-destructive-foreground',\n className\n )}\n {...props}\n />\n );\n }\n);\nToast.displayName = 'Toast';\n\nconst ToastAction = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, ...props }, ref) => (\n <button\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = 'ToastAction';\n\nconst ToastClose = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n 'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground/70 group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive-foreground/40',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n className=\"h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n));\nToastClose.displayName = 'ToastClose';\n\nconst ToastTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm font-semibold', className)}\n {...props}\n />\n));\nToastTitle.displayName = 'ToastTitle';\n\nconst ToastDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('text-sm opacity-90', className)} {...props} />\n));\nToastDescription.displayName = 'ToastDescription';\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<'ol'>,\n React.ComponentPropsWithoutRef<'ol'>\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = 'ToastViewport';\n\nexport {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastTitle,\n ToastViewport,\n};\n","import * as React from 'react';\nimport type { ToastActionElement, ToastProps } from './toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 5000; // 5 seconds auto-dismiss\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: 'ADD_TOAST',\n UPDATE_TOAST: 'UPDATE_TOAST',\n DISMISS_TOAST: 'DISMISS_TOAST',\n REMOVE_TOAST: 'REMOVE_TOAST',\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType['ADD_TOAST'];\n toast: ToasterToast;\n }\n | {\n type: ActionType['UPDATE_TOAST'];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType['DISMISS_TOAST'];\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionType['REMOVE_TOAST'];\n toastId?: ToasterToast['id'];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: 'REMOVE_TOAST',\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case 'REMOVE_TOAST':\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: 'UPDATE_TOAST',\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n // Auto-dismiss after TOAST_REMOVE_DELAY\n setTimeout(() => {\n dismiss();\n }, TOAST_REMOVE_DELAY);\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),\n };\n}\n\nexport { useToast, toast };\n","import {\n Toast,\n ToastClose,\n ToastDescription,\n ToastTitle,\n ToastViewport,\n} from './toast';\nimport { useToast } from './use-toast';\n\nexport function Toaster() {\n const { toasts, dismiss } = useToast();\n\n return (\n <ToastViewport>\n {toasts.map(function ({\n id,\n title,\n description,\n action,\n open,\n ...props\n }) {\n // Don't render toasts that are closed\n if (open === false) return null;\n\n return (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && (\n <ToastDescription>{description}</ToastDescription>\n )}\n </div>\n {action}\n <ToastClose\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n dismiss(id);\n }}\n />\n </Toast>\n );\n })}\n </ToastViewport>\n );\n}\n","import { Outlet } from 'react-router-dom';\nimport { ThemeProvider } from '../components/theme-provider';\nimport { TooltipProvider } from '../components/ui/tooltip';\nimport { Toaster } from '../components/ui/toaster';\n\nexport function RootLayout() {\n return (\n <ThemeProvider defaultTheme=\"system\" storageKey=\"vite-ui-theme\">\n <TooltipProvider delayDuration={300}>\n <div className=\"min-h-screen bg-background font-sans antialiased\">\n <Outlet />\n </div>\n <Toaster />\n </TooltipProvider>\n </ThemeProvider>\n );\n}\n","import { cn } from '@/lib/utils';\n\ninterface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {\n size?: 'sm' | 'md' | 'lg';\n variant?: 'primary' | 'secondary' | 'muted';\n}\n\nfunction Spinner({\n className,\n size = 'md',\n variant = 'primary',\n ...props\n}: SpinnerProps) {\n const sizeClasses = {\n sm: 'h-4 w-4',\n md: 'h-6 w-6',\n lg: 'h-8 w-8',\n };\n\n const variantClasses = {\n primary: 'border-primary',\n secondary: 'border-secondary',\n muted: 'border-muted-foreground',\n };\n\n return (\n <div\n className={cn(\n 'animate-spin rounded-full border-2 border-solid',\n sizeClasses[size],\n variantClasses[variant],\n className\n )}\n style={{ borderRightColor: 'transparent' }}\n {...props}\n />\n );\n}\n\nexport { Spinner };\n","import { lazy, Suspense } from 'react';\nimport { RouteObject } from 'react-router-dom';\nimport { RootLayout } from '@/layouts/RootLayout';\nimport { Spinner } from '@/components/ui/spinner';\n\n// Lazy load all pages for code splitting\nconst HomePage = lazy(() =>\n import('@/pages/HomePage').then((module) => ({ default: module.HomePage }))\n);\nconst JsonEditorPage = lazy(() =>\n import('@/pages/JsonEditorPage').then((module) => ({\n default: module.JsonEditorPage,\n }))\n);\nconst NotFoundPage = lazy(() =>\n import('@/pages/NotFoundPage').then((module) => ({\n default: module.NotFoundPage,\n }))\n);\n\n// Loading component for lazy loaded routes\nconst LazyLoadWrapper = ({ children }: { children: React.ReactNode }) => (\n <Suspense\n fallback={\n <div className=\"flex items-center justify-center h-screen\">\n <Spinner className=\"w-8 h-8\" />\n </div>\n }\n >\n {children}\n </Suspense>\n);\n\nexport const routes: RouteObject[] = [\n {\n path: '/',\n element: <RootLayout />,\n children: [\n {\n index: true,\n element: (\n <LazyLoadWrapper>\n <HomePage />\n </LazyLoadWrapper>\n ),\n },\n {\n path: 'json-editor',\n element: (\n <LazyLoadWrapper>\n <JsonEditorPage />\n </LazyLoadWrapper>\n ),\n },\n ],\n },\n {\n path: '*',\n element: (\n <LazyLoadWrapper>\n <NotFoundPage />\n </LazyLoadWrapper>\n ),\n },\n];\n","import { useRoutes } from 'react-router-dom';\nimport { routes } from './routes';\n\nexport function Router() {\n const element = useRoutes(routes);\n return element;\n}\n","import { BrowserRouter } from 'react-router-dom';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { Router } from './Router';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 1000 * 60 * 5, // 5 minutes\n retry: 1,\n },\n },\n});\n\nfunction App() {\n return (\n <QueryClientProvider client={queryClient}>\n <BrowserRouter>\n <Router />\n </BrowserRouter>\n </QueryClientProvider>\n );\n}\n\nexport default App;\n","// --------------------------------------------------------------------------\n// PropertyKey\n// --------------------------------------------------------------------------\n/** Returns true if this value has this property key */\nexport function HasPropertyKey(value, key) {\n return key in value;\n}\n// --------------------------------------------------------------------------\n// Object Instances\n// --------------------------------------------------------------------------\n/** Returns true if this value is an async iterator */\nexport function IsAsyncIterator(value) {\n return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;\n}\n/** Returns true if this value is an array */\nexport function IsArray(value) {\n return Array.isArray(value);\n}\n/** Returns true if this value is bigint */\nexport function IsBigInt(value) {\n return typeof value === 'bigint';\n}\n/** Returns true if this value is a boolean */\nexport function IsBoolean(value) {\n return typeof value === 'boolean';\n}\n/** Returns true if this value is a Date object */\nexport function IsDate(value) {\n return value instanceof globalThis.Date;\n}\n/** Returns true if this value is a function */\nexport function IsFunction(value) {\n return typeof value === 'function';\n}\n/** Returns true if this value is an iterator */\nexport function IsIterator(value) {\n return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;\n}\n/** Returns true if this value is null */\nexport function IsNull(value) {\n return value === null;\n}\n/** Returns true if this value is number */\nexport function IsNumber(value) {\n return typeof value === 'number';\n}\n/** Returns true if this value is an object */\nexport function IsObject(value) {\n return typeof value === 'object' && value !== null;\n}\n/** Returns true if this value is RegExp */\nexport function IsRegExp(value) {\n return value instanceof globalThis.RegExp;\n}\n/** Returns true if this value is string */\nexport function IsString(value) {\n return typeof value === 'string';\n}\n/** Returns true if this value is symbol */\nexport function IsSymbol(value) {\n return typeof value === 'symbol';\n}\n/** Returns true if this value is a Uint8Array */\nexport function IsUint8Array(value) {\n return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if this value is undefined */\nexport function IsUndefined(value) {\n return value === undefined;\n}\n","import * as ValueGuard from '../guard/value.mjs';\nfunction ArrayType(value) {\n return value.map((value) => Visit(value));\n}\nfunction DateType(value) {\n return new Date(value.getTime());\n}\nfunction Uint8ArrayType(value) {\n return new Uint8Array(value);\n}\nfunction RegExpType(value) {\n return new RegExp(value.source, value.flags);\n}\nfunction ObjectType(value) {\n const result = {};\n for (const key of Object.getOwnPropertyNames(value)) {\n result[key] = Visit(value[key]);\n }\n for (const key of Object.getOwnPropertySymbols(value)) {\n result[key] = Visit(value[key]);\n }\n return result;\n}\n// prettier-ignore\nfunction Visit(value) {\n return (ValueGuard.IsArray(value) ? ArrayType(value) :\n ValueGuard.IsDate(value) ? DateType(value) :\n ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) :\n ValueGuard.IsRegExp(value) ? RegExpType(value) :\n ValueGuard.IsObject(value) ? ObjectType(value) :\n value);\n}\n/** Clones a value */\nexport function Clone(value) {\n return Visit(value);\n}\n","import { Clone } from './value.mjs';\n/** Clones a Rest */\nexport function CloneRest(schemas) {\n return schemas.map((schema) => CloneType(schema));\n}\n/** Clones a Type */\nexport function CloneType(schema, options) {\n return options === undefined ? Clone(schema) : Clone({ ...options, ...schema });\n}\n","// --------------------------------------------------------------------------\n// Iterators\n// --------------------------------------------------------------------------\n/** Returns true if this value is an async iterator */\nexport function IsAsyncIterator(value) {\n return IsObject(value) && globalThis.Symbol.asyncIterator in value;\n}\n/** Returns true if this value is an iterator */\nexport function IsIterator(value) {\n return IsObject(value) && globalThis.Symbol.iterator in value;\n}\n// --------------------------------------------------------------------------\n// Object Instances\n// --------------------------------------------------------------------------\n/** Returns true if this value is not an instance of a class */\nexport function IsStandardObject(value) {\n return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);\n}\n/** Returns true if this value is an instance of a class */\nexport function IsInstanceObject(value) {\n return IsObject(value) && !IsArray(value) && IsFunction(value.constructor) && value.constructor.name !== 'Object';\n}\n// --------------------------------------------------------------------------\n// JavaScript\n// --------------------------------------------------------------------------\n/** Returns true if this value is a Promise */\nexport function IsPromise(value) {\n return value instanceof globalThis.Promise;\n}\n/** Returns true if this value is a Date */\nexport function IsDate(value) {\n return value instanceof Date && globalThis.Number.isFinite(value.getTime());\n}\n/** Returns true if this value is an instance of Map<K, T> */\nexport function IsMap(value) {\n return value instanceof globalThis.Map;\n}\n/** Returns true if this value is an instance of Set<T> */\nexport function IsSet(value) {\n return value instanceof globalThis.Set;\n}\n/** Returns true if this value is RegExp */\nexport function IsRegExp(value) {\n return value instanceof globalThis.RegExp;\n}\n/** Returns true if this value is a typed array */\nexport function IsTypedArray(value) {\n return globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if the value is a Int8Array */\nexport function IsInt8Array(value) {\n return value instanceof globalThis.Int8Array;\n}\n/** Returns true if the value is a Uint8Array */\nexport function IsUint8Array(value) {\n return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if the value is a Uint8ClampedArray */\nexport function IsUint8ClampedArray(value) {\n return value instanceof globalThis.Uint8ClampedArray;\n}\n/** Returns true if the value is a Int16Array */\nexport function IsInt16Array(value) {\n return value instanceof globalThis.Int16Array;\n}\n/** Returns true if the value is a Uint16Array */\nexport function IsUint16Array(value) {\n return value instanceof globalThis.Uint16Array;\n}\n/** Returns true if the value is a Int32Array */\nexport function IsInt32Array(value) {\n return value instanceof globalThis.Int32Array;\n}\n/** Returns true if the value is a Uint32Array */\nexport function IsUint32Array(value) {\n return value instanceof globalThis.Uint32Array;\n}\n/** Returns true if the value is a Float32Array */\nexport function IsFloat32Array(value) {\n return value instanceof globalThis.Float32Array;\n}\n/** Returns true if the value is a Float64Array */\nexport function IsFloat64Array(value) {\n return value instanceof globalThis.Float64Array;\n}\n/** Returns true if the value is a BigInt64Array */\nexport function IsBigInt64Array(value) {\n return value instanceof globalThis.BigInt64Array;\n}\n/** Returns true if the value is a BigUint64Array */\nexport function IsBigUint64Array(value) {\n return value instanceof globalThis.BigUint64Array;\n}\n// --------------------------------------------------------------------------\n// PropertyKey\n// --------------------------------------------------------------------------\n/** Returns true if this value has this property key */\nexport function HasPropertyKey(value, key) {\n return key in value;\n}\n// --------------------------------------------------------------------------\n// Standard\n// --------------------------------------------------------------------------\n/** Returns true of this value is an object type */\nexport function IsObject(value) {\n return value !== null && typeof value === 'object';\n}\n/** Returns true if this value is an array, but not a typed array */\nexport function IsArray(value) {\n return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if this value is an undefined */\nexport function IsUndefined(value) {\n return value === undefined;\n}\n/** Returns true if this value is an null */\nexport function IsNull(value) {\n return value === null;\n}\n/** Returns true if this value is an boolean */\nexport function IsBoolean(value) {\n return typeof value === 'boolean';\n}\n/** Returns true if this value is an number */\nexport function IsNumber(value) {\n return typeof value === 'number';\n}\n/** Returns true if this value is an integer */\nexport function IsInteger(value) {\n return globalThis.Number.isInteger(value);\n}\n/** Returns true if this value is bigint */\nexport function IsBigInt(value) {\n return typeof value === 'bigint';\n}\n/** Returns true if this value is string */\nexport function IsString(value) {\n return typeof value === 'string';\n}\n/** Returns true if this value is a function */\nexport function IsFunction(value) {\n return typeof value === 'function';\n}\n/** Returns true if this value is a symbol */\nexport function IsSymbol(value) {\n return typeof value === 'symbol';\n}\n/** Returns true if this value is a value type such as number, string, boolean */\nexport function IsValueType(value) {\n // prettier-ignore\n return (IsBigInt(value) ||\n IsBoolean(value) ||\n IsNull(value) ||\n IsNumber(value) ||\n IsString(value) ||\n IsSymbol(value) ||\n IsUndefined(value));\n}\n","import { IsObject, IsArray, IsNumber, IsUndefined } from '../value/guard/index.mjs';\nexport var TypeSystemPolicy;\n(function (TypeSystemPolicy) {\n // ------------------------------------------------------------------\n // TypeSystemPolicy: Instancing\n // ------------------------------------------------------------------\n /**\n * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript\n * references for embedded types, which may cause side effects if type properties are explicitly updated\n * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,\n * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making\n * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the\n * fastest way to instantiate types. The default setting is `default`.\n */\n TypeSystemPolicy.InstanceMode = 'default';\n // ------------------------------------------------------------------\n // TypeSystemPolicy: Checking\n // ------------------------------------------------------------------\n /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */\n TypeSystemPolicy.ExactOptionalPropertyTypes = false;\n /** Sets whether arrays should be treated as a kind of objects. The default is `false` */\n TypeSystemPolicy.AllowArrayObject = false;\n /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */\n TypeSystemPolicy.AllowNaN = false;\n /** Sets whether `null` should validate for void types. The default is `false` */\n TypeSystemPolicy.AllowNullVoid = false;\n /** Checks this value using the ExactOptionalPropertyTypes policy */\n function IsExactOptionalProperty(value, key) {\n return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined;\n }\n TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty;\n /** Checks this value using the AllowArrayObjects policy */\n function IsObjectLike(value) {\n const isObject = IsObject(value);\n return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !IsArray(value);\n }\n TypeSystemPolicy.IsObjectLike = IsObjectLike;\n /** Checks this value as a record using the AllowArrayObjects policy */\n function IsRecordLike(value) {\n return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);\n }\n TypeSystemPolicy.IsRecordLike = IsRecordLike;\n /** Checks this value using the AllowNaN policy */\n function IsNumberLike(value) {\n return TypeSystemPolicy.AllowNaN ? IsNumber(value) : Number.isFinite(value);\n }\n TypeSystemPolicy.IsNumberLike = IsNumberLike;\n /** Checks this value using the AllowVoidNull policy */\n function IsVoidLike(value) {\n const isUndefined = IsUndefined(value);\n return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined;\n }\n TypeSystemPolicy.IsVoidLike = IsVoidLike;\n})(TypeSystemPolicy || (TypeSystemPolicy = {}));\n","import * as ValueGuard from '../guard/value.mjs';\nfunction ImmutableArray(value) {\n return globalThis.Object.freeze(value).map((value) => Immutable(value));\n}\nfunction ImmutableDate(value) {\n return value;\n}\nfunction ImmutableUint8Array(value) {\n return value;\n}\nfunction ImmutableRegExp(value) {\n return value;\n}\nfunction ImmutableObject(value) {\n const result = {};\n for (const key of Object.getOwnPropertyNames(value)) {\n result[key] = Immutable(value[key]);\n }\n for (const key of Object.getOwnPropertySymbols(value)) {\n result[key] = Immutable(value[key]);\n }\n return globalThis.Object.freeze(result);\n}\n/** Specialized deep immutable value. Applies freeze recursively to the given value */\n// prettier-ignore\nexport function Immutable(value) {\n return (ValueGuard.IsArray(value) ? ImmutableArray(value) :\n ValueGuard.IsDate(value) ? ImmutableDate(value) :\n ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) :\n ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) :\n ValueGuard.IsObject(value) ? ImmutableObject(value) :\n value);\n}\n","import { TypeSystemPolicy } from '../../system/policy.mjs';\nimport { Immutable } from './immutable.mjs';\nimport { Clone } from '../clone/value.mjs';\n/** Creates TypeBox schematics using the configured InstanceMode */\nexport function CreateType(schema, options) {\n const result = options !== undefined ? { ...options, ...schema } : schema;\n switch (TypeSystemPolicy.InstanceMode) {\n case 'freeze':\n return Immutable(result);\n case 'clone':\n return Clone(result);\n default:\n return result;\n }\n}\n","/** The base Error type thrown for all TypeBox exceptions */\nexport class TypeBoxError extends Error {\n constructor(message) {\n super(message);\n }\n}\n","/** Symbol key applied to transform types */\nexport const TransformKind = Symbol.for('TypeBox.Transform');\n/** Symbol key applied to readonly types */\nexport const ReadonlyKind = Symbol.for('TypeBox.Readonly');\n/** Symbol key applied to optional types */\nexport const OptionalKind = Symbol.for('TypeBox.Optional');\n/** Symbol key applied to types */\nexport const Hint = Symbol.for('TypeBox.Hint');\n/** Symbol key applied to types */\nexport const Kind = Symbol.for('TypeBox.Kind');\n","import * as ValueGuard from './value.mjs';\nimport { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index.mjs';\n/** `[Kind-Only]` Returns true if this value has a Readonly symbol */\nexport function IsReadonly(value) {\n return ValueGuard.IsObject(value) && value[ReadonlyKind] === 'Readonly';\n}\n/** `[Kind-Only]` Returns true if this value has a Optional symbol */\nexport function IsOptional(value) {\n return ValueGuard.IsObject(value) && value[OptionalKind] === 'Optional';\n}\n/** `[Kind-Only]` Returns true if the given value is TAny */\nexport function IsAny(value) {\n return IsKindOf(value, 'Any');\n}\n/** `[Kind-Only]` Returns true if the given value is TArgument */\nexport function IsArgument(value) {\n return IsKindOf(value, 'Argument');\n}\n/** `[Kind-Only]` Returns true if the given value is TArray */\nexport function IsArray(value) {\n return IsKindOf(value, 'Array');\n}\n/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */\nexport function IsAsyncIterator(value) {\n return IsKindOf(value, 'AsyncIterator');\n}\n/** `[Kind-Only]` Returns true if the given value is TBigInt */\nexport function IsBigInt(value) {\n return IsKindOf(value, 'BigInt');\n}\n/** `[Kind-Only]` Returns true if the given value is TBoolean */\nexport function IsBoolean(value) {\n return IsKindOf(value, 'Boolean');\n}\n/** `[Kind-Only]` Returns true if the given value is TComputed */\nexport function IsComputed(value) {\n return IsKindOf(value, 'Computed');\n}\n/** `[Kind-Only]` Returns true if the given value is TConstructor */\nexport function IsConstructor(value) {\n return IsKindOf(value, 'Constructor');\n}\n/** `[Kind-Only]` Returns true if the given value is TDate */\nexport function IsDate(value) {\n return IsKindOf(value, 'Date');\n}\n/** `[Kind-Only]` Returns true if the given value is TFunction */\nexport function IsFunction(value) {\n return IsKindOf(value, 'Function');\n}\n/** `[Kind-Only]` Returns true if the given value is TInteger */\nexport function IsImport(value) {\n return IsKindOf(value, 'Import');\n}\n/** `[Kind-Only]` Returns true if the given value is TInteger */\nexport function IsInteger(value) {\n return IsKindOf(value, 'Integer');\n}\n/** `[Kind-Only]` Returns true if the given schema is TProperties */\nexport function IsProperties(value) {\n return ValueGuard.IsObject(value);\n}\n/** `[Kind-Only]` Returns true if the given value is TIntersect */\nexport function IsIntersect(value) {\n return IsKindOf(value, 'Intersect');\n}\n/** `[Kind-Only]` Returns true if the given value is TIterator */\nexport function IsIterator(value) {\n return IsKindOf(value, 'Iterator');\n}\n/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */\nexport function IsKindOf(value, kind) {\n return ValueGuard.IsObject(value) && Kind in value && value[Kind] === kind;\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<string> */\nexport function IsLiteralString(value) {\n return IsLiteral(value) && ValueGuard.IsString(value.const);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<number> */\nexport function IsLiteralNumber(value) {\n return IsLiteral(value) && ValueGuard.IsNumber(value.const);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<boolean> */\nexport function IsLiteralBoolean(value) {\n return IsLiteral(value) && ValueGuard.IsBoolean(value.const);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteralValue */\nexport function IsLiteralValue(value) {\n return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral */\nexport function IsLiteral(value) {\n return IsKindOf(value, 'Literal');\n}\n/** `[Kind-Only]` Returns true if the given value is a TMappedKey */\nexport function IsMappedKey(value) {\n return IsKindOf(value, 'MappedKey');\n}\n/** `[Kind-Only]` Returns true if the given value is TMappedResult */\nexport function IsMappedResult(value) {\n return IsKindOf(value, 'MappedResult');\n}\n/** `[Kind-Only]` Returns true if the given value is TNever */\nexport function IsNever(value) {\n return IsKindOf(value, 'Never');\n}\n/** `[Kind-Only]` Returns true if the given value is TNot */\nexport function IsNot(value) {\n return IsKindOf(value, 'Not');\n}\n/** `[Kind-Only]` Returns true if the given value is TNull */\nexport function IsNull(value) {\n return IsKindOf(value, 'Null');\n}\n/** `[Kind-Only]` Returns true if the given value is TNumber */\nexport function IsNumber(value) {\n return IsKindOf(value, 'Number');\n}\n/** `[Kind-Only]` Returns true if the given value is TObject */\nexport function IsObject(value) {\n return IsKindOf(value, 'Object');\n}\n/** `[Kind-Only]` Returns true if the given value is TPromise */\nexport function IsPromise(value) {\n return IsKindOf(value, 'Promise');\n}\n/** `[Kind-Only]` Returns true if the given value is TRecord */\nexport function IsRecord(value) {\n return IsKindOf(value, 'Record');\n}\n/** `[Kind-Only]` Returns true if this value is TRecursive */\nexport function IsRecursive(value) {\n return ValueGuard.IsObject(value) && Hint in value && value[Hint] === 'Recursive';\n}\n/** `[Kind-Only]` Returns true if the given value is TRef */\nexport function IsRef(value) {\n return IsKindOf(value, 'Ref');\n}\n/** `[Kind-Only]` Returns true if the given value is TRegExp */\nexport function IsRegExp(value) {\n return IsKindOf(value, 'RegExp');\n}\n/** `[Kind-Only]` Returns true if the given value is TString */\nexport function IsString(value) {\n return IsKindOf(value, 'String');\n}\n/** `[Kind-Only]` Returns true if the given value is TSymbol */\nexport function IsSymbol(value) {\n return IsKindOf(value, 'Symbol');\n}\n/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */\nexport function IsTemplateLiteral(value) {\n return IsKindOf(value, 'TemplateLiteral');\n}\n/** `[Kind-Only]` Returns true if the given value is TThis */\nexport function IsThis(value) {\n return IsKindOf(value, 'This');\n}\n/** `[Kind-Only]` Returns true of this value is TTransform */\nexport function IsTransform(value) {\n return ValueGuard.IsObject(value) && TransformKind in value;\n}\n/** `[Kind-Only]` Returns true if the given value is TTuple */\nexport function IsTuple(value) {\n return IsKindOf(value, 'Tuple');\n}\n/** `[Kind-Only]` Returns true if the given value is TUndefined */\nexport function IsUndefined(value) {\n return IsKindOf(value, 'Undefined');\n}\n/** `[Kind-Only]` Returns true if the given value is TUnion */\nexport function IsUnion(value) {\n return IsKindOf(value, 'Union');\n}\n/** `[Kind-Only]` Returns true if the given value is TUint8Array */\nexport function IsUint8Array(value) {\n return IsKindOf(value, 'Uint8Array');\n}\n/** `[Kind-Only]` Returns true if the given value is TUnknown */\nexport function IsUnknown(value) {\n return IsKindOf(value, 'Unknown');\n}\n/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */\nexport function IsUnsafe(value) {\n return IsKindOf(value, 'Unsafe');\n}\n/** `[Kind-Only]` Returns true if the given value is TVoid */\nexport function IsVoid(value) {\n return IsKindOf(value, 'Void');\n}\n/** `[Kind-Only]` Returns true if the given value is TKind */\nexport function IsKind(value) {\n return ValueGuard.IsObject(value) && Kind in value && ValueGuard.IsString(value[Kind]);\n}\n/** `[Kind-Only]` Returns true if the given value is TSchema */\nexport function IsSchema(value) {\n // prettier-ignore\n return (IsAny(value) ||\n IsArgument(value) ||\n IsArray(value) ||\n IsBoolean(value) ||\n IsBigInt(value) ||\n IsAsyncIterator(value) ||\n IsComputed(value) ||\n IsConstructor(value) ||\n IsDate(value) ||\n IsFunction(value) ||\n IsInteger(value) ||\n IsIntersect(value) ||\n IsIterator(value) ||\n IsLiteral(value) ||\n IsMappedKey(value) ||\n IsMappedResult(value) ||\n IsNever(value) ||\n IsNot(value) ||\n IsNull(value) ||\n IsNumber(value) ||\n IsObject(value) ||\n IsPromise(value) ||\n IsRecord(value) ||\n IsRef(value) ||\n IsRegExp(value) ||\n IsString(value) ||\n IsSymbol(value) ||\n IsTemplateLiteral(value) ||\n IsThis(value) ||\n IsTuple(value) ||\n IsUndefined(value) ||\n IsUnion(value) ||\n IsUint8Array(value) ||\n IsUnknown(value) ||\n IsUnsafe(value) ||\n IsVoid(value) ||\n IsKind(value));\n}\n","import * as ValueGuard from './value.mjs';\nimport { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\nexport class TypeGuardUnknownTypeError extends TypeBoxError {\n}\nconst KnownTypes = [\n 'Argument',\n 'Any',\n 'Array',\n 'AsyncIterator',\n 'BigInt',\n 'Boolean',\n 'Computed',\n 'Constructor',\n 'Date',\n 'Enum',\n 'Function',\n 'Integer',\n 'Intersect',\n 'Iterator',\n 'Literal',\n 'MappedKey',\n 'MappedResult',\n 'Not',\n 'Null',\n 'Number',\n 'Object',\n 'Promise',\n 'Record',\n 'Ref',\n 'RegExp',\n 'String',\n 'Symbol',\n 'TemplateLiteral',\n 'This',\n 'Tuple',\n 'Undefined',\n 'Union',\n 'Uint8Array',\n 'Unknown',\n 'Void',\n];\nfunction IsPattern(value) {\n try {\n new RegExp(value);\n return true;\n }\n catch {\n return false;\n }\n}\nfunction IsControlCharacterFree(value) {\n if (!ValueGuard.IsString(value))\n return false;\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i);\n if ((code >= 7 && code <= 13) || code === 27 || code === 127) {\n return false;\n }\n }\n return true;\n}\nfunction IsAdditionalProperties(value) {\n return IsOptionalBoolean(value) || IsSchema(value);\n}\nfunction IsOptionalBigInt(value) {\n return ValueGuard.IsUndefined(value) || ValueGuard.IsBigInt(value);\n}\nfunction IsOptionalNumber(value) {\n return ValueGuard.IsUndefined(value) || ValueGuard.IsNumber(value);\n}\nfunction IsOptionalBoolean(value) {\n return ValueGuard.IsUndefined(value) || ValueGuard.IsBoolean(value);\n}\nfunction IsOptionalString(value) {\n return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value);\n}\nfunction IsOptionalPattern(value) {\n return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value) && IsPattern(value));\n}\nfunction IsOptionalFormat(value) {\n return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value));\n}\nfunction IsOptionalSchema(value) {\n return ValueGuard.IsUndefined(value) || IsSchema(value);\n}\n// ------------------------------------------------------------------\n// Modifiers\n// ------------------------------------------------------------------\n/** Returns true if this value has a Readonly symbol */\nexport function IsReadonly(value) {\n return ValueGuard.IsObject(value) && value[ReadonlyKind] === 'Readonly';\n}\n/** Returns true if this value has a Optional symbol */\nexport function IsOptional(value) {\n return ValueGuard.IsObject(value) && value[OptionalKind] === 'Optional';\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\n/** Returns true if the given value is TAny */\nexport function IsAny(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Any') &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TArgument */\nexport function IsArgument(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Argument') &&\n ValueGuard.IsNumber(value.index));\n}\n/** Returns true if the given value is TArray */\nexport function IsArray(value) {\n return (IsKindOf(value, 'Array') &&\n value.type === 'array' &&\n IsOptionalString(value.$id) &&\n IsSchema(value.items) &&\n IsOptionalNumber(value.minItems) &&\n IsOptionalNumber(value.maxItems) &&\n IsOptionalBoolean(value.uniqueItems) &&\n IsOptionalSchema(value.contains) &&\n IsOptionalNumber(value.minContains) &&\n IsOptionalNumber(value.maxContains));\n}\n/** Returns true if the given value is TAsyncIterator */\nexport function IsAsyncIterator(value) {\n // prettier-ignore\n return (IsKindOf(value, 'AsyncIterator') &&\n value.type === 'AsyncIterator' &&\n IsOptionalString(value.$id) &&\n IsSchema(value.items));\n}\n/** Returns true if the given value is TBigInt */\nexport function IsBigInt(value) {\n // prettier-ignore\n return (IsKindOf(value, 'BigInt') &&\n value.type === 'bigint' &&\n IsOptionalString(value.$id) &&\n IsOptionalBigInt(value.exclusiveMaximum) &&\n IsOptionalBigInt(value.exclusiveMinimum) &&\n IsOptionalBigInt(value.maximum) &&\n IsOptionalBigInt(value.minimum) &&\n IsOptionalBigInt(value.multipleOf));\n}\n/** Returns true if the given value is TBoolean */\nexport function IsBoolean(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Boolean') &&\n value.type === 'boolean' &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TComputed */\nexport function IsComputed(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Computed') &&\n ValueGuard.IsString(value.target) &&\n ValueGuard.IsArray(value.parameters) &&\n value.parameters.every((schema) => IsSchema(schema)));\n}\n/** Returns true if the given value is TConstructor */\nexport function IsConstructor(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Constructor') &&\n value.type === 'Constructor' &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsArray(value.parameters) &&\n value.parameters.every(schema => IsSchema(schema)) &&\n IsSchema(value.returns));\n}\n/** Returns true if the given value is TDate */\nexport function IsDate(value) {\n return (IsKindOf(value, 'Date') &&\n value.type === 'Date' &&\n IsOptionalString(value.$id) &&\n IsOptionalNumber(value.exclusiveMaximumTimestamp) &&\n IsOptionalNumber(value.exclusiveMinimumTimestamp) &&\n IsOptionalNumber(value.maximumTimestamp) &&\n IsOptionalNumber(value.minimumTimestamp) &&\n IsOptionalNumber(value.multipleOfTimestamp));\n}\n/** Returns true if the given value is TFunction */\nexport function IsFunction(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Function') &&\n value.type === 'Function' &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsArray(value.parameters) &&\n value.parameters.every(schema => IsSchema(schema)) &&\n IsSchema(value.returns));\n}\n/** Returns true if the given value is TImport */\nexport function IsImport(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Import') &&\n ValueGuard.HasPropertyKey(value, '$defs') &&\n ValueGuard.IsObject(value.$defs) &&\n IsProperties(value.$defs) &&\n ValueGuard.HasPropertyKey(value, '$ref') &&\n ValueGuard.IsString(value.$ref) &&\n value.$ref in value.$defs // required\n );\n}\n/** Returns true if the given value is TInteger */\nexport function IsInteger(value) {\n return (IsKindOf(value, 'Integer') &&\n value.type === 'integer' &&\n IsOptionalString(value.$id) &&\n IsOptionalNumber(value.exclusiveMaximum) &&\n IsOptionalNumber(value.exclusiveMinimum) &&\n IsOptionalNumber(value.maximum) &&\n IsOptionalNumber(value.minimum) &&\n IsOptionalNumber(value.multipleOf));\n}\n/** Returns true if the given schema is TProperties */\nexport function IsProperties(value) {\n // prettier-ignore\n return (ValueGuard.IsObject(value) &&\n Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema(schema)));\n}\n/** Returns true if the given value is TIntersect */\nexport function IsIntersect(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Intersect') &&\n (ValueGuard.IsString(value.type) && value.type !== 'object' ? false : true) &&\n ValueGuard.IsArray(value.allOf) &&\n value.allOf.every(schema => IsSchema(schema) && !IsTransform(schema)) &&\n IsOptionalString(value.type) &&\n (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TIterator */\nexport function IsIterator(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Iterator') &&\n value.type === 'Iterator' &&\n IsOptionalString(value.$id) &&\n IsSchema(value.items));\n}\n/** Returns true if the given value is a TKind with the given name. */\nexport function IsKindOf(value, kind) {\n return ValueGuard.IsObject(value) && Kind in value && value[Kind] === kind;\n}\n/** Returns true if the given value is TLiteral<string> */\nexport function IsLiteralString(value) {\n return IsLiteral(value) && ValueGuard.IsString(value.const);\n}\n/** Returns true if the given value is TLiteral<number> */\nexport function IsLiteralNumber(value) {\n return IsLiteral(value) && ValueGuard.IsNumber(value.const);\n}\n/** Returns true if the given value is TLiteral<boolean> */\nexport function IsLiteralBoolean(value) {\n return IsLiteral(value) && ValueGuard.IsBoolean(value.const);\n}\n/** Returns true if the given value is TLiteral */\nexport function IsLiteral(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Literal') &&\n IsOptionalString(value.$id) && IsLiteralValue(value.const));\n}\n/** Returns true if the given value is a TLiteralValue */\nexport function IsLiteralValue(value) {\n return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value);\n}\n/** Returns true if the given value is a TMappedKey */\nexport function IsMappedKey(value) {\n // prettier-ignore\n return (IsKindOf(value, 'MappedKey') &&\n ValueGuard.IsArray(value.keys) &&\n value.keys.every(key => ValueGuard.IsNumber(key) || ValueGuard.IsString(key)));\n}\n/** Returns true if the given value is TMappedResult */\nexport function IsMappedResult(value) {\n // prettier-ignore\n return (IsKindOf(value, 'MappedResult') &&\n IsProperties(value.properties));\n}\n/** Returns true if the given value is TNever */\nexport function IsNever(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Never') &&\n ValueGuard.IsObject(value.not) &&\n Object.getOwnPropertyNames(value.not).length === 0);\n}\n/** Returns true if the given value is TNot */\nexport function IsNot(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Not') &&\n IsSchema(value.not));\n}\n/** Returns true if the given value is TNull */\nexport function IsNull(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Null') &&\n value.type === 'null' &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TNumber */\nexport function IsNumber(value) {\n return (IsKindOf(value, 'Number') &&\n value.type === 'number' &&\n IsOptionalString(value.$id) &&\n IsOptionalNumber(value.exclusiveMaximum) &&\n IsOptionalNumber(value.exclusiveMinimum) &&\n IsOptionalNumber(value.maximum) &&\n IsOptionalNumber(value.minimum) &&\n IsOptionalNumber(value.multipleOf));\n}\n/** Returns true if the given value is TObject */\nexport function IsObject(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Object') &&\n value.type === 'object' &&\n IsOptionalString(value.$id) &&\n IsProperties(value.properties) &&\n IsAdditionalProperties(value.additionalProperties) &&\n IsOptionalNumber(value.minProperties) &&\n IsOptionalNumber(value.maxProperties));\n}\n/** Returns true if the given value is TPromise */\nexport function IsPromise(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Promise') &&\n value.type === 'Promise' &&\n IsOptionalString(value.$id) &&\n IsSchema(value.item));\n}\n/** Returns true if the given value is TRecord */\nexport function IsRecord(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Record') &&\n value.type === 'object' &&\n IsOptionalString(value.$id) &&\n IsAdditionalProperties(value.additionalProperties) &&\n ValueGuard.IsObject(value.patternProperties) &&\n ((schema) => {\n const keys = Object.getOwnPropertyNames(schema.patternProperties);\n return (keys.length === 1 &&\n IsPattern(keys[0]) &&\n ValueGuard.IsObject(schema.patternProperties) &&\n IsSchema(schema.patternProperties[keys[0]]));\n })(value));\n}\n/** Returns true if this value is TRecursive */\nexport function IsRecursive(value) {\n return ValueGuard.IsObject(value) && Hint in value && value[Hint] === 'Recursive';\n}\n/** Returns true if the given value is TRef */\nexport function IsRef(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Ref') &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsString(value.$ref));\n}\n/** Returns true if the given value is TRegExp */\nexport function IsRegExp(value) {\n // prettier-ignore\n return (IsKindOf(value, 'RegExp') &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsString(value.source) &&\n ValueGuard.IsString(value.flags) &&\n IsOptionalNumber(value.maxLength) &&\n IsOptionalNumber(value.minLength));\n}\n/** Returns true if the given value is TString */\nexport function IsString(value) {\n // prettier-ignore\n return (IsKindOf(value, 'String') &&\n value.type === 'string' &&\n IsOptionalString(value.$id) &&\n IsOptionalNumber(value.minLength) &&\n IsOptionalNumber(value.maxLength) &&\n IsOptionalPattern(value.pattern) &&\n IsOptionalFormat(value.format));\n}\n/** Returns true if the given value is TSymbol */\nexport function IsSymbol(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Symbol') &&\n value.type === 'symbol' &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TTemplateLiteral */\nexport function IsTemplateLiteral(value) {\n // prettier-ignore\n return (IsKindOf(value, 'TemplateLiteral') &&\n value.type === 'string' &&\n ValueGuard.IsString(value.pattern) &&\n value.pattern[0] === '^' &&\n value.pattern[value.pattern.length - 1] === '$');\n}\n/** Returns true if the given value is TThis */\nexport function IsThis(value) {\n // prettier-ignore\n return (IsKindOf(value, 'This') &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsString(value.$ref));\n}\n/** Returns true of this value is TTransform */\nexport function IsTransform(value) {\n return ValueGuard.IsObject(value) && TransformKind in value;\n}\n/** Returns true if the given value is TTuple */\nexport function IsTuple(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Tuple') &&\n value.type === 'array' &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsNumber(value.minItems) &&\n ValueGuard.IsNumber(value.maxItems) &&\n value.minItems === value.maxItems &&\n (( // empty\n ValueGuard.IsUndefined(value.items) &&\n ValueGuard.IsUndefined(value.additionalItems) &&\n value.minItems === 0) || (ValueGuard.IsArray(value.items) &&\n value.items.every(schema => IsSchema(schema)))));\n}\n/** Returns true if the given value is TUndefined */\nexport function IsUndefined(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Undefined') &&\n value.type === 'undefined' &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TUnion<Literal<string | number>[]> */\nexport function IsUnionLiteral(value) {\n return IsUnion(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));\n}\n/** Returns true if the given value is TUnion */\nexport function IsUnion(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Union') &&\n IsOptionalString(value.$id) &&\n ValueGuard.IsObject(value) &&\n ValueGuard.IsArray(value.anyOf) &&\n value.anyOf.every(schema => IsSchema(schema)));\n}\n/** Returns true if the given value is TUint8Array */\nexport function IsUint8Array(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Uint8Array') &&\n value.type === 'Uint8Array' &&\n IsOptionalString(value.$id) &&\n IsOptionalNumber(value.minByteLength) &&\n IsOptionalNumber(value.maxByteLength));\n}\n/** Returns true if the given value is TUnknown */\nexport function IsUnknown(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Unknown') &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is a raw TUnsafe */\nexport function IsUnsafe(value) {\n return IsKindOf(value, 'Unsafe');\n}\n/** Returns true if the given value is TVoid */\nexport function IsVoid(value) {\n // prettier-ignore\n return (IsKindOf(value, 'Void') &&\n value.type === 'void' &&\n IsOptionalString(value.$id));\n}\n/** Returns true if the given value is TKind */\nexport function IsKind(value) {\n return ValueGuard.IsObject(value) && Kind in value && ValueGuard.IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);\n}\n/** Returns true if the given value is TSchema */\nexport function IsSchema(value) {\n // prettier-ignore\n return (ValueGuard.IsObject(value)) && (IsAny(value) ||\n IsArgument(value) ||\n IsArray(value) ||\n IsBoolean(value) ||\n IsBigInt(value) ||\n IsAsyncIterator(value) ||\n IsComputed(value) ||\n IsConstructor(value) ||\n IsDate(value) ||\n IsFunction(value) ||\n IsInteger(value) ||\n IsIntersect(value) ||\n IsIterator(value) ||\n IsLiteral(value) ||\n IsMappedKey(value) ||\n IsMappedResult(value) ||\n IsNever(value) ||\n IsNot(value) ||\n IsNull(value) ||\n IsNumber(value) ||\n IsObject(value) ||\n IsPromise(value) ||\n IsRecord(value) ||\n IsRef(value) ||\n IsRegExp(value) ||\n IsString(value) ||\n IsSymbol(value) ||\n IsTemplateLiteral(value) ||\n IsThis(value) ||\n IsTuple(value) ||\n IsUndefined(value) ||\n IsUnion(value) ||\n IsUint8Array(value) ||\n IsUnknown(value) ||\n IsUnsafe(value) ||\n IsVoid(value) ||\n IsKind(value));\n}\n","export const PatternBoolean = '(true|false)';\nexport const PatternNumber = '(0|[1-9][0-9]*)';\nexport const PatternString = '(.*)';\nexport const PatternNever = '(?!.*)';\nexport const PatternBooleanExact = `^${PatternBoolean}$`;\nexport const PatternNumberExact = `^${PatternNumber}$`;\nexport const PatternStringExact = `^${PatternString}$`;\nexport const PatternNeverExact = `^${PatternNever}$`;\n","/** A registry for user defined string formats */\nconst map = new Map();\n/** Returns the entries in this registry */\nexport function Entries() {\n return new Map(map);\n}\n/** Clears all user defined string formats */\nexport function Clear() {\n return map.clear();\n}\n/** Deletes a registered format */\nexport function Delete(format) {\n return map.delete(format);\n}\n/** Returns true if the user defined string format exists */\nexport function Has(format) {\n return map.has(format);\n}\n/** Sets a validation function for a user defined string format */\nexport function Set(format, func) {\n map.set(format, func);\n}\n/** Gets a validation function for a user defined string format */\nexport function Get(format) {\n return map.get(format);\n}\n","/** A registry for user defined types */\nconst map = new Map();\n/** Returns the entries in this registry */\nexport function Entries() {\n return new Map(map);\n}\n/** Clears all user defined types */\nexport function Clear() {\n return map.clear();\n}\n/** Deletes a registered type */\nexport function Delete(kind) {\n return map.delete(kind);\n}\n/** Returns true if this registry contains this kind */\nexport function Has(kind) {\n return map.has(kind);\n}\n/** Sets a validation function for a user defined type */\nexport function Set(kind, func) {\n map.set(kind, func);\n}\n/** Gets a custom validation function for a user defined type */\nexport function Get(kind) {\n return map.get(kind);\n}\n","/** Returns true if element right is in the set of left */\n// prettier-ignore\nexport function SetIncludes(T, S) {\n return T.includes(S);\n}\n/** Returns true if left is a subset of right */\nexport function SetIsSubset(T, S) {\n return T.every((L) => SetIncludes(S, L));\n}\n/** Returns a distinct set of elements */\nexport function SetDistinct(T) {\n return [...new Set(T)];\n}\n/** Returns the Intersect of the given sets */\nexport function SetIntersect(T, S) {\n return T.filter((L) => S.includes(L));\n}\n/** Returns the Union of the given sets */\nexport function SetUnion(T, S) {\n return [...T, ...S];\n}\n/** Returns the Complement by omitting elements in T that are in S */\n// prettier-ignore\nexport function SetComplement(T, S) {\n return T.filter(L => !S.includes(L));\n}\n// prettier-ignore\nfunction SetIntersectManyResolve(T, Init) {\n return T.reduce((Acc, L) => {\n return SetIntersect(Acc, L);\n }, Init);\n}\n// prettier-ignore\nexport function SetIntersectMany(T) {\n return (T.length === 1\n ? T[0]\n // Use left to initialize the accumulator for resolve\n : T.length > 1\n ? SetIntersectManyResolve(T.slice(1), T[0])\n : []);\n}\n/** Returns the Union of multiple sets */\nexport function SetUnionMany(T) {\n const Acc = [];\n for (const L of T)\n Acc.push(...L);\n return Acc;\n}\n","import { CreateType } from '../create/index.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates an Any type */\nexport function Any(options) {\n return CreateType({ [Kind]: 'Any' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates an Array type */\nexport function Array(items, options) {\n return CreateType({ [Kind]: 'Array', type: 'array', items }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates an Argument Type. */\nexport function Argument(index) {\n return CreateType({ [Kind]: 'Argument', index });\n}\n","import { Kind } from '../symbols/index.mjs';\nimport { CreateType } from '../create/type.mjs';\n/** `[JavaScript]` Creates a AsyncIterator type */\nexport function AsyncIterator(items, options) {\n return CreateType({ [Kind]: 'AsyncIterator', type: 'AsyncIterator', items }, options);\n}\n","import { CreateType } from '../create/index.mjs';\nimport { Kind } from '../symbols/symbols.mjs';\n/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */\nexport function Computed(target, parameters, options) {\n return CreateType({ [Kind]: 'Computed', target, parameters }, options);\n}\n","function DiscardKey(value, key) {\n const { [key]: _, ...rest } = value;\n return rest;\n}\n/** Discards property keys from the given value. This function returns a shallow Clone. */\nexport function Discard(value, keys) {\n return keys.reduce((acc, key) => DiscardKey(acc, key), value);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Never type */\nexport function Never(options) {\n return CreateType({ [Kind]: 'Never', not: {} }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n// prettier-ignore\nexport function MappedResult(properties) {\n return CreateType({\n [Kind]: 'MappedResult',\n properties\n });\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Constructor type */\nexport function Constructor(parameters, returns, options) {\n return CreateType({ [Kind]: 'Constructor', type: 'Constructor', parameters, returns }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Function type */\nexport function Function(parameters, returns, options) {\n return CreateType({ [Kind]: 'Function', type: 'Function', parameters, returns }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\nexport function UnionCreate(T, options) {\n return CreateType({ [Kind]: 'Union', anyOf: T }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { OptionalKind } from '../symbols/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { Optional } from '../optional/index.mjs';\nimport { UnionCreate } from './union-create.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsOptional } from '../guard/kind.mjs';\n// prettier-ignore\nfunction IsUnionOptional(types) {\n return types.some(type => IsOptional(type));\n}\n// prettier-ignore\nfunction RemoveOptionalFromRest(types) {\n return types.map(left => IsOptional(left) ? RemoveOptionalFromType(left) : left);\n}\n// prettier-ignore\nfunction RemoveOptionalFromType(T) {\n return (Discard(T, [OptionalKind]));\n}\n// prettier-ignore\nfunction ResolveUnion(types, options) {\n const isOptional = IsUnionOptional(types);\n return (isOptional\n ? Optional(UnionCreate(RemoveOptionalFromRest(types), options))\n : UnionCreate(RemoveOptionalFromRest(types), options));\n}\n/** `[Json]` Creates an evaluated Union type */\nexport function UnionEvaluated(T, options) {\n // prettier-ignore\n return (T.length === 1 ? CreateType(T[0], options) :\n T.length === 0 ? Never(options) :\n ResolveUnion(T, options));\n}\n","import { Never } from '../never/index.mjs';\nimport { CreateType } from '../create/type.mjs';\nimport { UnionCreate } from './union-create.mjs';\n/** `[Json]` Creates a Union type */\nexport function Union(types, options) {\n // prettier-ignore\n return (types.length === 0 ? Never(options) :\n types.length === 1 ? CreateType(types[0], options) :\n UnionCreate(types, options));\n}\n","import { TypeBoxError } from '../error/index.mjs';\n// ------------------------------------------------------------------\n// TemplateLiteralParserError\n// ------------------------------------------------------------------\nexport class TemplateLiteralParserError extends TypeBoxError {\n}\n// -------------------------------------------------------------------\n// Unescape\n//\n// Unescape for these control characters specifically. Note that this\n// function is only called on non union group content, and where we\n// still want to allow the user to embed control characters in that\n// content. For review.\n// -------------------------------------------------------------------\n// prettier-ignore\nfunction Unescape(pattern) {\n return pattern\n .replace(/\\\\\\$/g, '$')\n .replace(/\\\\\\*/g, '*')\n .replace(/\\\\\\^/g, '^')\n .replace(/\\\\\\|/g, '|')\n .replace(/\\\\\\(/g, '(')\n .replace(/\\\\\\)/g, ')');\n}\n// -------------------------------------------------------------------\n// Control Characters\n// -------------------------------------------------------------------\nfunction IsNonEscaped(pattern, index, char) {\n return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;\n}\nfunction IsOpenParen(pattern, index) {\n return IsNonEscaped(pattern, index, '(');\n}\nfunction IsCloseParen(pattern, index) {\n return IsNonEscaped(pattern, index, ')');\n}\nfunction IsSeparator(pattern, index) {\n return IsNonEscaped(pattern, index, '|');\n}\n// -------------------------------------------------------------------\n// Control Groups\n// -------------------------------------------------------------------\nfunction IsGroup(pattern) {\n if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))\n return false;\n let count = 0;\n for (let index = 0; index < pattern.length; index++) {\n if (IsOpenParen(pattern, index))\n count += 1;\n if (IsCloseParen(pattern, index))\n count -= 1;\n if (count === 0 && index !== pattern.length - 1)\n return false;\n }\n return true;\n}\n// prettier-ignore\nfunction InGroup(pattern) {\n return pattern.slice(1, pattern.length - 1);\n}\n// prettier-ignore\nfunction IsPrecedenceOr(pattern) {\n let count = 0;\n for (let index = 0; index < pattern.length; index++) {\n if (IsOpenParen(pattern, index))\n count += 1;\n if (IsCloseParen(pattern, index))\n count -= 1;\n if (IsSeparator(pattern, index) && count === 0)\n return true;\n }\n return false;\n}\n// prettier-ignore\nfunction IsPrecedenceAnd(pattern) {\n for (let index = 0; index < pattern.length; index++) {\n if (IsOpenParen(pattern, index))\n return true;\n }\n return false;\n}\n// prettier-ignore\nfunction Or(pattern) {\n let [count, start] = [0, 0];\n const expressions = [];\n for (let index = 0; index < pattern.length; index++) {\n if (IsOpenParen(pattern, index))\n count += 1;\n if (IsCloseParen(pattern, index))\n count -= 1;\n if (IsSeparator(pattern, index) && count === 0) {\n const range = pattern.slice(start, index);\n if (range.length > 0)\n expressions.push(TemplateLiteralParse(range));\n start = index + 1;\n }\n }\n const range = pattern.slice(start);\n if (range.length > 0)\n expressions.push(TemplateLiteralParse(range));\n if (expressions.length === 0)\n return { type: 'const', const: '' };\n if (expressions.length === 1)\n return expressions[0];\n return { type: 'or', expr: expressions };\n}\n// prettier-ignore\nfunction And(pattern) {\n function Group(value, index) {\n if (!IsOpenParen(value, index))\n throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);\n let count = 0;\n for (let scan = index; scan < value.length; scan++) {\n if (IsOpenParen(value, scan))\n count += 1;\n if (IsCloseParen(value, scan))\n count -= 1;\n if (count === 0)\n return [index, scan];\n }\n throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);\n }\n function Range(pattern, index) {\n for (let scan = index; scan < pattern.length; scan++) {\n if (IsOpenParen(pattern, scan))\n return [index, scan];\n }\n return [index, pattern.length];\n }\n const expressions = [];\n for (let index = 0; index < pattern.length; index++) {\n if (IsOpenParen(pattern, index)) {\n const [start, end] = Group(pattern, index);\n const range = pattern.slice(start, end + 1);\n expressions.push(TemplateLiteralParse(range));\n index = end;\n }\n else {\n const [start, end] = Range(pattern, index);\n const range = pattern.slice(start, end);\n if (range.length > 0)\n expressions.push(TemplateLiteralParse(range));\n index = end - 1;\n }\n }\n return ((expressions.length === 0) ? { type: 'const', const: '' } :\n (expressions.length === 1) ? expressions[0] :\n { type: 'and', expr: expressions });\n}\n// ------------------------------------------------------------------\n// TemplateLiteralParse\n// ------------------------------------------------------------------\n/** Parses a pattern and returns an expression tree */\nexport function TemplateLiteralParse(pattern) {\n // prettier-ignore\n return (IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) :\n IsPrecedenceOr(pattern) ? Or(pattern) :\n IsPrecedenceAnd(pattern) ? And(pattern) :\n { type: 'const', const: Unescape(pattern) });\n}\n// ------------------------------------------------------------------\n// TemplateLiteralParseExact\n// ------------------------------------------------------------------\n/** Parses a pattern and strips forward and trailing ^ and $ */\nexport function TemplateLiteralParseExact(pattern) {\n return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));\n}\n","import { TemplateLiteralParseExact } from './parse.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\n// ------------------------------------------------------------------\n// TemplateLiteralFiniteError\n// ------------------------------------------------------------------\nexport class TemplateLiteralFiniteError extends TypeBoxError {\n}\n// ------------------------------------------------------------------\n// IsTemplateLiteralFiniteCheck\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsNumberExpression(expression) {\n return (expression.type === 'or' &&\n expression.expr.length === 2 &&\n expression.expr[0].type === 'const' &&\n expression.expr[0].const === '0' &&\n expression.expr[1].type === 'const' &&\n expression.expr[1].const === '[1-9][0-9]*');\n}\n// prettier-ignore\nfunction IsBooleanExpression(expression) {\n return (expression.type === 'or' &&\n expression.expr.length === 2 &&\n expression.expr[0].type === 'const' &&\n expression.expr[0].const === 'true' &&\n expression.expr[1].type === 'const' &&\n expression.expr[1].const === 'false');\n}\n// prettier-ignore\nfunction IsStringExpression(expression) {\n return expression.type === 'const' && expression.const === '.*';\n}\n// ------------------------------------------------------------------\n// IsTemplateLiteralExpressionFinite\n// ------------------------------------------------------------------\n// prettier-ignore\nexport function IsTemplateLiteralExpressionFinite(expression) {\n return (IsNumberExpression(expression) || IsStringExpression(expression) ? false :\n IsBooleanExpression(expression) ? true :\n (expression.type === 'and') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) :\n (expression.type === 'or') ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) :\n (expression.type === 'const') ? true :\n (() => { throw new TemplateLiteralFiniteError(`Unknown expression type`); })());\n}\n/** Returns true if this TemplateLiteral resolves to a finite set of values */\nexport function IsTemplateLiteralFinite(schema) {\n const expression = TemplateLiteralParseExact(schema.pattern);\n return IsTemplateLiteralExpressionFinite(expression);\n}\n","import { IsTemplateLiteralExpressionFinite } from './finite.mjs';\nimport { TemplateLiteralParseExact } from './parse.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\n// ------------------------------------------------------------------\n// TemplateLiteralGenerateError\n// ------------------------------------------------------------------\nexport class TemplateLiteralGenerateError extends TypeBoxError {\n}\n// ------------------------------------------------------------------\n// TemplateLiteralExpressionGenerate\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction* GenerateReduce(buffer) {\n if (buffer.length === 1)\n return yield* buffer[0];\n for (const left of buffer[0]) {\n for (const right of GenerateReduce(buffer.slice(1))) {\n yield `${left}${right}`;\n }\n }\n}\n// prettier-ignore\nfunction* GenerateAnd(expression) {\n return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));\n}\n// prettier-ignore\nfunction* GenerateOr(expression) {\n for (const expr of expression.expr)\n yield* TemplateLiteralExpressionGenerate(expr);\n}\n// prettier-ignore\nfunction* GenerateConst(expression) {\n return yield expression.const;\n}\nexport function* TemplateLiteralExpressionGenerate(expression) {\n return expression.type === 'and'\n ? yield* GenerateAnd(expression)\n : expression.type === 'or'\n ? yield* GenerateOr(expression)\n : expression.type === 'const'\n ? yield* GenerateConst(expression)\n : (() => {\n throw new TemplateLiteralGenerateError('Unknown expression');\n })();\n}\n/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */\nexport function TemplateLiteralGenerate(schema) {\n const expression = TemplateLiteralParseExact(schema.pattern);\n // prettier-ignore\n return (IsTemplateLiteralExpressionFinite(expression)\n ? [...TemplateLiteralExpressionGenerate(expression)]\n : []);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Literal type */\nexport function Literal(value, options) {\n return CreateType({\n [Kind]: 'Literal',\n const: value,\n type: typeof value,\n }, options);\n}\n","import { Kind } from '../symbols/index.mjs';\nimport { CreateType } from '../create/index.mjs';\n/** `[Json]` Creates a Boolean type */\nexport function Boolean(options) {\n return CreateType({ [Kind]: 'Boolean', type: 'boolean' }, options);\n}\n","import { Kind } from '../symbols/index.mjs';\nimport { CreateType } from '../create/index.mjs';\n/** `[JavaScript]` Creates a BigInt type */\nexport function BigInt(options) {\n return CreateType({ [Kind]: 'BigInt', type: 'bigint' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Number type */\nexport function Number(options) {\n return CreateType({ [Kind]: 'Number', type: 'number' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a String type */\nexport function String(options) {\n return CreateType({ [Kind]: 'String', type: 'string' }, options);\n}\n","import { Literal } from '../literal/index.mjs';\nimport { Boolean } from '../boolean/index.mjs';\nimport { BigInt } from '../bigint/index.mjs';\nimport { Number } from '../number/index.mjs';\nimport { String } from '../string/index.mjs';\nimport { UnionEvaluated } from '../union/index.mjs';\nimport { Never } from '../never/index.mjs';\n// ------------------------------------------------------------------\n// SyntaxParsers\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction* FromUnion(syntax) {\n const trim = syntax.trim().replace(/\"|'/g, '');\n return (trim === 'boolean' ? yield Boolean() :\n trim === 'number' ? yield Number() :\n trim === 'bigint' ? yield BigInt() :\n trim === 'string' ? yield String() :\n yield (() => {\n const literals = trim.split('|').map((literal) => Literal(literal.trim()));\n return (literals.length === 0 ? Never() :\n literals.length === 1 ? literals[0] :\n UnionEvaluated(literals));\n })());\n}\n// prettier-ignore\nfunction* FromTerminal(syntax) {\n if (syntax[1] !== '{') {\n const L = Literal('$');\n const R = FromSyntax(syntax.slice(1));\n return yield* [L, ...R];\n }\n for (let i = 2; i < syntax.length; i++) {\n if (syntax[i] === '}') {\n const L = FromUnion(syntax.slice(2, i));\n const R = FromSyntax(syntax.slice(i + 1));\n return yield* [...L, ...R];\n }\n }\n yield Literal(syntax);\n}\n// prettier-ignore\nfunction* FromSyntax(syntax) {\n for (let i = 0; i < syntax.length; i++) {\n if (syntax[i] === '$') {\n const L = Literal(syntax.slice(0, i));\n const R = FromTerminal(syntax.slice(i));\n return yield* [L, ...R];\n }\n }\n yield Literal(syntax);\n}\n/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */\nexport function TemplateLiteralSyntax(syntax) {\n return [...FromSyntax(syntax)];\n}\n","import { PatternNumber, PatternString, PatternBoolean } from '../patterns/index.mjs';\nimport { Kind } from '../symbols/index.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsTemplateLiteral, IsUnion, IsNumber, IsInteger, IsBigInt, IsString, IsLiteral, IsBoolean } from '../guard/kind.mjs';\n// ------------------------------------------------------------------\n// TemplateLiteralPatternError\n// ------------------------------------------------------------------\nexport class TemplateLiteralPatternError extends TypeBoxError {\n}\n// ------------------------------------------------------------------\n// TemplateLiteralPattern\n// ------------------------------------------------------------------\nfunction Escape(value) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n// prettier-ignore\nfunction Visit(schema, acc) {\n return (IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) :\n IsUnion(schema) ? `(${schema.anyOf.map((schema) => Visit(schema, acc)).join('|')})` :\n IsNumber(schema) ? `${acc}${PatternNumber}` :\n IsInteger(schema) ? `${acc}${PatternNumber}` :\n IsBigInt(schema) ? `${acc}${PatternNumber}` :\n IsString(schema) ? `${acc}${PatternString}` :\n IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` :\n IsBoolean(schema) ? `${acc}${PatternBoolean}` :\n (() => { throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`); })());\n}\nexport function TemplateLiteralPattern(kinds) {\n return `^${kinds.map((schema) => Visit(schema, '')).join('')}\\$`;\n}\n","import { UnionEvaluated } from '../union/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { TemplateLiteralGenerate } from './generate.mjs';\n/** Returns a Union from the given TemplateLiteral */\nexport function TemplateLiteralToUnion(schema) {\n const R = TemplateLiteralGenerate(schema);\n const L = R.map((S) => Literal(S));\n return UnionEvaluated(L);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { TemplateLiteralSyntax } from './syntax.mjs';\nimport { TemplateLiteralPattern } from './pattern.mjs';\nimport { IsString } from '../guard/value.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a TemplateLiteral type */\n// prettier-ignore\nexport function TemplateLiteral(unresolved, options) {\n const pattern = IsString(unresolved)\n ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved))\n : TemplateLiteralPattern(unresolved);\n return CreateType({ [Kind]: 'TemplateLiteral', type: 'string', pattern }, options);\n}\n","import { TemplateLiteralGenerate } from '../template-literal/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsTemplateLiteral, IsUnion, IsLiteral, IsNumber, IsInteger } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromTemplateLiteral(templateLiteral) {\n const keys = TemplateLiteralGenerate(templateLiteral);\n return keys.map(key => key.toString());\n}\n// prettier-ignore\nfunction FromUnion(types) {\n const result = [];\n for (const type of types)\n result.push(...IndexPropertyKeys(type));\n return result;\n}\n// prettier-ignore\nfunction FromLiteral(literalValue) {\n return ([literalValue.toString()] // TS 5.4 observes TLiteralValue as not having a toString()\n );\n}\n/** Returns a tuple of PropertyKeys derived from the given TSchema */\n// prettier-ignore\nexport function IndexPropertyKeys(type) {\n return [...new Set((IsTemplateLiteral(type) ? FromTemplateLiteral(type) :\n IsUnion(type) ? FromUnion(type.anyOf) :\n IsLiteral(type) ? FromLiteral(type.const) :\n IsNumber(type) ? ['[number]'] :\n IsInteger(type) ? ['[number]'] :\n []))];\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { IndexPropertyKeys } from './indexed-property-keys.mjs';\nimport { Index } from './index.mjs';\n// prettier-ignore\nfunction FromProperties(type, properties, options) {\n const result = {};\n for (const K2 of Object.getOwnPropertyNames(properties)) {\n result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);\n }\n return result;\n}\n// prettier-ignore\nfunction FromMappedResult(type, mappedResult, options) {\n return FromProperties(type, mappedResult.properties, options);\n}\n// prettier-ignore\nexport function IndexFromMappedResult(type, mappedResult, options) {\n const properties = FromMappedResult(type, mappedResult, options);\n return MappedResult(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { IntersectEvaluated } from '../intersect/index.mjs';\nimport { UnionEvaluated } from '../union/index.mjs';\nimport { IndexPropertyKeys } from './indexed-property-keys.mjs';\nimport { IndexFromMappedKey } from './indexed-from-mapped-key.mjs';\nimport { IndexFromMappedResult } from './indexed-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsIntersect, IsObject, IsMappedKey, IsMappedResult, IsNever, IsSchema, IsTuple, IsUnion, IsRef } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromRest(types, key) {\n return types.map(type => IndexFromPropertyKey(type, key));\n}\n// prettier-ignore\nfunction FromIntersectRest(types) {\n return types.filter(type => !IsNever(type));\n}\n// prettier-ignore\nfunction FromIntersect(types, key) {\n return (IntersectEvaluated(FromIntersectRest(FromRest(types, key))));\n}\n// prettier-ignore\nfunction FromUnionRest(types) {\n return (types.some(L => IsNever(L))\n ? []\n : types);\n}\n// prettier-ignore\nfunction FromUnion(types, key) {\n return (UnionEvaluated(FromUnionRest(FromRest(types, key))));\n}\n// prettier-ignore\nfunction FromTuple(types, key) {\n return (key in types ? types[key] :\n key === '[number]' ? UnionEvaluated(types) :\n Never());\n}\n// prettier-ignore\nfunction FromArray(type, key) {\n return (key === '[number]'\n ? type\n : Never());\n}\n// prettier-ignore\nfunction FromProperty(properties, propertyKey) {\n return (propertyKey in properties ? properties[propertyKey] : Never());\n}\n// prettier-ignore\nexport function IndexFromPropertyKey(type, propertyKey) {\n return (IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) :\n IsUnion(type) ? FromUnion(type.anyOf, propertyKey) :\n IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) :\n IsArray(type) ? FromArray(type.items, propertyKey) :\n IsObject(type) ? FromProperty(type.properties, propertyKey) :\n Never());\n}\n// prettier-ignore\nexport function IndexFromPropertyKeys(type, propertyKeys) {\n return propertyKeys.map(propertyKey => IndexFromPropertyKey(type, propertyKey));\n}\n// prettier-ignore\nfunction FromSchema(type, propertyKeys) {\n return (UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys)));\n}\n// prettier-ignore\nexport function IndexFromComputed(type, key) {\n return Computed('Index', [type, key]);\n}\n/** `[Json]` Returns an Indexed property type for the given keys */\nexport function Index(type, key, options) {\n // computed-type\n if (IsRef(type) || IsRef(key)) {\n const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;\n if (!IsSchema(type) || !IsSchema(key))\n throw new TypeBoxError(error);\n return Computed('Index', [type, key]);\n }\n // mapped-types\n if (IsMappedResult(key))\n return IndexFromMappedResult(type, key, options);\n if (IsMappedKey(key))\n return IndexFromMappedKey(type, key, options);\n // prettier-ignore\n return CreateType(IsSchema(key)\n ? FromSchema(type, IndexPropertyKeys(key))\n : FromSchema(type, key), options);\n}\n","import { Index } from './indexed.mjs';\nimport { MappedResult } from '../mapped/index.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction MappedIndexPropertyKey(type, key, options) {\n return { [key]: Index(type, [key], Clone(options)) };\n}\n// prettier-ignore\nfunction MappedIndexPropertyKeys(type, propertyKeys, options) {\n return propertyKeys.reduce((result, left) => {\n return { ...result, ...MappedIndexPropertyKey(type, left, options) };\n }, {});\n}\n// prettier-ignore\nfunction MappedIndexProperties(type, mappedKey, options) {\n return MappedIndexPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nexport function IndexFromMappedKey(type, mappedKey, options) {\n const properties = MappedIndexProperties(type, mappedKey, options);\n return MappedResult(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates an Iterator type */\nexport function Iterator(items, options) {\n return CreateType({ [Kind]: 'Iterator', type: 'Iterator', items }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsOptional } from '../guard/kind.mjs';\nfunction RequiredKeys(properties) {\n const keys = [];\n for (let key in properties) {\n if (!IsOptional(properties[key]))\n keys.push(key);\n }\n return keys;\n}\n/** `[Json]` Creates an Object type */\nfunction _Object(properties, options) {\n const required = RequiredKeys(properties);\n const schematic = required.length > 0 ? { [Kind]: 'Object', type: 'object', properties, required } : { [Kind]: 'Object', type: 'object', properties };\n return CreateType(schematic, options);\n}\n/** `[Json]` Creates an Object type */\nexport var Object = _Object;\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Promise type */\nexport function Promise(item, options) {\n return CreateType({ [Kind]: 'Promise', type: 'Promise', item }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { ReadonlyKind } from '../symbols/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { ReadonlyFromMappedResult } from './readonly-from-mapped-result.mjs';\nimport { IsMappedResult } from '../guard/kind.mjs';\nfunction RemoveReadonly(schema) {\n return CreateType(Discard(schema, [ReadonlyKind]));\n}\nfunction AddReadonly(schema) {\n return CreateType({ ...schema, [ReadonlyKind]: 'Readonly' });\n}\n// prettier-ignore\nfunction ReadonlyWithFlag(schema, F) {\n return (F === false\n ? RemoveReadonly(schema)\n : AddReadonly(schema));\n}\n/** `[Json]` Creates a Readonly property */\nexport function Readonly(schema, enable) {\n const F = enable ?? true;\n return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Readonly } from './readonly.mjs';\n// prettier-ignore\nfunction FromProperties(K, F) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(K))\n Acc[K2] = Readonly(K[K2], F);\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, F) {\n return FromProperties(R.properties, F);\n}\n// prettier-ignore\nexport function ReadonlyFromMappedResult(R, F) {\n const P = FromMappedResult(R, F);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Tuple type */\nexport function Tuple(types, options) {\n // prettier-ignore\n return CreateType(types.length > 0 ?\n { [Kind]: 'Tuple', type: 'array', items: types, additionalItems: false, minItems: types.length, maxItems: types.length } :\n { [Kind]: 'Tuple', type: 'array', minItems: types.length, maxItems: types.length }, options);\n}\n","import { Kind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs';\nimport { Discard } from '../discard/index.mjs';\n// evaluation types\nimport { Array } from '../array/index.mjs';\nimport { AsyncIterator } from '../async-iterator/index.mjs';\nimport { Constructor } from '../constructor/index.mjs';\nimport { Function as FunctionType } from '../function/index.mjs';\nimport { IndexPropertyKeys } from '../indexed/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Iterator } from '../iterator/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Optional } from '../optional/index.mjs';\nimport { Promise } from '../promise/index.mjs';\nimport { Readonly } from '../readonly/index.mjs';\nimport { Tuple } from '../tuple/index.mjs';\nimport { Union } from '../union/index.mjs';\n// operator\nimport { SetIncludes } from '../sets/index.mjs';\n// mapping types\nimport { MappedResult } from './mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsAsyncIterator, IsConstructor, IsFunction, IsIntersect, IsIterator, IsReadonly, IsMappedResult, IsMappedKey, IsObject, IsOptional, IsPromise, IsSchema, IsTuple, IsUnion } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromMappedResult(K, P) {\n return (K in P\n ? FromSchemaType(K, P[K])\n : MappedResult(P));\n}\n// prettier-ignore\nfunction MappedKeyToKnownMappedResultProperties(K) {\n return { [K]: Literal(K) };\n}\n// prettier-ignore\nfunction MappedKeyToUnknownMappedResultProperties(P) {\n const Acc = {};\n for (const L of P)\n Acc[L] = Literal(L);\n return Acc;\n}\n// prettier-ignore\nfunction MappedKeyToMappedResultProperties(K, P) {\n return (SetIncludes(P, K)\n ? MappedKeyToKnownMappedResultProperties(K)\n : MappedKeyToUnknownMappedResultProperties(P));\n}\n// prettier-ignore\nfunction FromMappedKey(K, P) {\n const R = MappedKeyToMappedResultProperties(K, P);\n return FromMappedResult(K, R);\n}\n// prettier-ignore\nfunction FromRest(K, T) {\n return T.map(L => FromSchemaType(K, L));\n}\n// prettier-ignore\nfunction FromProperties(K, T) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(T))\n Acc[K2] = FromSchemaType(K, T[K2]);\n return Acc;\n}\n// prettier-ignore\nfunction FromSchemaType(K, T) {\n // required to retain user defined options for mapped type\n const options = { ...T };\n return (\n // unevaluated modifier types\n IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) :\n IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) :\n // unevaluated mapped types\n IsMappedResult(T) ? FromMappedResult(K, T.properties) :\n IsMappedKey(T) ? FromMappedKey(K, T.keys) :\n // unevaluated types\n IsConstructor(T) ? Constructor(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) :\n IsFunction(T) ? FunctionType(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) :\n IsAsyncIterator(T) ? AsyncIterator(FromSchemaType(K, T.items), options) :\n IsIterator(T) ? Iterator(FromSchemaType(K, T.items), options) :\n IsIntersect(T) ? Intersect(FromRest(K, T.allOf), options) :\n IsUnion(T) ? Union(FromRest(K, T.anyOf), options) :\n IsTuple(T) ? Tuple(FromRest(K, T.items ?? []), options) :\n IsObject(T) ? Object(FromProperties(K, T.properties), options) :\n IsArray(T) ? Array(FromSchemaType(K, T.items), options) :\n IsPromise(T) ? Promise(FromSchemaType(K, T.item), options) :\n T);\n}\n// prettier-ignore\nexport function MappedFunctionReturnType(K, T) {\n const Acc = {};\n for (const L of K)\n Acc[L] = FromSchemaType(L, T);\n return Acc;\n}\n/** `[Json]` Creates a Mapped object type */\nexport function Mapped(key, map, options) {\n const K = IsSchema(key) ? IndexPropertyKeys(key) : key;\n const RT = map({ [Kind]: 'MappedKey', keys: K });\n const R = MappedFunctionReturnType(K, RT);\n return Object(R, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { OptionalKind } from '../symbols/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { OptionalFromMappedResult } from './optional-from-mapped-result.mjs';\nimport { IsMappedResult } from '../guard/kind.mjs';\nfunction RemoveOptional(schema) {\n return CreateType(Discard(schema, [OptionalKind]));\n}\nfunction AddOptional(schema) {\n return CreateType({ ...schema, [OptionalKind]: 'Optional' });\n}\n// prettier-ignore\nfunction OptionalWithFlag(schema, F) {\n return (F === false\n ? RemoveOptional(schema)\n : AddOptional(schema));\n}\n/** `[Json]` Creates a Optional property */\nexport function Optional(schema, enable) {\n const F = enable ?? true;\n return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Optional } from './optional.mjs';\n// prettier-ignore\nfunction FromProperties(P, F) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(P))\n Acc[K2] = Optional(P[K2], F);\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, F) {\n return FromProperties(R.properties, F);\n}\n// prettier-ignore\nexport function OptionalFromMappedResult(R, F) {\n const P = FromMappedResult(R, F);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsObject, IsSchema } from '../guard/kind.mjs';\n// ------------------------------------------------------------------\n// IntersectCreate\n// ------------------------------------------------------------------\n// prettier-ignore\nexport function IntersectCreate(T, options = {}) {\n const allObjects = T.every((schema) => IsObject(schema));\n const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties)\n ? { unevaluatedProperties: options.unevaluatedProperties }\n : {};\n return CreateType((options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects\n ? { ...clonedUnevaluatedProperties, [Kind]: 'Intersect', type: 'object', allOf: T }\n : { ...clonedUnevaluatedProperties, [Kind]: 'Intersect', allOf: T }), options);\n}\n","import { OptionalKind } from '../symbols/index.mjs';\nimport { CreateType } from '../create/type.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { Optional } from '../optional/index.mjs';\nimport { IntersectCreate } from './intersect-create.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsOptional, IsTransform } from '../guard/kind.mjs';\n// prettier-ignore\nfunction IsIntersectOptional(types) {\n return types.every(left => IsOptional(left));\n}\n// prettier-ignore\nfunction RemoveOptionalFromType(type) {\n return (Discard(type, [OptionalKind]));\n}\n// prettier-ignore\nfunction RemoveOptionalFromRest(types) {\n return types.map(left => IsOptional(left) ? RemoveOptionalFromType(left) : left);\n}\n// prettier-ignore\nfunction ResolveIntersect(types, options) {\n return (IsIntersectOptional(types)\n ? Optional(IntersectCreate(RemoveOptionalFromRest(types), options))\n : IntersectCreate(RemoveOptionalFromRest(types), options));\n}\n/** `[Json]` Creates an evaluated Intersect type */\nexport function IntersectEvaluated(types, options = {}) {\n if (types.length === 1)\n return CreateType(types[0], options);\n if (types.length === 0)\n return Never(options);\n if (types.some((schema) => IsTransform(schema)))\n throw new Error('Cannot intersect transform types');\n return ResolveIntersect(types, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Never } from '../never/index.mjs';\nimport { IntersectCreate } from './intersect-create.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsTransform } from '../guard/kind.mjs';\n/** `[Json]` Creates an evaluated Intersect type */\nexport function Intersect(types, options) {\n if (types.length === 1)\n return CreateType(types[0], options);\n if (types.length === 0)\n return Never(options);\n if (types.some((schema) => IsTransform(schema)))\n throw new Error('Cannot intersect transform types');\n return IntersectCreate(types, options);\n}\n","import { TypeBoxError } from '../error/index.mjs';\nimport { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Ref type. The referenced type must contain a $id */\nexport function Ref(...args) {\n const [$ref, options] = typeof args[0] === 'string' ? [args[0], args[1]] : [args[0].$id, args[1]];\n if (typeof $ref !== 'string')\n throw new TypeBoxError('Ref: $ref must be a string');\n return CreateType({ [Kind]: 'Ref', $ref }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Ref } from '../ref/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsIntersect, IsUnion, IsPromise, IsRef, IsComputed } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n return Computed('Awaited', [Computed(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n return Computed('Awaited', [Ref($ref)]);\n}\n// prettier-ignore\nfunction FromIntersect(types) {\n return Intersect(FromRest(types));\n}\n// prettier-ignore\nfunction FromUnion(types) {\n return Union(FromRest(types));\n}\n// prettier-ignore\nfunction FromPromise(type) {\n return Awaited(type);\n}\n// prettier-ignore\nfunction FromRest(types) {\n return types.map(type => Awaited(type));\n}\n/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */\nexport function Awaited(type, options) {\n return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);\n}\n","import { SetUnionMany, SetIntersectMany } from '../sets/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsIntersect, IsUnion, IsTuple, IsArray, IsObject, IsRecord } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromRest(types) {\n const result = [];\n for (const L of types)\n result.push(KeyOfPropertyKeys(L));\n return result;\n}\n// prettier-ignore\nfunction FromIntersect(types) {\n const propertyKeysArray = FromRest(types);\n const propertyKeys = SetUnionMany(propertyKeysArray);\n return propertyKeys;\n}\n// prettier-ignore\nfunction FromUnion(types) {\n const propertyKeysArray = FromRest(types);\n const propertyKeys = SetIntersectMany(propertyKeysArray);\n return propertyKeys;\n}\n// prettier-ignore\nfunction FromTuple(types) {\n return types.map((_, indexer) => indexer.toString());\n}\n// prettier-ignore\nfunction FromArray(_) {\n return (['[number]']);\n}\n// prettier-ignore\nfunction FromProperties(T) {\n return (globalThis.Object.getOwnPropertyNames(T));\n}\n// ------------------------------------------------------------------\n// FromPatternProperties\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromPatternProperties(patternProperties) {\n if (!includePatternProperties)\n return [];\n const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);\n return patternPropertyKeys.map(key => {\n return (key[0] === '^' && key[key.length - 1] === '$')\n ? key.slice(1, key.length - 1)\n : key;\n });\n}\n/** Returns a tuple of PropertyKeys derived from the given TSchema. */\n// prettier-ignore\nexport function KeyOfPropertyKeys(type) {\n return (IsIntersect(type) ? FromIntersect(type.allOf) :\n IsUnion(type) ? FromUnion(type.anyOf) :\n IsTuple(type) ? FromTuple(type.items ?? []) :\n IsArray(type) ? FromArray(type.items) :\n IsObject(type) ? FromProperties(type.properties) :\n IsRecord(type) ? FromPatternProperties(type.patternProperties) :\n []);\n}\n// ----------------------------------------------------------------\n// KeyOfPattern\n// ----------------------------------------------------------------\nlet includePatternProperties = false;\n/** Returns a regular expression pattern derived from the given TSchema */\nexport function KeyOfPattern(schema) {\n includePatternProperties = true;\n const keys = KeyOfPropertyKeys(schema);\n includePatternProperties = false;\n const pattern = keys.map((key) => `(${key})`);\n return `^(${pattern.join('|')})$`;\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Number } from '../number/index.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Ref } from '../ref/index.mjs';\nimport { KeyOfPropertyKeys } from './keyof-property-keys.mjs';\nimport { UnionEvaluated } from '../union/index.mjs';\nimport { KeyOfFromMappedResult } from './keyof-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedResult, IsRef, IsComputed } from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n return Computed('KeyOf', [Computed(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n return Computed('KeyOf', [Ref($ref)]);\n}\n// prettier-ignore\nfunction KeyOfFromType(type, options) {\n const propertyKeys = KeyOfPropertyKeys(type);\n const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);\n const result = UnionEvaluated(propertyKeyTypes);\n return CreateType(result, options);\n}\n// prettier-ignore\nexport function KeyOfPropertyKeysToRest(propertyKeys) {\n return propertyKeys.map(L => L === '[number]' ? Number() : Literal(L));\n}\n/** `[Json]` Creates a KeyOf type */\nexport function KeyOf(type, options) {\n return (IsComputed(type) ? FromComputed(type.target, type.parameters) : IsRef(type) ? FromRef(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options));\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { KeyOf } from './keyof.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromProperties(properties, options) {\n const result = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(properties))\n result[K2] = KeyOf(properties[K2], Clone(options));\n return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, options) {\n return FromProperties(mappedResult.properties, options);\n}\n// prettier-ignore\nexport function KeyOfFromMappedResult(mappedResult, options) {\n const properties = FromMappedResult(mappedResult, options);\n return MappedResult(properties);\n}\n","import { IntersectEvaluated } from '../intersect/index.mjs';\nimport { IndexFromPropertyKeys } from '../indexed/index.mjs';\nimport { KeyOfPropertyKeys } from '../keyof/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { SetDistinct } from '../sets/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsNever } from '../guard/kind.mjs';\n// prettier-ignore\nfunction CompositeKeys(T) {\n const Acc = [];\n for (const L of T)\n Acc.push(...KeyOfPropertyKeys(L));\n return SetDistinct(Acc);\n}\n// prettier-ignore\nfunction FilterNever(T) {\n return T.filter(L => !IsNever(L));\n}\n// prettier-ignore\nfunction CompositeProperty(T, K) {\n const Acc = [];\n for (const L of T)\n Acc.push(...IndexFromPropertyKeys(L, [K]));\n return FilterNever(Acc);\n}\n// prettier-ignore\nfunction CompositeProperties(T, K) {\n const Acc = {};\n for (const L of K) {\n Acc[L] = IntersectEvaluated(CompositeProperty(T, L));\n }\n return Acc;\n}\n// prettier-ignore\nexport function Composite(T, options) {\n const K = CompositeKeys(T);\n const P = CompositeProperties(T, K);\n const R = Object(P, options);\n return R;\n}\n","import { Kind } from '../symbols/index.mjs';\nimport { CreateType } from '../create/type.mjs';\n/** `[JavaScript]` Creates a Date type */\nexport function Date(options) {\n return CreateType({ [Kind]: 'Date', type: 'Date' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Null type */\nexport function Null(options) {\n return CreateType({ [Kind]: 'Null', type: 'null' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Symbol type */\nexport function Symbol(options) {\n return CreateType({ [Kind]: 'Symbol', type: 'symbol' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Undefined type */\nexport function Undefined(options) {\n return CreateType({ [Kind]: 'Undefined', type: 'undefined' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Uint8Array type */\nexport function Uint8Array(options) {\n return CreateType({ [Kind]: 'Uint8Array', type: 'Uint8Array' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates an Unknown type */\nexport function Unknown(options) {\n return CreateType({ [Kind]: 'Unknown' }, options);\n}\n","import { Any } from '../any/index.mjs';\nimport { BigInt } from '../bigint/index.mjs';\nimport { Date } from '../date/index.mjs';\nimport { Function as FunctionType } from '../function/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Null } from '../null/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Symbol } from '../symbol/index.mjs';\nimport { Tuple } from '../tuple/index.mjs';\nimport { Readonly } from '../readonly/index.mjs';\nimport { Undefined } from '../undefined/index.mjs';\nimport { Uint8Array } from '../uint8array/index.mjs';\nimport { Unknown } from '../unknown/index.mjs';\nimport { CreateType } from '../create/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsNumber, IsBigInt, IsUint8Array, IsDate, IsIterator, IsObject, IsAsyncIterator, IsFunction, IsUndefined, IsNull, IsSymbol, IsBoolean, IsString } from '../guard/value.mjs';\n// prettier-ignore\nfunction FromArray(T) {\n return T.map(L => FromValue(L, false));\n}\n// prettier-ignore\nfunction FromProperties(value) {\n const Acc = {};\n for (const K of globalThis.Object.getOwnPropertyNames(value))\n Acc[K] = Readonly(FromValue(value[K], false));\n return Acc;\n}\nfunction ConditionalReadonly(T, root) {\n return (root === true ? T : Readonly(T));\n}\n// prettier-ignore\nfunction FromValue(value, root) {\n return (IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) :\n IsIterator(value) ? ConditionalReadonly(Any(), root) :\n IsArray(value) ? Readonly(Tuple(FromArray(value))) :\n IsUint8Array(value) ? Uint8Array() :\n IsDate(value) ? Date() :\n IsObject(value) ? ConditionalReadonly(Object(FromProperties(value)), root) :\n IsFunction(value) ? ConditionalReadonly(FunctionType([], Unknown()), root) :\n IsUndefined(value) ? Undefined() :\n IsNull(value) ? Null() :\n IsSymbol(value) ? Symbol() :\n IsBigInt(value) ? BigInt() :\n IsNumber(value) ? Literal(value) :\n IsBoolean(value) ? Literal(value) :\n IsString(value) ? Literal(value) :\n Object({}));\n}\n/** `[JavaScript]` Creates a readonly const type from the given value. */\nexport function Const(T, options) {\n return CreateType(FromValue(T, true), options);\n}\n","import { Tuple } from '../tuple/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport * as KindGuard from '../guard/kind.mjs';\n/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */\nexport function ConstructorParameters(schema, options) {\n return (KindGuard.IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options));\n}\n","import { Literal } from '../literal/index.mjs';\nimport { Kind, Hint } from '../symbols/index.mjs';\nimport { Union } from '../union/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsUndefined } from '../guard/value.mjs';\n/** `[Json]` Creates a Enum type */\nexport function Enum(item, options) {\n if (IsUndefined(item))\n throw new Error('Enum undefined or empty');\n const values1 = globalThis.Object.getOwnPropertyNames(item)\n .filter((key) => isNaN(key))\n .map((key) => item[key]);\n const values2 = [...new Set(values1)];\n const anyOf = values2.map((value) => Literal(value));\n return Union(anyOf, { ...options, [Hint]: 'Enum' });\n}\n","import { Any } from '../any/index.mjs';\nimport { Function as FunctionType } from '../function/index.mjs';\nimport { Number } from '../number/index.mjs';\nimport { String } from '../string/index.mjs';\nimport { Unknown } from '../unknown/index.mjs';\nimport { TemplateLiteralToUnion } from '../template-literal/index.mjs';\nimport { PatternNumberExact, PatternStringExact } from '../patterns/index.mjs';\nimport { Kind, Hint } from '../symbols/index.mjs';\nimport { TypeBoxError } from '../error/index.mjs';\nimport { TypeGuard, ValueGuard } from '../guard/index.mjs';\nexport class ExtendsResolverError extends TypeBoxError {\n}\nexport var ExtendsResult;\n(function (ExtendsResult) {\n ExtendsResult[ExtendsResult[\"Union\"] = 0] = \"Union\";\n ExtendsResult[ExtendsResult[\"True\"] = 1] = \"True\";\n ExtendsResult[ExtendsResult[\"False\"] = 2] = \"False\";\n})(ExtendsResult || (ExtendsResult = {}));\n// ------------------------------------------------------------------\n// IntoBooleanResult\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IntoBooleanResult(result) {\n return result === ExtendsResult.False ? result : ExtendsResult.True;\n}\n// ------------------------------------------------------------------\n// Throw\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Throw(message) {\n throw new ExtendsResolverError(message);\n}\n// ------------------------------------------------------------------\n// StructuralRight\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsStructuralRight(right) {\n return (TypeGuard.IsNever(right) ||\n TypeGuard.IsIntersect(right) ||\n TypeGuard.IsUnion(right) ||\n TypeGuard.IsUnknown(right) ||\n TypeGuard.IsAny(right));\n}\n// prettier-ignore\nfunction StructuralRight(left, right) {\n return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :\n TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :\n TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :\n TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :\n TypeGuard.IsAny(right) ? FromAnyRight(left, right) :\n Throw('StructuralRight'));\n}\n// ------------------------------------------------------------------\n// Any\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromAnyRight(left, right) {\n return ExtendsResult.True;\n}\n// prettier-ignore\nfunction FromAny(left, right) {\n return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :\n (TypeGuard.IsUnion(right) && right.anyOf.some((schema) => TypeGuard.IsAny(schema) || TypeGuard.IsUnknown(schema))) ? ExtendsResult.True :\n TypeGuard.IsUnion(right) ? ExtendsResult.Union :\n TypeGuard.IsUnknown(right) ? ExtendsResult.True :\n TypeGuard.IsAny(right) ? ExtendsResult.True :\n ExtendsResult.Union);\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromArrayRight(left, right) {\n return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :\n TypeGuard.IsAny(left) ? ExtendsResult.Union :\n TypeGuard.IsNever(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromArray(left, right) {\n return (TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :\n IsStructuralRight(right) ? StructuralRight(left, right) :\n !TypeGuard.IsArray(right) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.items, right.items)));\n}\n// ------------------------------------------------------------------\n// AsyncIterator\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromAsyncIterator(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n !TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.items, right.items)));\n}\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromBigInt(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsBigInt(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromBooleanRight(left, right) {\n return (TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True :\n TypeGuard.IsBoolean(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromBoolean(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsBoolean(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Constructor\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromConstructor(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n !TypeGuard.IsConstructor(right) ? ExtendsResult.False :\n left.parameters.length > right.parameters.length ? ExtendsResult.False :\n (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.returns, right.returns)));\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromDate(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsDate(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Function\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromFunction(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n !TypeGuard.IsFunction(right) ? ExtendsResult.False :\n left.parameters.length > right.parameters.length ? ExtendsResult.False :\n (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.returns, right.returns)));\n}\n// ------------------------------------------------------------------\n// Integer\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIntegerRight(left, right) {\n return (TypeGuard.IsLiteral(left) && ValueGuard.IsNumber(left.const) ? ExtendsResult.True :\n TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromInteger(left, right) {\n return (TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :\n IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Intersect\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIntersectRight(left, right) {\n return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True)\n ? ExtendsResult.True\n : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromIntersect(left, right) {\n return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True)\n ? ExtendsResult.True\n : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Iterator\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIterator(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n !TypeGuard.IsIterator(right) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.items, right.items)));\n}\n// ------------------------------------------------------------------\n// Literal\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromLiteral(left, right) {\n return (TypeGuard.IsLiteral(right) && right.const === left.const ? ExtendsResult.True :\n IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsString(right) ? FromStringRight(left, right) :\n TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :\n TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :\n TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Never\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNeverRight(left, right) {\n return ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromNever(left, right) {\n return ExtendsResult.True;\n}\n// ------------------------------------------------------------------\n// Not\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction UnwrapTNot(schema) {\n let [current, depth] = [schema, 0];\n while (true) {\n if (!TypeGuard.IsNot(current))\n break;\n current = current.not;\n depth += 1;\n }\n return depth % 2 === 0 ? current : Unknown();\n}\n// prettier-ignore\nfunction FromNot(left, right) {\n // TypeScript has no concept of negated types, and attempts to correctly check the negated\n // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer\n // the type. Instead we unwrap to either unknown or T and continue evaluating.\n // prettier-ignore\n return (TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) :\n TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) :\n Throw('Invalid fallthrough for Not'));\n}\n// ------------------------------------------------------------------\n// Null\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNull(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsNull(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNumberRight(left, right) {\n return (TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True :\n TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromNumber(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsObjectPropertyCount(schema, count) {\n return Object.getOwnPropertyNames(schema.properties).length === count;\n}\n// prettier-ignore\nfunction IsObjectStringLike(schema) {\n return IsObjectArrayLike(schema);\n}\n// prettier-ignore\nfunction IsObjectSymbolLike(schema) {\n return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.IsString(schema.properties.description.anyOf[0]) &&\n TypeGuard.IsUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.IsString(schema.properties.description.anyOf[1]) &&\n TypeGuard.IsUndefined(schema.properties.description.anyOf[0]))));\n}\n// prettier-ignore\nfunction IsObjectNumberLike(schema) {\n return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectBooleanLike(schema) {\n return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectBigIntLike(schema) {\n return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectDateLike(schema) {\n return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectUint8ArrayLike(schema) {\n return IsObjectArrayLike(schema);\n}\n// prettier-ignore\nfunction IsObjectFunctionLike(schema) {\n const length = Number();\n return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);\n}\n// prettier-ignore\nfunction IsObjectConstructorLike(schema) {\n return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectArrayLike(schema) {\n const length = Number();\n return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);\n}\n// prettier-ignore\nfunction IsObjectPromiseLike(schema) {\n const then = FunctionType([Any()], Any());\n return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True);\n}\n// ------------------------------------------------------------------\n// Property\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Property(left, right) {\n return (Visit(left, right) === ExtendsResult.False ? ExtendsResult.False :\n TypeGuard.IsOptional(left) && !TypeGuard.IsOptional(right) ? ExtendsResult.False :\n ExtendsResult.True);\n}\n// prettier-ignore\nfunction FromObjectRight(left, right) {\n return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :\n TypeGuard.IsAny(left) ? ExtendsResult.Union : (TypeGuard.IsNever(left) ||\n (TypeGuard.IsLiteralString(left) && IsObjectStringLike(right)) ||\n (TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right)) ||\n (TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right)) ||\n (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||\n (TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right)) ||\n (TypeGuard.IsString(left) && IsObjectStringLike(right)) ||\n (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||\n (TypeGuard.IsNumber(left) && IsObjectNumberLike(right)) ||\n (TypeGuard.IsInteger(left) && IsObjectNumberLike(right)) ||\n (TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right)) ||\n (TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right)) ||\n (TypeGuard.IsDate(left) && IsObjectDateLike(right)) ||\n (TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right)) ||\n (TypeGuard.IsFunction(left) && IsObjectFunctionLike(right))) ? ExtendsResult.True :\n (TypeGuard.IsRecord(left) && TypeGuard.IsString(RecordKey(left))) ? (() => {\n // When expressing a Record with literal key values, the Record is converted into a Object with\n // the Hint assigned as `Record`. This is used to invert the extends logic.\n return right[Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False;\n })() :\n (TypeGuard.IsRecord(left) && TypeGuard.IsNumber(RecordKey(left))) ? (() => {\n return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;\n })() :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromObject(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n !TypeGuard.IsObject(right) ? ExtendsResult.False :\n (() => {\n for (const key of Object.getOwnPropertyNames(right.properties)) {\n if (!(key in left.properties) && !TypeGuard.IsOptional(right.properties[key])) {\n return ExtendsResult.False;\n }\n if (TypeGuard.IsOptional(right.properties[key])) {\n return ExtendsResult.True;\n }\n if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {\n return ExtendsResult.False;\n }\n }\n return ExtendsResult.True;\n })());\n}\n// ------------------------------------------------------------------\n// Promise\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromPromise(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True :\n !TypeGuard.IsPromise(right) ? ExtendsResult.False :\n IntoBooleanResult(Visit(left.item, right.item)));\n}\n// ------------------------------------------------------------------\n// Record\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordKey(schema) {\n return (PatternNumberExact in schema.patternProperties ? Number() :\n PatternStringExact in schema.patternProperties ? String() :\n Throw('Unknown record key pattern'));\n}\n// prettier-ignore\nfunction RecordValue(schema) {\n return (PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] :\n PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] :\n Throw('Unable to get record value schema'));\n}\n// prettier-ignore\nfunction FromRecordRight(left, right) {\n const [Key, Value] = [RecordKey(right), RecordValue(right)];\n return ((TypeGuard.IsLiteralString(left) && TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True) ? ExtendsResult.True :\n TypeGuard.IsUint8Array(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :\n TypeGuard.IsString(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :\n TypeGuard.IsArray(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :\n TypeGuard.IsObject(left) ? (() => {\n for (const key of Object.getOwnPropertyNames(left.properties)) {\n if (Property(Value, left.properties[key]) === ExtendsResult.False) {\n return ExtendsResult.False;\n }\n }\n return ExtendsResult.True;\n })() :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromRecord(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n !TypeGuard.IsRecord(right) ? ExtendsResult.False :\n Visit(RecordValue(left), RecordValue(right)));\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromRegExp(left, right) {\n // Note: RegExp types evaluate as strings, not RegExp objects.\n // Here we remap either into string and continue evaluating.\n const L = TypeGuard.IsRegExp(left) ? String() : left;\n const R = TypeGuard.IsRegExp(right) ? String() : right;\n return Visit(L, R);\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromStringRight(left, right) {\n return (TypeGuard.IsLiteral(left) && ValueGuard.IsString(left.const) ? ExtendsResult.True :\n TypeGuard.IsString(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromString(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsString(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Symbol\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromSymbol(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsSymbol(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// TemplateLiteral\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromTemplateLiteral(left, right) {\n // TemplateLiteral types are resolved to either unions for finite expressions or string\n // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for\n // either type and continue evaluating.\n return (TypeGuard.IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) :\n TypeGuard.IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) :\n Throw('Invalid fallthrough for TemplateLiteral'));\n}\n// ------------------------------------------------------------------\n// Tuple\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsArrayOfTuple(left, right) {\n return (TypeGuard.IsArray(right) &&\n left.items !== undefined &&\n left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True));\n}\n// prettier-ignore\nfunction FromTupleRight(left, right) {\n return (TypeGuard.IsNever(left) ? ExtendsResult.True :\n TypeGuard.IsUnknown(left) ? ExtendsResult.False :\n TypeGuard.IsAny(left) ? ExtendsResult.Union :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromTuple(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :\n TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True :\n !TypeGuard.IsTuple(right) ? ExtendsResult.False :\n (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) || (!ValueGuard.IsUndefined(left.items) && ValueGuard.IsUndefined(right.items)) ? ExtendsResult.False :\n (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) ? ExtendsResult.True :\n left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Uint8Array\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUint8Array(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsUint8Array(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Undefined\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUndefined(left, right) {\n return (IsStructuralRight(right) ? StructuralRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :\n TypeGuard.IsVoid(right) ? FromVoidRight(left, right) :\n TypeGuard.IsUndefined(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Union\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUnionRight(left, right) {\n return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True)\n ? ExtendsResult.True\n : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromUnion(left, right) {\n return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True)\n ? ExtendsResult.True\n : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Unknown\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUnknownRight(left, right) {\n return ExtendsResult.True;\n}\n// prettier-ignore\nfunction FromUnknown(left, right) {\n return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :\n TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :\n TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :\n TypeGuard.IsAny(right) ? FromAnyRight(left, right) :\n TypeGuard.IsString(right) ? FromStringRight(left, right) :\n TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :\n TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :\n TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :\n TypeGuard.IsArray(right) ? FromArrayRight(left, right) :\n TypeGuard.IsTuple(right) ? FromTupleRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsUnknown(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// ------------------------------------------------------------------\n// Void\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromVoidRight(left, right) {\n return (TypeGuard.IsUndefined(left) ? ExtendsResult.True :\n TypeGuard.IsUndefined(left) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction FromVoid(left, right) {\n return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :\n TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :\n TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :\n TypeGuard.IsAny(right) ? FromAnyRight(left, right) :\n TypeGuard.IsObject(right) ? FromObjectRight(left, right) :\n TypeGuard.IsVoid(right) ? ExtendsResult.True :\n ExtendsResult.False);\n}\n// prettier-ignore\nfunction Visit(left, right) {\n return (\n // resolvable\n (TypeGuard.IsTemplateLiteral(left) || TypeGuard.IsTemplateLiteral(right)) ? FromTemplateLiteral(left, right) :\n (TypeGuard.IsRegExp(left) || TypeGuard.IsRegExp(right)) ? FromRegExp(left, right) :\n (TypeGuard.IsNot(left) || TypeGuard.IsNot(right)) ? FromNot(left, right) :\n // standard\n TypeGuard.IsAny(left) ? FromAny(left, right) :\n TypeGuard.IsArray(left) ? FromArray(left, right) :\n TypeGuard.IsBigInt(left) ? FromBigInt(left, right) :\n TypeGuard.IsBoolean(left) ? FromBoolean(left, right) :\n TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) :\n TypeGuard.IsConstructor(left) ? FromConstructor(left, right) :\n TypeGuard.IsDate(left) ? FromDate(left, right) :\n TypeGuard.IsFunction(left) ? FromFunction(left, right) :\n TypeGuard.IsInteger(left) ? FromInteger(left, right) :\n TypeGuard.IsIntersect(left) ? FromIntersect(left, right) :\n TypeGuard.IsIterator(left) ? FromIterator(left, right) :\n TypeGuard.IsLiteral(left) ? FromLiteral(left, right) :\n TypeGuard.IsNever(left) ? FromNever(left, right) :\n TypeGuard.IsNull(left) ? FromNull(left, right) :\n TypeGuard.IsNumber(left) ? FromNumber(left, right) :\n TypeGuard.IsObject(left) ? FromObject(left, right) :\n TypeGuard.IsRecord(left) ? FromRecord(left, right) :\n TypeGuard.IsString(left) ? FromString(left, right) :\n TypeGuard.IsSymbol(left) ? FromSymbol(left, right) :\n TypeGuard.IsTuple(left) ? FromTuple(left, right) :\n TypeGuard.IsPromise(left) ? FromPromise(left, right) :\n TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) :\n TypeGuard.IsUndefined(left) ? FromUndefined(left, right) :\n TypeGuard.IsUnion(left) ? FromUnion(left, right) :\n TypeGuard.IsUnknown(left) ? FromUnknown(left, right) :\n TypeGuard.IsVoid(left) ? FromVoid(left, right) :\n Throw(`Unknown left type operand '${left[Kind]}'`));\n}\nexport function ExtendsCheck(left, right) {\n return Visit(left, right);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Extends } from './extends.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromProperties(P, Right, True, False, options) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(P))\n Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(Left, Right, True, False, options) {\n return FromProperties(Left.properties, Right, True, False, options);\n}\n// prettier-ignore\nexport function ExtendsFromMappedResult(Left, Right, True, False, options) {\n const P = FromMappedResult(Left, Right, True, False, options);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Union } from '../union/index.mjs';\nimport { ExtendsCheck, ExtendsResult } from './extends-check.mjs';\nimport { ExtendsFromMappedKey } from './extends-from-mapped-key.mjs';\nimport { ExtendsFromMappedResult } from './extends-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedKey, IsMappedResult } from '../guard/kind.mjs';\n// prettier-ignore\nfunction ExtendsResolve(left, right, trueType, falseType) {\n const R = ExtendsCheck(left, right);\n return (R === ExtendsResult.Union ? Union([trueType, falseType]) :\n R === ExtendsResult.True ? trueType :\n falseType);\n}\n/** `[Json]` Creates a Conditional type */\nexport function Extends(L, R, T, F, options) {\n // prettier-ignore\n return (IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) :\n IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) :\n CreateType(ExtendsResolve(L, R, T, F), options));\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Extends } from './extends.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromPropertyKey(K, U, L, R, options) {\n return {\n [K]: Extends(Literal(K), U, L, R, Clone(options))\n };\n}\n// prettier-ignore\nfunction FromPropertyKeys(K, U, L, R, options) {\n return K.reduce((Acc, LK) => {\n return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };\n }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(K, U, L, R, options) {\n return FromPropertyKeys(K.keys, U, L, R, options);\n}\n// prettier-ignore\nexport function ExtendsFromMappedKey(T, U, L, R, options) {\n const P = FromMappedKey(T, U, L, R, options);\n return MappedResult(P);\n}\n","import { Kind } from '../symbols/index.mjs';\n/** Fast undefined check used for properties of type undefined */\nfunction Intersect(schema) {\n return schema.allOf.every((schema) => ExtendsUndefinedCheck(schema));\n}\nfunction Union(schema) {\n return schema.anyOf.some((schema) => ExtendsUndefinedCheck(schema));\n}\nfunction Not(schema) {\n return !ExtendsUndefinedCheck(schema.not);\n}\n/** Fast undefined check used for properties of type undefined */\n// prettier-ignore\nexport function ExtendsUndefinedCheck(schema) {\n return (schema[Kind] === 'Intersect' ? Intersect(schema) :\n schema[Kind] === 'Union' ? Union(schema) :\n schema[Kind] === 'Not' ? Not(schema) :\n schema[Kind] === 'Undefined' ? true :\n false);\n}\n","import { Exclude } from './exclude.mjs';\nimport { TemplateLiteralToUnion } from '../template-literal/index.mjs';\nexport function ExcludeFromTemplateLiteral(L, R) {\n return Exclude(TemplateLiteralToUnion(L), R);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { ExtendsCheck, ExtendsResult } from '../extends/index.mjs';\nimport { ExcludeFromMappedResult } from './exclude-from-mapped-result.mjs';\nimport { ExcludeFromTemplateLiteral } from './exclude-from-template-literal.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedResult, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs';\nfunction ExcludeRest(L, R) {\n const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);\n return excluded.length === 1 ? excluded[0] : Union(excluded);\n}\n/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */\nexport function Exclude(L, R, options = {}) {\n // overloads\n if (IsTemplateLiteral(L))\n return CreateType(ExcludeFromTemplateLiteral(L, R), options);\n if (IsMappedResult(L))\n return CreateType(ExcludeFromMappedResult(L, R), options);\n // prettier-ignore\n return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) :\n ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Exclude } from './exclude.mjs';\n// prettier-ignore\nfunction FromProperties(P, U) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(P))\n Acc[K2] = Exclude(P[K2], U);\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, T) {\n return FromProperties(R.properties, T);\n}\n// prettier-ignore\nexport function ExcludeFromMappedResult(R, T) {\n const P = FromMappedResult(R, T);\n return MappedResult(P);\n}\n","import { Extract } from './extract.mjs';\nimport { TemplateLiteralToUnion } from '../template-literal/index.mjs';\nexport function ExtractFromTemplateLiteral(L, R) {\n return Extract(TemplateLiteralToUnion(L), R);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { ExtendsCheck, ExtendsResult } from '../extends/index.mjs';\nimport { ExtractFromMappedResult } from './extract-from-mapped-result.mjs';\nimport { ExtractFromTemplateLiteral } from './extract-from-template-literal.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedResult, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs';\nfunction ExtractRest(L, R) {\n const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);\n return extracted.length === 1 ? extracted[0] : Union(extracted);\n}\n/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */\nexport function Extract(L, R, options) {\n // overloads\n if (IsTemplateLiteral(L))\n return CreateType(ExtractFromTemplateLiteral(L, R), options);\n if (IsMappedResult(L))\n return CreateType(ExtractFromMappedResult(L, R), options);\n // prettier-ignore\n return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) :\n ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Extract } from './extract.mjs';\n// prettier-ignore\nfunction FromProperties(P, T) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(P))\n Acc[K2] = Extract(P[K2], T);\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, T) {\n return FromProperties(R.properties, T);\n}\n// prettier-ignore\nexport function ExtractFromMappedResult(R, T) {\n const P = FromMappedResult(R, T);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Never } from '../never/index.mjs';\nimport * as KindGuard from '../guard/kind.mjs';\n/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */\nexport function InstanceType(schema, options) {\n return (KindGuard.IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options));\n}\n","import { Readonly } from '../readonly/index.mjs';\nimport { Optional } from '../optional/index.mjs';\n/** `[Json]` Creates a Readonly and Optional property */\nexport function ReadonlyOptional(schema) {\n return Readonly(Optional(schema));\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind, Hint } from '../symbols/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { Number } from '../number/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { String } from '../string/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { IsTemplateLiteralFinite } from '../template-literal/index.mjs';\nimport { PatternStringExact, PatternNumberExact, PatternNeverExact } from '../patterns/index.mjs';\nimport { IndexPropertyKeys } from '../indexed/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsUndefined } from '../guard/value.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsInteger, IsLiteral, IsAny, IsBoolean, IsNever, IsNumber, IsString, IsRegExp, IsTemplateLiteral, IsUnion } from '../guard/kind.mjs';\n// ------------------------------------------------------------------\n// RecordCreateFromPattern\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordCreateFromPattern(pattern, T, options) {\n return CreateType({ [Kind]: 'Record', type: 'object', patternProperties: { [pattern]: T } }, options);\n}\n// ------------------------------------------------------------------\n// RecordCreateFromKeys\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordCreateFromKeys(K, T, options) {\n const result = {};\n for (const K2 of K)\n result[K2] = T;\n return Object(result, { ...options, [Hint]: 'Record' });\n}\n// prettier-ignore\nfunction FromTemplateLiteralKey(K, T, options) {\n return (IsTemplateLiteralFinite(K)\n ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options)\n : RecordCreateFromPattern(K.pattern, T, options));\n}\n// prettier-ignore\nfunction FromUnionKey(key, type, options) {\n return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);\n}\n// prettier-ignore\nfunction FromLiteralKey(key, type, options) {\n return RecordCreateFromKeys([key.toString()], type, options);\n}\n// prettier-ignore\nfunction FromRegExpKey(key, type, options) {\n return RecordCreateFromPattern(key.source, type, options);\n}\n// prettier-ignore\nfunction FromStringKey(key, type, options) {\n const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;\n return RecordCreateFromPattern(pattern, type, options);\n}\n// prettier-ignore\nfunction FromAnyKey(_, type, options) {\n return RecordCreateFromPattern(PatternStringExact, type, options);\n}\n// prettier-ignore\nfunction FromNeverKey(_key, type, options) {\n return RecordCreateFromPattern(PatternNeverExact, type, options);\n}\n// prettier-ignore\nfunction FromBooleanKey(_key, type, options) {\n return Object({ true: type, false: type }, options);\n}\n// prettier-ignore\nfunction FromIntegerKey(_key, type, options) {\n return RecordCreateFromPattern(PatternNumberExact, type, options);\n}\n// prettier-ignore\nfunction FromNumberKey(_, type, options) {\n return RecordCreateFromPattern(PatternNumberExact, type, options);\n}\n// ------------------------------------------------------------------\n// TRecordOrObject\n// ------------------------------------------------------------------\n/** `[Json]` Creates a Record type */\nexport function Record(key, type, options = {}) {\n // prettier-ignore\n return (IsUnion(key) ? FromUnionKey(key.anyOf, type, options) :\n IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) :\n IsLiteral(key) ? FromLiteralKey(key.const, type, options) :\n IsBoolean(key) ? FromBooleanKey(key, type, options) :\n IsInteger(key) ? FromIntegerKey(key, type, options) :\n IsNumber(key) ? FromNumberKey(key, type, options) :\n IsRegExp(key) ? FromRegExpKey(key, type, options) :\n IsString(key) ? FromStringKey(key, type, options) :\n IsAny(key) ? FromAnyKey(key, type, options) :\n IsNever(key) ? FromNeverKey(key, type, options) :\n Never(options));\n}\n// ------------------------------------------------------------------\n// Record Utilities\n// ------------------------------------------------------------------\n/** Gets the Records Pattern */\nexport function RecordPattern(record) {\n return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];\n}\n/** Gets the Records Key Type */\n// prettier-ignore\nexport function RecordKey(type) {\n const pattern = RecordPattern(type);\n return (pattern === PatternStringExact ? String() :\n pattern === PatternNumberExact ? Number() :\n String({ pattern }));\n}\n/** Gets a Record Value Type */\n// prettier-ignore\nexport function RecordValue(type) {\n return type.patternProperties[RecordPattern(type)];\n}\n","import { CloneType } from '../clone/type.mjs';\nimport { Unknown } from '../unknown/index.mjs';\nimport { ReadonlyOptional } from '../readonly-optional/index.mjs';\nimport { Readonly } from '../readonly/index.mjs';\nimport { Optional } from '../optional/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Record, RecordKey, RecordValue } from '../record/index.mjs';\nimport * as ValueGuard from '../guard/value.mjs';\nimport * as KindGuard from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromConstructor(args, type) {\n type.parameters = FromTypes(args, type.parameters);\n type.returns = FromType(args, type.returns);\n return type;\n}\n// prettier-ignore\nfunction FromFunction(args, type) {\n type.parameters = FromTypes(args, type.parameters);\n type.returns = FromType(args, type.returns);\n return type;\n}\n// prettier-ignore\nfunction FromIntersect(args, type) {\n type.allOf = FromTypes(args, type.allOf);\n return type;\n}\n// prettier-ignore\nfunction FromUnion(args, type) {\n type.anyOf = FromTypes(args, type.anyOf);\n return type;\n}\n// prettier-ignore\nfunction FromTuple(args, type) {\n if (ValueGuard.IsUndefined(type.items))\n return type;\n type.items = FromTypes(args, type.items);\n return type;\n}\n// prettier-ignore\nfunction FromArray(args, type) {\n type.items = FromType(args, type.items);\n return type;\n}\n// prettier-ignore\nfunction FromAsyncIterator(args, type) {\n type.items = FromType(args, type.items);\n return type;\n}\n// prettier-ignore\nfunction FromIterator(args, type) {\n type.items = FromType(args, type.items);\n return type;\n}\n// prettier-ignore\nfunction FromPromise(args, type) {\n type.item = FromType(args, type.item);\n return type;\n}\n// prettier-ignore\nfunction FromObject(args, type) {\n const mappedProperties = FromProperties(args, type.properties);\n return { ...type, ...Object(mappedProperties) }; // retain options\n}\n// prettier-ignore\nfunction FromRecord(args, type) {\n const mappedKey = FromType(args, RecordKey(type));\n const mappedValue = FromType(args, RecordValue(type));\n const result = Record(mappedKey, mappedValue);\n return { ...type, ...result }; // retain options\n}\n// prettier-ignore\nfunction FromArgument(args, argument) {\n return argument.index in args ? args[argument.index] : Unknown();\n}\n// prettier-ignore\nfunction FromProperty(args, type) {\n const isReadonly = KindGuard.IsReadonly(type);\n const isOptional = KindGuard.IsOptional(type);\n const mapped = FromType(args, type);\n return (isReadonly && isOptional ? ReadonlyOptional(mapped) :\n isReadonly && !isOptional ? Readonly(mapped) :\n !isReadonly && isOptional ? Optional(mapped) :\n mapped);\n}\n// prettier-ignore\nfunction FromProperties(args, properties) {\n return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {\n return { ...result, [key]: FromProperty(args, properties[key]) };\n }, {});\n}\n// prettier-ignore\nexport function FromTypes(args, types) {\n return types.map(type => FromType(args, type));\n}\n// prettier-ignore\nfunction FromType(args, type) {\n return (KindGuard.IsConstructor(type) ? FromConstructor(args, type) :\n KindGuard.IsFunction(type) ? FromFunction(args, type) :\n KindGuard.IsIntersect(type) ? FromIntersect(args, type) :\n KindGuard.IsUnion(type) ? FromUnion(args, type) :\n KindGuard.IsTuple(type) ? FromTuple(args, type) :\n KindGuard.IsArray(type) ? FromArray(args, type) :\n KindGuard.IsAsyncIterator(type) ? FromAsyncIterator(args, type) :\n KindGuard.IsIterator(type) ? FromIterator(args, type) :\n KindGuard.IsPromise(type) ? FromPromise(args, type) :\n KindGuard.IsObject(type) ? FromObject(args, type) :\n KindGuard.IsRecord(type) ? FromRecord(args, type) :\n KindGuard.IsArgument(type) ? FromArgument(args, type) :\n type);\n}\n/** `[JavaScript]` Instantiates a type with the given parameters */\n// prettier-ignore\nexport function Instantiate(type, args) {\n return FromType(args, CloneType(type));\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates an Integer type */\nexport function Integer(options) {\n return CreateType({ [Kind]: 'Integer', type: 'integer' }, options);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Intrinsic } from './intrinsic.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction MappedIntrinsicPropertyKey(K, M, options) {\n return {\n [K]: Intrinsic(Literal(K), M, Clone(options))\n };\n}\n// prettier-ignore\nfunction MappedIntrinsicPropertyKeys(K, M, options) {\n const result = K.reduce((Acc, L) => {\n return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };\n }, {});\n return result;\n}\n// prettier-ignore\nfunction MappedIntrinsicProperties(T, M, options) {\n return MappedIntrinsicPropertyKeys(T['keys'], M, options);\n}\n// prettier-ignore\nexport function IntrinsicFromMappedKey(T, M, options) {\n const P = MappedIntrinsicProperties(T, M, options);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { TemplateLiteral, TemplateLiteralParseExact, IsTemplateLiteralExpressionFinite, TemplateLiteralExpressionGenerate } from '../template-literal/index.mjs';\nimport { IntrinsicFromMappedKey } from './intrinsic-from-mapped-key.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Union } from '../union/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedKey, IsTemplateLiteral, IsUnion, IsLiteral } from '../guard/kind.mjs';\n// ------------------------------------------------------------------\n// Apply\n// ------------------------------------------------------------------\nfunction ApplyUncapitalize(value) {\n const [first, rest] = [value.slice(0, 1), value.slice(1)];\n return [first.toLowerCase(), rest].join('');\n}\nfunction ApplyCapitalize(value) {\n const [first, rest] = [value.slice(0, 1), value.slice(1)];\n return [first.toUpperCase(), rest].join('');\n}\nfunction ApplyUppercase(value) {\n return value.toUpperCase();\n}\nfunction ApplyLowercase(value) {\n return value.toLowerCase();\n}\nfunction FromTemplateLiteral(schema, mode, options) {\n // note: template literals require special runtime handling as they are encoded in string patterns.\n // This diverges from the mapped type which would otherwise map on the template literal kind.\n const expression = TemplateLiteralParseExact(schema.pattern);\n const finite = IsTemplateLiteralExpressionFinite(expression);\n if (!finite)\n return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };\n const strings = [...TemplateLiteralExpressionGenerate(expression)];\n const literals = strings.map((value) => Literal(value));\n const mapped = FromRest(literals, mode);\n const union = Union(mapped);\n return TemplateLiteral([union], options);\n}\n// prettier-ignore\nfunction FromLiteralValue(value, mode) {\n return (typeof value === 'string' ? (mode === 'Uncapitalize' ? ApplyUncapitalize(value) :\n mode === 'Capitalize' ? ApplyCapitalize(value) :\n mode === 'Uppercase' ? ApplyUppercase(value) :\n mode === 'Lowercase' ? ApplyLowercase(value) :\n value) : value.toString());\n}\n// prettier-ignore\nfunction FromRest(T, M) {\n return T.map(L => Intrinsic(L, M));\n}\n/** Applies an intrinsic string manipulation to the given type. */\nexport function Intrinsic(schema, mode, options = {}) {\n // prettier-ignore\n return (\n // Intrinsic-Mapped-Inference\n IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) :\n // Standard-Inference\n IsTemplateLiteral(schema) ? FromTemplateLiteral(schema, mode, options) :\n IsUnion(schema) ? Union(FromRest(schema.anyOf, mode), options) :\n IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) :\n // Default Type\n CreateType(schema, options));\n}\n","import { Intrinsic } from './intrinsic.mjs';\n/** `[Json]` Intrinsic function to Capitalize LiteralString types */\nexport function Capitalize(T, options = {}) {\n return Intrinsic(T, 'Capitalize', options);\n}\n","import { Intrinsic } from './intrinsic.mjs';\n/** `[Json]` Intrinsic function to Lowercase LiteralString types */\nexport function Lowercase(T, options = {}) {\n return Intrinsic(T, 'Lowercase', options);\n}\n","import { Intrinsic } from './intrinsic.mjs';\n/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */\nexport function Uncapitalize(T, options = {}) {\n return Intrinsic(T, 'Uncapitalize', options);\n}\n","import { Intrinsic } from './intrinsic.mjs';\n/** `[Json]` Intrinsic function to Uppercase LiteralString types */\nexport function Uppercase(T, options = {}) {\n return Intrinsic(T, 'Uppercase', options);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Omit } from './omit.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys, options) {\n const result = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(properties))\n result[K2] = Omit(properties[K2], propertyKeys, Clone(options));\n return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, propertyKeys, options) {\n return FromProperties(mappedResult.properties, propertyKeys, options);\n}\n// prettier-ignore\nexport function OmitFromMappedResult(mappedResult, propertyKeys, options) {\n const properties = FromMappedResult(mappedResult, propertyKeys, options);\n return MappedResult(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Discard } from '../discard/discard.mjs';\nimport { TransformKind } from '../symbols/symbols.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { IndexPropertyKeys } from '../indexed/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Object } from '../object/index.mjs';\n// ------------------------------------------------------------------\n// Mapped\n// ------------------------------------------------------------------\nimport { OmitFromMappedKey } from './omit-from-mapped-key.mjs';\nimport { OmitFromMappedResult } from './omit-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsMappedKey, IsIntersect, IsUnion, IsObject, IsSchema, IsMappedResult, IsLiteralValue, IsRef } from '../guard/kind.mjs';\nimport { IsArray as IsArrayValue } from '../guard/value.mjs';\n// prettier-ignore\nfunction FromIntersect(types, propertyKeys) {\n return types.map((type) => OmitResolve(type, propertyKeys));\n}\n// prettier-ignore\nfunction FromUnion(types, propertyKeys) {\n return types.map((type) => OmitResolve(type, propertyKeys));\n}\n// ------------------------------------------------------------------\n// FromProperty\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromProperty(properties, key) {\n const { [key]: _, ...R } = properties;\n return R;\n}\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys) {\n return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties);\n}\n// prettier-ignore\nfunction FromObject(properties, propertyKeys) {\n const options = Discard(properties, [TransformKind, '$id', 'required', 'properties']);\n const omittedProperties = FromProperties(properties['properties'], propertyKeys);\n return Object(omittedProperties, options);\n}\n// prettier-ignore\nfunction UnionFromPropertyKeys(propertyKeys) {\n const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []);\n return Union(result);\n}\n// prettier-ignore\nfunction OmitResolve(properties, propertyKeys) {\n return (IsIntersect(properties) ? Intersect(FromIntersect(properties.allOf, propertyKeys)) :\n IsUnion(properties) ? Union(FromUnion(properties.anyOf, propertyKeys)) :\n IsObject(properties) ? FromObject(properties, propertyKeys) :\n Object({}));\n}\n/** `[Json]` Constructs a type whose keys are picked from the given type */\n// prettier-ignore\nexport function Omit(type, key, options) {\n const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key;\n const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;\n const isTypeRef = IsRef(type);\n const isKeyRef = IsRef(key);\n return (IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) :\n IsMappedKey(key) ? OmitFromMappedKey(type, key, options) :\n (isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) :\n (!isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) :\n (isTypeRef && !isKeyRef) ? Computed('Omit', [type, typeKey], options) :\n CreateType({ ...OmitResolve(type, propertyKeys), ...options }));\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Omit } from './omit.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromPropertyKey(type, key, options) {\n return { [key]: Omit(type, [key], Clone(options)) };\n}\n// prettier-ignore\nfunction FromPropertyKeys(type, propertyKeys, options) {\n return propertyKeys.reduce((Acc, LK) => {\n return { ...Acc, ...FromPropertyKey(type, LK, options) };\n }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(type, mappedKey, options) {\n return FromPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nexport function OmitFromMappedKey(type, mappedKey, options) {\n const properties = FromMappedKey(type, mappedKey, options);\n return MappedResult(properties);\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Pick } from './pick.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys, options) {\n const result = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(properties))\n result[K2] = Pick(properties[K2], propertyKeys, Clone(options));\n return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, propertyKeys, options) {\n return FromProperties(mappedResult.properties, propertyKeys, options);\n}\n// prettier-ignore\nexport function PickFromMappedResult(mappedResult, propertyKeys, options) {\n const properties = FromMappedResult(mappedResult, propertyKeys, options);\n return MappedResult(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Discard } from '../discard/discard.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Literal } from '../literal/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { IndexPropertyKeys } from '../indexed/index.mjs';\nimport { TransformKind } from '../symbols/symbols.mjs';\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nimport { IsMappedKey, IsMappedResult, IsIntersect, IsUnion, IsObject, IsSchema, IsLiteralValue, IsRef } from '../guard/kind.mjs';\nimport { IsArray as IsArrayValue } from '../guard/value.mjs';\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\nimport { PickFromMappedKey } from './pick-from-mapped-key.mjs';\nimport { PickFromMappedResult } from './pick-from-mapped-result.mjs';\nfunction FromIntersect(types, propertyKeys) {\n return types.map((type) => PickResolve(type, propertyKeys));\n}\n// prettier-ignore\nfunction FromUnion(types, propertyKeys) {\n return types.map((type) => PickResolve(type, propertyKeys));\n}\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys) {\n const result = {};\n for (const K2 of propertyKeys)\n if (K2 in properties)\n result[K2] = properties[K2];\n return result;\n}\n// prettier-ignore\nfunction FromObject(T, K) {\n const options = Discard(T, [TransformKind, '$id', 'required', 'properties']);\n const properties = FromProperties(T['properties'], K);\n return Object(properties, options);\n}\n// prettier-ignore\nfunction UnionFromPropertyKeys(propertyKeys) {\n const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []);\n return Union(result);\n}\n// prettier-ignore\nfunction PickResolve(properties, propertyKeys) {\n return (IsIntersect(properties) ? Intersect(FromIntersect(properties.allOf, propertyKeys)) :\n IsUnion(properties) ? Union(FromUnion(properties.anyOf, propertyKeys)) :\n IsObject(properties) ? FromObject(properties, propertyKeys) :\n Object({}));\n}\n/** `[Json]` Constructs a type whose keys are picked from the given type */\n// prettier-ignore\nexport function Pick(type, key, options) {\n const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key;\n const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;\n const isTypeRef = IsRef(type);\n const isKeyRef = IsRef(key);\n return (IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) :\n IsMappedKey(key) ? PickFromMappedKey(type, key, options) :\n (isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) :\n (!isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) :\n (isTypeRef && !isKeyRef) ? Computed('Pick', [type, typeKey], options) :\n CreateType({ ...PickResolve(type, propertyKeys), ...options }));\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Pick } from './pick.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromPropertyKey(type, key, options) {\n return {\n [key]: Pick(type, [key], Clone(options))\n };\n}\n// prettier-ignore\nfunction FromPropertyKeys(type, propertyKeys, options) {\n return propertyKeys.reduce((result, leftKey) => {\n return { ...result, ...FromPropertyKey(type, leftKey, options) };\n }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(type, mappedKey, options) {\n return FromPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nexport function PickFromMappedKey(type, mappedKey, options) {\n const properties = FromMappedKey(type, mappedKey, options);\n return MappedResult(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Optional } from '../optional/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Ref } from '../ref/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { TransformKind } from '../symbols/index.mjs';\nimport { PartialFromMappedResult } from './partial-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nimport * as KindGuard from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n return Computed('Partial', [Computed(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n return Computed('Partial', [Ref($ref)]);\n}\n// prettier-ignore\nfunction FromProperties(properties) {\n const partialProperties = {};\n for (const K of globalThis.Object.getOwnPropertyNames(properties))\n partialProperties[K] = Optional(properties[K]);\n return partialProperties;\n}\n// prettier-ignore\nfunction FromObject(type) {\n const options = Discard(type, [TransformKind, '$id', 'required', 'properties']);\n const properties = FromProperties(type['properties']);\n return Object(properties, options);\n}\n// prettier-ignore\nfunction FromRest(types) {\n return types.map(type => PartialResolve(type));\n}\n// ------------------------------------------------------------------\n// PartialResolve\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction PartialResolve(type) {\n return (\n // Mappable\n KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) :\n KindGuard.IsRef(type) ? FromRef(type.$ref) :\n KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) :\n KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) :\n KindGuard.IsObject(type) ? FromObject(type) :\n // Intrinsic\n KindGuard.IsBigInt(type) ? type :\n KindGuard.IsBoolean(type) ? type :\n KindGuard.IsInteger(type) ? type :\n KindGuard.IsLiteral(type) ? type :\n KindGuard.IsNull(type) ? type :\n KindGuard.IsNumber(type) ? type :\n KindGuard.IsString(type) ? type :\n KindGuard.IsSymbol(type) ? type :\n KindGuard.IsUndefined(type) ? type :\n // Passthrough\n Object({}));\n}\n/** `[Json]` Constructs a type where all properties are optional */\nexport function Partial(type, options) {\n if (KindGuard.IsMappedResult(type)) {\n return PartialFromMappedResult(type, options);\n }\n else {\n // special: mapping types require overridable options\n return CreateType({ ...PartialResolve(type), ...options });\n }\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Partial } from './partial.mjs';\nimport { Clone } from '../clone/value.mjs';\n// prettier-ignore\nfunction FromProperties(K, options) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(K))\n Acc[K2] = Partial(K[K2], Clone(options));\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, options) {\n return FromProperties(R.properties, options);\n}\n// prettier-ignore\nexport function PartialFromMappedResult(R, options) {\n const P = FromMappedResult(R, options);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Computed } from '../computed/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Union } from '../union/index.mjs';\nimport { Ref } from '../ref/index.mjs';\nimport { OptionalKind, TransformKind } from '../symbols/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { RequiredFromMappedResult } from './required-from-mapped-result.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport * as KindGuard from '../guard/kind.mjs';\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n return Computed('Required', [Computed(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n return Computed('Required', [Ref($ref)]);\n}\n// prettier-ignore\nfunction FromProperties(properties) {\n const requiredProperties = {};\n for (const K of globalThis.Object.getOwnPropertyNames(properties))\n requiredProperties[K] = Discard(properties[K], [OptionalKind]);\n return requiredProperties;\n}\n// prettier-ignore\nfunction FromObject(type) {\n const options = Discard(type, [TransformKind, '$id', 'required', 'properties']);\n const properties = FromProperties(type['properties']);\n return Object(properties, options);\n}\n// prettier-ignore\nfunction FromRest(types) {\n return types.map(type => RequiredResolve(type));\n}\n// ------------------------------------------------------------------\n// RequiredResolve\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RequiredResolve(type) {\n return (\n // Mappable\n KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) :\n KindGuard.IsRef(type) ? FromRef(type.$ref) :\n KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) :\n KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) :\n KindGuard.IsObject(type) ? FromObject(type) :\n // Intrinsic\n KindGuard.IsBigInt(type) ? type :\n KindGuard.IsBoolean(type) ? type :\n KindGuard.IsInteger(type) ? type :\n KindGuard.IsLiteral(type) ? type :\n KindGuard.IsNull(type) ? type :\n KindGuard.IsNumber(type) ? type :\n KindGuard.IsString(type) ? type :\n KindGuard.IsSymbol(type) ? type :\n KindGuard.IsUndefined(type) ? type :\n // Passthrough\n Object({}));\n}\n/** `[Json]` Constructs a type where all properties are required */\nexport function Required(type, options) {\n if (KindGuard.IsMappedResult(type)) {\n return RequiredFromMappedResult(type, options);\n }\n else {\n // special: mapping types require overridable options\n return CreateType({ ...RequiredResolve(type), ...options });\n }\n}\n","import { MappedResult } from '../mapped/index.mjs';\nimport { Required } from './required.mjs';\n// prettier-ignore\nfunction FromProperties(P, options) {\n const Acc = {};\n for (const K2 of globalThis.Object.getOwnPropertyNames(P))\n Acc[K2] = Required(P[K2], options);\n return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, options) {\n return FromProperties(R.properties, options);\n}\n// prettier-ignore\nexport function RequiredFromMappedResult(R, options) {\n const P = FromMappedResult(R, options);\n return MappedResult(P);\n}\n","import { CreateType } from '../create/index.mjs';\nimport { CloneType } from '../clone/index.mjs';\nimport { Discard } from '../discard/index.mjs';\nimport { Array } from '../array/index.mjs';\nimport { Awaited } from '../awaited/index.mjs';\nimport { AsyncIterator } from '../async-iterator/index.mjs';\nimport { Constructor } from '../constructor/index.mjs';\nimport { Index } from '../indexed/index.mjs';\nimport { Function as FunctionType } from '../function/index.mjs';\nimport { Intersect } from '../intersect/index.mjs';\nimport { Iterator } from '../iterator/index.mjs';\nimport { KeyOf } from '../keyof/index.mjs';\nimport { Object } from '../object/index.mjs';\nimport { Omit } from '../omit/index.mjs';\nimport { Pick } from '../pick/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport { Partial } from '../partial/index.mjs';\nimport { RecordValue, RecordPattern } from '../record/index.mjs';\nimport { Required } from '../required/index.mjs';\nimport { Tuple } from '../tuple/index.mjs';\nimport { Union } from '../union/index.mjs';\n// ------------------------------------------------------------------\n// Symbols\n// ------------------------------------------------------------------\nimport { TransformKind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs';\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nimport * as KindGuard from '../guard/kind.mjs';\n// prettier-ignore\nfunction DereferenceParameters(moduleProperties, types) {\n return types.map((type) => {\n return KindGuard.IsRef(type)\n ? Dereference(moduleProperties, type.$ref)\n : FromType(moduleProperties, type);\n });\n}\n// prettier-ignore\nfunction Dereference(moduleProperties, ref) {\n return (ref in moduleProperties\n ? KindGuard.IsRef(moduleProperties[ref])\n ? Dereference(moduleProperties, moduleProperties[ref].$ref)\n : FromType(moduleProperties, moduleProperties[ref])\n : Never());\n}\n// prettier-ignore\nfunction FromAwaited(parameters) {\n return Awaited(parameters[0]);\n}\n// prettier-ignore\nfunction FromIndex(parameters) {\n return Index(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromKeyOf(parameters) {\n return KeyOf(parameters[0]);\n}\n// prettier-ignore\nfunction FromPartial(parameters) {\n return Partial(parameters[0]);\n}\n// prettier-ignore\nfunction FromOmit(parameters) {\n return Omit(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromPick(parameters) {\n return Pick(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromRequired(parameters) {\n return Required(parameters[0]);\n}\n// prettier-ignore\nfunction FromComputed(moduleProperties, target, parameters) {\n const dereferenced = DereferenceParameters(moduleProperties, parameters);\n return (target === 'Awaited' ? FromAwaited(dereferenced) :\n target === 'Index' ? FromIndex(dereferenced) :\n target === 'KeyOf' ? FromKeyOf(dereferenced) :\n target === 'Partial' ? FromPartial(dereferenced) :\n target === 'Omit' ? FromOmit(dereferenced) :\n target === 'Pick' ? FromPick(dereferenced) :\n target === 'Required' ? FromRequired(dereferenced) :\n Never());\n}\nfunction FromArray(moduleProperties, type) {\n return Array(FromType(moduleProperties, type));\n}\nfunction FromAsyncIterator(moduleProperties, type) {\n return AsyncIterator(FromType(moduleProperties, type));\n}\n// prettier-ignore\nfunction FromConstructor(moduleProperties, parameters, instanceType) {\n return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));\n}\n// prettier-ignore\nfunction FromFunction(moduleProperties, parameters, returnType) {\n return FunctionType(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));\n}\nfunction FromIntersect(moduleProperties, types) {\n return Intersect(FromTypes(moduleProperties, types));\n}\nfunction FromIterator(moduleProperties, type) {\n return Iterator(FromType(moduleProperties, type));\n}\nfunction FromObject(moduleProperties, properties) {\n return Object(globalThis.Object.keys(properties).reduce((result, key) => {\n return { ...result, [key]: FromType(moduleProperties, properties[key]) };\n }, {}));\n}\n// prettier-ignore\nfunction FromRecord(moduleProperties, type) {\n const [value, pattern] = [FromType(moduleProperties, RecordValue(type)), RecordPattern(type)];\n const result = CloneType(type);\n result.patternProperties[pattern] = value;\n return result;\n}\n// prettier-ignore\nfunction FromTransform(moduleProperties, transform) {\n return (KindGuard.IsRef(transform))\n ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] }\n : transform;\n}\nfunction FromTuple(moduleProperties, types) {\n return Tuple(FromTypes(moduleProperties, types));\n}\nfunction FromUnion(moduleProperties, types) {\n return Union(FromTypes(moduleProperties, types));\n}\nfunction FromTypes(moduleProperties, types) {\n return types.map((type) => FromType(moduleProperties, type));\n}\n// prettier-ignore\nexport function FromType(moduleProperties, type) {\n return (\n // Modifiers\n KindGuard.IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) :\n KindGuard.IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) :\n // Transform\n KindGuard.IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) :\n // Types\n KindGuard.IsArray(type) ? CreateType(FromArray(moduleProperties, type.items), type) :\n KindGuard.IsAsyncIterator(type) ? CreateType(FromAsyncIterator(moduleProperties, type.items), type) :\n KindGuard.IsComputed(type) ? CreateType(FromComputed(moduleProperties, type.target, type.parameters)) :\n KindGuard.IsConstructor(type) ? CreateType(FromConstructor(moduleProperties, type.parameters, type.returns), type) :\n KindGuard.IsFunction(type) ? CreateType(FromFunction(moduleProperties, type.parameters, type.returns), type) :\n KindGuard.IsIntersect(type) ? CreateType(FromIntersect(moduleProperties, type.allOf), type) :\n KindGuard.IsIterator(type) ? CreateType(FromIterator(moduleProperties, type.items), type) :\n KindGuard.IsObject(type) ? CreateType(FromObject(moduleProperties, type.properties), type) :\n KindGuard.IsRecord(type) ? CreateType(FromRecord(moduleProperties, type)) :\n KindGuard.IsTuple(type) ? CreateType(FromTuple(moduleProperties, type.items || []), type) :\n KindGuard.IsUnion(type) ? CreateType(FromUnion(moduleProperties, type.anyOf), type) :\n type);\n}\n// prettier-ignore\nexport function ComputeType(moduleProperties, key) {\n return (key in moduleProperties\n ? FromType(moduleProperties, moduleProperties[key])\n : Never());\n}\n// prettier-ignore\nexport function ComputeModuleProperties(moduleProperties) {\n return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {\n return { ...result, [key]: ComputeType(moduleProperties, key) };\n }, {});\n}\n","import { CreateType } from '../create/index.mjs';\nimport { Kind } from '../symbols/index.mjs';\n// ------------------------------------------------------------------\n// Module Infrastructure Types\n// ------------------------------------------------------------------\nimport { ComputeModuleProperties } from './compute.mjs';\n// ------------------------------------------------------------------\n// Module\n// ------------------------------------------------------------------\n// prettier-ignore\nexport class TModule {\n constructor($defs) {\n const computed = ComputeModuleProperties($defs);\n const identified = this.WithIdentifiers(computed);\n this.$defs = identified;\n }\n /** `[Json]` Imports a Type by Key. */\n Import(key, options) {\n const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };\n return CreateType({ [Kind]: 'Import', $defs, $ref: key });\n }\n // prettier-ignore\n WithIdentifiers($defs) {\n return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {\n return { ...result, [key]: { ...$defs[key], $id: key } };\n }, {});\n }\n}\n/** `[Json]` Creates a Type Definition Module. */\nexport function Module(properties) {\n return new TModule(properties);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Not type */\nexport function Not(type, options) {\n return CreateType({ [Kind]: 'Not', not: type }, options);\n}\n","import { Tuple } from '../tuple/index.mjs';\nimport { Never } from '../never/index.mjs';\nimport * as KindGuard from '../guard/kind.mjs';\n/** `[JavaScript]` Extracts the Parameters from the given Function type */\nexport function Parameters(schema, options) {\n return (KindGuard.IsFunction(schema) ? Tuple(schema.parameters, options) : Never());\n}\n","import { CloneType } from '../clone/type.mjs';\nimport { CreateType } from '../create/type.mjs';\nimport { IsUndefined } from '../guard/value.mjs';\nimport { Kind, Hint } from '../symbols/index.mjs';\n// Auto Tracked For Recursive Types without ID's\nlet Ordinal = 0;\n/** `[Json]` Creates a Recursive type */\nexport function Recursive(callback, options = {}) {\n if (IsUndefined(options.$id))\n options.$id = `T${Ordinal++}`;\n const thisType = CloneType(callback({ [Kind]: 'This', $ref: `${options.$id}` }));\n thisType.$id = options.$id;\n // prettier-ignore\n return CreateType({ [Hint]: 'Recursive', ...thisType }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { IsString } from '../guard/value.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a RegExp type */\nexport function RegExp(unresolved, options) {\n const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;\n return CreateType({ [Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags }, options);\n}\n","// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsIntersect, IsUnion, IsTuple } from '../guard/kind.mjs';\n// prettier-ignore\nfunction RestResolve(T) {\n return (IsIntersect(T) ? T.allOf :\n IsUnion(T) ? T.anyOf :\n IsTuple(T) ? T.items ?? [] :\n []);\n}\n/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */\nexport function Rest(T) {\n return RestResolve(T);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Never } from '../never/index.mjs';\nimport * as KindGuard from '../guard/kind.mjs';\n/** `[JavaScript]` Extracts the ReturnType from the given Function type */\nexport function ReturnType(schema, options) {\n return (KindGuard.IsFunction(schema) ? CreateType(schema.returns, options) : Never(options));\n}\n","import { TransformKind } from '../symbols/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsTransform } from '../guard/kind.mjs';\n// ------------------------------------------------------------------\n// TransformBuilders\n// ------------------------------------------------------------------\nexport class TransformDecodeBuilder {\n constructor(schema) {\n this.schema = schema;\n }\n Decode(decode) {\n return new TransformEncodeBuilder(this.schema, decode);\n }\n}\n// prettier-ignore\nexport class TransformEncodeBuilder {\n constructor(schema, decode) {\n this.schema = schema;\n this.decode = decode;\n }\n EncodeTransform(encode, schema) {\n const Encode = (value) => schema[TransformKind].Encode(encode(value));\n const Decode = (value) => this.decode(schema[TransformKind].Decode(value));\n const Codec = { Encode: Encode, Decode: Decode };\n return { ...schema, [TransformKind]: Codec };\n }\n EncodeSchema(encode, schema) {\n const Codec = { Decode: this.decode, Encode: encode };\n return { ...schema, [TransformKind]: Codec };\n }\n Encode(encode) {\n return (IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema));\n }\n}\n/** `[Json]` Creates a Transform type */\nexport function Transform(schema) {\n return new TransformDecodeBuilder(schema);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */\nexport function Unsafe(options = {}) {\n return CreateType({ [Kind]: options[Kind] ?? 'Unsafe' }, options);\n}\n","import { CreateType } from '../create/type.mjs';\nimport { Kind } from '../symbols/index.mjs';\n/** `[JavaScript]` Creates a Void type */\nexport function Void(options) {\n return CreateType({ [Kind]: 'Void', type: 'void' }, options);\n}\n","// ------------------------------------------------------------------\n// JsonTypeBuilder\n// ------------------------------------------------------------------\nexport { JsonTypeBuilder } from './json.mjs';\n// ------------------------------------------------------------------\n// JavaScriptTypeBuilder\n// ------------------------------------------------------------------\nimport * as TypeBuilder from './type.mjs';\nimport { JavaScriptTypeBuilder } from './javascript.mjs';\n/** JavaScript Type Builder with Static Resolution for TypeScript */\nconst Type = TypeBuilder;\nexport { JavaScriptTypeBuilder };\nexport { Type };\n","// src/schemas/font-catalog.ts\nimport { Type } from \"@sinclair/typebox\";\nvar SAFE_FONTS = [\n \"Arial\",\n \"Calibri\",\n \"Cambria\",\n \"Consolas\",\n \"Courier New\",\n \"Georgia\",\n \"Segoe UI\",\n \"Tahoma\",\n \"Times New Roman\",\n \"Trebuchet MS\",\n \"Verdana\",\n \"Helvetica\",\n \"Helvetica Neue\",\n \"Menlo\",\n \"Monaco\"\n];\nfunction isSafeFont(name) {\n const lower = name.toLowerCase();\n return SAFE_FONTS.some((f) => f.toLowerCase() === lower);\n}\nvar FontFamilyNameSchema = Type.String({\n 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.\",\n examples: [\"Arial\", \"Calibri\", \"Georgia\", \"Inter\", \"Roboto\"]\n});\nvar FontWeightSchema = Type.Number({\n minimum: 100,\n maximum: 900,\n description: \"OpenType weight (100 thin ... 900 black). Default 400.\"\n});\nvar FontItalicSchema = Type.Boolean({\n description: \"Whether this source is italic. Default false.\"\n});\nvar SafeFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"safe\"),\n family: Type.String({\n description: \"A SAFE_FONTS name \\u2014 installed with Office.\"\n })\n },\n {\n additionalProperties: false,\n description: \"Office-installed font \\u2014 no embedding\"\n }\n);\nvar GoogleFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"google\"),\n family: Type.String({\n description: 'Exact Google Fonts family name (e.g. \"Inter\").'\n }),\n weights: Type.Optional(\n Type.Array(FontWeightSchema, {\n description: \"Weights to fetch. Default [400, 700].\"\n })\n ),\n italics: Type.Optional(\n Type.Boolean({ description: \"Include italic variants. Default false.\" })\n )\n },\n {\n additionalProperties: false,\n description: \"Google Fonts \\u2014 auto-fetched and embedded\"\n }\n);\nvar FileFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"file\"),\n path: Type.String({\n description: \"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file.\"\n }),\n weight: Type.Optional(FontWeightSchema),\n italic: Type.Optional(FontItalicSchema)\n },\n { additionalProperties: false, description: \"Local font file to embed\" }\n);\nvar UrlFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"url\"),\n url: Type.String({\n description: \"HTTPS URL of a TTF or OTF file.\"\n }),\n weight: Type.Optional(FontWeightSchema),\n italic: Type.Optional(FontItalicSchema)\n },\n {\n additionalProperties: false,\n description: \"Direct TTF/OTF URL (non-Google CDN)\"\n }\n);\nvar VariableFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"variable\"),\n url: Type.String({\n description: \"HTTPS URL of a variable TTF (`fvar` axis table required).\"\n }),\n weight: FontWeightSchema,\n italic: Type.Optional(FontItalicSchema),\n axes: Type.Optional(\n Type.Record(Type.String(), Type.Number(), {\n 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.\"\n })\n )\n },\n {\n additionalProperties: false,\n 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.\"\n }\n);\nvar DataFontSourceSchema = Type.Object(\n {\n kind: Type.Literal(\"data\"),\n data: Type.String({\n description: \"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size.\"\n }),\n weight: Type.Optional(FontWeightSchema),\n italic: Type.Optional(FontItalicSchema)\n },\n { additionalProperties: false, description: \"Inline base64 font \\u2014 portable\" }\n);\nvar FontSourceSchema = Type.Union(\n [\n SafeFontSourceSchema,\n GoogleFontSourceSchema,\n FileFontSourceSchema,\n DataFontSourceSchema,\n UrlFontSourceSchema,\n VariableFontSourceSchema\n ],\n {\n 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.'\n }\n);\nvar FontCategorySchema = Type.Union(\n [\n Type.Literal(\"sans\"),\n Type.Literal(\"serif\"),\n Type.Literal(\"mono\"),\n Type.Literal(\"display\"),\n Type.Literal(\"handwriting\")\n ],\n { description: \"Broad category used for fallback selection\" }\n);\nvar FontRegistryEntrySchema = Type.Object(\n {\n id: Type.String({\n description: 'Registry key. By convention, match the display family name (\"Inter\", \"Roboto Slab\").'\n }),\n family: Type.String({\n description: \"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id.\"\n }),\n category: Type.Optional(FontCategorySchema),\n sources: Type.Array(FontSourceSchema, {\n minItems: 1,\n description: \"One or more weight/style variants. List at least a regular (weight 400, italic false).\"\n })\n },\n {\n additionalProperties: false,\n description: \"A font registered for this document. Referenced by family from font.family, fontFace, and theme.fonts.*.\"\n }\n);\nvar FontRegistrySchema = Type.Array(FontRegistryEntrySchema, {\n description: \"Document-scoped font registry. Every non-safe font used in this document must be registered here.\"\n});\n\n// src/theme/design-system.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nvar TYPE_ROLES = [\n \"eyebrow\",\n \"display\",\n \"stat\",\n \"quote\",\n \"label\",\n \"footer\",\n \"tableHeader\",\n \"tableCell\",\n \"chartLabel\",\n \"tracker\",\n \"source\"\n];\nvar TypeRoleNameSchema = Type2.Union(\n TYPE_ROLES.map((name) => Type2.Literal(name))\n);\nvar CANVASES = [\"a4\", \"letter\", \"wide169\", \"standard43\"];\nvar TextCaseSchema = Type2.Union([\n Type2.Literal(\"none\"),\n Type2.Literal(\"upper\"),\n Type2.Literal(\"smallCaps\")\n]);\nvar ColorTokenSchema = Type2.String({\n pattern: \"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$\",\n description: \"Six-digit hex or a theme color/palette token. References must resolve without cycles.\"\n});\nvar PaletteSchema = Type2.Object(\n {\n rule: Type2.Optional(ColorTokenSchema),\n textMuted: Type2.Optional(ColorTokenSchema),\n onPrimary: Type2.Optional(ColorTokenSchema),\n surfaceInverse: Type2.Optional(ColorTokenSchema),\n positive: Type2.Optional(ColorTokenSchema),\n negative: Type2.Optional(ColorTokenSchema),\n chart: Type2.Optional(\n Type2.Array(ColorTokenSchema, { minItems: 1, maxItems: 12 })\n )\n },\n { additionalProperties: false }\n);\nvar TypeRoleSchema = Type2.Object(\n {\n face: Type2.Optional(\n Type2.Union([\n Type2.Literal(\"heading\"),\n Type2.Literal(\"body\"),\n Type2.Literal(\"mono\"),\n Type2.Literal(\"light\")\n ])\n ),\n weight: Type2.Optional(Type2.Integer({ minimum: 100, maximum: 900 })),\n size: Type2.Optional(\n Type2.Number({\n minimum: 5,\n maximum: 200,\n description: \"Explicit size in points; takes precedence over the canvas scale.\"\n })\n ),\n lineHeight: Type2.Optional(Type2.Number({ minimum: 0.5, maximum: 3 })),\n tracking: Type2.Optional(\n Type2.Number({ description: \"Tracking in hundredths of an em.\" })\n ),\n case: Type2.Optional(TextCaseSchema),\n color: Type2.Optional(ColorTokenSchema),\n spaceBefore: Type2.Optional(Type2.Number({ minimum: 0 })),\n spaceAfter: Type2.Optional(Type2.Number({ minimum: 0 }))\n },\n { additionalProperties: false }\n);\nvar TypeRolesSchema = Type2.Object(\n {\n eyebrow: Type2.Optional(TypeRoleSchema),\n display: Type2.Optional(TypeRoleSchema),\n stat: Type2.Optional(TypeRoleSchema),\n quote: Type2.Optional(TypeRoleSchema),\n label: Type2.Optional(TypeRoleSchema),\n footer: Type2.Optional(TypeRoleSchema),\n tableHeader: Type2.Optional(TypeRoleSchema),\n tableCell: Type2.Optional(TypeRoleSchema),\n chartLabel: Type2.Optional(TypeRoleSchema),\n tracker: Type2.Optional(TypeRoleSchema),\n source: Type2.Optional(TypeRoleSchema)\n },\n { additionalProperties: false }\n);\nvar ScaleSchema = Type2.Object(\n {\n base: Type2.Number({ minimum: 5, maximum: 200 }),\n ratio: Type2.Optional(Type2.Number({ minimum: 1, maximum: 2 })),\n baselinePt: Type2.Optional(\n Type2.Number({ exclusiveMinimum: 0, maximum: 24 })\n )\n },\n { additionalProperties: false }\n);\nvar TypographySchema = Type2.Object(\n {\n roles: Type2.Optional(TypeRolesSchema),\n scale: Type2.Optional(\n Type2.Object(\n {\n a4: Type2.Optional(ScaleSchema),\n letter: Type2.Optional(ScaleSchema),\n wide169: Type2.Optional(ScaleSchema),\n standard43: Type2.Optional(ScaleSchema)\n },\n { additionalProperties: false }\n )\n )\n },\n { additionalProperties: false }\n);\nvar CanvasSpacingSchema = Type2.Object(\n {\n safeAreaIn: Type2.Optional(Type2.Number({ minimum: 0 })),\n gutterIn: Type2.Optional(Type2.Number({ minimum: 0 })),\n columns: Type2.Optional(Type2.Integer({ minimum: 1, maximum: 100 })),\n rows: Type2.Optional(Type2.Integer({ minimum: 1, maximum: 100 }))\n },\n { additionalProperties: false }\n);\nvar DesignSpacingSchema = Type2.Object(\n {\n basePt: Type2.Optional(Type2.Number({ exclusiveMinimum: 0 })),\n blockGap: Type2.Optional(\n Type2.Object(\n {\n tight: Type2.Optional(Type2.Number({ minimum: 0 })),\n normal: Type2.Optional(Type2.Number({ minimum: 0 })),\n loose: Type2.Optional(Type2.Number({ minimum: 0 }))\n },\n { additionalProperties: false }\n )\n ),\n canvas: Type2.Optional(\n Type2.Object(\n {\n a4: Type2.Optional(CanvasSpacingSchema),\n letter: Type2.Optional(CanvasSpacingSchema),\n wide169: Type2.Optional(CanvasSpacingSchema),\n standard43: Type2.Optional(CanvasSpacingSchema)\n },\n { additionalProperties: false }\n )\n )\n },\n { additionalProperties: false }\n);\nvar RecipeSchema = Type2.Object(\n {\n type: Type2.Optional(TypeRoleNameSchema),\n color: Type2.Optional(ColorTokenSchema),\n fill: Type2.Optional(ColorTokenSchema),\n rule: Type2.Optional(\n Type2.Object(\n {\n weightPt: Type2.Optional(Type2.Number({ minimum: 0 })),\n color: Type2.Optional(ColorTokenSchema)\n },\n { additionalProperties: false }\n )\n ),\n padPt: Type2.Optional(Type2.Number({ minimum: 0 })),\n alignment: Type2.Optional(\n Type2.Union([\n Type2.Literal(\"left\"),\n Type2.Literal(\"center\"),\n Type2.Literal(\"right\")\n ])\n )\n },\n { additionalProperties: false }\n);\nvar ChromeSchema = Type2.Object(\n {\n runningHead: Type2.Optional(RecipeSchema),\n tracker: Type2.Optional(RecipeSchema),\n actionTitle: Type2.Optional(RecipeSchema),\n keyTakeaways: Type2.Optional(RecipeSchema),\n sourceLine: Type2.Optional(RecipeSchema),\n confidentialFooter: Type2.Optional(RecipeSchema),\n logoSlot: Type2.Optional(RecipeSchema),\n cover: Type2.Optional(RecipeSchema)\n },\n {\n additionalProperties: false,\n description: \"Visual recipes; consumers land in #361. No automatic content or presence requirements.\"\n }\n);\nvar MotifSchema = Type2.Object(\n {\n kind: Type2.Union([\n Type2.Literal(\"none\"),\n Type2.Literal(\"rule\"),\n Type2.Literal(\"corner\"),\n Type2.Literal(\"band\")\n ]),\n color: Type2.Optional(ColorTokenSchema),\n weightPt: Type2.Optional(Type2.Number({ minimum: 0 })),\n placement: Type2.Optional(\n Type2.Union([\n Type2.Literal(\"top\"),\n Type2.Literal(\"bottom\"),\n Type2.Literal(\"left\"),\n Type2.Literal(\"right\"),\n Type2.Literal(\"topLeft\"),\n Type2.Literal(\"topRight\"),\n Type2.Literal(\"bottomLeft\"),\n Type2.Literal(\"bottomRight\")\n ])\n )\n },\n {\n additionalProperties: false,\n description: \"At most one motif. Rendering consumers land in #361.\"\n }\n);\nvar DesignSystemProperties = {\n palette: Type2.Optional(PaletteSchema),\n typography: Type2.Optional(TypographySchema),\n spacing: Type2.Optional(DesignSpacingSchema),\n chrome: Type2.Optional(ChromeSchema),\n motif: Type2.Optional(MotifSchema)\n};\nvar DesignSystemSchema = Type2.Object(DesignSystemProperties, {\n additionalProperties: false\n});\nfunction designCanvas(format, size) {\n if (format === \"docx\") return size === \"LETTER\" ? \"letter\" : \"a4\";\n const ratio = typeof size === \"object\" ? size.width / size.height : 4 / 3;\n return Math.abs(ratio - 16 / 9) < Math.abs(ratio - 4 / 3) ? \"wide169\" : \"standard43\";\n}\nvar ROLE_SCALE_STEPS = {\n display: 4,\n stat: 3,\n quote: 1,\n tableHeader: 0,\n tableCell: 0,\n label: -1,\n eyebrow: -1,\n chartLabel: -1,\n tracker: -1,\n footer: -2,\n source: -2\n};\nfunction scaledSize(scale, step) {\n if (step === 0) return scale.base;\n const baseline = scale.baselinePt ?? 4;\n const exact = scale.base * (scale.ratio ?? 1.25) ** step;\n return Math.max(5, Math.min(200, Math.round(exact / baseline) * baseline));\n}\nvar SCALE_STEP_RANGE = { from: -2, to: 5 };\nfunction typeScaleSizes(scale) {\n const sizes = /* @__PURE__ */ new Set();\n for (let step = SCALE_STEP_RANGE.from; step <= SCALE_STEP_RANGE.to; step += 1) {\n sizes.add(scaledSize(scale, step));\n }\n return [...sizes].sort((a, b) => a - b);\n}\nfunction paletteScalars(palette) {\n const scalars = {};\n for (const [key, value] of Object.entries(palette ?? {})) {\n if (typeof value === \"string\") scalars[key] = value;\n }\n return scalars;\n}\nfunction capsFormatting(textCase) {\n return textCase === \"upper\" ? { allCaps: true } : { smallCaps: textCase === \"smallCaps\" };\n}\nfunction resolveMotif(motif) {\n return motif && motif.kind !== \"none\" ? motif : void 0;\n}\nfunction resolveTypeRoles(system, canvas, base) {\n const scale = system.typography?.scale?.[canvas];\n const roles = {};\n for (const name of TYPE_ROLES) {\n const role = system.typography?.roles?.[name];\n if (!role) continue;\n roles[name] = {\n ...role,\n size: role.size ?? (scale ? scaledSize(scale, ROLE_SCALE_STEPS[name]) : base)\n };\n }\n return roles;\n}\nfunction designColors(colors, palette) {\n return { ...colors, ...paletteScalars(palette) };\n}\nfunction resolveDesignColor(value, colors) {\n const seen = /* @__PURE__ */ new Set();\n let current = value;\n while (current !== void 0 && !seen.has(current)) {\n if (!current.startsWith(\"#\") && Object.hasOwn(colors, current)) {\n seen.add(current);\n current = colors[current];\n } else {\n return /^#?[0-9a-f]{6}$/i.test(current) ? current.replace(/^#/, \"\") : void 0;\n }\n }\n return void 0;\n}\nfunction validateDesignColors(system, colors) {\n const resolved = designColors(colors, system.palette);\n const entries = Object.entries(system.palette ?? {}).flatMap(\n ([key, value]) => Array.isArray(value) ? value.map((entry, i) => [`palette.${key}[${i}]`, entry]) : [[`palette.${key}`, value]]\n );\n for (const [name, role] of Object.entries(system.typography?.roles ?? {})) {\n if (role.color)\n entries.push([`typography.roles.${name}.color`, role.color]);\n }\n for (const [path, value] of entries) {\n if (value && !resolveDesignColor(value, resolved)) {\n throw new Error(\n `Unresolvable theme color at ${path}: \"${value}\" (unknown token or cycle)`\n );\n }\n }\n}\n\nexport {\n SAFE_FONTS,\n isSafeFont,\n FontFamilyNameSchema,\n FontSourceSchema,\n FontRegistryEntrySchema,\n FontRegistrySchema,\n TYPE_ROLES,\n TypeRoleNameSchema,\n CANVASES,\n TextCaseSchema,\n PaletteSchema,\n TypeRoleSchema,\n TypeRolesSchema,\n TypographySchema,\n DesignSpacingSchema,\n ChromeSchema,\n MotifSchema,\n DesignSystemProperties,\n DesignSystemSchema,\n designCanvas,\n ROLE_SCALE_STEPS,\n typeScaleSizes,\n capsFormatting,\n resolveMotif,\n resolveTypeRoles,\n designColors,\n resolveDesignColor,\n validateDesignColors\n};\n//# sourceMappingURL=chunk-7ZEN5H5R.js.map","import {\n FontFamilyNameSchema,\n TYPE_ROLES\n} from \"../chunk-7ZEN5H5R.js\";\n\n// src/schemas/slide-content.ts\nimport { Type as Type9 } from \"@sinclair/typebox\";\n\n// src/schemas/slide-content/text.ts\nimport { Type as Type3 } from \"@sinclair/typebox\";\n\n// src/schemas/slide-content/common.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\n\n// src/schemas/slide-content/theme.ts\nimport { Type } from \"@sinclair/typebox\";\nvar HexColorSchema = Type.String({\n pattern: \"^#?[0-9A-Fa-f]{6}$\",\n description: \"Hex color (e.g. #FF0000)\"\n});\nvar SEMANTIC_COLOR_NAMES = [\n \"primary\",\n \"secondary\",\n \"accent\",\n \"background\",\n \"text\",\n \"text2\",\n \"background2\",\n \"accent4\",\n \"accent5\",\n \"accent6\"\n];\nvar SEMANTIC_COLOR_ALIASES = [\n \"accent1\",\n \"accent2\",\n \"accent3\",\n \"tx1\",\n \"tx2\",\n \"bg1\",\n \"bg2\"\n];\nvar ColorValueSchema = Type.Union(\n [\n HexColorSchema,\n ...SEMANTIC_COLOR_NAMES.map((name) => Type.Literal(name)),\n ...SEMANTIC_COLOR_ALIASES.map((name) => Type.Literal(name))\n ],\n { description: \"Hex color or semantic theme color name\" }\n);\nvar STYLE_NAMES = [\n \"title\",\n \"subtitle\",\n \"heading1\",\n \"heading2\",\n \"heading3\",\n \"body\",\n \"caption\",\n ...TYPE_ROLES\n];\nvar StyleNameSchema = Type.Union(\n STYLE_NAMES.map((name) => Type.Literal(name)),\n { description: \"Predefined style name\" }\n);\n\n// src/schemas/slide-content/common.ts\nvar PptxAlignmentSchema = Type2.Union(\n [Type2.Literal(\"left\"), Type2.Literal(\"center\"), Type2.Literal(\"right\")],\n { description: \"Horizontal alignment options\" }\n);\nvar VerticalAlignmentSchema = Type2.Union(\n [Type2.Literal(\"top\"), Type2.Literal(\"middle\"), Type2.Literal(\"bottom\")],\n { description: \"Vertical alignment options\" }\n);\nvar ShadowSchema = Type2.Object(\n {\n type: Type2.Optional(\n Type2.Union([Type2.Literal(\"outer\"), Type2.Literal(\"inner\")], {\n description: \"Shadow type\"\n })\n ),\n color: Type2.Optional(ColorValueSchema),\n blur: Type2.Optional(\n Type2.Number({ description: \"Shadow blur radius in points\" })\n ),\n offset: Type2.Optional(\n Type2.Number({ description: \"Shadow offset in points\" })\n ),\n angle: Type2.Optional(\n Type2.Number({ description: \"Shadow angle in degrees\" })\n ),\n opacity: Type2.Optional(\n Type2.Number({\n minimum: 0,\n maximum: 1,\n description: \"Shadow opacity (0-1)\"\n })\n )\n },\n {\n description: \"Shadow configuration\",\n additionalProperties: false\n }\n);\nvar GridPositionSchema = Type2.Object(\n {\n column: Type2.Number({\n minimum: 0,\n description: \"Starting column (0-indexed)\"\n }),\n row: Type2.Number({ minimum: 0, description: \"Starting row (0-indexed)\" }),\n columnSpan: Type2.Optional(\n Type2.Number({\n minimum: 1,\n description: \"Number of columns to span (default: 1)\"\n })\n ),\n rowSpan: Type2.Optional(\n Type2.Number({\n minimum: 1,\n description: \"Number of rows to span (default: 1)\"\n })\n )\n },\n { additionalProperties: false, description: \"Grid-based positioning\" }\n);\n\n// src/schemas/slide-content/text.ts\nvar TextRunSchema = Type3.Object(\n {\n text: Type3.String({ description: \"Run text content\" }),\n color: Type3.Optional(\n Type3.String({\n description: \"Run color (hex without # or semantic theme name)\"\n })\n ),\n bold: Type3.Optional(Type3.Boolean({ description: \"Bold run\" })),\n fontWeight: Type3.Optional(\n Type3.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Per-run weight (100\\u2013900). Overrides `bold` when set \\u2014 renderer picks the closest embedded variant via CSS font-matching.\"\n })\n ),\n italic: Type3.Optional(Type3.Boolean({ description: \"Italic run\" })),\n underline: Type3.Optional(\n Type3.Union([\n Type3.Boolean({ description: \"Simple underline toggle\" }),\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"sng\"),\n Type3.Literal(\"dbl\"),\n Type3.Literal(\"dash\"),\n Type3.Literal(\"dotted\")\n ])\n ),\n color: Type3.Optional(\n Type3.String({ description: \"Underline color (hex)\" })\n )\n },\n { additionalProperties: false }\n )\n ])\n ),\n strike: Type3.Optional(Type3.Boolean({ description: \"Strikethrough run\" })),\n fontSize: Type3.Optional(\n Type3.Number({ minimum: 1, description: \"Run font size in points\" })\n ),\n fontFace: Type3.Optional(Type3.String({ description: \"Run font family\" })),\n superscript: Type3.Optional(\n Type3.Boolean({ description: \"Render run as superscript\" })\n ),\n subscript: Type3.Optional(\n Type3.Boolean({ description: \"Render run as subscript\" })\n ),\n charSpacing: Type3.Optional(\n Type3.Number({ description: \"Character spacing in points\" })\n ),\n breakLine: Type3.Optional(\n Type3.Boolean({ description: \"Insert line break after this run\" })\n )\n },\n {\n description: \"A styled text run. Run options override component-level defaults.\",\n additionalProperties: false\n }\n);\nvar TextPropsSchema = Type3.Object(\n {\n text: Type3.Optional(\n Type3.String({\n description: \"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two.\"\n })\n ),\n runs: Type3.Optional(\n Type3.Array(TextRunSchema, {\n minItems: 1,\n 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.\"\n })\n ),\n x: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"X position in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"X as percentage\"\n })\n ])\n ),\n y: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Y position in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Y as percentage\"\n })\n ])\n ),\n w: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Width in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Width as percentage\"\n })\n ])\n ),\n h: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Height in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Height as percentage\"\n })\n ])\n ),\n fit: Type3.Optional(\n Type3.Object(\n {\n maxLines: Type3.Optional(\n Type3.Integer({\n minimum: 1,\n description: \"Lines the text may occupy, estimated with the width model at the effective font size.\"\n })\n ),\n shrink: Type3.Optional(\n Type3.Array(Type3.Number({ minimum: 1 }), {\n minItems: 1,\n description: \"Readable font sizes to try in order when the text exceeds maxLines or the box height. The first that fits is used.\"\n })\n )\n },\n {\n additionalProperties: false,\n 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.\"\n }\n )\n ),\n fontSize: Type3.Optional(\n Type3.Number({ minimum: 1, description: \"Font size in points\" })\n ),\n fontFace: Type3.Optional(FontFamilyNameSchema),\n color: Type3.Optional(\n Type3.String({ description: 'Text color (hex without #, e.g., \"FF0000\")' })\n ),\n bold: Type3.Optional(Type3.Boolean({ description: \"Bold text\" })),\n fontWeight: Type3.Optional(\n Type3.Integer({\n minimum: 100,\n maximum: 900,\n 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.\"\n })\n ),\n italic: Type3.Optional(Type3.Boolean({ description: \"Italic text\" })),\n underline: Type3.Optional(\n Type3.Union([\n Type3.Boolean({ description: \"Simple underline toggle\" }),\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"sng\"),\n Type3.Literal(\"dbl\"),\n Type3.Literal(\"dash\"),\n Type3.Literal(\"dotted\")\n ])\n ),\n color: Type3.Optional(\n Type3.String({ description: \"Underline color (hex)\" })\n )\n },\n { additionalProperties: false }\n )\n ])\n ),\n strike: Type3.Optional(Type3.Boolean({ description: \"Strikethrough text\" })),\n language: Type3.Optional(\n Type3.String({\n pattern: \"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$\",\n description: 'Language tag (BCP-47, e.g. \"en-US\", \"fr-FR\") for spell-checking this text. Overrides the presentation default.',\n examples: [\"en-US\", \"fr-FR\", \"de-DE\", \"it-IT\", \"es-ES\"]\n })\n ),\n align: Type3.Optional(PptxAlignmentSchema),\n valign: Type3.Optional(VerticalAlignmentSchema),\n breakLine: Type3.Optional(\n Type3.Boolean({ description: \"Add line break after text\" })\n ),\n bullet: Type3.Optional(\n Type3.Union([\n Type3.Boolean({ description: \"Enable default bullet\" }),\n Type3.Object(\n {\n type: Type3.Optional(\n Type3.Union([Type3.Literal(\"bullet\"), Type3.Literal(\"number\")])\n ),\n style: Type3.Optional(\n Type3.String({ description: \"Bullet character or style\" })\n ),\n startAt: Type3.Optional(\n Type3.Number({ description: \"Starting number for numbered lists\" })\n )\n },\n { additionalProperties: false }\n )\n ])\n ),\n margin: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Margin in points (all sides)\" }),\n Type3.Array(Type3.Number(), {\n description: \"Margins as [top, right, bottom, left] in points\",\n minItems: 4,\n maxItems: 4\n })\n ])\n ),\n rotate: Type3.Optional(\n Type3.Number({ description: \"Rotation angle in degrees\" })\n ),\n shadow: Type3.Optional(ShadowSchema),\n fill: Type3.Optional(\n Type3.Object(\n {\n color: Type3.String({ description: \"Fill color (hex without #)\" }),\n transparency: Type3.Optional(\n Type3.Number({\n minimum: 0,\n maximum: 100,\n description: \"Fill transparency (0-100)\"\n })\n )\n },\n { additionalProperties: false }\n )\n ),\n hyperlink: Type3.Optional(\n Type3.Object(\n {\n url: Type3.Optional(Type3.String({ description: \"Hyperlink URL\" })),\n slide: Type3.Optional(\n Type3.Number({ description: \"Slide number to link to\" })\n ),\n tooltip: Type3.Optional(\n Type3.String({ description: \"Hyperlink tooltip\" })\n )\n },\n { additionalProperties: false }\n )\n ),\n lineSpacing: Type3.Optional(\n Type3.Number({ description: \"Line spacing in points\" })\n ),\n lineSpacingMultiple: Type3.Optional(\n Type3.Number({\n minimum: 0.1,\n maximum: 10,\n description: \"Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing.\"\n })\n ),\n charSpacing: Type3.Optional(\n Type3.Number({\n description: \"Character spacing in points (positive = wider, negative = tighter)\"\n })\n ),\n paraSpaceBefore: Type3.Optional(\n Type3.Number({ description: \"Space before paragraph in points\" })\n ),\n paraSpaceAfter: Type3.Optional(\n Type3.Number({ description: \"Space after paragraph in points\" })\n ),\n grid: Type3.Optional(GridPositionSchema),\n style: Type3.Optional(StyleNameSchema)\n },\n {\n description: \"Text component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content/image.ts\nimport { Type as Type4 } from \"@sinclair/typebox\";\nvar PptxImagePropsSchema = Type4.Object(\n {\n path: Type4.Optional(\n Type4.String({\n description: \"Image file path or URL (mutually exclusive with base64 and svg)\"\n })\n ),\n base64: Type4.Optional(\n Type4.String({\n description: \"Base64-encoded image data in data URI format (mutually exclusive with path and svg)\"\n })\n ),\n svg: Type4.Optional(\n Type4.String({\n 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.'\n })\n ),\n x: Type4.Optional(\n Type4.Union([\n Type4.Number({ description: \"X position in inches\" }),\n Type4.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"X as percentage\"\n })\n ])\n ),\n y: Type4.Optional(\n Type4.Union([\n Type4.Number({ description: \"Y position in inches\" }),\n Type4.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Y as percentage\"\n })\n ])\n ),\n w: Type4.Optional(\n Type4.Union([\n Type4.Number({ description: \"Width in inches\" }),\n Type4.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Width as percentage\"\n })\n ])\n ),\n h: Type4.Optional(\n Type4.Union([\n Type4.Number({ description: \"Height in inches\" }),\n Type4.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Height as percentage\"\n })\n ])\n ),\n sizing: Type4.Optional(\n Type4.Object(\n {\n type: Type4.Union(\n [\n Type4.Literal(\"contain\"),\n Type4.Literal(\"cover\"),\n Type4.Literal(\"crop\")\n ],\n { description: \"Image sizing strategy\" }\n ),\n w: Type4.Optional(\n Type4.Number({ description: \"Target width in inches\" })\n ),\n h: Type4.Optional(\n Type4.Number({ description: \"Target height in inches\" })\n )\n },\n { description: \"Image sizing options\", additionalProperties: false }\n )\n ),\n rotate: Type4.Optional(\n Type4.Number({ description: \"Rotation angle in degrees\" })\n ),\n rounding: Type4.Optional(\n Type4.Boolean({ description: \"Apply rounded corners to image\" })\n ),\n shadow: Type4.Optional(ShadowSchema),\n hyperlink: Type4.Optional(\n Type4.Object(\n {\n url: Type4.Optional(Type4.String({ description: \"Hyperlink URL\" })),\n slide: Type4.Optional(\n Type4.Number({ description: \"Slide number to link to\" })\n ),\n tooltip: Type4.Optional(\n Type4.String({ description: \"Hyperlink tooltip\" })\n )\n },\n { additionalProperties: false }\n )\n ),\n alt: Type4.Optional(\n Type4.String({ description: \"Alternative text for accessibility\" })\n ),\n grid: Type4.Optional(GridPositionSchema)\n },\n {\n description: \"PPTX image component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content/shape.ts\nimport { Type as Type5 } from \"@sinclair/typebox\";\nvar ShapeTypeSchema = Type5.Union(\n [\n Type5.Literal(\"rect\"),\n Type5.Literal(\"roundRect\"),\n Type5.Literal(\"ellipse\"),\n Type5.Literal(\"triangle\"),\n Type5.Literal(\"diamond\"),\n Type5.Literal(\"pentagon\"),\n Type5.Literal(\"hexagon\"),\n Type5.Literal(\"star5\"),\n Type5.Literal(\"star6\"),\n Type5.Literal(\"line\"),\n Type5.Literal(\"arc\"),\n Type5.Literal(\"pie\"),\n Type5.Literal(\"blockArc\"),\n Type5.Literal(\"chord\"),\n Type5.Literal(\"arrow\"),\n Type5.Literal(\"chevron\"),\n Type5.Literal(\"cloud\"),\n Type5.Literal(\"heart\"),\n Type5.Literal(\"lightning\")\n ],\n { description: \"Shape type\" }\n);\nvar TextSegmentSchema = Type5.Object(\n {\n text: Type5.String(),\n fontSize: Type5.Optional(Type5.Number({ minimum: 1 })),\n fontFace: Type5.Optional(Type5.String()),\n color: Type5.Optional(\n Type5.String({\n description: \"Segment color (hex without # or semantic name)\"\n })\n ),\n bold: Type5.Optional(Type5.Boolean()),\n fontWeight: Type5.Optional(Type5.Integer({ minimum: 100, maximum: 900 })),\n italic: Type5.Optional(Type5.Boolean()),\n breakLine: Type5.Optional(\n Type5.Boolean({ description: \"Insert line break after this segment\" })\n ),\n spaceBefore: Type5.Optional(\n Type5.Number({\n minimum: 0,\n description: \"Space before paragraph in points\"\n })\n ),\n spaceAfter: Type5.Optional(\n Type5.Number({\n minimum: 0,\n description: \"Space after paragraph in points\"\n })\n ),\n charSpacing: Type5.Optional(\n Type5.Number({ description: \"Character spacing in points\" })\n )\n },\n { additionalProperties: false }\n);\nvar PATTERN_FILL_PRESETS = [\n \"pct5\",\n \"pct10\",\n \"pct20\",\n \"pct25\",\n \"pct30\",\n \"pct40\",\n \"pct50\",\n \"pct60\",\n \"pct70\",\n \"pct75\",\n \"pct80\",\n \"pct90\",\n \"horz\",\n \"vert\",\n \"ltHorz\",\n \"ltVert\",\n \"dkHorz\",\n \"dkVert\",\n \"narHorz\",\n \"narVert\",\n \"dashHorz\",\n \"dashVert\",\n \"cross\",\n \"dnDiag\",\n \"upDiag\",\n \"ltDnDiag\",\n \"ltUpDiag\",\n \"dkDnDiag\",\n \"dkUpDiag\",\n \"wdDnDiag\",\n \"wdUpDiag\",\n \"dashDnDiag\",\n \"dashUpDiag\",\n \"diagCross\",\n \"smCheck\",\n \"lgCheck\",\n \"smGrid\",\n \"lgGrid\",\n \"dotGrid\",\n \"smConfetti\",\n \"lgConfetti\",\n \"horzBrick\",\n \"diagBrick\",\n \"solidDmnd\",\n \"openDmnd\",\n \"dotDmnd\",\n \"plaid\",\n \"sphere\",\n \"weave\",\n \"divot\",\n \"shingle\",\n \"wave\",\n \"trellis\",\n \"zigZag\"\n];\nvar GradientStopSchema = Type5.Object(\n {\n color: Type5.String({\n description: \"Stop color (hex without # or semantic theme name)\"\n }),\n pos: Type5.Number({\n minimum: 0,\n maximum: 100,\n description: \"Stop position along the gradient (0-100)\"\n }),\n transparency: Type5.Optional(\n Type5.Number({\n minimum: 0,\n maximum: 100,\n description: \"Stop transparency (0-100)\"\n })\n )\n },\n { additionalProperties: false, description: \"Gradient color stop\" }\n);\nvar GradientFillSchema = Type5.Object(\n {\n type: Type5.Union([Type5.Literal(\"linear\"), Type5.Literal(\"radial\")], {\n description: \"Gradient type\"\n }),\n angle: Type5.Optional(\n Type5.Number({\n minimum: 0,\n maximum: 360,\n description: \"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0.\"\n })\n ),\n stops: Type5.Array(GradientStopSchema, {\n minItems: 2,\n description: \"Gradient color stops (at least 2)\"\n }),\n focus: Type5.Optional(\n Type5.Union(\n [\n Type5.Literal(\"center\"),\n Type5.Literal(\"topLeft\"),\n Type5.Literal(\"topRight\"),\n Type5.Literal(\"bottomLeft\"),\n Type5.Literal(\"bottomRight\")\n ],\n {\n description: 'Focus point for radial gradients (default: \"center\")'\n }\n )\n )\n },\n { additionalProperties: false, description: \"Gradient fill configuration\" }\n);\nvar PatternFillSchema = Type5.Object(\n {\n preset: Type5.Union(\n PATTERN_FILL_PRESETS.map((p) => Type5.Literal(p)),\n { description: \"OOXML pattern preset name (a:pattFill prst value)\" }\n ),\n foreground: Type5.String({\n description: \"Pattern foreground color (hex without # or semantic name)\"\n }),\n background: Type5.String({\n description: \"Pattern background color (hex without # or semantic name)\"\n })\n },\n { additionalProperties: false, description: \"Pattern fill configuration\" }\n);\nvar ShapePropsSchema = Type5.Object(\n {\n type: ShapeTypeSchema,\n x: Type5.Optional(\n Type5.Union([\n Type5.Number({ description: \"X position in inches\" }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"X as percentage\"\n })\n ])\n ),\n y: Type5.Optional(\n Type5.Union([\n Type5.Number({ description: \"Y position in inches\" }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Y as percentage\"\n })\n ])\n ),\n w: Type5.Optional(\n Type5.Union([\n Type5.Number({ description: \"Width in inches\" }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Width as percentage\"\n })\n ])\n ),\n h: Type5.Optional(\n Type5.Union([\n Type5.Number({ description: \"Height in inches\" }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Height as percentage\"\n })\n ])\n ),\n fill: Type5.Optional(\n Type5.Object(\n {\n color: Type5.Optional(\n Type5.String({ description: \"Fill color (hex without #)\" })\n ),\n transparency: Type5.Optional(\n Type5.Number({\n minimum: 0,\n maximum: 100,\n description: \"Fill transparency (0-100)\"\n })\n ),\n gradient: Type5.Optional(GradientFillSchema),\n pattern: Type5.Optional(PatternFillSchema)\n },\n { additionalProperties: false }\n )\n ),\n line: Type5.Optional(\n Type5.Object(\n {\n color: Type5.Optional(\n Type5.String({ description: \"Line color (hex without #)\" })\n ),\n width: Type5.Optional(\n Type5.Number({ minimum: 0, description: \"Line width in points\" })\n ),\n dashType: Type5.Optional(\n Type5.Union([\n Type5.Literal(\"solid\"),\n Type5.Literal(\"dash\"),\n Type5.Literal(\"dot\"),\n Type5.Literal(\"dashDot\")\n ])\n )\n },\n { additionalProperties: false }\n )\n ),\n text: Type5.Optional(\n Type5.Union(\n [\n Type5.String({ description: \"Plain text\" }),\n Type5.Array(TextSegmentSchema, {\n description: \"Rich text segments with per-segment formatting\"\n })\n ],\n { description: \"Text content inside the shape\" }\n )\n ),\n fontSize: Type5.Optional(\n Type5.Number({ minimum: 1, description: \"Font size for shape text\" })\n ),\n fontFace: Type5.Optional(\n Type5.String({ description: \"Font family for shape text\" })\n ),\n fontColor: Type5.Optional(\n Type5.String({ description: \"Font color for shape text (hex without #)\" })\n ),\n charSpacing: Type5.Optional(\n Type5.Number({ description: \"Character spacing in points for shape text\" })\n ),\n bold: Type5.Optional(Type5.Boolean({ description: \"Bold shape text\" })),\n fontWeight: Type5.Optional(\n Type5.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Per-shape weight (100\\u2013900). Overrides `bold` when set.\"\n })\n ),\n italic: Type5.Optional(Type5.Boolean({ description: \"Italic shape text\" })),\n align: Type5.Optional(PptxAlignmentSchema),\n valign: Type5.Optional(VerticalAlignmentSchema),\n rotate: Type5.Optional(\n Type5.Number({ description: \"Rotation angle in degrees\" })\n ),\n angleRange: Type5.Optional(\n Type5.Array(Type5.Number(), {\n minItems: 2,\n maxItems: 2,\n description: \"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)\"\n })\n ),\n flipH: Type5.Optional(\n Type5.Boolean({ description: \"Flip shape horizontally\" })\n ),\n flipV: Type5.Optional(\n Type5.Boolean({ description: \"Flip shape vertically\" })\n ),\n shadow: Type5.Optional(ShadowSchema),\n rectRadius: Type5.Optional(\n Type5.Number({\n minimum: 0,\n description: \"Corner radius for roundRect shape in inches\"\n })\n ),\n grid: Type5.Optional(GridPositionSchema),\n style: Type5.Optional(StyleNameSchema)\n },\n {\n description: \"Shape component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content/table.ts\nimport { Type as Type6 } from \"@sinclair/typebox\";\nvar PptxTableCellSchema = Type6.Union([\n Type6.String({ description: \"Simple text cell\" }),\n Type6.Object(\n {\n text: Type6.String({ description: \"Cell text content\" }),\n color: Type6.Optional(\n Type6.String({ description: \"Text color (hex without #)\" })\n ),\n fill: Type6.Optional(\n Type6.String({ description: \"Cell background color (hex without #)\" })\n ),\n fontSize: Type6.Optional(\n Type6.Number({ description: \"Font size in points\" })\n ),\n fontFace: Type6.Optional(Type6.String({ description: \"Font family\" })),\n bold: Type6.Optional(Type6.Boolean({ description: \"Bold text\" })),\n fontWeight: Type6.Optional(\n Type6.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Per-cell weight (100\\u2013900). Overrides `bold` when set.\"\n })\n ),\n italic: Type6.Optional(Type6.Boolean({ description: \"Italic text\" })),\n align: Type6.Optional(PptxAlignmentSchema),\n valign: Type6.Optional(VerticalAlignmentSchema),\n colspan: Type6.Optional(\n Type6.Number({ minimum: 1, description: \"Column span\" })\n ),\n rowspan: Type6.Optional(\n Type6.Number({ minimum: 1, description: \"Row span\" })\n ),\n margin: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Margin in points (all sides)\" }),\n Type6.Array(Type6.Number(), { minItems: 4, maxItems: 4 })\n ])\n )\n },\n { additionalProperties: false }\n )\n]);\nvar PptxTablePropsSchema = Type6.Object(\n {\n rows: Type6.Array(\n Type6.Array(PptxTableCellSchema, { description: \"Row of cells\" }),\n { description: \"Table rows (array of arrays)\", minItems: 1 }\n ),\n x: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"X position in inches\" }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"X as percentage\"\n })\n ])\n ),\n y: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Y position in inches\" }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Y as percentage\"\n })\n ])\n ),\n w: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Width in inches\" }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Width as percentage\"\n })\n ])\n ),\n h: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Height in inches\" }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Height as percentage\"\n })\n ])\n ),\n colW: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Uniform column width in inches\" }),\n Type6.Array(Type6.Number(), {\n description: \"Individual column widths in inches\"\n })\n ])\n ),\n rowH: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Uniform row height in inches\" }),\n Type6.Array(Type6.Number(), {\n description: \"Individual row heights in inches\"\n })\n ])\n ),\n border: Type6.Optional(\n Type6.Object(\n {\n type: Type6.Optional(\n Type6.Union([\n Type6.Literal(\"solid\"),\n Type6.Literal(\"dash\"),\n Type6.Literal(\"dot\"),\n Type6.Literal(\"none\")\n ])\n ),\n pt: Type6.Optional(\n Type6.Number({ minimum: 0, description: \"Border width in points\" })\n ),\n color: Type6.Optional(\n Type6.String({ description: \"Border color (hex without #)\" })\n )\n },\n { additionalProperties: false }\n )\n ),\n fill: Type6.Optional(\n Type6.String({ description: \"Table background color (hex without #)\" })\n ),\n fontSize: Type6.Optional(\n Type6.Number({\n minimum: 1,\n description: \"Default font size for all cells\"\n })\n ),\n fontFace: Type6.Optional(\n Type6.String({ description: \"Default font family for all cells\" })\n ),\n fontWeight: Type6.Optional(\n Type6.Integer({\n minimum: 100,\n maximum: 900,\n 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.\"\n })\n ),\n color: Type6.Optional(\n Type6.String({\n description: \"Default text color for all cells (hex without #)\"\n })\n ),\n align: Type6.Optional(PptxAlignmentSchema),\n valign: Type6.Optional(VerticalAlignmentSchema),\n headerRow: Type6.Optional(\n Type6.Boolean({\n 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.\"\n })\n ),\n autoPage: Type6.Optional(\n Type6.Boolean({\n description: \"Auto-paginate table across multiple slides when content overflows\"\n })\n ),\n autoPageRepeatHeader: Type6.Optional(\n Type6.Boolean({\n description: \"Repeat first row as header on each auto-paged slide\"\n })\n ),\n margin: Type6.Optional(\n Type6.Union([\n Type6.Number({ description: \"Cell margin in points (all sides)\" }),\n Type6.Array(Type6.Number(), { minItems: 4, maxItems: 4 })\n ])\n ),\n borderRadius: Type6.Optional(\n Type6.Number({\n minimum: 0,\n description: \"Rounded corner radius in inches. Renders a roundRect shape behind the table.\"\n })\n ),\n grid: Type6.Optional(GridPositionSchema)\n },\n {\n description: \"PPTX table component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content/highcharts.ts\nimport { Type as Type7 } from \"@sinclair/typebox\";\nvar PptxHighchartsPropsSchema = Type7.Object(\n {\n options: Type7.Intersect([\n Type7.Record(Type7.String(), Type7.Unknown()),\n Type7.Object({\n chart: Type7.Object({\n width: Type7.Number(),\n height: Type7.Number()\n })\n })\n ]),\n scale: Type7.Optional(Type7.Number()),\n serverUrl: Type7.Optional(\n Type7.String({\n description: \"Highcharts Export Server URL (default: http://localhost:7801)\"\n })\n ),\n // Optional resources forwarded verbatim to the export server (CSS/JS/files).\n // Notably enables @font-face rules so charts render in custom fonts.\n resources: Type7.Optional(\n Type7.Object({\n css: Type7.Optional(Type7.String()),\n js: Type7.Optional(Type7.String()),\n files: Type7.Optional(Type7.Array(Type7.String()))\n })\n ),\n x: Type7.Optional(\n Type7.Union([\n Type7.Number({ description: \"X position in inches\" }),\n Type7.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"X as percentage\"\n })\n ])\n ),\n y: Type7.Optional(\n Type7.Union([\n Type7.Number({ description: \"Y position in inches\" }),\n Type7.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Y as percentage\"\n })\n ])\n ),\n w: Type7.Optional(\n Type7.Union([\n Type7.Number({ description: \"Width in inches\" }),\n Type7.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Width as percentage\"\n })\n ])\n ),\n h: Type7.Optional(\n Type7.Union([\n Type7.Number({ description: \"Height in inches\" }),\n Type7.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Height as percentage\"\n })\n ])\n ),\n grid: Type7.Optional(GridPositionSchema)\n },\n {\n description: \"PPTX Highcharts component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content/chart.ts\nimport { Type as Type8 } from \"@sinclair/typebox\";\nvar positionValue = (inches, percent) => Type8.Union([\n Type8.Number({ description: inches }),\n Type8.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: percent\n })\n]);\nvar ChartTypeSchema = Type8.Union(\n [\n Type8.Literal(\"area\"),\n Type8.Literal(\"bar\"),\n Type8.Literal(\"bar3D\"),\n Type8.Literal(\"bubble\"),\n Type8.Literal(\"doughnut\"),\n Type8.Literal(\"line\"),\n Type8.Literal(\"pie\"),\n Type8.Literal(\"radar\"),\n Type8.Literal(\"scatter\")\n ],\n { description: \"Chart type\" }\n);\nvar ChartDataSeriesSchema = Type8.Object(\n {\n name: Type8.Optional(Type8.String({ description: \"Series name\" })),\n labels: Type8.Optional(\n Type8.Array(Type8.String(), {\n 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.\"\n })\n ),\n values: Type8.Optional(\n Type8.Array(Type8.Number(), {\n description: \"Data values, one per label. Needed on every series \\u2014 see `labels`.\"\n })\n ),\n sizes: Type8.Optional(\n Type8.Array(Type8.Number(), {\n description: \"Bubble sizes (bubble charts only)\"\n })\n )\n },\n { additionalProperties: false }\n);\nvar ChartGridLineSchema = Type8.Object(\n {\n style: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"solid\"),\n Type8.Literal(\"dash\"),\n Type8.Literal(\"dot\"),\n Type8.Literal(\"none\")\n ],\n { description: \"Grid line style\" }\n )\n ),\n size: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Grid line width (points)\" })\n ),\n color: Type8.Optional(\n Type8.String({ description: \"Grid line color (hex or semantic)\" })\n )\n },\n { additionalProperties: false, description: \"Axis grid line styling\" }\n);\nvar PptxChartPropsSchema = Type8.Object(\n {\n type: ChartTypeSchema,\n data: Type8.Array(ChartDataSeriesSchema, {\n description: \"Chart data series\",\n minItems: 1\n }),\n // Display toggles\n showLegend: Type8.Optional(\n Type8.Boolean({ description: \"Show chart legend\" })\n ),\n showTitle: Type8.Optional(Type8.Boolean({ description: \"Show chart title\" })),\n showValue: Type8.Optional(Type8.Boolean({ description: \"Show data values\" })),\n showPercent: Type8.Optional(\n Type8.Boolean({ description: \"Show percentages (pie/doughnut)\" })\n ),\n showLabel: Type8.Optional(\n Type8.Boolean({ description: \"Show category labels on data points\" })\n ),\n showSerName: Type8.Optional(\n Type8.Boolean({ description: \"Show series name on data points\" })\n ),\n // Title\n title: Type8.Optional(Type8.String({ description: \"Chart title text\" })),\n titleFontSize: Type8.Optional(\n Type8.Number({ description: \"Title font size (points)\" })\n ),\n titleColor: Type8.Optional(\n Type8.String({ description: \"Title color (hex or semantic)\" })\n ),\n titleFontFace: Type8.Optional(\n Type8.String({ description: \"Title font face\" })\n ),\n titleFontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`.\"\n })\n ),\n // Chart colors\n chartColors: Type8.Optional(\n Type8.Array(Type8.String(), {\n description: \"Series colors (hex or semantic theme names). Defaults to theme palette.\"\n })\n ),\n // Data element border (bars/slices/areas)\n dataBorder: Type8.Optional(\n Type8.Object(\n {\n pt: Type8.Number({\n minimum: 0,\n description: \"Border width (points)\"\n }),\n color: Type8.String({\n description: \"Border color (hex or semantic)\"\n })\n },\n {\n additionalProperties: false,\n description: \"Outline on data elements (bars, slices, areas)\"\n }\n )\n ),\n // Legend\n legendPos: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"b\"),\n Type8.Literal(\"l\"),\n Type8.Literal(\"r\"),\n Type8.Literal(\"t\"),\n Type8.Literal(\"tr\")\n ],\n { description: \"Legend position\" }\n )\n ),\n legendFontSize: Type8.Optional(\n Type8.Number({ description: \"Legend font size\" })\n ),\n legendFontFace: Type8.Optional(\n Type8.String({ description: \"Legend font face\" })\n ),\n legendFontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n 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).\"\n })\n ),\n legendColor: Type8.Optional(\n Type8.String({ description: \"Legend text color\" })\n ),\n // Category axis\n catAxisTitle: Type8.Optional(\n Type8.String({ description: \"Category axis title\" })\n ),\n catAxisHidden: Type8.Optional(\n Type8.Boolean({ description: \"Hide category axis\" })\n ),\n catAxisLabelRotate: Type8.Optional(\n Type8.Number({ description: \"Category axis label rotation (degrees)\" })\n ),\n catAxisLabelFontSize: Type8.Optional(\n Type8.Number({ description: \"Category axis label font size\" })\n ),\n catAxisLabelColor: Type8.Optional(\n Type8.String({\n description: \"Category axis label color (hex or semantic)\"\n })\n ),\n catAxisLabelFontFace: Type8.Optional(\n Type8.String({ description: \"Category axis label font face\" })\n ),\n catAxisLabelFontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`.\"\n })\n ),\n catGridLine: Type8.Optional(ChartGridLineSchema),\n // Value axis\n valAxisTitle: Type8.Optional(\n Type8.String({ description: \"Value axis title\" })\n ),\n valAxisHidden: Type8.Optional(\n Type8.Boolean({ description: \"Hide value axis\" })\n ),\n valAxisMinVal: Type8.Optional(\n Type8.Number({ description: \"Value axis minimum\" })\n ),\n valAxisMaxVal: Type8.Optional(\n Type8.Number({ description: \"Value axis maximum\" })\n ),\n valAxisLabelFormatCode: Type8.Optional(\n Type8.String({\n description: 'Value axis label format (e.g. \"$0.00\", \"#%\")'\n })\n ),\n valAxisMajorUnit: Type8.Optional(\n Type8.Number({ description: \"Value axis major unit / tick interval\" })\n ),\n valAxisLabelColor: Type8.Optional(\n Type8.String({ description: \"Value axis label color (hex or semantic)\" })\n ),\n valAxisLabelFontFace: Type8.Optional(\n Type8.String({ description: \"Value axis label font face\" })\n ),\n valAxisLabelFontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`.\"\n })\n ),\n valAxisLabelFontSize: Type8.Optional(\n Type8.Number({ description: \"Value axis label font size\" })\n ),\n valGridLine: Type8.Optional(ChartGridLineSchema),\n catAxisLineShow: Type8.Optional(\n Type8.Boolean({ description: \"Show the category axis line\" })\n ),\n valAxisLineShow: Type8.Optional(\n Type8.Boolean({ description: \"Show the value axis line\" })\n ),\n // Bar-specific\n barDir: Type8.Optional(\n Type8.Union([Type8.Literal(\"bar\"), Type8.Literal(\"col\")], {\n description: 'Bar direction: \"bar\" (horizontal) or \"col\" (vertical, default)'\n })\n ),\n barGrouping: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"clustered\"),\n Type8.Literal(\"stacked\"),\n Type8.Literal(\"percentStacked\")\n ],\n { description: \"Bar grouping style\" }\n )\n ),\n barGapWidthPct: Type8.Optional(\n Type8.Number({\n minimum: 0,\n maximum: 500,\n description: \"Bar gap width (0-500%)\"\n })\n ),\n barOverlapPct: Type8.Optional(\n Type8.Number({\n minimum: -100,\n maximum: 100,\n description: \"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap.\"\n })\n ),\n // Line-specific\n lineSmooth: Type8.Optional(Type8.Boolean({ description: \"Smooth lines\" })),\n lineDataSymbol: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"circle\"),\n Type8.Literal(\"dash\"),\n Type8.Literal(\"diamond\"),\n Type8.Literal(\"dot\"),\n Type8.Literal(\"none\"),\n Type8.Literal(\"square\"),\n Type8.Literal(\"triangle\")\n ],\n { description: \"Line data point marker symbol\" }\n )\n ),\n lineSize: Type8.Optional(\n Type8.Number({ description: \"Line width (points)\" })\n ),\n lineDataSymbolSize: Type8.Optional(\n Type8.Number({\n minimum: 2,\n maximum: 72,\n description: \"Line data point marker size (points)\"\n })\n ),\n // Pie/doughnut-specific\n firstSliceAng: Type8.Optional(\n Type8.Number({\n minimum: 0,\n maximum: 359,\n description: \"Angle of first slice (degrees)\"\n })\n ),\n holeSize: Type8.Optional(\n Type8.Number({\n minimum: 10,\n maximum: 90,\n description: \"Doughnut hole size (%)\"\n })\n ),\n // Radar-specific\n radarStyle: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"standard\"),\n Type8.Literal(\"marker\"),\n Type8.Literal(\"filled\")\n ],\n { description: \"Radar chart style\" }\n )\n ),\n // Data labels\n dataLabelColor: Type8.Optional(\n Type8.String({ description: \"Data label text color\" })\n ),\n dataLabelFontSize: Type8.Optional(\n Type8.Number({ description: \"Data label font size\" })\n ),\n dataLabelFontFace: Type8.Optional(\n Type8.String({ description: \"Data label font face\" })\n ),\n dataLabelFontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n 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.'\n })\n ),\n dataLabelFontBold: Type8.Optional(\n Type8.Boolean({ description: \"Bold data labels\" })\n ),\n dataLabelPosition: Type8.Optional(\n Type8.Union(\n [\n Type8.Literal(\"b\"),\n Type8.Literal(\"bestFit\"),\n Type8.Literal(\"ctr\"),\n Type8.Literal(\"l\"),\n Type8.Literal(\"r\"),\n Type8.Literal(\"t\"),\n Type8.Literal(\"inEnd\"),\n Type8.Literal(\"outEnd\")\n ],\n { description: \"Data label position\" }\n )\n ),\n // Positioning\n x: Type8.Optional(positionValue(\"X position in inches\", \"X as percentage\")),\n y: Type8.Optional(positionValue(\"Y position in inches\", \"Y as percentage\")),\n w: Type8.Optional(positionValue(\"Width in inches\", \"Width as percentage\")),\n h: Type8.Optional(positionValue(\"Height in inches\", \"Height as percentage\")),\n grid: Type8.Optional(GridPositionSchema)\n },\n {\n description: \"Native PowerPoint chart component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/slide-content.ts\nfunction pptxComponentRequiresProps(component) {\n if (component.propsRequired !== void 0) return component.propsRequired;\n const schema = component.propsSchema;\n return schema.type !== \"object\" || (schema.required?.length ?? 0) > 0;\n}\nvar PPTX_SLIDE_CONTENT_COMPONENTS = [\n {\n name: \"text\",\n propsSchema: TextPropsSchema,\n hasChildren: false,\n category: \"content\",\n // `text` XOR `runs`: both optional in the schema, one of them mandatory in\n // fact (validation/text-content-conflicts.ts rejects neither and both).\n propsRequired: true,\n 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.\"\n },\n {\n name: \"image\",\n propsSchema: PptxImagePropsSchema,\n hasChildren: false,\n category: \"content\",\n // One of `path`/`base64`/`svg`, so same shape as `text`: a source is\n // mandatory in fact and optional in the schema. Unlike `text` this is only\n // half enforced — the missing key is caught, an empty props object is not,\n // because `image` has no analogue of validation/text-content-conflicts.ts\n // and a sourceless image is an IMAGE_NO_SOURCE warning at generation, not\n // an error. The flag is still not the guess: `image` has required `props`\n // in the published schema since it was first generated, so dropping it\n // here would loosen that contract rather than tighten the runtime.\n propsRequired: true,\n description: \"Image element - displays images from file path, URL, or base64 data.\"\n },\n {\n name: \"shape\",\n propsSchema: ShapePropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Shape element - draws geometric shapes with optional text, fill, and line styling.\"\n },\n {\n name: \"table\",\n propsSchema: PptxTablePropsSchema,\n hasChildren: false,\n category: \"content\",\n 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.\"\n },\n {\n name: \"highcharts\",\n propsSchema: PptxHighchartsPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Highcharts element - renders charts via Highcharts Export Server.\"\n },\n {\n name: \"chart\",\n propsSchema: PptxChartPropsSchema,\n hasChildren: false,\n category: \"content\",\n 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.\"\n }\n];\nfunction createSlideContentComponentSchema(component) {\n return Type9.Object(\n {\n name: Type9.Literal(component.name),\n id: Type9.Optional(Type9.String()),\n enabled: Type9.Optional(\n Type9.Boolean({\n default: true,\n description: \"When false, this component is filtered out and not rendered. Defaults to true.\"\n })\n ),\n props: pptxComponentRequiresProps(component) ? component.propsSchema : Type9.Optional(component.propsSchema)\n },\n { additionalProperties: false, description: component.description }\n );\n}\nvar PptxSlideContentSchema = Type9.Union(\n [\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[0]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[1]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[2]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[3]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[4]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[5])\n ],\n {\n $id: \"PptxSlideContent\",\n discriminator: { propertyName: \"name\" },\n description: \"A single PPTX slide content element (text, image, shape, table, highcharts, or chart).\"\n }\n);\nexport {\n ColorValueSchema,\n GradientFillSchema,\n GradientStopSchema,\n GridPositionSchema,\n PATTERN_FILL_PRESETS,\n PPTX_SLIDE_CONTENT_COMPONENTS,\n PatternFillSchema,\n PptxAlignmentSchema,\n PptxChartPropsSchema,\n PptxHighchartsPropsSchema,\n PptxImagePropsSchema,\n PptxSlideContentSchema,\n PptxTablePropsSchema,\n SEMANTIC_COLOR_ALIASES,\n SEMANTIC_COLOR_NAMES,\n STYLE_NAMES,\n ShadowSchema,\n ShapePropsSchema,\n ShapeTypeSchema,\n StyleNameSchema,\n TextPropsSchema,\n TextRunSchema,\n TextSegmentSchema,\n VerticalAlignmentSchema,\n pptxComponentRequiresProps\n};\n//# sourceMappingURL=slide-content.js.map","// src/schemas/component-defaults.ts\nimport { Type } from \"@sinclair/typebox\";\n\n// src/schemas/components/text.ts\nimport {\n TextPropsSchema,\n TextRunSchema\n} from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/image.ts\nimport { PptxImagePropsSchema } from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/shape.ts\nimport {\n ShapePropsSchema,\n ShapeTypeSchema,\n TextSegmentSchema,\n GradientStopSchema,\n GradientFillSchema,\n PatternFillSchema,\n PATTERN_FILL_PRESETS\n} from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/table.ts\nimport { PptxTablePropsSchema } from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/highcharts.ts\nimport { PptxHighchartsPropsSchema } from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/chart.ts\nimport { PptxChartPropsSchema } from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/component-defaults.ts\nvar TextComponentDefaultsSchema = Type.Partial(TextPropsSchema);\nvar ImageComponentDefaultsSchema = Type.Partial(PptxImagePropsSchema);\nvar ShapeComponentDefaultsSchema = Type.Partial(ShapePropsSchema);\nvar TableComponentDefaultsSchema = Type.Partial(PptxTablePropsSchema);\nvar HighchartsComponentDefaultsSchema = Type.Partial(\n PptxHighchartsPropsSchema\n);\nvar ChartComponentDefaultsSchema = Type.Partial(PptxChartPropsSchema);\nvar PptxComponentDefaultsSchema = Type.Object(\n {\n text: Type.Optional(TextComponentDefaultsSchema),\n image: Type.Optional(ImageComponentDefaultsSchema),\n shape: Type.Optional(ShapeComponentDefaultsSchema),\n table: Type.Optional(TableComponentDefaultsSchema),\n highcharts: Type.Optional(HighchartsComponentDefaultsSchema),\n chart: Type.Optional(ChartComponentDefaultsSchema)\n },\n { additionalProperties: true }\n);\n\nexport {\n TextPropsSchema,\n TextRunSchema,\n PptxImagePropsSchema,\n ShapePropsSchema,\n ShapeTypeSchema,\n TextSegmentSchema,\n GradientStopSchema,\n GradientFillSchema,\n PatternFillSchema,\n PATTERN_FILL_PRESETS,\n PptxTablePropsSchema,\n PptxHighchartsPropsSchema,\n PptxChartPropsSchema,\n TextComponentDefaultsSchema,\n ImageComponentDefaultsSchema,\n ShapeComponentDefaultsSchema,\n TableComponentDefaultsSchema,\n HighchartsComponentDefaultsSchema,\n ChartComponentDefaultsSchema,\n PptxComponentDefaultsSchema\n};\n//# sourceMappingURL=chunk-Z6NUHS34.js.map","import { Kind } from '../type/symbols/index.mjs';\nimport { ValueErrorType } from './errors.mjs';\n/** Creates an error message using en-US as the default locale */\nexport function DefaultErrorFunction(error) {\n switch (error.errorType) {\n case ValueErrorType.ArrayContains:\n return 'Expected array to contain at least one matching value';\n case ValueErrorType.ArrayMaxContains:\n return `Expected array to contain no more than ${error.schema.maxContains} matching values`;\n case ValueErrorType.ArrayMinContains:\n return `Expected array to contain at least ${error.schema.minContains} matching values`;\n case ValueErrorType.ArrayMaxItems:\n return `Expected array length to be less or equal to ${error.schema.maxItems}`;\n case ValueErrorType.ArrayMinItems:\n return `Expected array length to be greater or equal to ${error.schema.minItems}`;\n case ValueErrorType.ArrayUniqueItems:\n return 'Expected array elements to be unique';\n case ValueErrorType.Array:\n return 'Expected array';\n case ValueErrorType.AsyncIterator:\n return 'Expected AsyncIterator';\n case ValueErrorType.BigIntExclusiveMaximum:\n return `Expected bigint to be less than ${error.schema.exclusiveMaximum}`;\n case ValueErrorType.BigIntExclusiveMinimum:\n return `Expected bigint to be greater than ${error.schema.exclusiveMinimum}`;\n case ValueErrorType.BigIntMaximum:\n return `Expected bigint to be less or equal to ${error.schema.maximum}`;\n case ValueErrorType.BigIntMinimum:\n return `Expected bigint to be greater or equal to ${error.schema.minimum}`;\n case ValueErrorType.BigIntMultipleOf:\n return `Expected bigint to be a multiple of ${error.schema.multipleOf}`;\n case ValueErrorType.BigInt:\n return 'Expected bigint';\n case ValueErrorType.Boolean:\n return 'Expected boolean';\n case ValueErrorType.DateExclusiveMinimumTimestamp:\n return `Expected Date timestamp to be greater than ${error.schema.exclusiveMinimumTimestamp}`;\n case ValueErrorType.DateExclusiveMaximumTimestamp:\n return `Expected Date timestamp to be less than ${error.schema.exclusiveMaximumTimestamp}`;\n case ValueErrorType.DateMinimumTimestamp:\n return `Expected Date timestamp to be greater or equal to ${error.schema.minimumTimestamp}`;\n case ValueErrorType.DateMaximumTimestamp:\n return `Expected Date timestamp to be less or equal to ${error.schema.maximumTimestamp}`;\n case ValueErrorType.DateMultipleOfTimestamp:\n return `Expected Date timestamp to be a multiple of ${error.schema.multipleOfTimestamp}`;\n case ValueErrorType.Date:\n return 'Expected Date';\n case ValueErrorType.Function:\n return 'Expected function';\n case ValueErrorType.IntegerExclusiveMaximum:\n return `Expected integer to be less than ${error.schema.exclusiveMaximum}`;\n case ValueErrorType.IntegerExclusiveMinimum:\n return `Expected integer to be greater than ${error.schema.exclusiveMinimum}`;\n case ValueErrorType.IntegerMaximum:\n return `Expected integer to be less or equal to ${error.schema.maximum}`;\n case ValueErrorType.IntegerMinimum:\n return `Expected integer to be greater or equal to ${error.schema.minimum}`;\n case ValueErrorType.IntegerMultipleOf:\n return `Expected integer to be a multiple of ${error.schema.multipleOf}`;\n case ValueErrorType.Integer:\n return 'Expected integer';\n case ValueErrorType.IntersectUnevaluatedProperties:\n return 'Unexpected property';\n case ValueErrorType.Intersect:\n return 'Expected all values to match';\n case ValueErrorType.Iterator:\n return 'Expected Iterator';\n case ValueErrorType.Literal:\n return `Expected ${typeof error.schema.const === 'string' ? `'${error.schema.const}'` : error.schema.const}`;\n case ValueErrorType.Never:\n return 'Never';\n case ValueErrorType.Not:\n return 'Value should not match';\n case ValueErrorType.Null:\n return 'Expected null';\n case ValueErrorType.NumberExclusiveMaximum:\n return `Expected number to be less than ${error.schema.exclusiveMaximum}`;\n case ValueErrorType.NumberExclusiveMinimum:\n return `Expected number to be greater than ${error.schema.exclusiveMinimum}`;\n case ValueErrorType.NumberMaximum:\n return `Expected number to be less or equal to ${error.schema.maximum}`;\n case ValueErrorType.NumberMinimum:\n return `Expected number to be greater or equal to ${error.schema.minimum}`;\n case ValueErrorType.NumberMultipleOf:\n return `Expected number to be a multiple of ${error.schema.multipleOf}`;\n case ValueErrorType.Number:\n return 'Expected number';\n case ValueErrorType.Object:\n return 'Expected object';\n case ValueErrorType.ObjectAdditionalProperties:\n return 'Unexpected property';\n case ValueErrorType.ObjectMaxProperties:\n return `Expected object to have no more than ${error.schema.maxProperties} properties`;\n case ValueErrorType.ObjectMinProperties:\n return `Expected object to have at least ${error.schema.minProperties} properties`;\n case ValueErrorType.ObjectRequiredProperty:\n return 'Expected required property';\n case ValueErrorType.Promise:\n return 'Expected Promise';\n case ValueErrorType.RegExp:\n return 'Expected string to match regular expression';\n case ValueErrorType.StringFormatUnknown:\n return `Unknown format '${error.schema.format}'`;\n case ValueErrorType.StringFormat:\n return `Expected string to match '${error.schema.format}' format`;\n case ValueErrorType.StringMaxLength:\n return `Expected string length less or equal to ${error.schema.maxLength}`;\n case ValueErrorType.StringMinLength:\n return `Expected string length greater or equal to ${error.schema.minLength}`;\n case ValueErrorType.StringPattern:\n return `Expected string to match '${error.schema.pattern}'`;\n case ValueErrorType.String:\n return 'Expected string';\n case ValueErrorType.Symbol:\n return 'Expected symbol';\n case ValueErrorType.TupleLength:\n return `Expected tuple to have ${error.schema.maxItems || 0} elements`;\n case ValueErrorType.Tuple:\n return 'Expected tuple';\n case ValueErrorType.Uint8ArrayMaxByteLength:\n return `Expected byte length less or equal to ${error.schema.maxByteLength}`;\n case ValueErrorType.Uint8ArrayMinByteLength:\n return `Expected byte length greater or equal to ${error.schema.minByteLength}`;\n case ValueErrorType.Uint8Array:\n return 'Expected Uint8Array';\n case ValueErrorType.Undefined:\n return 'Expected undefined';\n case ValueErrorType.Union:\n return 'Expected union value';\n case ValueErrorType.Void:\n return 'Expected void';\n case ValueErrorType.Kind:\n return `Expected kind '${error.schema[Kind]}'`;\n default:\n return 'Unknown error type';\n }\n}\n/** Manages error message providers */\nlet errorFunction = DefaultErrorFunction;\n/** Sets the error function used to generate error messages. */\nexport function SetErrorFunction(callback) {\n errorFunction = callback;\n}\n/** Gets the error function used to generate error messages */\nexport function GetErrorFunction() {\n return errorFunction;\n}\n","import { TypeBoxError } from '../../type/error/index.mjs';\nimport { Kind } from '../../type/symbols/index.mjs';\nimport { IsString } from '../guard/guard.mjs';\nexport class TypeDereferenceError extends TypeBoxError {\n constructor(schema) {\n super(`Unable to dereference schema with $id '${schema.$ref}'`);\n this.schema = schema;\n }\n}\nfunction Resolve(schema, references) {\n const target = references.find((target) => target.$id === schema.$ref);\n if (target === undefined)\n throw new TypeDereferenceError(schema);\n return Deref(target, references);\n}\n/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */\nexport function Pushref(schema, references) {\n if (!IsString(schema.$id) || references.some((target) => target.$id === schema.$id))\n return references;\n references.push(schema);\n return references;\n}\n/** `[Internal]` Dereferences a schema from the references array or throws if not found */\nexport function Deref(schema, references) {\n // prettier-ignore\n return (schema[Kind] === 'This' || schema[Kind] === 'Ref')\n ? Resolve(schema, references)\n : schema;\n}\n","import { IsArray, IsBoolean, IsBigInt, IsDate, IsNull, IsNumber, IsObject, IsString, IsSymbol, IsUint8Array, IsUndefined } from '../guard/index.mjs';\nimport { TypeBoxError } from '../../type/error/index.mjs';\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nexport class ValueHashError extends TypeBoxError {\n constructor(value) {\n super(`Unable to hash value`);\n this.value = value;\n }\n}\n// ------------------------------------------------------------------\n// ByteMarker\n// ------------------------------------------------------------------\nvar ByteMarker;\n(function (ByteMarker) {\n ByteMarker[ByteMarker[\"Undefined\"] = 0] = \"Undefined\";\n ByteMarker[ByteMarker[\"Null\"] = 1] = \"Null\";\n ByteMarker[ByteMarker[\"Boolean\"] = 2] = \"Boolean\";\n ByteMarker[ByteMarker[\"Number\"] = 3] = \"Number\";\n ByteMarker[ByteMarker[\"String\"] = 4] = \"String\";\n ByteMarker[ByteMarker[\"Object\"] = 5] = \"Object\";\n ByteMarker[ByteMarker[\"Array\"] = 6] = \"Array\";\n ByteMarker[ByteMarker[\"Date\"] = 7] = \"Date\";\n ByteMarker[ByteMarker[\"Uint8Array\"] = 8] = \"Uint8Array\";\n ByteMarker[ByteMarker[\"Symbol\"] = 9] = \"Symbol\";\n ByteMarker[ByteMarker[\"BigInt\"] = 10] = \"BigInt\";\n})(ByteMarker || (ByteMarker = {}));\n// ------------------------------------------------------------------\n// State\n// ------------------------------------------------------------------\nlet Accumulator = BigInt('14695981039346656037');\nconst [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)];\nconst Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));\nconst F64 = new Float64Array(1);\nconst F64In = new DataView(F64.buffer);\nconst F64Out = new Uint8Array(F64.buffer);\n// ------------------------------------------------------------------\n// NumberToBytes\n// ------------------------------------------------------------------\nfunction* NumberToBytes(value) {\n const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8);\n for (let i = 0; i < byteCount; i++) {\n yield (value >> (8 * (byteCount - 1 - i))) & 0xff;\n }\n}\n// ------------------------------------------------------------------\n// Hashing Functions\n// ------------------------------------------------------------------\nfunction ArrayType(value) {\n FNV1A64(ByteMarker.Array);\n for (const item of value) {\n Visit(item);\n }\n}\nfunction BooleanType(value) {\n FNV1A64(ByteMarker.Boolean);\n FNV1A64(value ? 1 : 0);\n}\nfunction BigIntType(value) {\n FNV1A64(ByteMarker.BigInt);\n F64In.setBigInt64(0, value);\n for (const byte of F64Out) {\n FNV1A64(byte);\n }\n}\nfunction DateType(value) {\n FNV1A64(ByteMarker.Date);\n Visit(value.getTime());\n}\nfunction NullType(value) {\n FNV1A64(ByteMarker.Null);\n}\nfunction NumberType(value) {\n FNV1A64(ByteMarker.Number);\n F64In.setFloat64(0, value);\n for (const byte of F64Out) {\n FNV1A64(byte);\n }\n}\nfunction ObjectType(value) {\n FNV1A64(ByteMarker.Object);\n for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) {\n Visit(key);\n Visit(value[key]);\n }\n}\nfunction StringType(value) {\n FNV1A64(ByteMarker.String);\n for (let i = 0; i < value.length; i++) {\n for (const byte of NumberToBytes(value.charCodeAt(i))) {\n FNV1A64(byte);\n }\n }\n}\nfunction SymbolType(value) {\n FNV1A64(ByteMarker.Symbol);\n Visit(value.description);\n}\nfunction Uint8ArrayType(value) {\n FNV1A64(ByteMarker.Uint8Array);\n for (let i = 0; i < value.length; i++) {\n FNV1A64(value[i]);\n }\n}\nfunction UndefinedType(value) {\n return FNV1A64(ByteMarker.Undefined);\n}\nfunction Visit(value) {\n if (IsArray(value))\n return ArrayType(value);\n if (IsBoolean(value))\n return BooleanType(value);\n if (IsBigInt(value))\n return BigIntType(value);\n if (IsDate(value))\n return DateType(value);\n if (IsNull(value))\n return NullType(value);\n if (IsNumber(value))\n return NumberType(value);\n if (IsObject(value))\n return ObjectType(value);\n if (IsString(value))\n return StringType(value);\n if (IsSymbol(value))\n return SymbolType(value);\n if (IsUint8Array(value))\n return Uint8ArrayType(value);\n if (IsUndefined(value))\n return UndefinedType(value);\n throw new ValueHashError(value);\n}\nfunction FNV1A64(byte) {\n Accumulator = Accumulator ^ Bytes[byte];\n Accumulator = (Accumulator * Prime) % Size;\n}\n// ------------------------------------------------------------------\n// Hash\n// ------------------------------------------------------------------\n/** Creates a FNV1A-64 non cryptographic hash of the given value */\nexport function Hash(value) {\n Accumulator = BigInt('14695981039346656037');\n Visit(value);\n return Accumulator;\n}\n","import { TypeSystemPolicy } from '../../system/index.mjs';\nimport { Deref, Pushref } from '../deref/index.mjs';\nimport { Hash } from '../hash/index.mjs';\nimport { Kind } from '../../type/symbols/index.mjs';\nimport { KeyOfPattern } from '../../type/keyof/index.mjs';\nimport { ExtendsUndefinedCheck } from '../../type/extends/index.mjs';\nimport { TypeRegistry, FormatRegistry } from '../../type/registry/index.mjs';\nimport { TypeBoxError } from '../../type/error/index.mjs';\nimport { Never } from '../../type/never/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../guard/index.mjs';\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nimport { IsSchema } from '../../type/guard/kind.mjs';\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nexport class ValueCheckUnknownTypeError extends TypeBoxError {\n constructor(schema) {\n super(`Unknown type`);\n this.schema = schema;\n }\n}\n// ------------------------------------------------------------------\n// TypeGuards\n// ------------------------------------------------------------------\nfunction IsAnyOrUnknown(schema) {\n return schema[Kind] === 'Any' || schema[Kind] === 'Unknown';\n}\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nfunction IsDefined(value) {\n return value !== undefined;\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\nfunction FromAny(schema, references, value) {\n return true;\n}\nfunction FromArgument(schema, references, value) {\n return true;\n}\nfunction FromArray(schema, references, value) {\n if (!IsArray(value))\n return false;\n if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {\n return false;\n }\n if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {\n return false;\n }\n if (!value.every((value) => Visit(schema.items, references, value))) {\n return false;\n }\n // prettier-ignore\n if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) {\n const hashed = Hash(element);\n if (set.has(hashed)) {\n return false;\n }\n else {\n set.add(hashed);\n }\n } return true; })())) {\n return false;\n }\n // contains\n if (!(IsDefined(schema.contains) || IsNumber(schema.minContains) || IsNumber(schema.maxContains))) {\n return true; // exit\n }\n const containsSchema = IsDefined(schema.contains) ? schema.contains : Never();\n const containsCount = value.reduce((acc, value) => (Visit(containsSchema, references, value) ? acc + 1 : acc), 0);\n if (containsCount === 0) {\n return false;\n }\n if (IsNumber(schema.minContains) && containsCount < schema.minContains) {\n return false;\n }\n if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) {\n return false;\n }\n return true;\n}\nfunction FromAsyncIterator(schema, references, value) {\n return IsAsyncIterator(value);\n}\nfunction FromBigInt(schema, references, value) {\n if (!IsBigInt(value))\n return false;\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n return false;\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n return false;\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n return false;\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n return false;\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {\n return false;\n }\n return true;\n}\nfunction FromBoolean(schema, references, value) {\n return IsBoolean(value);\n}\nfunction FromConstructor(schema, references, value) {\n return Visit(schema.returns, references, value.prototype);\n}\nfunction FromDate(schema, references, value) {\n if (!IsDate(value))\n return false;\n if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {\n return false;\n }\n if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {\n return false;\n }\n if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {\n return false;\n }\n if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {\n return false;\n }\n if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {\n return false;\n }\n return true;\n}\nfunction FromFunction(schema, references, value) {\n return IsFunction(value);\n}\nfunction FromImport(schema, references, value) {\n const definitions = globalThis.Object.values(schema.$defs);\n const target = schema.$defs[schema.$ref];\n return Visit(target, [...references, ...definitions], value);\n}\nfunction FromInteger(schema, references, value) {\n if (!IsInteger(value)) {\n return false;\n }\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n return false;\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n return false;\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n return false;\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n return false;\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n return false;\n }\n return true;\n}\nfunction FromIntersect(schema, references, value) {\n const check1 = schema.allOf.every((schema) => Visit(schema, references, value));\n if (schema.unevaluatedProperties === false) {\n const keyPattern = new RegExp(KeyOfPattern(schema));\n const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key));\n return check1 && check2;\n }\n else if (IsSchema(schema.unevaluatedProperties)) {\n const keyCheck = new RegExp(KeyOfPattern(schema));\n const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key]));\n return check1 && check2;\n }\n else {\n return check1;\n }\n}\nfunction FromIterator(schema, references, value) {\n return IsIterator(value);\n}\nfunction FromLiteral(schema, references, value) {\n return value === schema.const;\n}\nfunction FromNever(schema, references, value) {\n return false;\n}\nfunction FromNot(schema, references, value) {\n return !Visit(schema.not, references, value);\n}\nfunction FromNull(schema, references, value) {\n return IsNull(value);\n}\nfunction FromNumber(schema, references, value) {\n if (!TypeSystemPolicy.IsNumberLike(value))\n return false;\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n return false;\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n return false;\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n return false;\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n return false;\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n return false;\n }\n return true;\n}\nfunction FromObject(schema, references, value) {\n if (!TypeSystemPolicy.IsObjectLike(value))\n return false;\n if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n return false;\n }\n if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n return false;\n }\n const knownKeys = Object.getOwnPropertyNames(schema.properties);\n for (const knownKey of knownKeys) {\n const property = schema.properties[knownKey];\n if (schema.required && schema.required.includes(knownKey)) {\n if (!Visit(property, references, value[knownKey])) {\n return false;\n }\n if ((ExtendsUndefinedCheck(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) {\n return false;\n }\n }\n else {\n if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) {\n return false;\n }\n }\n }\n if (schema.additionalProperties === false) {\n const valueKeys = Object.getOwnPropertyNames(value);\n // optimization: value is valid if schemaKey length matches the valueKey length\n if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) {\n return true;\n }\n else {\n return valueKeys.every((valueKey) => knownKeys.includes(valueKey));\n }\n }\n else if (typeof schema.additionalProperties === 'object') {\n const valueKeys = Object.getOwnPropertyNames(value);\n return valueKeys.every((key) => knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key]));\n }\n else {\n return true;\n }\n}\nfunction FromPromise(schema, references, value) {\n return IsPromise(value);\n}\nfunction FromRecord(schema, references, value) {\n if (!TypeSystemPolicy.IsRecordLike(value)) {\n return false;\n }\n if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n return false;\n }\n if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n return false;\n }\n const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];\n const regex = new RegExp(patternKey);\n // prettier-ignore\n const check1 = Object.entries(value).every(([key, value]) => {\n return (regex.test(key)) ? Visit(patternSchema, references, value) : true;\n });\n // prettier-ignore\n const check2 = typeof schema.additionalProperties === 'object' ? Object.entries(value).every(([key, value]) => {\n return (!regex.test(key)) ? Visit(schema.additionalProperties, references, value) : true;\n }) : true;\n const check3 = schema.additionalProperties === false\n ? Object.getOwnPropertyNames(value).every((key) => {\n return regex.test(key);\n })\n : true;\n return check1 && check2 && check3;\n}\nfunction FromRef(schema, references, value) {\n return Visit(Deref(schema, references), references, value);\n}\nfunction FromRegExp(schema, references, value) {\n const regex = new RegExp(schema.source, schema.flags);\n if (IsDefined(schema.minLength)) {\n if (!(value.length >= schema.minLength))\n return false;\n }\n if (IsDefined(schema.maxLength)) {\n if (!(value.length <= schema.maxLength))\n return false;\n }\n return regex.test(value);\n}\nfunction FromString(schema, references, value) {\n if (!IsString(value)) {\n return false;\n }\n if (IsDefined(schema.minLength)) {\n if (!(value.length >= schema.minLength))\n return false;\n }\n if (IsDefined(schema.maxLength)) {\n if (!(value.length <= schema.maxLength))\n return false;\n }\n if (IsDefined(schema.pattern)) {\n const regex = new RegExp(schema.pattern);\n if (!regex.test(value))\n return false;\n }\n if (IsDefined(schema.format)) {\n if (!FormatRegistry.Has(schema.format))\n return false;\n const func = FormatRegistry.Get(schema.format);\n return func(value);\n }\n return true;\n}\nfunction FromSymbol(schema, references, value) {\n return IsSymbol(value);\n}\nfunction FromTemplateLiteral(schema, references, value) {\n return IsString(value) && new RegExp(schema.pattern).test(value);\n}\nfunction FromThis(schema, references, value) {\n return Visit(Deref(schema, references), references, value);\n}\nfunction FromTuple(schema, references, value) {\n if (!IsArray(value)) {\n return false;\n }\n if (schema.items === undefined && !(value.length === 0)) {\n return false;\n }\n if (!(value.length === schema.maxItems)) {\n return false;\n }\n if (!schema.items) {\n return true;\n }\n for (let i = 0; i < schema.items.length; i++) {\n if (!Visit(schema.items[i], references, value[i]))\n return false;\n }\n return true;\n}\nfunction FromUndefined(schema, references, value) {\n return IsUndefined(value);\n}\nfunction FromUnion(schema, references, value) {\n return schema.anyOf.some((inner) => Visit(inner, references, value));\n}\nfunction FromUint8Array(schema, references, value) {\n if (!IsUint8Array(value)) {\n return false;\n }\n if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {\n return false;\n }\n if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {\n return false;\n }\n return true;\n}\nfunction FromUnknown(schema, references, value) {\n return true;\n}\nfunction FromVoid(schema, references, value) {\n return TypeSystemPolicy.IsVoidLike(value);\n}\nfunction FromKind(schema, references, value) {\n if (!TypeRegistry.Has(schema[Kind]))\n return false;\n const func = TypeRegistry.Get(schema[Kind]);\n return func(schema, value);\n}\nfunction Visit(schema, references, value) {\n const references_ = IsDefined(schema.$id) ? Pushref(schema, references) : references;\n const schema_ = schema;\n switch (schema_[Kind]) {\n case 'Any':\n return FromAny(schema_, references_, value);\n case 'Argument':\n return FromArgument(schema_, references_, value);\n case 'Array':\n return FromArray(schema_, references_, value);\n case 'AsyncIterator':\n return FromAsyncIterator(schema_, references_, value);\n case 'BigInt':\n return FromBigInt(schema_, references_, value);\n case 'Boolean':\n return FromBoolean(schema_, references_, value);\n case 'Constructor':\n return FromConstructor(schema_, references_, value);\n case 'Date':\n return FromDate(schema_, references_, value);\n case 'Function':\n return FromFunction(schema_, references_, value);\n case 'Import':\n return FromImport(schema_, references_, value);\n case 'Integer':\n return FromInteger(schema_, references_, value);\n case 'Intersect':\n return FromIntersect(schema_, references_, value);\n case 'Iterator':\n return FromIterator(schema_, references_, value);\n case 'Literal':\n return FromLiteral(schema_, references_, value);\n case 'Never':\n return FromNever(schema_, references_, value);\n case 'Not':\n return FromNot(schema_, references_, value);\n case 'Null':\n return FromNull(schema_, references_, value);\n case 'Number':\n return FromNumber(schema_, references_, value);\n case 'Object':\n return FromObject(schema_, references_, value);\n case 'Promise':\n return FromPromise(schema_, references_, value);\n case 'Record':\n return FromRecord(schema_, references_, value);\n case 'Ref':\n return FromRef(schema_, references_, value);\n case 'RegExp':\n return FromRegExp(schema_, references_, value);\n case 'String':\n return FromString(schema_, references_, value);\n case 'Symbol':\n return FromSymbol(schema_, references_, value);\n case 'TemplateLiteral':\n return FromTemplateLiteral(schema_, references_, value);\n case 'This':\n return FromThis(schema_, references_, value);\n case 'Tuple':\n return FromTuple(schema_, references_, value);\n case 'Undefined':\n return FromUndefined(schema_, references_, value);\n case 'Union':\n return FromUnion(schema_, references_, value);\n case 'Uint8Array':\n return FromUint8Array(schema_, references_, value);\n case 'Unknown':\n return FromUnknown(schema_, references_, value);\n case 'Void':\n return FromVoid(schema_, references_, value);\n default:\n if (!TypeRegistry.Has(schema_[Kind]))\n throw new ValueCheckUnknownTypeError(schema_);\n return FromKind(schema_, references_, value);\n }\n}\n/** Returns true if the value matches the given type. */\nexport function Check(...args) {\n return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);\n}\n","import { TypeSystemPolicy } from '../system/index.mjs';\nimport { KeyOfPattern } from '../type/keyof/index.mjs';\nimport { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs';\nimport { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs';\nimport { GetErrorFunction } from './function.mjs';\nimport { TypeBoxError } from '../type/error/index.mjs';\nimport { Deref } from '../value/deref/index.mjs';\nimport { Hash } from '../value/hash/index.mjs';\nimport { Check } from '../value/check/index.mjs';\nimport { Kind } from '../type/symbols/index.mjs';\nimport { Never } from '../type/never/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\n// prettier-ignore\nimport { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../value/guard/index.mjs';\n// ------------------------------------------------------------------\n// ValueErrorType\n// ------------------------------------------------------------------\nexport var ValueErrorType;\n(function (ValueErrorType) {\n ValueErrorType[ValueErrorType[\"ArrayContains\"] = 0] = \"ArrayContains\";\n ValueErrorType[ValueErrorType[\"ArrayMaxContains\"] = 1] = \"ArrayMaxContains\";\n ValueErrorType[ValueErrorType[\"ArrayMaxItems\"] = 2] = \"ArrayMaxItems\";\n ValueErrorType[ValueErrorType[\"ArrayMinContains\"] = 3] = \"ArrayMinContains\";\n ValueErrorType[ValueErrorType[\"ArrayMinItems\"] = 4] = \"ArrayMinItems\";\n ValueErrorType[ValueErrorType[\"ArrayUniqueItems\"] = 5] = \"ArrayUniqueItems\";\n ValueErrorType[ValueErrorType[\"Array\"] = 6] = \"Array\";\n ValueErrorType[ValueErrorType[\"AsyncIterator\"] = 7] = \"AsyncIterator\";\n ValueErrorType[ValueErrorType[\"BigIntExclusiveMaximum\"] = 8] = \"BigIntExclusiveMaximum\";\n ValueErrorType[ValueErrorType[\"BigIntExclusiveMinimum\"] = 9] = \"BigIntExclusiveMinimum\";\n ValueErrorType[ValueErrorType[\"BigIntMaximum\"] = 10] = \"BigIntMaximum\";\n ValueErrorType[ValueErrorType[\"BigIntMinimum\"] = 11] = \"BigIntMinimum\";\n ValueErrorType[ValueErrorType[\"BigIntMultipleOf\"] = 12] = \"BigIntMultipleOf\";\n ValueErrorType[ValueErrorType[\"BigInt\"] = 13] = \"BigInt\";\n ValueErrorType[ValueErrorType[\"Boolean\"] = 14] = \"Boolean\";\n ValueErrorType[ValueErrorType[\"DateExclusiveMaximumTimestamp\"] = 15] = \"DateExclusiveMaximumTimestamp\";\n ValueErrorType[ValueErrorType[\"DateExclusiveMinimumTimestamp\"] = 16] = \"DateExclusiveMinimumTimestamp\";\n ValueErrorType[ValueErrorType[\"DateMaximumTimestamp\"] = 17] = \"DateMaximumTimestamp\";\n ValueErrorType[ValueErrorType[\"DateMinimumTimestamp\"] = 18] = \"DateMinimumTimestamp\";\n ValueErrorType[ValueErrorType[\"DateMultipleOfTimestamp\"] = 19] = \"DateMultipleOfTimestamp\";\n ValueErrorType[ValueErrorType[\"Date\"] = 20] = \"Date\";\n ValueErrorType[ValueErrorType[\"Function\"] = 21] = \"Function\";\n ValueErrorType[ValueErrorType[\"IntegerExclusiveMaximum\"] = 22] = \"IntegerExclusiveMaximum\";\n ValueErrorType[ValueErrorType[\"IntegerExclusiveMinimum\"] = 23] = \"IntegerExclusiveMinimum\";\n ValueErrorType[ValueErrorType[\"IntegerMaximum\"] = 24] = \"IntegerMaximum\";\n ValueErrorType[ValueErrorType[\"IntegerMinimum\"] = 25] = \"IntegerMinimum\";\n ValueErrorType[ValueErrorType[\"IntegerMultipleOf\"] = 26] = \"IntegerMultipleOf\";\n ValueErrorType[ValueErrorType[\"Integer\"] = 27] = \"Integer\";\n ValueErrorType[ValueErrorType[\"IntersectUnevaluatedProperties\"] = 28] = \"IntersectUnevaluatedProperties\";\n ValueErrorType[ValueErrorType[\"Intersect\"] = 29] = \"Intersect\";\n ValueErrorType[ValueErrorType[\"Iterator\"] = 30] = \"Iterator\";\n ValueErrorType[ValueErrorType[\"Kind\"] = 31] = \"Kind\";\n ValueErrorType[ValueErrorType[\"Literal\"] = 32] = \"Literal\";\n ValueErrorType[ValueErrorType[\"Never\"] = 33] = \"Never\";\n ValueErrorType[ValueErrorType[\"Not\"] = 34] = \"Not\";\n ValueErrorType[ValueErrorType[\"Null\"] = 35] = \"Null\";\n ValueErrorType[ValueErrorType[\"NumberExclusiveMaximum\"] = 36] = \"NumberExclusiveMaximum\";\n ValueErrorType[ValueErrorType[\"NumberExclusiveMinimum\"] = 37] = \"NumberExclusiveMinimum\";\n ValueErrorType[ValueErrorType[\"NumberMaximum\"] = 38] = \"NumberMaximum\";\n ValueErrorType[ValueErrorType[\"NumberMinimum\"] = 39] = \"NumberMinimum\";\n ValueErrorType[ValueErrorType[\"NumberMultipleOf\"] = 40] = \"NumberMultipleOf\";\n ValueErrorType[ValueErrorType[\"Number\"] = 41] = \"Number\";\n ValueErrorType[ValueErrorType[\"ObjectAdditionalProperties\"] = 42] = \"ObjectAdditionalProperties\";\n ValueErrorType[ValueErrorType[\"ObjectMaxProperties\"] = 43] = \"ObjectMaxProperties\";\n ValueErrorType[ValueErrorType[\"ObjectMinProperties\"] = 44] = \"ObjectMinProperties\";\n ValueErrorType[ValueErrorType[\"ObjectRequiredProperty\"] = 45] = \"ObjectRequiredProperty\";\n ValueErrorType[ValueErrorType[\"Object\"] = 46] = \"Object\";\n ValueErrorType[ValueErrorType[\"Promise\"] = 47] = \"Promise\";\n ValueErrorType[ValueErrorType[\"RegExp\"] = 48] = \"RegExp\";\n ValueErrorType[ValueErrorType[\"StringFormatUnknown\"] = 49] = \"StringFormatUnknown\";\n ValueErrorType[ValueErrorType[\"StringFormat\"] = 50] = \"StringFormat\";\n ValueErrorType[ValueErrorType[\"StringMaxLength\"] = 51] = \"StringMaxLength\";\n ValueErrorType[ValueErrorType[\"StringMinLength\"] = 52] = \"StringMinLength\";\n ValueErrorType[ValueErrorType[\"StringPattern\"] = 53] = \"StringPattern\";\n ValueErrorType[ValueErrorType[\"String\"] = 54] = \"String\";\n ValueErrorType[ValueErrorType[\"Symbol\"] = 55] = \"Symbol\";\n ValueErrorType[ValueErrorType[\"TupleLength\"] = 56] = \"TupleLength\";\n ValueErrorType[ValueErrorType[\"Tuple\"] = 57] = \"Tuple\";\n ValueErrorType[ValueErrorType[\"Uint8ArrayMaxByteLength\"] = 58] = \"Uint8ArrayMaxByteLength\";\n ValueErrorType[ValueErrorType[\"Uint8ArrayMinByteLength\"] = 59] = \"Uint8ArrayMinByteLength\";\n ValueErrorType[ValueErrorType[\"Uint8Array\"] = 60] = \"Uint8Array\";\n ValueErrorType[ValueErrorType[\"Undefined\"] = 61] = \"Undefined\";\n ValueErrorType[ValueErrorType[\"Union\"] = 62] = \"Union\";\n ValueErrorType[ValueErrorType[\"Void\"] = 63] = \"Void\";\n})(ValueErrorType || (ValueErrorType = {}));\n// ------------------------------------------------------------------\n// ValueErrors\n// ------------------------------------------------------------------\nexport class ValueErrorsUnknownTypeError extends TypeBoxError {\n constructor(schema) {\n super('Unknown type');\n this.schema = schema;\n }\n}\n// ------------------------------------------------------------------\n// EscapeKey\n// ------------------------------------------------------------------\nfunction EscapeKey(key) {\n return key.replace(/~/g, '~0').replace(/\\//g, '~1'); // RFC6901 Path\n}\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nfunction IsDefined(value) {\n return value !== undefined;\n}\n// ------------------------------------------------------------------\n// ValueErrorIterator\n// ------------------------------------------------------------------\nexport class ValueErrorIterator {\n constructor(iterator) {\n this.iterator = iterator;\n }\n [Symbol.iterator]() {\n return this.iterator;\n }\n /** Returns the first value error or undefined if no errors */\n First() {\n const next = this.iterator.next();\n return next.done ? undefined : next.value;\n }\n}\n// --------------------------------------------------------------------------\n// Create\n// --------------------------------------------------------------------------\nfunction Create(errorType, schema, path, value, errors = []) {\n return {\n type: errorType,\n schema,\n path,\n value,\n message: GetErrorFunction()({ errorType, path, schema, value, errors }),\n errors,\n };\n}\n// --------------------------------------------------------------------------\n// Types\n// --------------------------------------------------------------------------\nfunction* FromAny(schema, references, path, value) { }\nfunction* FromArgument(schema, references, path, value) { }\nfunction* FromArray(schema, references, path, value) {\n if (!IsArray(value)) {\n return yield Create(ValueErrorType.Array, schema, path, value);\n }\n if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {\n yield Create(ValueErrorType.ArrayMinItems, schema, path, value);\n }\n if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {\n yield Create(ValueErrorType.ArrayMaxItems, schema, path, value);\n }\n for (let i = 0; i < value.length; i++) {\n yield* Visit(schema.items, references, `${path}/${i}`, value[i]);\n }\n // prettier-ignore\n if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) {\n const hashed = Hash(element);\n if (set.has(hashed)) {\n return false;\n }\n else {\n set.add(hashed);\n }\n } return true; })())) {\n yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value);\n }\n // contains\n if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) {\n return;\n }\n const containsSchema = IsDefined(schema.contains) ? schema.contains : Never();\n const containsCount = value.reduce((acc, value, index) => (Visit(containsSchema, references, `${path}${index}`, value).next().done === true ? acc + 1 : acc), 0);\n if (containsCount === 0) {\n yield Create(ValueErrorType.ArrayContains, schema, path, value);\n }\n if (IsNumber(schema.minContains) && containsCount < schema.minContains) {\n yield Create(ValueErrorType.ArrayMinContains, schema, path, value);\n }\n if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) {\n yield Create(ValueErrorType.ArrayMaxContains, schema, path, value);\n }\n}\nfunction* FromAsyncIterator(schema, references, path, value) {\n if (!IsAsyncIterator(value))\n yield Create(ValueErrorType.AsyncIterator, schema, path, value);\n}\nfunction* FromBigInt(schema, references, path, value) {\n if (!IsBigInt(value))\n return yield Create(ValueErrorType.BigInt, schema, path, value);\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value);\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value);\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n yield Create(ValueErrorType.BigIntMaximum, schema, path, value);\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n yield Create(ValueErrorType.BigIntMinimum, schema, path, value);\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {\n yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value);\n }\n}\nfunction* FromBoolean(schema, references, path, value) {\n if (!IsBoolean(value))\n yield Create(ValueErrorType.Boolean, schema, path, value);\n}\nfunction* FromConstructor(schema, references, path, value) {\n yield* Visit(schema.returns, references, path, value.prototype);\n}\nfunction* FromDate(schema, references, path, value) {\n if (!IsDate(value))\n return yield Create(ValueErrorType.Date, schema, path, value);\n if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {\n yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value);\n }\n if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {\n yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value);\n }\n if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {\n yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value);\n }\n if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {\n yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value);\n }\n if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {\n yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value);\n }\n}\nfunction* FromFunction(schema, references, path, value) {\n if (!IsFunction(value))\n yield Create(ValueErrorType.Function, schema, path, value);\n}\nfunction* FromImport(schema, references, path, value) {\n const definitions = globalThis.Object.values(schema.$defs);\n const target = schema.$defs[schema.$ref];\n yield* Visit(target, [...references, ...definitions], path, value);\n}\nfunction* FromInteger(schema, references, path, value) {\n if (!IsInteger(value))\n return yield Create(ValueErrorType.Integer, schema, path, value);\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value);\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value);\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n yield Create(ValueErrorType.IntegerMaximum, schema, path, value);\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n yield Create(ValueErrorType.IntegerMinimum, schema, path, value);\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value);\n }\n}\nfunction* FromIntersect(schema, references, path, value) {\n let hasError = false;\n for (const inner of schema.allOf) {\n for (const error of Visit(inner, references, path, value)) {\n hasError = true;\n yield error;\n }\n }\n if (hasError) {\n return yield Create(ValueErrorType.Intersect, schema, path, value);\n }\n if (schema.unevaluatedProperties === false) {\n const keyCheck = new RegExp(KeyOfPattern(schema));\n for (const valueKey of Object.getOwnPropertyNames(value)) {\n if (!keyCheck.test(valueKey)) {\n yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value);\n }\n }\n }\n if (typeof schema.unevaluatedProperties === 'object') {\n const keyCheck = new RegExp(KeyOfPattern(schema));\n for (const valueKey of Object.getOwnPropertyNames(value)) {\n if (!keyCheck.test(valueKey)) {\n const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next();\n if (!next.done)\n yield next.value; // yield interior\n }\n }\n }\n}\nfunction* FromIterator(schema, references, path, value) {\n if (!IsIterator(value))\n yield Create(ValueErrorType.Iterator, schema, path, value);\n}\nfunction* FromLiteral(schema, references, path, value) {\n if (!(value === schema.const))\n yield Create(ValueErrorType.Literal, schema, path, value);\n}\nfunction* FromNever(schema, references, path, value) {\n yield Create(ValueErrorType.Never, schema, path, value);\n}\nfunction* FromNot(schema, references, path, value) {\n if (Visit(schema.not, references, path, value).next().done === true)\n yield Create(ValueErrorType.Not, schema, path, value);\n}\nfunction* FromNull(schema, references, path, value) {\n if (!IsNull(value))\n yield Create(ValueErrorType.Null, schema, path, value);\n}\nfunction* FromNumber(schema, references, path, value) {\n if (!TypeSystemPolicy.IsNumberLike(value))\n return yield Create(ValueErrorType.Number, schema, path, value);\n if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value);\n }\n if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value);\n }\n if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n yield Create(ValueErrorType.NumberMaximum, schema, path, value);\n }\n if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n yield Create(ValueErrorType.NumberMinimum, schema, path, value);\n }\n if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n yield Create(ValueErrorType.NumberMultipleOf, schema, path, value);\n }\n}\nfunction* FromObject(schema, references, path, value) {\n if (!TypeSystemPolicy.IsObjectLike(value))\n return yield Create(ValueErrorType.Object, schema, path, value);\n if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);\n }\n if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);\n }\n const requiredKeys = Array.isArray(schema.required) ? schema.required : [];\n const knownKeys = Object.getOwnPropertyNames(schema.properties);\n const unknownKeys = Object.getOwnPropertyNames(value);\n for (const requiredKey of requiredKeys) {\n if (unknownKeys.includes(requiredKey))\n continue;\n yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${EscapeKey(requiredKey)}`, undefined);\n }\n if (schema.additionalProperties === false) {\n for (const valueKey of unknownKeys) {\n if (!knownKeys.includes(valueKey)) {\n yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);\n }\n }\n }\n if (typeof schema.additionalProperties === 'object') {\n for (const valueKey of unknownKeys) {\n if (knownKeys.includes(valueKey))\n continue;\n yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);\n }\n }\n for (const knownKey of knownKeys) {\n const property = schema.properties[knownKey];\n if (schema.required && schema.required.includes(knownKey)) {\n yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);\n if (ExtendsUndefinedCheck(schema) && !(knownKey in value)) {\n yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${EscapeKey(knownKey)}`, undefined);\n }\n }\n else {\n if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) {\n yield* Visit(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);\n }\n }\n }\n}\nfunction* FromPromise(schema, references, path, value) {\n if (!IsPromise(value))\n yield Create(ValueErrorType.Promise, schema, path, value);\n}\nfunction* FromRecord(schema, references, path, value) {\n if (!TypeSystemPolicy.IsRecordLike(value))\n return yield Create(ValueErrorType.Object, schema, path, value);\n if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);\n }\n if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);\n }\n const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];\n const regex = new RegExp(patternKey);\n for (const [propertyKey, propertyValue] of Object.entries(value)) {\n if (regex.test(propertyKey))\n yield* Visit(patternSchema, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);\n }\n if (typeof schema.additionalProperties === 'object') {\n for (const [propertyKey, propertyValue] of Object.entries(value)) {\n if (!regex.test(propertyKey))\n yield* Visit(schema.additionalProperties, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);\n }\n }\n if (schema.additionalProperties === false) {\n for (const [propertyKey, propertyValue] of Object.entries(value)) {\n if (regex.test(propertyKey))\n continue;\n return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(propertyKey)}`, propertyValue);\n }\n }\n}\nfunction* FromRef(schema, references, path, value) {\n yield* Visit(Deref(schema, references), references, path, value);\n}\nfunction* FromRegExp(schema, references, path, value) {\n if (!IsString(value))\n return yield Create(ValueErrorType.String, schema, path, value);\n if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {\n yield Create(ValueErrorType.StringMinLength, schema, path, value);\n }\n if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {\n yield Create(ValueErrorType.StringMaxLength, schema, path, value);\n }\n const regex = new RegExp(schema.source, schema.flags);\n if (!regex.test(value)) {\n return yield Create(ValueErrorType.RegExp, schema, path, value);\n }\n}\nfunction* FromString(schema, references, path, value) {\n if (!IsString(value))\n return yield Create(ValueErrorType.String, schema, path, value);\n if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {\n yield Create(ValueErrorType.StringMinLength, schema, path, value);\n }\n if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {\n yield Create(ValueErrorType.StringMaxLength, schema, path, value);\n }\n if (IsString(schema.pattern)) {\n const regex = new RegExp(schema.pattern);\n if (!regex.test(value)) {\n yield Create(ValueErrorType.StringPattern, schema, path, value);\n }\n }\n if (IsString(schema.format)) {\n if (!FormatRegistry.Has(schema.format)) {\n yield Create(ValueErrorType.StringFormatUnknown, schema, path, value);\n }\n else {\n const format = FormatRegistry.Get(schema.format);\n if (!format(value)) {\n yield Create(ValueErrorType.StringFormat, schema, path, value);\n }\n }\n }\n}\nfunction* FromSymbol(schema, references, path, value) {\n if (!IsSymbol(value))\n yield Create(ValueErrorType.Symbol, schema, path, value);\n}\nfunction* FromTemplateLiteral(schema, references, path, value) {\n if (!IsString(value))\n return yield Create(ValueErrorType.String, schema, path, value);\n const regex = new RegExp(schema.pattern);\n if (!regex.test(value)) {\n yield Create(ValueErrorType.StringPattern, schema, path, value);\n }\n}\nfunction* FromThis(schema, references, path, value) {\n yield* Visit(Deref(schema, references), references, path, value);\n}\nfunction* FromTuple(schema, references, path, value) {\n if (!IsArray(value))\n return yield Create(ValueErrorType.Tuple, schema, path, value);\n if (schema.items === undefined && !(value.length === 0)) {\n return yield Create(ValueErrorType.TupleLength, schema, path, value);\n }\n if (!(value.length === schema.maxItems)) {\n return yield Create(ValueErrorType.TupleLength, schema, path, value);\n }\n if (!schema.items) {\n return;\n }\n for (let i = 0; i < schema.items.length; i++) {\n yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]);\n }\n}\nfunction* FromUndefined(schema, references, path, value) {\n if (!IsUndefined(value))\n yield Create(ValueErrorType.Undefined, schema, path, value);\n}\nfunction* FromUnion(schema, references, path, value) {\n if (Check(schema, references, value))\n return;\n const errors = schema.anyOf.map((variant) => new ValueErrorIterator(Visit(variant, references, path, value)));\n yield Create(ValueErrorType.Union, schema, path, value, errors);\n}\nfunction* FromUint8Array(schema, references, path, value) {\n if (!IsUint8Array(value))\n return yield Create(ValueErrorType.Uint8Array, schema, path, value);\n if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {\n yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value);\n }\n if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {\n yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value);\n }\n}\nfunction* FromUnknown(schema, references, path, value) { }\nfunction* FromVoid(schema, references, path, value) {\n if (!TypeSystemPolicy.IsVoidLike(value))\n yield Create(ValueErrorType.Void, schema, path, value);\n}\nfunction* FromKind(schema, references, path, value) {\n const check = TypeRegistry.Get(schema[Kind]);\n if (!check(schema, value))\n yield Create(ValueErrorType.Kind, schema, path, value);\n}\nfunction* Visit(schema, references, path, value) {\n const references_ = IsDefined(schema.$id) ? [...references, schema] : references;\n const schema_ = schema;\n switch (schema_[Kind]) {\n case 'Any':\n return yield* FromAny(schema_, references_, path, value);\n case 'Argument':\n return yield* FromArgument(schema_, references_, path, value);\n case 'Array':\n return yield* FromArray(schema_, references_, path, value);\n case 'AsyncIterator':\n return yield* FromAsyncIterator(schema_, references_, path, value);\n case 'BigInt':\n return yield* FromBigInt(schema_, references_, path, value);\n case 'Boolean':\n return yield* FromBoolean(schema_, references_, path, value);\n case 'Constructor':\n return yield* FromConstructor(schema_, references_, path, value);\n case 'Date':\n return yield* FromDate(schema_, references_, path, value);\n case 'Function':\n return yield* FromFunction(schema_, references_, path, value);\n case 'Import':\n return yield* FromImport(schema_, references_, path, value);\n case 'Integer':\n return yield* FromInteger(schema_, references_, path, value);\n case 'Intersect':\n return yield* FromIntersect(schema_, references_, path, value);\n case 'Iterator':\n return yield* FromIterator(schema_, references_, path, value);\n case 'Literal':\n return yield* FromLiteral(schema_, references_, path, value);\n case 'Never':\n return yield* FromNever(schema_, references_, path, value);\n case 'Not':\n return yield* FromNot(schema_, references_, path, value);\n case 'Null':\n return yield* FromNull(schema_, references_, path, value);\n case 'Number':\n return yield* FromNumber(schema_, references_, path, value);\n case 'Object':\n return yield* FromObject(schema_, references_, path, value);\n case 'Promise':\n return yield* FromPromise(schema_, references_, path, value);\n case 'Record':\n return yield* FromRecord(schema_, references_, path, value);\n case 'Ref':\n return yield* FromRef(schema_, references_, path, value);\n case 'RegExp':\n return yield* FromRegExp(schema_, references_, path, value);\n case 'String':\n return yield* FromString(schema_, references_, path, value);\n case 'Symbol':\n return yield* FromSymbol(schema_, references_, path, value);\n case 'TemplateLiteral':\n return yield* FromTemplateLiteral(schema_, references_, path, value);\n case 'This':\n return yield* FromThis(schema_, references_, path, value);\n case 'Tuple':\n return yield* FromTuple(schema_, references_, path, value);\n case 'Undefined':\n return yield* FromUndefined(schema_, references_, path, value);\n case 'Union':\n return yield* FromUnion(schema_, references_, path, value);\n case 'Uint8Array':\n return yield* FromUint8Array(schema_, references_, path, value);\n case 'Unknown':\n return yield* FromUnknown(schema_, references_, path, value);\n case 'Void':\n return yield* FromVoid(schema_, references_, path, value);\n default:\n if (!TypeRegistry.Has(schema_[Kind]))\n throw new ValueErrorsUnknownTypeError(schema);\n return yield* FromKind(schema_, references_, path, value);\n }\n}\n/** Returns an iterator for each error in this value. */\nexport function Errors(...args) {\n const iterator = args.length === 3 ? Visit(args[0], args[1], '', args[2]) : Visit(args[0], [], '', args[1]);\n return new ValueErrorIterator(iterator);\n}\n","// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsDate, IsMap, IsSet, IsObject, IsTypedArray, IsValueType } from '../guard/index.mjs';\n// ------------------------------------------------------------------\n// Clonable\n// ------------------------------------------------------------------\nfunction FromObject(value) {\n const Acc = {};\n for (const key of Object.getOwnPropertyNames(value)) {\n Acc[key] = Clone(value[key]);\n }\n for (const key of Object.getOwnPropertySymbols(value)) {\n Acc[key] = Clone(value[key]);\n }\n return Acc;\n}\nfunction FromArray(value) {\n return value.map((element) => Clone(element));\n}\nfunction FromTypedArray(value) {\n return value.slice();\n}\nfunction FromMap(value) {\n return new Map(Clone([...value.entries()]));\n}\nfunction FromSet(value) {\n return new Set(Clone([...value.entries()]));\n}\nfunction FromDate(value) {\n return new Date(value.toISOString());\n}\nfunction FromValue(value) {\n return value;\n}\n// ------------------------------------------------------------------\n// Clone\n// ------------------------------------------------------------------\n/** Returns a clone of the given value */\nexport function Clone(value) {\n if (IsArray(value))\n return FromArray(value);\n if (IsDate(value))\n return FromDate(value);\n if (IsTypedArray(value))\n return FromTypedArray(value);\n if (IsMap(value))\n return FromMap(value);\n if (IsSet(value))\n return FromSet(value);\n if (IsObject(value))\n return FromObject(value);\n if (IsValueType(value))\n return FromValue(value);\n throw new Error('ValueClone: Unable to clone value');\n}\n","import { Check } from '../check/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Deref, Pushref } from '../deref/index.mjs';\nimport { Kind } from '../../type/symbols/index.mjs';\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nimport { IsArray, IsDate, IsFunction, IsObject, IsUndefined, HasPropertyKey } from '../guard/index.mjs';\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nimport { IsKind } from '../../type/guard/kind.mjs';\n// ------------------------------------------------------------------\n// ValueOrDefault\n// ------------------------------------------------------------------\nfunction ValueOrDefault(schema, value) {\n const defaultValue = HasPropertyKey(schema, 'default') ? schema.default : undefined;\n const clone = IsFunction(defaultValue) ? defaultValue() : Clone(defaultValue);\n return IsUndefined(value) ? clone : IsObject(value) && IsObject(clone) ? Object.assign(clone, value) : value;\n}\n// ------------------------------------------------------------------\n// HasDefaultProperty\n// ------------------------------------------------------------------\nfunction HasDefaultProperty(schema) {\n return IsKind(schema) && 'default' in schema;\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\nfunction FromArray(schema, references, value) {\n // if the value is an array, we attempt to initialize it's elements\n if (IsArray(value)) {\n for (let i = 0; i < value.length; i++) {\n value[i] = Visit(schema.items, references, value[i]);\n }\n return value;\n }\n // ... otherwise use default initialization\n const defaulted = ValueOrDefault(schema, value);\n if (!IsArray(defaulted))\n return defaulted;\n for (let i = 0; i < defaulted.length; i++) {\n defaulted[i] = Visit(schema.items, references, defaulted[i]);\n }\n return defaulted;\n}\nfunction FromDate(schema, references, value) {\n // special case intercept for dates\n return IsDate(value) ? value : ValueOrDefault(schema, value);\n}\nfunction FromImport(schema, references, value) {\n const definitions = globalThis.Object.values(schema.$defs);\n const target = schema.$defs[schema.$ref];\n return Visit(target, [...references, ...definitions], value);\n}\nfunction FromIntersect(schema, references, value) {\n const defaulted = ValueOrDefault(schema, value);\n return schema.allOf.reduce((acc, schema) => {\n const next = Visit(schema, references, defaulted);\n return IsObject(next) ? { ...acc, ...next } : next;\n }, {});\n}\nfunction FromObject(schema, references, value) {\n const defaulted = ValueOrDefault(schema, value);\n // return defaulted\n if (!IsObject(defaulted))\n return defaulted;\n const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties);\n // properties\n for (const key of knownPropertyKeys) {\n // note: we need to traverse into the object and test if the return value\n // yielded a non undefined result. Here we interpret an undefined result as\n // a non assignable property and continue.\n const propertyValue = Visit(schema.properties[key], references, defaulted[key]);\n if (IsUndefined(propertyValue))\n continue;\n defaulted[key] = Visit(schema.properties[key], references, defaulted[key]);\n }\n // return if not additional properties\n if (!HasDefaultProperty(schema.additionalProperties))\n return defaulted;\n // additional properties\n for (const key of Object.getOwnPropertyNames(defaulted)) {\n if (knownPropertyKeys.includes(key))\n continue;\n defaulted[key] = Visit(schema.additionalProperties, references, defaulted[key]);\n }\n return defaulted;\n}\nfunction FromRecord(schema, references, value) {\n const defaulted = ValueOrDefault(schema, value);\n if (!IsObject(defaulted))\n return defaulted;\n const additionalPropertiesSchema = schema.additionalProperties;\n const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0];\n const knownPropertyKey = new RegExp(propertyKeyPattern);\n // properties\n for (const key of Object.getOwnPropertyNames(defaulted)) {\n if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema)))\n continue;\n defaulted[key] = Visit(propertySchema, references, defaulted[key]);\n }\n // return if not additional properties\n if (!HasDefaultProperty(additionalPropertiesSchema))\n return defaulted;\n // additional properties\n for (const key of Object.getOwnPropertyNames(defaulted)) {\n if (knownPropertyKey.test(key))\n continue;\n defaulted[key] = Visit(additionalPropertiesSchema, references, defaulted[key]);\n }\n return defaulted;\n}\nfunction FromRef(schema, references, value) {\n return Visit(Deref(schema, references), references, ValueOrDefault(schema, value));\n}\nfunction FromThis(schema, references, value) {\n return Visit(Deref(schema, references), references, value);\n}\nfunction FromTuple(schema, references, value) {\n const defaulted = ValueOrDefault(schema, value);\n if (!IsArray(defaulted) || IsUndefined(schema.items))\n return defaulted;\n const [items, max] = [schema.items, Math.max(schema.items.length, defaulted.length)];\n for (let i = 0; i < max; i++) {\n if (i < items.length)\n defaulted[i] = Visit(items[i], references, defaulted[i]);\n }\n return defaulted;\n}\nfunction FromUnion(schema, references, value) {\n const defaulted = ValueOrDefault(schema, value);\n for (const inner of schema.anyOf) {\n const result = Visit(inner, references, Clone(defaulted));\n if (Check(inner, references, result)) {\n return result;\n }\n }\n return defaulted;\n}\nfunction Visit(schema, references, value) {\n const references_ = Pushref(schema, references);\n const schema_ = schema;\n switch (schema_[Kind]) {\n case 'Array':\n return FromArray(schema_, references_, value);\n case 'Date':\n return FromDate(schema_, references_, value);\n case 'Import':\n return FromImport(schema_, references_, value);\n case 'Intersect':\n return FromIntersect(schema_, references_, value);\n case 'Object':\n return FromObject(schema_, references_, value);\n case 'Record':\n return FromRecord(schema_, references_, value);\n case 'Ref':\n return FromRef(schema_, references_, value);\n case 'This':\n return FromThis(schema_, references_, value);\n case 'Tuple':\n return FromTuple(schema_, references_, value);\n case 'Union':\n return FromUnion(schema_, references_, value);\n default:\n return ValueOrDefault(schema_, value);\n }\n}\n/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */\nexport function Default(...args) {\n return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);\n}\n","// src/validation/unified/schema-utils.ts\nvar componentNamesCache = /* @__PURE__ */ new Map();\nfunction isUnionSchema(schema) {\n return \"anyOf\" in schema && Array.isArray(schema.anyOf);\n}\nfunction isObjectSchema(schema) {\n return schema.type === \"object\" && \"properties\" in schema;\n}\nfunction isLiteralSchema(schema) {\n return \"const\" in schema;\n}\nfunction getObjectSchemaPropertyNames(schema) {\n if (isObjectSchema(schema)) {\n return Object.keys(schema.properties);\n }\n return [];\n}\nfunction getLiteralValue(schema) {\n if (isLiteralSchema(schema)) {\n return schema.const;\n }\n return void 0;\n}\nfunction extractStandardComponentNames(schema) {\n if (componentNamesCache.has(schema)) {\n return componentNamesCache.get(schema);\n }\n const names = [];\n if (\"anyOf\" in schema && Array.isArray(schema.anyOf)) {\n for (const componentSchema of schema.anyOf) {\n if (isObjectSchema(componentSchema)) {\n const nameProperty = componentSchema.properties?.name;\n if (nameProperty && isLiteralSchema(nameProperty)) {\n const nameValue = getLiteralValue(nameProperty);\n if (typeof nameValue === \"string\") {\n names.push(nameValue);\n }\n }\n }\n }\n } else if (isObjectSchema(schema)) {\n const nameProperty = schema.properties?.name ?? schema.properties?.type;\n if (nameProperty && isLiteralSchema(nameProperty)) {\n const nameValue = getLiteralValue(nameProperty);\n if (typeof nameValue === \"string\") {\n names.push(nameValue);\n }\n }\n }\n componentNamesCache.set(schema, names);\n return names;\n}\nfunction clearComponentNamesCache() {\n componentNamesCache.clear();\n}\nfunction getSchemaMetadata(schema) {\n const metadata = {};\n if (\"type\" in schema) {\n metadata.type = String(schema.type);\n }\n if (isObjectSchema(schema)) {\n metadata.properties = getObjectSchemaPropertyNames(schema);\n }\n if (isLiteralSchema(schema)) {\n metadata.literal = getLiteralValue(schema);\n }\n return metadata;\n}\n\n// src/validation/unified/error-formatter-config.ts\nfunction isCI() {\n if (typeof process === \"undefined\" || !process.env) return false;\n return !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI);\n}\nfunction hasColorSupport() {\n if (typeof process === \"undefined\") return false;\n if (process.env?.NO_COLOR) return false;\n if (process.env?.FORCE_COLOR) return true;\n if (process.stdout?.isTTY) return true;\n return !isCI();\n}\nvar DEFAULT_ERROR_CONFIG = {\n includeEmojis: !isCI(),\n verbosity: \"normal\",\n includeSuggestions: true,\n includePath: true,\n maxMessageLength: 0,\n includeDocLinks: false,\n colorSupport: hasColorSupport()\n};\nfunction createErrorConfig(config) {\n return { ...DEFAULT_ERROR_CONFIG, ...config };\n}\nvar ERROR_EMOJIS = {\n ERROR: \"\\u274C\",\n WARNING: \"\\u26A0\\uFE0F\",\n FIX: \"\\u{1F527}\",\n INFO: \"\\u2139\\uFE0F\",\n SUCCESS: \"\\u2705\"\n};\nfunction formatErrorMessage(message, config) {\n if (config.maxMessageLength > 0 && message.length > config.maxMessageLength) {\n return message.substring(0, config.maxMessageLength) + \"...\";\n }\n return message;\n}\n\n// src/validation/unified/error-transformer.ts\nfunction generateEnhancedMessage(error, _config) {\n const typeStr = String(error.type || \"\");\n const path = error.path || \"root\";\n if (typeStr === \"62\" || typeStr === \"union\") {\n return generateUnionErrorMessage(error);\n }\n if (error.message?.includes(\"additionalProperties\")) {\n return generateAdditionalPropertiesMessage(error);\n }\n if (error.message?.includes(\"Required property\")) {\n return generateRequiredPropertyMessage(error);\n }\n if (typeStr === \"string\" || typeStr === \"number\" || typeStr === \"boolean\" || typeStr === \"array\" || typeStr === \"object\") {\n return generateTypeMismatchMessage(error);\n }\n if (typeStr === \"literal\") {\n return generateLiteralErrorMessage(error);\n }\n if (typeStr === \"pattern\" || typeStr === \"RegExp\") {\n return generatePatternErrorMessage(error);\n }\n return `At ${path}: ${error.message}`;\n}\nfunction generateUnionErrorMessage(error) {\n const path = error.path || \"root\";\n const value = error.value;\n if (path === \"root\" || path === \"/\" || path === \"/jsonDefinition\") {\n if (value && typeof value === \"object\") {\n if (\"name\" in value) {\n return `Invalid component configuration for '${value.name}'. Check that all required fields are present.`;\n }\n if (\"children\" in value && Array.isArray(value.children)) {\n return \"Document is missing required 'name' field.\";\n }\n }\n return \"Invalid document structure. Check required fields.\";\n }\n if (path.includes(\"/children/\")) {\n if (value && typeof value === \"object\" && \"name\" in value) {\n const componentType = value.name;\n return `Invalid component configuration for type '${componentType}'. Check that all required fields are present and correctly formatted.`;\n }\n return 'Invalid component structure. Each component must have a \"name\" field and valid configuration.';\n }\n return `Value at ${path} doesn't match any of the expected formats. Check the structure and required fields.`;\n}\nfunction generateAdditionalPropertiesMessage(error) {\n const path = error.path || \"root\";\n const value = error.value;\n if (typeof value === \"object\" && value !== null) {\n const schema = error.schema;\n if (schema && isObjectSchema(schema)) {\n const knownProps = getObjectSchemaPropertyNames(schema);\n const actualProps = Object.keys(value);\n const unknownProps = actualProps.filter((p) => !knownProps.includes(p));\n if (unknownProps.length > 0) {\n return `Unknown properties at ${path}: ${unknownProps.join(\", \")}. Allowed properties are: ${knownProps.join(\", \")}`;\n }\n }\n }\n return `Additional properties not allowed at ${path}. Check for typos or unsupported fields.`;\n}\nfunction generateRequiredPropertyMessage(error) {\n const path = error.path || \"root\";\n const match = error.message?.match(/Required property '([^']+)'/);\n if (match) {\n const propName = match[1];\n return `Missing required field '${propName}' at ${path}. This field is mandatory.`;\n }\n return `Missing required property at ${path}. Check that all mandatory fields are present.`;\n}\nfunction generateTypeMismatchMessage(error) {\n const path = error.path || \"root\";\n const expectedType = String(error.type);\n const actualType = Array.isArray(error.value) ? \"array\" : typeof error.value;\n if (path.includes(\"alignment\")) {\n return `Invalid alignment value at ${path}. Expected one of: left, center, right, justify`;\n }\n if (path.includes(\"color\")) {\n return `Invalid color value at ${path}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`;\n }\n if (path.includes(\"fontSize\") || path.includes(\"size\")) {\n return `Invalid size value at ${path}. Expected a number (in points)`;\n }\n if (path.includes(\"margin\") || path.includes(\"padding\") || path.includes(\"spacing\")) {\n return `Invalid spacing value at ${path}. Expected a number or spacing object with top/bottom/left/right`;\n }\n return `Type mismatch at ${path}: Expected ${expectedType} but got ${actualType}`;\n}\nfunction generateLiteralErrorMessage(error) {\n const path = error.path || \"root\";\n const expected = error.schema ? JSON.stringify(getLiteralValue(error.schema)) : \"specific value\";\n const actual = JSON.stringify(error.value);\n return `Invalid value at ${path}: Expected exactly ${expected} but got ${actual}`;\n}\nfunction generatePatternErrorMessage(error) {\n const path = error.path || \"root\";\n if (path.includes(\"email\")) {\n return `Invalid email format at ${path}. Use format: user@example.com`;\n }\n if (path.includes(\"url\") || path.includes(\"link\")) {\n return `Invalid URL format at ${path}. Use format: https://example.com`;\n }\n if (path.includes(\"date\")) {\n return `Invalid date format at ${path}. Use ISO format: YYYY-MM-DD`;\n }\n return `Value at ${path} doesn't match the required pattern`;\n}\nfunction transformValueError(error, jsonString, config) {\n const formatterConfig = createErrorConfig(config);\n const enhancedMessage = generateEnhancedMessage(error, formatterConfig);\n const baseError = {\n path: error.path || \"root\",\n message: formatErrorMessage(\n enhancedMessage || error.message,\n formatterConfig\n ),\n code: String(error.type || \"validation_error\"),\n value: error.value\n };\n if (formatterConfig.includeSuggestions) {\n const suggestion = getSuggestion(error, formatterConfig);\n if (suggestion) {\n baseError.suggestion = formatErrorMessage(suggestion, formatterConfig);\n }\n }\n if (jsonString && error.path) {\n const position = calculatePosition(jsonString, error.path);\n if (position) {\n baseError.line = position.line;\n baseError.column = position.column;\n }\n }\n return baseError;\n}\nfunction transformValueErrors(errors, options) {\n const maxErrors = options?.maxErrors ?? Number.MAX_SAFE_INTEGER;\n const result = [];\n const seenPaths = /* @__PURE__ */ new Set();\n for (const error of errors) {\n if (result.length >= maxErrors) break;\n const errorKey = `${error.path}:${error.type}`;\n if (!seenPaths.has(errorKey)) {\n seenPaths.add(errorKey);\n result.push(transformValueError(error, options?.jsonString, void 0));\n }\n }\n return result;\n}\nfunction calculatePosition(jsonString, path) {\n try {\n const pathParts = path.split(\"/\").filter(Boolean);\n if (pathParts.length === 0) {\n return { line: 1, column: 1 };\n }\n const lastPart = pathParts[pathParts.length - 1];\n const searchPattern = `\"${lastPart}\"`;\n const index = jsonString.indexOf(searchPattern);\n if (index === -1) {\n return { line: 1, column: 1 };\n }\n const beforeError = jsonString.substring(0, index);\n const lines = beforeError.split(\"\\n\");\n const line = lines.length;\n const column = lines[lines.length - 1].length + 1;\n return { line, column };\n } catch {\n return null;\n }\n}\nfunction getSuggestion(error, _config) {\n const { type, path } = error;\n const typeStr = String(type);\n if (typeStr === \"62\" || typeStr === \"union\") {\n if (path === \"root\" || path === \"/\") {\n return 'Ensure the document has proper structure with a root \"name\" field';\n }\n if (path?.includes(\"/children/\")) {\n return 'Check that the component has a valid \"name\" and all required fields';\n }\n return \"Review the structure and ensure all required fields are present with correct types\";\n }\n if (error.message?.includes(\"additionalProperties\")) {\n return \"Remove any unknown or unsupported fields.\";\n }\n if (error.message?.includes(\"Required property\")) {\n return \"Add the missing required field to fix this error\";\n }\n if (typeStr === \"string\") {\n if (path?.includes(\"color\")) {\n return \"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)\";\n }\n return \"Provide a text string value\";\n }\n if (typeStr === \"number\") {\n return \"Provide a numeric value\";\n }\n if (typeStr === \"boolean\") {\n return \"Use true or false (without quotes)\";\n }\n if (typeStr === \"array\") {\n return \"Provide an array of values using square brackets []\";\n }\n if (typeStr === \"object\") {\n return \"Provide an object with key-value pairs using curly braces {}\";\n }\n if (typeStr === \"literal\") {\n const expected = error.schema ? JSON.stringify(getLiteralValue(error.schema)) : \"specific value\";\n return `Use exactly this value: ${expected}`;\n }\n return void 0;\n}\nfunction formatErrorSummary(errors) {\n if (errors.length === 0) return \"No errors\";\n if (errors.length === 1) {\n return errors[0].message;\n }\n const summary = errors.slice(0, 3).map((e) => `${e.path}: ${e.message}`).join(\", \");\n if (errors.length > 3) {\n return `${summary} and ${errors.length - 3} more...`;\n }\n return summary;\n}\nfunction groupErrorsByPath(errors) {\n const grouped = /* @__PURE__ */ new Map();\n for (const error of errors) {\n const path = error.path || \"root\";\n const group = grouped.get(path) || [];\n group.push(error);\n grouped.set(path, group);\n }\n return grouped;\n}\nfunction createJsonParseError(error, jsonString) {\n const match = error.message.match(/position (\\d+)/);\n const position = match ? parseInt(match[1], 10) : 0;\n let line = 1;\n let column = 1;\n if (position > 0) {\n const lines = jsonString.substring(0, position).split(\"\\n\");\n line = lines.length;\n column = lines[lines.length - 1].length + 1;\n }\n return {\n path: \"root\",\n message: `JSON Parse Error: ${error.message}`,\n code: \"json_parse_error\",\n line,\n column,\n suggestion: \"Check for missing commas, quotes, or brackets\"\n };\n}\n\nexport {\n isUnionSchema,\n isObjectSchema,\n isLiteralSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n extractStandardComponentNames,\n clearComponentNamesCache,\n getSchemaMetadata,\n DEFAULT_ERROR_CONFIG,\n createErrorConfig,\n ERROR_EMOJIS,\n formatErrorMessage,\n transformValueError,\n transformValueErrors,\n calculatePosition,\n formatErrorSummary,\n groupErrorsByPath,\n createJsonParseError\n};\n//# sourceMappingURL=chunk-LLBCT7WL.js.map","// src/utils/semver.ts\nvar SEMVER_RE = /^(\\d+)\\.(\\d+)\\.(\\d+)$/;\nfunction isValidSemver(version) {\n return SEMVER_RE.test(version);\n}\nfunction parseSemver(version) {\n const match = version.match(SEMVER_RE);\n if (!match) {\n throw new Error(\n `Invalid semver: \"${version}\". Expected format: major.minor.patch`\n );\n }\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3])\n };\n}\nfunction compareSemver(a, b) {\n const pa = parseSemver(a);\n const pb = parseSemver(b);\n return pa.major - pb.major || pa.minor - pb.minor || pa.patch - pb.patch;\n}\nfunction latestVersion(versions) {\n if (versions.length === 0) {\n throw new Error(\"Cannot determine latest version from empty array\");\n }\n return versions.reduce(\n (latest, v) => compareSemver(v, latest) > 0 ? v : latest\n );\n}\n\nexport {\n isValidSemver,\n parseSemver,\n compareSemver,\n latestVersion\n};\n//# sourceMappingURL=chunk-244MHDOZ.js.map","// src/schemas/schema-utils.ts\nimport { Type } from \"@sinclair/typebox\";\n\n// src/schemas/discriminated-unions.ts\nfunction branchNameConst(branch) {\n if (typeof branch !== \"object\" || branch === null || Array.isArray(branch))\n return void 0;\n const name = branch.properties?.name;\n return typeof name?.const === \"string\" ? name.const : void 0;\n}\nfunction isVersionedBranch(branch) {\n const version = branch.properties?.version;\n return typeof version?.const === \"string\";\n}\nfunction branchRequiresName(branch) {\n return Array.isArray(branch.required) && branch.required.includes(\"name\");\n}\nfunction groupByName(branches) {\n const groups = /* @__PURE__ */ new Map();\n for (const branch of branches) {\n const name = branchNameConst(branch);\n const group = groups.get(name);\n if (group) group.push(branch);\n else groups.set(name, [branch]);\n }\n return groups;\n}\nfunction nameEntry(name, group) {\n const source = group.find(\n (b) => !isVersionedBranch(b) && typeof b.description === \"string\"\n ) ?? group.find((b) => typeof b.description === \"string\");\n return {\n const: name,\n type: \"string\",\n ...source ? { description: source.description } : {}\n };\n}\nfunction restructureNameDiscriminatedUnions(schema) {\n const visited = /* @__PURE__ */ new WeakSet();\n function walk(node) {\n if (typeof node !== \"object\" || node === null) return;\n if (visited.has(node)) return;\n visited.add(node);\n if (Array.isArray(node)) {\n node.forEach(walk);\n return;\n }\n const obj = node;\n const anyOf = obj.anyOf;\n const isCandidate = Array.isArray(anyOf) && anyOf.length >= 2 && anyOf.every(\n (b) => branchNameConst(b) !== void 0 && branchRequiresName(b)\n ) && obj.properties === void 0 && obj.allOf === void 0 && obj.if === void 0 && obj.required === void 0 && // A sibling `additionalProperties` evaluates against the node's own\n // (absent) `properties`; declaring `name` here would change what it\n // rejects, so such unions are left alone.\n obj.additionalProperties === void 0 && (obj.type === void 0 || obj.type === \"object\");\n const groups = isCandidate ? groupByName(anyOf) : void 0;\n if (groups && groups.size >= 2) {\n obj.type = \"object\";\n obj.required = [\"name\"];\n obj.properties = {\n name: {\n description: \"Component or registered plugin to render.\",\n anyOf: [...groups.entries()].map(\n ([name, group]) => nameEntry(name, group)\n )\n }\n };\n obj.allOf = [...groups.entries()].map(([name, group]) => ({\n if: {\n properties: { name: { const: name } },\n required: [\"name\"]\n },\n then: group.length === 1 ? group[0] : { anyOf: group }\n }));\n delete obj.anyOf;\n }\n for (const value of Object.values(obj)) walk(value);\n }\n walk(schema);\n}\nfunction unionBranches(schema) {\n if (typeof schema !== \"object\" || schema === null) return [];\n const obj = schema;\n if (Array.isArray(obj.anyOf)) {\n return obj.anyOf.filter(\n (b) => typeof b === \"object\" && b !== null\n );\n }\n if (Array.isArray(obj.allOf)) {\n return obj.allOf.flatMap((entry) => {\n const then = entry?.then;\n if (typeof then !== \"object\" || then === null) return [];\n const inner = then.anyOf;\n return Array.isArray(inner) ? inner.filter(\n (b) => typeof b === \"object\" && b !== null\n ) : [then];\n });\n }\n return [];\n}\n\n// src/schemas/schema-utils.ts\nfunction replaceRefs(obj, target, replacement) {\n if (typeof obj !== \"object\" || obj === null) return;\n if (Array.isArray(obj)) {\n obj.forEach((item) => {\n if (typeof item === \"object\" && item !== null) {\n replaceRefs(item, target, replacement);\n }\n });\n return;\n }\n if (obj.$ref === target) {\n obj.$ref = replacement;\n }\n for (const value of Object.values(obj)) {\n if (typeof value === \"object\" && value !== null) {\n replaceRefs(value, target, replacement);\n }\n }\n}\nfunction fixSchemaReferences(schema, rootDefinitionName = \"ComponentDefinition\") {\n const definitionNames = new Set(\n Object.keys(\n schema.definitions ?? {}\n )\n );\n const definitionRef = (name) => {\n const target = definitionNames.has(name) ? name : rootDefinitionName;\n return definitionNames.has(target) ? `#/definitions/${target}` : void 0;\n };\n const isBareDefinitionRef = (value) => typeof value === \"string\" && (/^T\\d+$/.test(value) || value === rootDefinitionName || definitionNames.has(value));\n function traverse(obj, path = \"\") {\n if (typeof obj !== \"object\" || obj === null) return;\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = path ? `${path}.${key}` : key;\n if (value && typeof value === \"object\") {\n const schemaValue = value;\n if (schemaValue.type === \"array\" && schemaValue.items && Object.keys(schemaValue.items).length === 0 && definitionNames.has(rootDefinitionName)) {\n schemaValue.items = {\n $ref: `#/definitions/${rootDefinitionName}`\n };\n }\n if (schemaValue.type === \"array\" && schemaValue.items && typeof schemaValue.items === \"object\" && \"$ref\" in schemaValue.items && isBareDefinitionRef(\n schemaValue.items.$ref\n )) {\n const name = schemaValue.items.$ref;\n const ref = definitionRef(name);\n schemaValue.items = ref ? { $ref: ref } : {};\n }\n if (isBareDefinitionRef(schemaValue.$ref)) {\n const ref = definitionRef(schemaValue.$ref);\n if (ref) schemaValue.$ref = ref;\n else delete schemaValue.$ref;\n }\n if (key === \"$id\" && isBareDefinitionRef(value) && currentPath !== `definitions.${value}.$id`) {\n delete obj[key];\n continue;\n }\n traverse(value, currentPath);\n }\n }\n }\n traverse(schema);\n}\nfunction convertToJsonSchema(schema, options = {}) {\n const {\n $schema = \"http://json-schema.org/draft-07/schema#\",\n $id,\n title,\n description,\n definitions = {},\n enrich\n } = options;\n const schemaJson = JSON.parse(JSON.stringify(schema));\n if (schemaJson.$id && typeof schemaJson.$id === \"string\" && /^T\\d+$/.test(schemaJson.$id)) {\n const recursiveId = schemaJson.$id;\n delete schemaJson.$id;\n replaceRefs(schemaJson, recursiveId, \"#\");\n }\n const extractedDefinitions = { ...definitions };\n function extractRecursiveSchemas(obj, path = \"\") {\n if (typeof obj !== \"object\" || obj === null) return;\n for (const [key, value] of Object.entries(obj)) {\n if (value && typeof value === \"object\") {\n const schemaValue = value;\n if (schemaValue.$id && typeof schemaValue.$id === \"string\") {\n const definitionName = schemaValue.$id;\n if (path !== `definitions.${definitionName}`) {\n const { $id: _id, ...schemaWithoutId } = schemaValue;\n extractedDefinitions[definitionName] = schemaWithoutId;\n obj[key] = { $ref: `#/definitions/${definitionName}` };\n extractRecursiveSchemas(\n schemaWithoutId,\n `definitions.${definitionName}`\n );\n continue;\n }\n }\n extractRecursiveSchemas(\n value,\n path ? `${path}.${key}` : key\n );\n }\n }\n }\n extractRecursiveSchemas(schemaJson);\n const jsonSchema = { $schema };\n if ($id) jsonSchema.$id = $id;\n Object.assign(jsonSchema, schemaJson);\n jsonSchema.$schema = $schema;\n if ($id) jsonSchema.$id = $id;\n if (title !== void 0) jsonSchema.title = title;\n if (description !== void 0) jsonSchema.description = description;\n if (Object.keys(extractedDefinitions).length > 0) {\n jsonSchema.definitions = extractedDefinitions;\n }\n fixSchemaReferences(jsonSchema);\n enrich?.(jsonSchema);\n restructureNameDiscriminatedUnions(jsonSchema);\n return jsonSchema;\n}\nfunction createComponentSchema(name, config, containerNames, componentDefinitionSchema, rootDefinitionName = \"ComponentDefinition\") {\n const componentStructure = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n $id: `${name}.schema.json`,\n title: config.title,\n description: config.description,\n type: \"object\",\n required: [\"name\", \"props\"],\n properties: {\n name: {\n type: \"string\",\n const: name,\n description: `Component name identifier (must be \"${name}\")`\n },\n id: {\n type: \"string\",\n description: \"Optional unique identifier for the component\"\n },\n props: JSON.parse(JSON.stringify(config.schema))\n }\n };\n if (containerNames.includes(name)) {\n componentStructure.properties.children = {\n type: \"array\",\n description: \"Children within this container\",\n items: {\n $ref: `#/definitions/${rootDefinitionName}`\n }\n };\n if (componentDefinitionSchema) {\n componentStructure.definitions = {\n [rootDefinitionName]: JSON.parse(\n JSON.stringify(componentDefinitionSchema)\n )\n };\n }\n }\n fixSchemaReferences(componentStructure, rootDefinitionName);\n componentStructure.additionalProperties = false;\n return componentStructure;\n}\nasync function exportSchemaToFile(schema, outputPath, options = {}) {\n const { prettyPrint = true } = options;\n const jsonSchema = prettyPrint ? JSON.stringify(schema, null, 2) : JSON.stringify(schema);\n const fs = await import(\"fs/promises\");\n await fs.writeFile(outputPath, jsonSchema, \"utf-8\");\n}\nfunction createComponentSchemaObject(component, recursiveRef) {\n const schema = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description: \"When false, this component is filtered out and not rendered. Defaults to true.\"\n })\n )\n };\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: \"uri\" }));\n }\n schema.props = component.propsSchema;\n if (component.hasChildren && recursiveRef) {\n schema.children = Type.Optional(Type.Array(recursiveRef));\n }\n return Type.Object(schema, { additionalProperties: false });\n}\n\nexport {\n restructureNameDiscriminatedUnions,\n unionBranches,\n fixSchemaReferences,\n convertToJsonSchema,\n createComponentSchema,\n exportSchemaToFile,\n createComponentSchemaObject\n};\n//# sourceMappingURL=chunk-LFHU4EOV.js.map","// src/types.ts\nvar QUALITY_CODES = {\n CANVAS_UNSPECIFIED: \"W_QUALITY_CANVAS_UNSPECIFIED\",\n CANVAS_NONSTANDARD: \"W_QUALITY_CANVAS_NONSTANDARD\",\n CANVAS_LEGACY: \"W_QUALITY_CANVAS_LEGACY\",\n TEXT_OVERFLOW: \"W_QUALITY_TEXT_OVERFLOW\",\n TEXT_TIGHT: \"W_QUALITY_TEXT_TIGHT\",\n SLIDE_DENSITY: \"W_QUALITY_SLIDE_DENSITY\",\n FONT_SIZE_MIN: \"W_QUALITY_FONT_SIZE_MIN\",\n TABLE_WIDTH_OVERFLOW: \"W_QUALITY_TABLE_WIDTH_OVERFLOW\",\n FRAME_COLLISION: \"W_QUALITY_FRAME_COLLISION\",\n HEADING_SKIP: \"W_QUALITY_HEADING_SKIP\",\n TEXT_CONTRAST: \"W_QUALITY_TEXT_CONTRAST\",\n SVG_TEXT_CLIPPED: \"W_QUALITY_SVG_TEXT_CLIPPED\",\n LINE_BOX_COLLAPSE: \"W_QUALITY_LINE_BOX_COLLAPSE\",\n PLACEHOLDER_TEXT: \"W_QUALITY_PLACEHOLDER_TEXT\",\n SCAFFOLD_MARKER: \"W_QUALITY_SCAFFOLD_MARKER\",\n BOX_OVERLAP: \"W_QUALITY_BOX_OVERLAP\",\n FONT_COUNT: \"W_QUALITY_FONT_COUNT\",\n OFF_PALETTE: \"W_QUALITY_OFF_PALETTE\",\n CHART_3D: \"W_QUALITY_CHART_3D\",\n CHART_OVERLOADED: \"W_QUALITY_CHART_OVERLOADED\",\n CHART_AXIS_BASELINE: \"W_QUALITY_CHART_AXIS_BASELINE\",\n CHART_SERIES_COLORS: \"W_QUALITY_CHART_SERIES_COLORS\",\n CHART_UNITS: \"W_QUALITY_CHART_UNITS\",\n CHART_ANNOTATION: \"W_QUALITY_CHART_ANNOTATION\",\n TABLE_NUMERIC_ALIGN: \"W_QUALITY_TABLE_NUMERIC_ALIGN\",\n TABLE_MIXED_DECIMALS: \"W_QUALITY_TABLE_MIXED_DECIMALS\",\n TABLE_GRID: \"W_QUALITY_TABLE_GRID\",\n TABLE_ROW_COUNT: \"W_QUALITY_TABLE_ROW_COUNT\",\n SLOT_BUDGET: \"W_QUALITY_SLOT_BUDGET\",\n OFF_CANVAS: \"W_QUALITY_OFF_CANVAS\",\n CHROME_MISSING: \"W_QUALITY_CHROME_MISSING\",\n EXHIBIT_MISSING: \"W_QUALITY_EXHIBIT_MISSING\",\n ACTION_TITLE_LENGTH: \"W_QUALITY_ACTION_TITLE_LENGTH\",\n TYPE_OFF_SCALE: \"W_QUALITY_TYPE_OFF_SCALE\",\n TYPE_SIZE_COUNT: \"W_QUALITY_TYPE_SIZE_COUNT\",\n TYPE_ROLE_DRIFT: \"W_QUALITY_TYPE_ROLE_DRIFT\",\n TITLE_DRIFT: \"W_QUALITY_TITLE_DRIFT\",\n SECTION_EMPTY: \"W_QUALITY_SECTION_EMPTY\",\n SECTION_UNTITLED: \"W_QUALITY_SECTION_UNTITLED\",\n SLIDE_UNTITLED: \"W_QUALITY_SLIDE_UNTITLED\",\n BODY_MEASURE: \"W_QUALITY_BODY_MEASURE\",\n HEADING_ORPHAN: \"W_QUALITY_HEADING_ORPHAN\",\n FIGURE_UNLABELLED: \"W_QUALITY_FIGURE_UNLABELLED\",\n CONTENTS_MISSING: \"W_QUALITY_CONTENTS_MISSING\",\n IMAGE_ASPECT: \"W_QUALITY_IMAGE_ASPECT\",\n BULLET_COUNT: \"W_QUALITY_BULLET_COUNT\",\n BULLET_LENGTH: \"W_QUALITY_BULLET_LENGTH\",\n SAFE_AREA: \"W_QUALITY_SAFE_AREA\",\n RENDERED_CLIP: \"W_QUALITY_RENDERED_CLIP\",\n RENDERED_SPILL: \"W_QUALITY_RENDERED_SPILL\",\n RENDERED_OVERLAP: \"W_QUALITY_RENDERED_OVERLAP\",\n RENDERED_TEXT_MISSING: \"W_QUALITY_RENDERED_TEXT_MISSING\",\n RENDERED_FONT_SUBSTITUTED: \"W_QUALITY_RENDERED_FONT_SUBSTITUTED\",\n RENDERED_EMPTY_PAGE: \"W_QUALITY_RENDERED_EMPTY_PAGE\",\n RENDERED_HEADING_STRANDED: \"W_QUALITY_RENDERED_HEADING_STRANDED\",\n RENDERED_PARAGRAPH_SPLIT: \"W_QUALITY_RENDERED_PARAGRAPH_SPLIT\",\n RENDERED_PAGE_UNDERFILLED: \"W_QUALITY_RENDERED_PAGE_UNDERFILLED\",\n RENDERED_TABLE_SPLIT: \"W_QUALITY_RENDERED_TABLE_SPLIT\"\n};\n\n// src/policy.ts\nvar SEVERITY_RANK = {\n error: 0,\n warning: 1,\n info: 2\n};\nvar QualityPolicyError = class extends Error {\n code = \"QUALITY_POLICY_INVALID\";\n constructor(message) {\n super(message);\n this.name = \"QualityPolicyError\";\n }\n};\nfunction isSeverity(value) {\n return value === \"error\" || value === \"warning\" || value === \"info\";\n}\nfunction assertRuleConfigurations(rules, origin) {\n for (const [ruleId, configuration] of Object.entries(rules ?? {})) {\n if (typeof configuration !== \"object\" || configuration === null || Array.isArray(configuration)) {\n throw new QualityPolicyError(\n `Quality ${origin} rule \"${ruleId}\" has invalid configuration ${JSON.stringify(configuration)}; expected an object`\n );\n }\n if (configuration.severity !== void 0 && !isSeverity(configuration.severity)) {\n throw new QualityPolicyError(\n `Quality ${origin} rule \"${ruleId}\" has invalid severity ${JSON.stringify(configuration.severity)}; expected \"error\", \"warning\" or \"info\"`\n );\n }\n }\n}\nfunction assertValidQualityPolicy(policy) {\n if (!policy) return;\n if (policy.gate !== void 0 && policy.gate !== \"none\" && !isSeverity(policy.gate)) {\n throw new QualityPolicyError(\n `Quality policy has invalid gate ${JSON.stringify(policy.gate)}; expected \"none\", \"error\", \"warning\" or \"info\"`\n );\n }\n assertRuleConfigurations(policy.rules, \"policy\");\n if (policy.suppressions !== void 0) {\n if (!Array.isArray(policy.suppressions)) {\n throw new QualityPolicyError(\n `Quality policy has invalid suppressions ${JSON.stringify(policy.suppressions)}; expected an array`\n );\n }\n policy.suppressions.forEach((suppression, index) => {\n if (typeof suppression !== \"object\" || suppression === null || Array.isArray(suppression)) {\n throw new QualityPolicyError(\n `Quality policy suppression ${index} is ${JSON.stringify(suppression)}; expected an object`\n );\n }\n for (const key of [\"ruleId\", \"code\", \"path\", \"reason\"]) {\n if (suppression[key] !== void 0 && typeof suppression[key] !== \"string\") {\n throw new QualityPolicyError(\n `Quality policy suppression ${index} has invalid ${key} ${JSON.stringify(suppression[key])}; expected a string`\n );\n }\n }\n if (suppression.pathMatch !== void 0 && suppression.pathMatch !== \"exact\" && suppression.pathMatch !== \"subtree\") {\n throw new QualityPolicyError(\n `Quality policy suppression ${index} has invalid pathMatch ${JSON.stringify(suppression.pathMatch)}; expected \"exact\" or \"subtree\"`\n );\n }\n });\n }\n if (policy.maxDiagnostics !== void 0 && (!Number.isInteger(policy.maxDiagnostics) || policy.maxDiagnostics < 0)) {\n throw new QualityPolicyError(\n `Quality policy has invalid maxDiagnostics ${JSON.stringify(policy.maxDiagnostics)}; expected a non-negative integer`\n );\n }\n if (policy.onRuleError !== void 0 && policy.onRuleError !== \"continue\" && policy.onRuleError !== \"throw\") {\n throw new QualityPolicyError(\n `Quality policy has invalid onRuleError ${JSON.stringify(policy.onRuleError)}; expected \"continue\" or \"throw\"`\n );\n }\n}\nfunction assertValidQualityProfile(profile) {\n if (!profile) return;\n assertRuleConfigurations(profile.rules, \"profile\");\n}\nfunction mergeQualityProfiles(base, override) {\n const rules = { ...base.rules };\n for (const [ruleId, configuration] of Object.entries(override.rules ?? {})) {\n const shipped = rules[ruleId];\n rules[ruleId] = shipped ? {\n ...shipped,\n ...configuration,\n parameters: {\n ...shipped.parameters,\n ...configuration.parameters\n }\n } : configuration;\n }\n return {\n ...base,\n ...override,\n rules,\n parameters: { ...base.parameters, ...override.parameters }\n };\n}\nfunction resolveRuleConfiguration(rule, profile, policy) {\n const profileRule = profile?.rules?.[rule.id];\n const policyRule = policy?.rules?.[rule.id];\n return {\n enabled: policyRule?.enabled ?? profileRule?.enabled ?? rule.defaultEnabled ?? true,\n severity: policyRule?.severity ?? profileRule?.severity ?? rule.defaultSeverity,\n severityOverride: policyRule?.severity ?? profileRule?.severity,\n parameters: {\n ...rule.defaultParameters ?? {},\n ...profile?.parameters ?? {},\n ...profileRule?.parameters ?? {},\n ...policyRule?.parameters ?? {}\n }\n };\n}\nfunction matchesPath(diagnosticPath, suppression) {\n if (suppression.path === void 0) return true;\n if (suppression.pathMatch !== \"subtree\") {\n return diagnosticPath === suppression.path;\n }\n if (suppression.path === \"\") return true;\n return diagnosticPath === suppression.path || diagnosticPath.startsWith(`${suppression.path}/`);\n}\nfunction isSuppressed(diagnostic, suppressions = []) {\n return suppressions.some((suppression) => {\n const hasSelector = suppression.ruleId !== void 0 || suppression.code !== void 0 || suppression.path !== void 0;\n if (!hasSelector) return false;\n if (suppression.ruleId !== void 0 && diagnostic.ruleId !== suppression.ruleId) {\n return false;\n }\n if (suppression.code !== void 0 && diagnostic.code !== suppression.code) {\n return false;\n }\n return matchesPath(diagnostic.path, suppression);\n });\n}\nfunction isBlocking(severity, gate = \"none\") {\n if (gate === \"none\") return false;\n return SEVERITY_RANK[severity] <= SEVERITY_RANK[gate];\n}\nfunction severityRank(severity) {\n return SEVERITY_RANK[severity];\n}\n\n// src/brand.ts\nvar COLOR_KEY = /(colou?r|fill|stroke|shade|tint|background|border)/i;\nvar FAMILY_KEYS = /* @__PURE__ */ new Set([\"family\", \"fontFace\", \"fontFamily\"]);\nvar HEX = /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;\nfunction pointerSegment(value) {\n return value.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction normalizeHex(value) {\n const found = HEX.exec(value.trim());\n if (!found) return void 0;\n const digits = found[1];\n const full = digits.length === 3 ? digits[0] + digits[0] + digits[1] + digits[1] + digits[2] + digits[2] : digits;\n return `#${full.toUpperCase()}`;\n}\nfunction walk(node, path, key, options) {\n if (typeof node === \"string\") {\n options.onString(node, path, key);\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(\n (entry, index) => walk(entry, `${path}/${index}`, key, options)\n );\n return;\n }\n if (typeof node !== \"object\" || node === null) return;\n const record2 = node;\n if (record2.enabled === false) return;\n for (const [name, value] of Object.entries(record2)) {\n walk(value, `${path}/${pointerSegment(name)}`, name, options);\n }\n}\nfunction collectColorLiterals(document) {\n const found = [];\n walk(document, \"\", \"\", {\n onString: (value, path, key) => {\n if (!COLOR_KEY.test(key)) return;\n const hex = normalizeHex(value);\n if (hex) found.push({ path, raw: value, hex });\n }\n });\n return found;\n}\nfunction collectFontFamilies(document) {\n const found = [];\n walk(document, \"\", \"\", {\n onString: (value, path, key) => {\n const family = value.trim();\n if (FAMILY_KEYS.has(key) && family !== \"\") found.push({ path, family });\n }\n });\n return found;\n}\nfunction nearestPaletteToken(hex, palette) {\n const target = normalizeHex(hex);\n if (!target) return void 0;\n const [tr, tg, tb] = channels(target);\n let best;\n for (const token of Object.keys(palette).sort()) {\n const candidate = normalizeHex(palette[token] ?? \"\");\n if (!candidate) continue;\n const [cr, cg, cb] = channels(candidate);\n const meanRed = (tr + cr) / 2;\n const dr = tr - cr;\n const dg = tg - cg;\n const db = tb - cb;\n const distance = Math.sqrt(\n (2 + meanRed / 256) * dr * dr + 4 * dg * dg + (2 + (255 - meanRed) / 256) * db * db\n );\n if (!best || distance < best.distance) {\n best = { token, hex: candidate, distance };\n }\n }\n return best;\n}\nfunction channels(hex) {\n const value = parseInt(hex.slice(1), 16);\n return [value >> 16 & 255, value >> 8 & 255, value & 255];\n}\nfunction offPaletteFinding(input) {\n const { nearest } = input;\n return {\n code: QUALITY_CODES.OFF_PALETTE,\n severity: \"info\",\n category: \"brand\",\n certainty: \"deterministic\",\n message: nearest ? `${input.raw} is not in the theme palette; the nearest token is \\`${nearest.token}\\` (${nearest.hex}).` : `${input.raw} is not in the theme palette.`,\n path: input.path,\n suggestion: nearest ? `Use \"${nearest.token}\" so the colour follows the theme, or keep the literal if it is deliberately off-palette.` : \"Name a theme colour instead of a literal, so a theme swap repaints it.\",\n context: {\n color: input.hex,\n ...nearest && {\n nearestToken: nearest.token,\n nearestHex: nearest.hex,\n distance: Math.round(nearest.distance * 10) / 10\n }\n },\n evidence: {\n actual: input.hex,\n ...nearest && { expected: nearest.hex }\n },\n // `replace`, not `add`. The two are the same on an object member, and\n // very different on an array element: RFC 6902 `add` at `/colors/0`\n // SPLICES, so a fix for one entry of a chart's palette would insert the\n // token and leave the off-palette hex behind at index 1 — a fix that does\n // not make its own finding disappear. The value always exists here, since\n // it was read from this exact pointer, so `replace` is always legal.\n ...nearest && {\n fixes: [\n { op: \"replace\", path: input.path, value: nearest.token }\n ]\n }\n };\n}\nfunction fontCountFinding(input) {\n return {\n code: QUALITY_CODES.FONT_COUNT,\n severity: \"warning\",\n category: \"brand\",\n certainty: \"deterministic\",\n message: `${input.families.length} font families in one document (${input.families.join(\", \")}) \\u2014 past ${input.maximum} a document reads as assembled rather than designed.`,\n path: input.path,\n suggestion: \"Carry the extra weight with size, weight and colour instead of another family; a family the theme already defines costs nothing.\",\n context: { families: [...input.families], maximum: input.maximum },\n evidence: {\n actual: input.families.length,\n expected: input.maximum,\n unit: \"families\"\n },\n ...input.relatedPaths && input.relatedPaths.length > 0 && { relatedPaths: input.relatedPaths }\n };\n}\n\n// src/information-design.ts\nvar DEFAULT_MAXIMUM_CHART_SERIES = 4;\nvar DEFAULT_MAXIMUM_PIE_SLICES = 6;\nfunction chartInfoDesignFindings(chart, options = {}) {\n const maximumSeries = options.maximumSeries ?? DEFAULT_MAXIMUM_CHART_SERIES;\n const maximumSlices = options.maximumSlices ?? DEFAULT_MAXIMUM_PIE_SLICES;\n const findings = [];\n if (chart.threeD) {\n findings.push({\n code: QUALITY_CODES.CHART_3D,\n severity: \"warning\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `\\`${chart.chartType}\\` draws the data in perspective, which makes the front of the chart read larger than the back \\u2014 the comparison the chart exists for is the thing the projection distorts.`,\n path: chart.path,\n suggestion: \"Use the flat form of the same chart; depth adds no dimension of data.\",\n context: { chartType: chart.chartType },\n evidence: { actual: chart.chartType, summary: \"3D projection\" }\n });\n }\n if (chart.encoding === \"angle\") {\n if (chart.categoryCount > maximumSlices) {\n findings.push(\n overloadedFinding(chart, {\n actual: chart.categoryCount,\n maximum: maximumSlices,\n unit: \"slices\",\n message: `${chart.categoryCount} slices in one ${chart.chartType} \\u2014 past ${maximumSlices} the wedges are too close in angle to rank by eye.`,\n suggestion: 'Keep the largest slices and gather the rest into one \"other\", or use a bar chart, where length ranks at a glance.'\n })\n );\n }\n } else if (chart.seriesCount > maximumSeries) {\n findings.push(\n overloadedFinding(chart, {\n actual: chart.seriesCount,\n maximum: maximumSeries,\n unit: \"series\",\n message: `${chart.seriesCount} series on one chart \\u2014 past ${maximumSeries} the reader spends the chart on the legend.`,\n suggestion: \"Show the series that carry the message and drop or aggregate the rest, or split the chart into small multiples.\"\n })\n );\n }\n if (chart.encoding === \"length\" && chart.valueAxisMin !== void 0 && chart.valueAxisMin !== 0) {\n findings.push({\n code: QUALITY_CODES.CHART_AXIS_BASELINE,\n severity: \"warning\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `The value axis starts at ${chart.valueAxisMin}, so the bars are lengths of a number nobody stated \\u2014 a 2% difference can be drawn as a doubling.`,\n path: chart.path,\n suggestion: \"Start the value axis at zero. To show a small movement, plot the change itself, or use a line chart, where position rather than length carries the value.\",\n context: { valueAxisMin: chart.valueAxisMin },\n evidence: { actual: chart.valueAxisMin, expected: 0 }\n });\n }\n if (!chart.seriesColorsStated) {\n findings.push({\n code: QUALITY_CODES.CHART_SERIES_COLORS,\n severity: \"warning\",\n category: \"brand\",\n certainty: \"deterministic\",\n message: \"No series colours: the chart paints in the renderer\\u2019s default palette, which belongs to no document.\",\n path: chart.seriesColorsPath,\n suggestion: \"Name one theme colour per series, so the chart is part of the document rather than a picture pasted into it.\",\n context: { seriesCount: chart.seriesCount },\n ...options.seriesColorFix && options.seriesColorFix.length > 0 && {\n fixes: options.seriesColorFix\n }\n });\n }\n if (!chart.unitStated) {\n findings.push({\n code: QUALITY_CODES.CHART_UNITS,\n severity: \"info\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: \"Nothing on the chart names the unit of its numbers \\u2014 the axis title, the value format and the chart title are all silent.\",\n path: chart.path,\n suggestion: 'Put the unit where the numbers are: a value-axis title like \"Revenue (\\u20ACm)\", or a format code on the labels.'\n });\n }\n if (chart.annotation && !chart.annotation.stated) {\n findings.push({\n code: QUALITY_CODES.CHART_ANNOTATION,\n severity: \"info\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `Nothing in \\`${chart.annotation.slot}\\`: the chart states no takeaway and cites no source.`,\n path: chart.annotation.path,\n context: { slot: chart.annotation.slot },\n suggestion: \"Caption the chart with what it shows and where the numbers came from; a chart nobody has to interpret is worth the line.\"\n });\n }\n return findings;\n}\nfunction overloadedFinding(chart, input) {\n return {\n code: QUALITY_CODES.CHART_OVERLOADED,\n severity: \"warning\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: input.message,\n path: chart.path,\n suggestion: input.suggestion,\n context: {\n chartType: chart.chartType,\n [input.unit]: input.actual,\n maximum: input.maximum\n },\n evidence: {\n actual: input.actual,\n expected: input.maximum,\n unit: input.unit\n }\n };\n}\nfunction record(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value : void 0;\n}\nfunction text(value) {\n return typeof value === \"string\" ? value : \"\";\n}\nfunction finite(value) {\n return typeof value === \"number\" && Number.isFinite(value) ? value : void 0;\n}\nvar ANGLE_TYPES = /* @__PURE__ */ new Set([\"pie\", \"variablepie\", \"funnel\", \"pyramid\"]);\nvar LENGTH_TYPES = /* @__PURE__ */ new Set([\n \"bar\",\n \"column\",\n \"waterfall\",\n \"bullet\",\n \"columnrange\",\n \"columnpyramid\"\n]);\nvar POSITION_TYPES = /* @__PURE__ */ new Set([\n \"line\",\n \"spline\",\n \"area\",\n \"areaspline\",\n \"arearange\",\n \"scatter\",\n \"bubble\"\n]);\nfunction chartEncodingFor(chartType) {\n const name = chartType.toLowerCase();\n if (ANGLE_TYPES.has(name) || name === \"doughnut\" || name === \"donut\") {\n return \"angle\";\n }\n if (LENGTH_TYPES.has(name) || name.startsWith(\"bar\") || name === \"histogram\") {\n return \"length\";\n }\n if (POSITION_TYPES.has(name)) return \"position\";\n return \"other\";\n}\nfunction normalizeHighchartsChart(options) {\n const config = record(options) ?? {};\n const chart = record(config.chart) ?? {};\n const series = Array.isArray(config.series) ? config.series : [];\n const seriesRecords = series.flatMap((entry) => {\n const found = record(entry);\n return found ? [found] : [];\n });\n const chartType = text(chart.type) || text(seriesRecords[0]?.type) || \"line\";\n const options3d = record(chart.options3d);\n const categoryCount = Math.max(\n 0,\n ...seriesRecords.map(\n (entry) => Array.isArray(entry.data) ? entry.data.length : 0\n ),\n Array.isArray(record(config.xAxis)?.categories) ? (record(config.xAxis)?.categories).length : 0\n );\n const paletteStated = Array.isArray(config.colors) && config.colors.length > 0 || seriesRecords.length > 0 && seriesRecords.every((entry) => typeof entry.color === \"string\");\n const yAxis = Array.isArray(config.yAxis) ? record(config.yAxis[0]) : record(config.yAxis);\n const labelFormats = [\n ...Object.values(record(config.plotOptions) ?? {}).flatMap((entry) => {\n const labels = record(record(entry)?.dataLabels);\n return [text(labels?.format), text(labels?.valueSuffix)];\n }),\n text(record(yAxis?.labels)?.format),\n text(record(config.tooltip)?.valueSuffix)\n ];\n return {\n chartType,\n encoding: chartEncodingFor(chartType),\n threeD: options3d?.enabled === true,\n seriesCount: seriesRecords.length,\n categoryCount,\n seriesColorsStated: paletteStated,\n ...finite(yAxis?.min) !== void 0 && {\n valueAxisMin: finite(yAxis?.min)\n },\n unitStated: hasUnitMarker(text(record(yAxis?.title)?.text)) || hasUnitMarker(text(record(config.title)?.text)) || hasUnitMarker(text(record(config.subtitle)?.text)) || labelFormats.some((format) => hasUnitMarker(format)),\n annotationStated: text(record(config.caption)?.text).trim() !== \"\" || text(record(config.subtitle)?.text).trim() !== \"\"\n };\n}\nfunction tableInfoDesignFindings(table, options = {}) {\n const findings = [];\n for (const column of table.columns) {\n const profile = columnNumericProfile(column.values);\n if (!profile.numeric) continue;\n if (column.alignment !== \"right\") {\n const fixes = options.alignFix?.(column);\n findings.push({\n code: QUALITY_CODES.TABLE_NUMERIC_ALIGN,\n severity: \"warning\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `${describeColumn(column)} holds ${profile.counted} numbers and is aligned ${column.alignment} \\u2014 digits only line up by place value when they are flush right.`,\n path: column.path,\n suggestion: \"Right-align the column, header included, so units sit over units and the reader can compare magnitudes down the column.\",\n context: {\n column: column.index,\n alignment: column.alignment,\n ...column.header !== void 0 && { header: column.header }\n },\n evidence: {\n actual: column.alignment,\n expected: \"right\",\n values: { numbers: profile.counted }\n },\n ...fixes && fixes.length > 0 && { fixes }\n });\n }\n if (profile.decimals.length > 1) {\n findings.push({\n code: QUALITY_CODES.TABLE_MIXED_DECIMALS,\n severity: \"warning\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `${describeColumn(column)} is rounded ${profile.decimals.length} different ways (${profile.decimals.join(\", \")} decimal places) \\u2014 a column of numbers reads as one quantity, and inconsistent precision reads as inconsistent data.`,\n path: column.path,\n suggestion: \"Round every cell in the column to the precision the source actually supports, and pad the rest with zeros.\",\n context: {\n column: column.index,\n decimalPlaces: profile.decimals,\n ...column.header !== void 0 && { header: column.header }\n },\n evidence: {\n actual: profile.decimals,\n unit: \"decimal places\"\n }\n });\n }\n }\n if (table.fullGrid) {\n findings.push({\n code: QUALITY_CODES.TABLE_GRID,\n severity: \"info\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: \"Every cell is boxed on all four sides, which spends ink on the container rather than on the numbers and reads as a spreadsheet.\",\n path: table.gridPath ?? table.path,\n suggestion: \"Keep a rule under the header and, where rows need separating, between rows; drop the vertical rules and the outer box, and let alignment and space do the work.\"\n });\n }\n const maximumRows = options.maximumRows;\n if (maximumRows !== void 0 && table.rowCount > maximumRows) {\n const surface = options.rowSurface ?? \"page\";\n findings.push({\n code: QUALITY_CODES.TABLE_ROW_COUNT,\n severity: options.rowSeverity ?? \"info\",\n category: \"information-design\",\n certainty: \"deterministic\",\n message: `${table.rowCount} rows ${surface === \"slide\" ? \"on one slide\" : \"in one table\"} \\u2014 past ${maximumRows} the table is a data dump rather than something anybody reads in place.`,\n path: table.path,\n suggestion: surface === \"slide\" ? \"Show the rows that carry the message and move the rest to an appendix or to the document.\" : \"Summarise the rows that carry the argument here and move the full set to an appendix.\",\n context: { rows: table.rowCount, maximum: maximumRows },\n evidence: {\n actual: table.rowCount,\n expected: maximumRows,\n unit: \"rows\"\n }\n });\n }\n return findings;\n}\nfunction describeColumn(column) {\n return column.header !== void 0 && column.header.trim() !== \"\" ? `Column \"${column.header.trim()}\"` : `Column ${column.index + 1}`;\n}\nvar BLANK_CELL = /^(?:|[-–—]|n\\/?a|n\\.a\\.|tbd|\\.|·|–|—)$/i;\nvar CURRENCY = /[$€£¥₹¢₽₺]|\\b(?:usd|eur|gbp|chf|jpy|cad|aud)\\b/gi;\nvar MAGNITUDE_SUFFIX = /(?<=\\d)\\s*(?:k|m|mn|bn|b|tn|pp|bps|x)\\b/i;\nfunction columnNumericProfile(values) {\n const decimals = /* @__PURE__ */ new Set();\n let counted = 0;\n for (const value of values) {\n const trimmed = value.trim();\n if (BLANK_CELL.test(trimmed)) continue;\n const parsed = parseNumericCell(trimmed);\n if (!parsed) return { numeric: false, decimals: [], counted };\n counted += 1;\n decimals.add(parsed.decimals);\n }\n return {\n numeric: counted >= 2,\n decimals: [...decimals].sort((a, b) => a - b),\n counted\n };\n}\nfunction parseNumericCell(text2) {\n let body = text2.trim();\n if (body === \"\") return void 0;\n let sign = 1;\n const bracketed = /^\\((.*)\\)$/.exec(body);\n if (bracketed) {\n sign = -1;\n body = bracketed[1].trim();\n }\n body = body.replace(CURRENCY, \"\").replace(/%/g, \"\").trim();\n body = body.replace(MAGNITUDE_SUFFIX, \"\").trim();\n body = body.replace(/[\\s'’]/g, \"\");\n const leading = /^([+\\-−])(.*)$/.exec(body);\n if (leading) {\n if (leading[1] !== \"+\") sign = -sign;\n body = leading[2];\n }\n if (body === \"\" || !/^[\\d.,]+$/.test(body)) return void 0;\n const separators = [...body].filter(\n (character) => character === \".\" || character === \",\"\n );\n if (separators.length === 0) {\n if (!/^\\d+$/.test(body)) return void 0;\n return { value: sign * Number(body), decimals: 0 };\n }\n const lastIndex = Math.max(body.lastIndexOf(\".\"), body.lastIndexOf(\",\"));\n const head = body.slice(0, lastIndex);\n const tail = body.slice(lastIndex + 1);\n if (!/^\\d+$/.test(tail) || tail === \"\") return void 0;\n if (head !== \"\" && !/^\\d{1,3}(?:[.,]\\d{3})*$/.test(head)) return void 0;\n const digitsOnlyHead = head.replace(/[.,]/g, \"\");\n const otherMark = body[lastIndex] === \".\" ? \",\" : \".\";\n const thousands = tail.length === 3 && !head.includes(otherMark);\n const value = thousands ? Number(`${digitsOnlyHead}${tail}`) : Number(`${digitsOnlyHead === \"\" ? \"0\" : digitsOnlyHead}.${tail}`);\n if (!Number.isFinite(value)) return void 0;\n return { value: sign * value, decimals: thousands ? 0 : tail.length };\n}\nvar UNIT_MARKER = /[%$€£¥₹]|\\([^)]{1,24}\\)|\\b(?:bn|mn|pp|bps|kg|km|kwh|mwh?|gwh?|tco2e?|usd|eur|gbp|chf|units?|hours?|days?|weeks?|months?|years?|fte|index|per\\s+\\w+)\\b/i;\nfunction hasUnitMarker(label) {\n return UNIT_MARKER.test(label);\n}\nvar DEFAULT_IMAGE_ASPECT_TOLERANCE = 0.02;\nvar aspectLabel = (ratio) => `${Math.round(ratio * 100) / 100}:1`;\nfunction imageAspectFinding(image, surface, tolerance = DEFAULT_IMAGE_ASPECT_TOLERANCE) {\n if (!Number.isFinite(image.drawn) || !Number.isFinite(image.natural) || image.natural <= 0)\n return void 0;\n if (Math.abs(image.drawn - image.natural) / image.natural <= tolerance)\n return void 0;\n const sides = surface === \"page\" ? \"width and height\" : \"w and h\";\n return {\n path: image.path,\n message: `The image is drawn at ${aspectLabel(image.drawn)} and the asset is ${aspectLabel(image.natural)}, so it is stretched on the ${surface}.`,\n suggestion: `State one of ${sides} and let the other follow the asset, or crop the asset to the shape you want.`,\n context: { drawn: image.drawn, natural: image.natural },\n evidence: {\n actual: Math.round(image.drawn * 1e3) / 1e3,\n expected: Math.round(image.natural * 1e3) / 1e3,\n values: { source: \"asset\" }\n }\n };\n}\n\n// src/type-consistency.ts\nvar SIZE_TOLERANCE_PT = 0.25;\nvar near = (a, b) => Math.abs(a - b) <= SIZE_TOLERANCE_PT;\nvar patchable = (sizes) => sizes.filter((size) => size.sizePath !== void 0 && !size.generated);\nfunction driftingSizes(sizes, roleSizesPt) {\n const byRole = /* @__PURE__ */ new Map();\n for (const size of sizes) {\n if (size.role === void 0) continue;\n byRole.set(size.role, [...byRole.get(size.role) ?? [], size]);\n }\n const drifting = /* @__PURE__ */ new Map();\n for (const [role, members] of byRole) {\n const painted = [...new Set(members.map((m) => m.fontSizePt))].sort(\n (a, b) => a - b\n );\n if (painted.length < 2) continue;\n const expected = roleSizesPt[role];\n if (expected === void 0) continue;\n for (const member of patchable(members))\n if (!near(member.fontSizePt, expected))\n drifting.set(member, { expected, sizes: painted });\n }\n return drifting;\n}\nfunction nearestSize(size, scale) {\n let best = scale[0];\n for (const candidate of scale)\n if (Math.abs(candidate - size) < Math.abs(best - size)) best = candidate;\n return best;\n}\nfunction offScaleFindings(sizes, scale, themeName, vocabulary, drifting = /* @__PURE__ */ new Map()) {\n if (scale.length === 0) return [];\n const drifted = new Set([...drifting.keys()].map((size) => size.sizePath));\n const offScale = patchable(sizes).filter(\n (size) => !drifted.has(size.sizePath) && !scale.some((step) => near(step, size.fontSizePt))\n );\n const groups = /* @__PURE__ */ new Map();\n for (const size of offScale) {\n const key = `${size.role ?? \"\"}@${size.fontSizePt}`;\n groups.set(key, [...groups.get(key) ?? [], size]);\n }\n return [...groups.values()].map((members) => {\n const [first] = members;\n const nearest = nearestSize(first.fontSizePt, scale);\n const sizePaths = members.map((member) => member.sizePath);\n const count = members.length === 1 ? \"\" : ` (${members.length} places, patched together)`;\n const role = first.role ?? `the ${vocabulary.subject} default`;\n return {\n path: sizePaths[0],\n ...sizePaths.length > 1 && { relatedPaths: sizePaths.slice(1) },\n message: `${first.fontSizePt}pt is not a size the ${themeName} theme paints; the nearest on its scale is ${nearest}pt${count}.`,\n suggestion: `Use ${nearest}pt, or drop the size and let \"${role}\" set it.`,\n context: { role: first.role, scale, paths: sizePaths },\n evidence: {\n actual: first.fontSizePt,\n expected: nearest,\n unit: \"pt\",\n values: { source: \"theme\" }\n },\n fixes: sizePaths.map(\n (path) => ({ op: \"replace\", path, value: nearest })\n )\n };\n });\n}\nfunction sizeCountFinding(sizes, maximum, themePath, profileId, vocabulary) {\n const firstPathBySize = /* @__PURE__ */ new Map();\n for (const size of sizes) {\n const rounded = Math.round(size.fontSizePt * 4) / 4;\n if (!firstPathBySize.has(rounded)) firstPathBySize.set(rounded, size.path);\n }\n if (firstPathBySize.size <= maximum) return [];\n const painted = [...firstPathBySize.keys()].sort((a, b) => a - b);\n return [\n {\n path: themePath,\n relatedPaths: painted.map((size) => firstPathBySize.get(size)),\n message: `The ${vocabulary.subject} paints ${painted.length} distinct text sizes (${painted.join(\", \")}pt); the ${profileId ?? \"selected\"} profile allows ${maximum}.`,\n suggestion: vocabulary.keepTo,\n context: { sizes: painted, maximum },\n evidence: {\n actual: painted.length,\n expected: maximum,\n values: { source: \"profile\" }\n }\n }\n ];\n}\nfunction roleDriftFindings(sizes, roleSizesPt) {\n const findings = [];\n for (const [size, { expected, sizes: painted }] of driftingSizes(\n sizes,\n roleSizesPt\n )) {\n const keeper = sizes.find(\n (member) => member.role === size.role && near(member.fontSizePt, expected)\n );\n const others = painted.filter((value) => value !== size.fontSizePt);\n const sizePath = size.sizePath;\n findings.push({\n path: sizePath,\n ...keeper && { relatedPaths: [keeper.path] },\n message: `\"${size.role}\" is painted at ${size.fontSizePt}pt here and at ${others.join(\"pt, \")}pt elsewhere; the theme sets it at ${expected}pt.`,\n suggestion: `Drop the size so \"${size.role}\" paints at the theme's ${expected}pt.`,\n context: { role: size.role, sizes: painted },\n evidence: {\n actual: size.fontSizePt,\n expected,\n unit: \"pt\",\n values: { role: size.role, source: \"theme\" }\n },\n fixes: [{ op: \"replace\", path: sizePath, value: expected }]\n });\n }\n return findings;\n}\n\n// src/registry.ts\nvar DuplicateQualityRuleError = class extends Error {\n constructor(ruleId) {\n super(`Quality rule \"${ruleId}\" is already registered`);\n this.name = \"DuplicateQualityRuleError\";\n }\n};\nvar QualityRuleRegistry = class {\n entries = /* @__PURE__ */ new Map();\n constructor(rules = []) {\n for (const rule of rules) this.register(rule);\n }\n register(rule) {\n if (this.entries.has(rule.id)) {\n throw new DuplicateQualityRuleError(rule.id);\n }\n this.entries.set(rule.id, rule);\n return this;\n }\n registerPack(pack) {\n const ids = new Set(this.entries.keys());\n for (const rule of pack.rules) {\n if (ids.has(rule.id)) {\n throw new DuplicateQualityRuleError(rule.id);\n }\n ids.add(rule.id);\n }\n for (const rule of pack.rules) this.register(rule);\n return this;\n }\n has(ruleId) {\n return this.entries.has(ruleId);\n }\n get(ruleId) {\n return this.entries.get(ruleId);\n }\n rules(format) {\n const all = [...this.entries.values()];\n if (format === void 0) return all;\n return all.filter(\n (rule) => rule.formats === void 0 || rule.formats.includes(format)\n );\n }\n};\n\n// src/placeholder.ts\nvar SCAFFOLD_MARKER_SYNTAX = \"{{\\u2026}}\";\nfunction isScaffoldMarker(value) {\n return /^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(value);\n}\nvar EXCERPT_MAX = 60;\nvar PATTERNS = [\n {\n id: \"scaffold-marker\",\n kind: \"scaffold-marker\",\n expression: /\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}/\n },\n { id: \"lorem-ipsum\", kind: \"filler\", expression: /lorem\\s+ipsum/i },\n {\n id: \"your-x-here\",\n kind: \"filler\",\n expression: /\\byour\\b[^.!?\\n]{0,40}?\\bhere\\b/i\n },\n {\n id: \"goes-here\",\n kind: \"filler\",\n expression: /\\b(?:goes\\s+here|go\\s+here|(?:text|title|subtitle|content|image|logo|caption|name)\\s+here)\\b/i\n },\n {\n id: \"click-to-add\",\n kind: \"filler\",\n expression: /\\bclick\\s+to\\s+(?:add|edit)\\b/i\n },\n {\n id: \"bracketed\",\n kind: \"filler\",\n expression: /^\\[[^[\\]\\n]*[A-Za-z][^[\\]\\n]*\\]$/\n },\n {\n id: \"debris\",\n kind: \"filler\",\n expression: /^(?:todo|fixme|x{3,}|placeholder|sample\\s+text|dummy\\s+text|insert\\s+text)$/i\n }\n];\nfunction excerpt(value) {\n const collapsed = value.replace(/\\s+/g, \" \").trim();\n return collapsed.length > EXCERPT_MAX ? `${collapsed.slice(0, EXCERPT_MAX - 1)}\\u2026` : collapsed;\n}\nfunction detectPlaceholder(text2) {\n const trimmed = text2.trim();\n if (trimmed === \"\") return void 0;\n for (const pattern of PATTERNS) {\n const found = pattern.expression.exec(trimmed);\n if (found) {\n return {\n kind: pattern.kind,\n pattern: pattern.id,\n excerpt: excerpt(found[0])\n };\n }\n }\n return void 0;\n}\nvar PLACEHOLDER_PATTERN_IDS = PATTERNS.map(\n (pattern) => pattern.id\n);\nfunction pointerSegment2(value) {\n return value.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction collectPlaceholders(document) {\n const found = [];\n const visit = (node, path) => {\n if (typeof node === \"string\") {\n const match = detectPlaceholder(node);\n if (match) found.push({ path, text: node, match });\n return;\n }\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (typeof node !== \"object\" || node === null) return;\n const record2 = node;\n if (record2.enabled === false) return;\n for (const [key, value] of Object.entries(record2)) {\n visit(value, `${path}/${pointerSegment2(key)}`);\n }\n };\n visit(document, \"\");\n return found;\n}\nfunction placeholderFinding(input) {\n const marker = input.kind === \"scaffold-marker\";\n return {\n code: marker ? QUALITY_CODES.SCAFFOLD_MARKER : QUALITY_CODES.PLACEHOLDER_TEXT,\n severity: \"warning\",\n category: \"integrity\",\n certainty: \"deterministic\",\n message: marker ? `Unfilled scaffold slot: \"${input.excerpt}\". Generation refuses a document that still carries a marker.` : `Placeholder text left in the document: \"${input.excerpt}\".`,\n path: input.path,\n suggestion: marker ? \"Patch the slot with real content, or remove the component that holds it.\" : \"Replace it with the real content, or delete the component.\",\n context: { kind: input.kind, pattern: input.pattern },\n evidence: { summary: input.excerpt }\n };\n}\n\n// src/engine.ts\nvar QualityProfileError = class extends Error {\n code = \"QUALITY_PROFILE_INCOMPATIBLE\";\n constructor(message) {\n super(message);\n this.name = \"QualityProfileError\";\n }\n};\nvar QualityGateError = class extends Error {\n code = \"QUALITY_GATE_FAILED\";\n analysis;\n constructor(analysis) {\n const blocking = analysis.diagnostics.filter(\n (diagnostic) => diagnostic.blocking\n );\n super(\n `Quality gate failed with ${blocking.length} blocking diagnostic${blocking.length === 1 ? \"\" : \"s\"}`\n );\n this.name = \"QualityGateError\";\n this.analysis = analysis;\n }\n};\nfunction errorMessage(error) {\n return error instanceof Error ? error.message : String(error);\n}\nfunction emptyCounts() {\n return { error: 0, warning: 0, info: 0 };\n}\nfunction countDiagnostics(diagnostics) {\n const counts = emptyCounts();\n for (const diagnostic of diagnostics) counts[diagnostic.severity] += 1;\n return counts;\n}\nfunction assertProfileSupports(profile, prepared) {\n if (profile?.formats && !profile.formats.includes(prepared.format)) {\n throw new QualityProfileError(\n `Quality profile \"${profile.id}\" does not support format \"${prepared.format}\"`\n );\n }\n if (profile?.rendererTargets) {\n if (!prepared.renderer) {\n throw new QualityProfileError(\n `Quality profile \"${profile.id}\" declares renderer targets, but the prepared document has no renderer identity`\n );\n }\n if (!profile.rendererTargets.includes(prepared.renderer)) {\n throw new QualityProfileError(\n `Quality profile \"${profile.id}\" does not support renderer \"${prepared.renderer}\"`\n );\n }\n }\n}\nvar QualityEngine = class {\n registry;\n constructor(rules = []) {\n this.registry = rules instanceof QualityRuleRegistry ? rules : new QualityRuleRegistry(rules);\n }\n async analyze(prepared, options = {}) {\n assertValidQualityPolicy(options.policy);\n assertValidQualityProfile(options.profile);\n assertProfileSupports(options.profile, prepared);\n return this.runAsync(prepared, options);\n }\n analyzeSync(prepared, options = {}) {\n assertValidQualityPolicy(options.policy);\n assertValidQualityProfile(options.profile);\n assertProfileSupports(options.profile, prepared);\n const state = createAnalysisState();\n for (const rule of this.registry.rules(prepared.format)) {\n const configuration = resolveRuleConfiguration(\n rule,\n options.profile,\n options.policy\n );\n if (!configuration.enabled) continue;\n state.evaluatedRuleIds.push(rule.id);\n let findings;\n try {\n findings = rule.evaluate({\n prepared,\n facts: prepared.facts,\n profile: options.profile,\n policy: options.policy,\n configuration\n });\n } catch (error) {\n handleRuleError(state.ruleErrors, rule.id, error, options.policy);\n continue;\n }\n if (isPromiseLike(findings)) {\n throw new Error(\n `Quality rule \"${rule.id}\" is asynchronous; use analyze()`\n );\n }\n appendFindings(state, rule, findings, options);\n }\n return finalizeAnalysis(state, options);\n }\n async runAsync(prepared, options) {\n assertProfileSupports(options.profile, prepared);\n const state = createAnalysisState();\n for (const rule of this.registry.rules(prepared.format)) {\n const configuration = resolveRuleConfiguration(\n rule,\n options.profile,\n options.policy\n );\n if (!configuration.enabled) continue;\n state.evaluatedRuleIds.push(rule.id);\n let findings;\n try {\n findings = await rule.evaluate({\n prepared,\n facts: prepared.facts,\n profile: options.profile,\n policy: options.policy,\n configuration\n });\n } catch (error) {\n handleRuleError(state.ruleErrors, rule.id, error, options.policy);\n continue;\n }\n appendFindings(state, rule, findings, options);\n }\n return finalizeAnalysis(state, options);\n }\n};\nfunction createAnalysisState() {\n return {\n diagnostics: [],\n evaluatedRuleIds: [],\n ruleErrors: [],\n suppressedCount: 0\n };\n}\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && typeof value.then === \"function\";\n}\nfunction handleRuleError(ruleErrors, ruleId, error, policy) {\n if (policy?.onRuleError === \"throw\") throw error;\n ruleErrors.push({ ruleId, message: errorMessage(error) });\n}\nfunction appendFindings(state, rule, findings, options) {\n const configuration = resolveRuleConfiguration(\n rule,\n options.profile,\n options.policy\n );\n for (const finding of findings) {\n const severity = configuration.severityOverride ?? finding.severity ?? configuration.severity;\n const diagnostic = {\n source: \"quality\",\n ruleId: rule.id,\n code: finding.code ?? rule.code,\n category: finding.category ?? rule.category,\n certainty: finding.certainty ?? rule.defaultCertainty,\n severity,\n message: finding.message,\n path: finding.path,\n blocking: isBlocking(severity, options.policy?.gate),\n ...options.profile && { profileId: options.profile.id },\n ...finding.suggestion !== void 0 && {\n suggestion: finding.suggestion\n },\n ...finding.context !== void 0 && { context: finding.context },\n ...finding.relatedPaths !== void 0 && {\n relatedPaths: finding.relatedPaths\n },\n ...finding.evidence !== void 0 && {\n evidence: finding.evidence\n },\n ...finding.fixes !== void 0 && { fixes: finding.fixes }\n };\n if (isSuppressed(diagnostic, options.policy?.suppressions)) {\n state.suppressedCount += 1;\n continue;\n }\n state.diagnostics.push(diagnostic);\n }\n}\nfunction finalizeAnalysis(state, options) {\n const counts = countDiagnostics(state.diagnostics);\n const blocked = state.diagnostics.some((diagnostic) => diagnostic.blocking);\n const maxDiagnostics = options.policy?.maxDiagnostics;\n let kept = state.diagnostics;\n let truncated = false;\n if (maxDiagnostics !== void 0 && Number.isInteger(maxDiagnostics) && maxDiagnostics >= 0 && state.diagnostics.length > maxDiagnostics) {\n const ordered = state.diagnostics.map((diagnostic, index) => ({ diagnostic, index })).sort(\n (a, b) => severityRank(a.diagnostic.severity) - severityRank(b.diagnostic.severity) || a.index - b.index\n );\n const blockingCount = ordered.filter(\n ({ diagnostic }) => diagnostic.blocking\n ).length;\n let budget = Math.max(0, maxDiagnostics - blockingCount);\n kept = ordered.filter(({ diagnostic }) => {\n if (diagnostic.blocking) return true;\n if (budget === 0) return false;\n budget -= 1;\n return true;\n }).map(({ diagnostic }) => diagnostic);\n truncated = kept.length < state.diagnostics.length;\n }\n return {\n diagnostics: kept,\n counts,\n blocked,\n truncated,\n suppressedCount: state.suppressedCount,\n evaluatedRuleIds: state.evaluatedRuleIds,\n ruleErrors: state.ruleErrors,\n ...options.profile && { profileId: options.profile.id }\n };\n}\nfunction qualitySeverityCounts(diagnostics) {\n return countDiagnostics(diagnostics);\n}\nexport {\n DEFAULT_IMAGE_ASPECT_TOLERANCE,\n DEFAULT_MAXIMUM_CHART_SERIES,\n DEFAULT_MAXIMUM_PIE_SLICES,\n DuplicateQualityRuleError,\n PLACEHOLDER_PATTERN_IDS,\n QUALITY_CODES,\n QualityEngine,\n QualityGateError,\n QualityPolicyError,\n QualityProfileError,\n QualityRuleRegistry,\n SCAFFOLD_MARKER_SYNTAX,\n SIZE_TOLERANCE_PT,\n assertValidQualityPolicy,\n assertValidQualityProfile,\n chartEncodingFor,\n chartInfoDesignFindings,\n collectColorLiterals,\n collectFontFamilies,\n collectPlaceholders,\n columnNumericProfile,\n detectPlaceholder,\n driftingSizes,\n fontCountFinding,\n hasUnitMarker,\n imageAspectFinding,\n isBlocking,\n isScaffoldMarker,\n isSuppressed,\n mergeQualityProfiles,\n nearestPaletteToken,\n normalizeHex,\n normalizeHighchartsChart,\n offPaletteFinding,\n offScaleFindings,\n parseNumericCell,\n placeholderFinding,\n qualitySeverityCounts,\n resolveRuleConfiguration,\n roleDriftFindings,\n severityRank,\n sizeCountFinding,\n tableInfoDesignFindings\n};\n//# sourceMappingURL=index.js.map","import {\n FONT_URL_ALLOWLIST,\n detectFontFormat,\n isAllowedFontUrl,\n readFontFamilyNames,\n readNameRecords,\n rewriteFontFamilyName,\n standardSubfamilyNames\n} from \"./chunk-OM2IOZMT.js\";\nimport {\n ComponentValidationError,\n DuplicateComponentError,\n UnknownPreservedComponentError,\n createComponent,\n createVersion,\n getValidationSummary,\n isValidationSuccess,\n resolveComponentVersion,\n validateCustomComponentProps\n} from \"./chunk-A4CY2MAM.js\";\nimport {\n DEFAULT_ERROR_CONFIG,\n ERROR_EMOJIS,\n calculatePosition,\n clearComponentNamesCache,\n createErrorConfig,\n createJsonParseError,\n extractStandardComponentNames,\n formatErrorMessage,\n formatErrorSummary,\n getLiteralValue,\n getObjectSchemaPropertyNames,\n getSchemaMetadata,\n groupErrorsByPath,\n isLiteralSchema,\n isObjectSchema,\n isUnionSchema,\n transformValueError,\n transformValueErrors\n} from \"./chunk-LLBCT7WL.js\";\nimport {\n FeatureRequirementCollector,\n RENDERER_DEPENDENCY_MISSING,\n RendererRegistry,\n UnsupportedRendererFeatureError,\n assertNever,\n assertRendererSupports,\n diagnoseUnsupportedFeatures,\n partitionDiagnostics,\n rendererError,\n rendererWarning\n} from \"./chunk-QLZNOXT5.js\";\nimport {\n convertToJsonSchema,\n createComponentSchema,\n createComponentSchemaObject,\n exportSchemaToFile,\n fixSchemaReferences,\n restructureNameDiscriminatedUnions,\n unionBranches\n} from \"./chunk-LFHU4EOV.js\";\nimport {\n CANVASES,\n ChromeSchema,\n DesignSpacingSchema,\n DesignSystemProperties,\n DesignSystemSchema,\n FontFamilyNameSchema,\n FontRegistryEntrySchema,\n FontRegistrySchema,\n FontSourceSchema,\n MotifSchema,\n PaletteSchema,\n ROLE_SCALE_STEPS,\n SAFE_FONTS,\n TYPE_ROLES,\n TextCaseSchema,\n TypeRoleNameSchema,\n TypeRoleSchema,\n TypeRolesSchema,\n TypographySchema,\n capsFormatting,\n designCanvas,\n designColors,\n isSafeFont,\n resolveDesignColor,\n resolveMotif,\n resolveTypeRoles,\n typeScaleSizes,\n validateDesignColors\n} from \"./chunk-7ZEN5H5R.js\";\nimport {\n compareSemver,\n isValidSemver,\n latestVersion,\n parseSemver\n} from \"./chunk-244MHDOZ.js\";\n\n// src/types/services.ts\nvar DEFAULT_VISUAL_DPI = 200;\nvar MIN_VISUAL_DPI = 36;\nvar MAX_VISUAL_DPI = 600;\nfunction clampVisualDpi(dpi) {\n if (typeof dpi !== \"number\" || !Number.isFinite(dpi))\n return DEFAULT_VISUAL_DPI;\n return Math.min(MAX_VISUAL_DPI, Math.max(MIN_VISUAL_DPI, Math.round(dpi)));\n}\nvar MAX_RASTERIZE_FONTS = 32;\nvar MAX_RASTERIZE_FONT_BYTES = 8 * 1024 * 1024;\nvar MAX_RASTERIZE_BATCH_SLIDES = 32;\n\n// src/fonts/collect.ts\nvar FONT_NAME_KEYS = /* @__PURE__ */ new Set([\n \"family\",\n \"fontFace\",\n \"titleFontFace\",\n \"legendFontFace\",\n \"dataLabelFontFace\",\n \"catAxisLabelFontFace\",\n \"valAxisLabelFontFace\"\n]);\nvar THEME_FONT_KEYS = /* @__PURE__ */ new Set([\"heading\", \"body\", \"mono\", \"light\"]);\nvar FONT_DECLARATION_KEYS = /* @__PURE__ */ new Set([\"fontRegistry\"]);\nfunction collect(node, out, parentKey) {\n if (node == null) return;\n if (typeof node === \"string\") {\n if (parentKey && (FONT_NAME_KEYS.has(parentKey) || THEME_FONT_KEYS.has(parentKey))) {\n const trimmed = node.trim();\n if (trimmed.length > 0) out.add(trimmed);\n }\n return;\n }\n if (Array.isArray(node)) {\n for (const item of node) collect(item, out, parentKey);\n return;\n }\n if (typeof node === \"object\") {\n const maybeFonts = node.fonts;\n if (parentKey === \"theme\" && maybeFonts && typeof maybeFonts === \"object\") {\n for (const [k, v] of Object.entries(\n maybeFonts\n )) {\n if (typeof v === \"string\") {\n const trimmed = v.trim();\n if (trimmed.length > 0) out.add(trimmed);\n } else if (v && typeof v === \"object\") {\n const fam = v.family;\n if (typeof fam === \"string\" && fam.trim().length > 0) {\n out.add(fam.trim());\n }\n }\n void k;\n }\n }\n for (const [k, v] of Object.entries(node)) {\n if (FONT_DECLARATION_KEYS.has(k)) continue;\n collect(v, out, k);\n }\n }\n}\nfunction collectFontNames(doc) {\n const out = /* @__PURE__ */ new Set();\n collect(doc, out);\n return out;\n}\nvar collectFontNamesFromDocx = collectFontNames;\nvar collectFontNamesFromPptx = collectFontNames;\n\n// src/fonts/document-registry.ts\nfunction isEntry(v) {\n if (!v || typeof v !== \"object\") return false;\n const e = v;\n return typeof e.id === \"string\" && typeof e.family === \"string\" && Array.isArray(e.sources);\n}\nfunction readAt(node, key) {\n if (!node || typeof node !== \"object\") return [];\n const raw = node[key];\n return Array.isArray(raw) ? raw.filter(isEntry) : [];\n}\nfunction documentFontRegistry(document) {\n if (!document || typeof document !== \"object\") return [];\n return readAt(document.props, \"fontRegistry\");\n}\nfunction themeFontRegistry(theme) {\n return readAt(theme, \"fontRegistry\");\n}\nfunction mergeFontRegistries(...groups) {\n const out = [];\n for (const group of groups) {\n for (const entry of group ?? []) {\n const family = entry.family.toLowerCase();\n const id = entry.id.toLowerCase();\n for (let i = out.length - 1; i >= 0; i--) {\n if (out[i].family.toLowerCase() === family && out[i].id.toLowerCase() === id) {\n out.splice(i, 1);\n }\n }\n out.push(entry);\n }\n }\n return out;\n}\n\n// src/fonts/validator.ts\nfunction buildRegistryIndex(registeredEntries) {\n const idx = /* @__PURE__ */ new Set();\n for (const e of registeredEntries ?? []) {\n idx.add(e.family.toLowerCase());\n idx.add(e.id.toLowerCase());\n }\n return idx;\n}\nfunction validateFontReferences(input) {\n const registryIdx = buildRegistryIndex(input.registeredEntries);\n const resolved = [];\n const unresolved = [];\n const warnings = [];\n for (const name of input.referencedNames) {\n if (isSafeFont(name) || registryIdx.has(name.toLowerCase())) {\n resolved.push(name);\n continue;\n }\n unresolved.push(name);\n warnings.push({\n code: \"FONT_UNRESOLVED\",\n family: name,\n message: `Font \"${name}\" 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: ${SAFE_FONTS.join(\", \")}.`\n });\n }\n return { resolved, unresolved, warnings };\n}\n\n// src/fonts/synthesize.ts\nvar WEIGHT_LABELS = {\n 100: \"Thin\",\n 200: \"ExtraLight\",\n 300: \"Light\",\n 400: \"Regular\",\n 500: \"Medium\",\n 600: \"SemiBold\",\n 700: \"Bold\",\n 800: \"ExtraBold\",\n 900: \"Black\"\n};\nfunction synthesizeFamilyName(family, weight2, italic) {\n if (weight2 == null) {\n return { family, bold: false, italic, nonCanonicalWeight: false };\n }\n if (weight2 === 400) {\n return { family, bold: false, italic, nonCanonicalWeight: false };\n }\n if (weight2 === 700) {\n return { family, bold: true, italic, nonCanonicalWeight: false };\n }\n const label = WEIGHT_LABELS[weight2];\n if (!label) {\n return {\n family,\n bold: weight2 >= 600,\n italic,\n nonCanonicalWeight: true\n };\n }\n const suffix = italic ? ` ${label} Italic` : ` ${label}`;\n return {\n family: `${family}${suffix}`,\n bold: false,\n italic: false,\n nonCanonicalWeight: false\n };\n}\n\n// src/fonts/sources/data-loader.ts\nvar MAX_DATA_FONT_BYTES = 5 * 1024 * 1024;\nfunction loadDataFontSource(input) {\n const raw = input.data.trim();\n let b64;\n if (raw.startsWith(\"data:\")) {\n const comma = raw.indexOf(\",\");\n if (comma < 0) throw new Error(\"Invalid data URL: no payload separator\");\n const header = raw.slice(5, comma);\n if (!header.includes(\";base64\")) {\n throw new Error(\"Data URL must be base64-encoded\");\n }\n b64 = raw.slice(comma + 1);\n } else {\n b64 = raw;\n }\n const approxDecodedBytes = Math.floor(b64.length * 3 / 4);\n if (approxDecodedBytes > MAX_DATA_FONT_BYTES) {\n throw new Error(\n `Font data payload exceeds ${MAX_DATA_FONT_BYTES} byte limit`\n );\n }\n const data = Buffer.from(b64, \"base64\");\n if (data.length === 0) throw new Error(\"Decoded font buffer is empty\");\n if (data.length > MAX_DATA_FONT_BYTES) {\n throw new Error(\n `Font data payload exceeds ${MAX_DATA_FONT_BYTES} byte limit`\n );\n }\n const format = detectFontFormat(data);\n if (format === \"unknown\") {\n throw new Error(\n \"Decoded font buffer is not a recognized font (expected TTF/OTF/WOFF/WOFF2)\"\n );\n }\n return {\n data,\n weight: input.weight ?? 400,\n italic: input.italic ?? false,\n format\n };\n}\n\n// src/fonts/sources/google-fetcher.ts\nvar TTF_UA = \"Mozilla/4.0\";\nasync function fetchWithTimeout(url, opts) {\n const ctrl = new AbortController();\n const timer = setTimeout(() => ctrl.abort(), opts.timeoutMs ?? 5e3);\n try {\n const f = opts.fetcher ?? fetch;\n return await f(url, { headers: opts.headers, signal: ctrl.signal });\n } finally {\n clearTimeout(timer);\n }\n}\nfunction buildCssUrl(family, weights, italics) {\n const famPart = encodeURIComponent(family).replace(/%20/g, \"+\");\n const sortedWeights = [...weights].sort((a, b) => a - b);\n if (italics) {\n const axis = sortedWeights.flatMap((w) => [`0,${w}`, `1,${w}`]).join(\";\");\n return `https://fonts.googleapis.com/css2?family=${famPart}:ital,wght@${axis}&display=swap`;\n }\n const wghtPart = sortedWeights.join(\";\");\n return `https://fonts.googleapis.com/css2?family=${famPart}:wght@${wghtPart}&display=swap`;\n}\nfunction parseCssFaces(css) {\n const out = [];\n const faceRe = /@font-face\\s*\\{([^}]*)\\}/g;\n let m;\n while ((m = faceRe.exec(css)) !== null) {\n const block = m[1];\n const urlM = block.match(\n /src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/[^)]+\\.ttf)\\)/\n );\n if (!urlM) continue;\n const weightM = block.match(/font-weight:\\s*(\\d+)/);\n const italicM = block.match(/font-style:\\s*italic/);\n out.push({\n weight: weightM ? parseInt(weightM[1], 10) : 400,\n italic: Boolean(italicM),\n ttfUrl: urlM[1]\n });\n }\n return out;\n}\nfunction cacheKey(family, weight2, italic) {\n return `google|${family}|${weight2}|${italic ? \"i\" : \"r\"}`;\n}\nasync function fetchGoogleFontSources(opts) {\n const weights = opts.weights?.length ? opts.weights : [400, 700];\n const italics = opts.italics ?? false;\n const warnings = [];\n const sources = [];\n const wanted = [];\n for (const w of weights) {\n wanted.push({ weight: w, italic: false });\n if (italics) wanted.push({ weight: w, italic: true });\n }\n const pending = [];\n for (const w of wanted) {\n const key = cacheKey(opts.family, w.weight, w.italic);\n const mem = opts.memoryCache?.get(key);\n if (mem) {\n sources.push({\n data: mem,\n weight: w.weight,\n italic: w.italic,\n format: detectFontFormat(mem)\n });\n continue;\n }\n const disk = await opts.diskCache?.get(key);\n if (disk) {\n opts.memoryCache?.set(key, disk);\n sources.push({\n data: disk,\n weight: w.weight,\n italic: w.italic,\n format: detectFontFormat(disk)\n });\n continue;\n }\n pending.push(w);\n }\n if (pending.length === 0) {\n return { sources, warnings };\n }\n const needItalics = pending.some((p) => p.italic);\n const cssUrl = buildCssUrl(\n opts.family,\n Array.from(new Set(pending.map((p) => p.weight))),\n needItalics\n );\n let faces;\n try {\n const cssRes = await fetchWithTimeout(cssUrl, {\n headers: { \"User-Agent\": TTF_UA },\n timeoutMs: opts.fetchTimeoutMs,\n fetcher: opts.fetcher\n });\n if (!cssRes.ok) {\n warnings.push(\n `Google Fonts CSS fetch for \"${opts.family}\" returned ${cssRes.status}`\n );\n return { sources, warnings };\n }\n const css = await cssRes.text();\n faces = parseCssFaces(css);\n } catch (err) {\n warnings.push(\n `Google Fonts CSS fetch for \"${opts.family}\" failed: ${err.message}`\n );\n return { sources, warnings };\n }\n for (const need of pending) {\n const match = faces.find(\n (f) => f.weight === need.weight && f.italic === need.italic\n );\n if (!match) {\n warnings.push(\n `Google Fonts \"${opts.family}\" missing weight ${need.weight}${need.italic ? \" italic\" : \"\"}`\n );\n continue;\n }\n try {\n const res = await fetchWithTimeout(match.ttfUrl, {\n timeoutMs: opts.fetchTimeoutMs,\n fetcher: opts.fetcher\n });\n if (!res.ok) {\n warnings.push(\n `Google Fonts TTF fetch for \"${opts.family}\" ${need.weight} returned ${res.status}`\n );\n continue;\n }\n const ab = await res.arrayBuffer();\n const buf = Buffer.from(ab);\n const key = cacheKey(opts.family, need.weight, need.italic);\n opts.memoryCache?.set(key, buf);\n await opts.diskCache?.set(key, buf);\n sources.push({\n data: buf,\n weight: need.weight,\n italic: need.italic,\n format: detectFontFormat(buf)\n });\n } catch (err) {\n warnings.push(\n `Google Fonts TTF fetch for \"${opts.family}\" ${need.weight} failed: ${err.message}`\n );\n }\n }\n return { sources, warnings };\n}\n\n// src/fonts/sources/url-fetcher.ts\nfunction cacheKey2(url, weight2, italic) {\n return `url|${url}|${weight2}|${italic ? \"i\" : \"r\"}`;\n}\nasync function fetchUrlFontSource(opts) {\n if (!isAllowedFontUrl(opts.url)) {\n return {\n warnings: [\n `URL font fetch rejected (host not in allowlist or non-HTTPS): ${opts.url}`\n ]\n };\n }\n const key = cacheKey2(opts.url, opts.weight, opts.italic);\n const mem = opts.memoryCache?.get(key);\n if (mem) {\n return {\n source: {\n data: mem,\n weight: opts.weight,\n italic: opts.italic,\n format: detectFontFormat(mem)\n },\n warnings: []\n };\n }\n const disk = await opts.diskCache?.get(key);\n if (disk) {\n opts.memoryCache?.set(key, disk);\n return {\n source: {\n data: disk,\n weight: opts.weight,\n italic: opts.italic,\n format: detectFontFormat(disk)\n },\n warnings: []\n };\n }\n const ctrl = new AbortController();\n const timer = setTimeout(() => ctrl.abort(), opts.fetchTimeoutMs ?? 1e4);\n try {\n const f = opts.fetcher ?? fetch;\n let res = await f(opts.url, { signal: ctrl.signal, redirect: \"manual\" });\n let hops = 0;\n while (res.status >= 300 && res.status < 400 && res.status !== 304) {\n const next = res.headers.get(\"location\");\n if (!next) {\n return {\n warnings: [\n `URL font fetch \"${opts.url}\" ${res.status} with no Location header`\n ]\n };\n }\n const resolved = new URL(next, opts.url).toString();\n if (!isAllowedFontUrl(resolved)) {\n return {\n warnings: [\n `URL font fetch \"${opts.url}\" redirected to disallowed host: ${resolved}`\n ]\n };\n }\n if (++hops > 3) {\n return {\n warnings: [`URL font fetch \"${opts.url}\" too many redirects`]\n };\n }\n res = await f(resolved, { signal: ctrl.signal, redirect: \"manual\" });\n }\n if (!res.ok) {\n return {\n warnings: [`URL font fetch \"${opts.url}\" returned ${res.status}`]\n };\n }\n const ab = await res.arrayBuffer();\n const raw = Buffer.from(ab);\n const format = detectFontFormat(raw);\n if (format === \"unknown\" || raw.length < 512) {\n return {\n warnings: [\n `URL font fetch \"${opts.url}\" returned ${raw.length} bytes of ${format} \\u2014 not a TTF/OTF. Skipping.`\n ]\n };\n }\n const buf = raw;\n opts.memoryCache?.set(key, buf);\n await opts.diskCache?.set(key, buf);\n return {\n source: {\n data: buf,\n weight: opts.weight,\n italic: opts.italic,\n format\n },\n warnings: []\n };\n } catch (err) {\n return {\n warnings: [\n `URL font fetch \"${opts.url}\" failed: ${err.message}`\n ]\n };\n } finally {\n clearTimeout(timer);\n }\n}\n\n// src/fonts/sources/ttf-validate.ts\nvar HEADER_SIZE = 12;\nvar TABLE_RECORD_SIZE = 16;\nfunction readTable(ttf, tag) {\n if (ttf.length < HEADER_SIZE) return null;\n const version = ttf.readUInt32BE(0);\n if (version !== 65536 && version !== 1330926671) return null;\n const numTables = ttf.readUInt16BE(4);\n for (let i = 0; i < numTables; i++) {\n const r = HEADER_SIZE + i * TABLE_RECORD_SIZE;\n if (r + TABLE_RECORD_SIZE > ttf.length) return null;\n if (ttf.toString(\"ascii\", r, r + 4) === tag) {\n return { off: ttf.readUInt32BE(r + 8), len: ttf.readUInt32BE(r + 12) };\n }\n }\n return null;\n}\nfunction readUsWeightClass(ttf) {\n const os2 = readTable(ttf, \"OS/2\");\n if (!os2) return null;\n if (os2.off + 6 > ttf.length) return null;\n return ttf.readUInt16BE(os2.off + 4);\n}\nfunction validateFontMetadata(ttf, weight2, italic, familyLabel) {\n const diags = [];\n const usWeight = readUsWeightClass(ttf);\n if (usWeight != null && usWeight !== weight2) {\n diags.push({\n code: \"WEIGHT_CLASS_MISMATCH\",\n message: `Font \"${familyLabel}\" weight ${weight2}: OS/2.usWeightClass reports ${usWeight}. Likely a defective redistribution \\u2014 consider adding an upstream override.`\n });\n }\n const declaredFamilies = readFontFamilyNames(ttf);\n if (declaredFamilies.length > 0 && !declaredFamilies.includes(familyLabel.trim())) {\n diags.push({\n code: \"FAMILY_MISMATCH\",\n message: `Font \"${familyLabel}\" weight ${weight2}${italic ? \" italic\" : \"\"}: name table declares ${declaredFamilies.map((f) => `\"${f}\"`).join(\n \" / \"\n )}, not \"${familyLabel}\". Referencing runs will not resolve this face.`\n });\n }\n const std = standardSubfamilyNames(weight2, italic);\n if (!std) return diags;\n const expected17 = std.typographic;\n const expected2 = std.legacy;\n const names = readNameRecords(ttf, /* @__PURE__ */ new Set([2, 17]));\n for (const n of names) {\n if (n.nameID === 17 && n.value !== expected17) {\n diags.push({\n code: \"SUBFAMILY_MISMATCH\",\n message: `Font \"${familyLabel}\" weight ${weight2}${italic ? \" italic\" : \"\"}: name record (platform ${n.platformID}) nameID 17 = \"${n.value}\", expected \"${expected17}\".`\n });\n }\n if (n.nameID === 2 && n.value !== expected2) {\n diags.push({\n code: \"LEGACY_SUBFAMILY_MISMATCH\",\n message: `Font \"${familyLabel}\" weight ${weight2}${italic ? \" italic\" : \"\"}: name record (platform ${n.platformID}) nameID 2 = \"${n.value}\", expected \"${expected2}\".`\n });\n }\n }\n return diags;\n}\n\n// src/fonts/sources/ttf-structure.ts\nvar SFNT_VERSIONS = /* @__PURE__ */ new Set([\n 65536,\n // TrueType outlines\n 1330926671,\n // 'OTTO' — CFF outlines\n 1953658213,\n // 'true'\n 1954115633\n // 'typ1'\n]);\nvar HEADER_SIZE2 = 12;\nvar TABLE_RECORD_SIZE2 = 16;\nfunction validateFontStructure(ttf, weight2, italic, familyLabel) {\n const face = `Font \"${familyLabel}\" weight ${weight2}${italic ? \" italic\" : \"\"}`;\n const unreadable = (reason) => ({\n code: \"FONT_UNREADABLE\",\n message: `${face}: ${reason} The face will not resolve; text referencing it renders in a fallback.`\n });\n if (ttf.length < HEADER_SIZE2) {\n return unreadable(\n `${ttf.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`\n );\n }\n const version = ttf.readUInt32BE(0);\n if (!SFNT_VERSIONS.has(version)) {\n return unreadable(\n `sfnt version 0x${version.toString(16).padStart(8, \"0\")} is neither TrueType nor OpenType.`\n );\n }\n const numTables = ttf.readUInt16BE(4);\n if (numTables === 0) return unreadable(\"its table directory is empty.\");\n const directoryEnd = HEADER_SIZE2 + numTables * TABLE_RECORD_SIZE2;\n if (directoryEnd > ttf.length) {\n return unreadable(\n `its directory claims ${numTables} tables (${directoryEnd} bytes) but the file is ${ttf.length} bytes \\u2014 truncated.`\n );\n }\n const tags = /* @__PURE__ */ new Set();\n for (let i = 0; i < numTables; i += 1) {\n const ro = HEADER_SIZE2 + i * TABLE_RECORD_SIZE2;\n const tag = ttf.toString(\"ascii\", ro, ro + 4);\n const offset = ttf.readUInt32BE(ro + 8);\n const length = ttf.readUInt32BE(ro + 12);\n if (offset + length > ttf.length) {\n return unreadable(\n `its \"${tag}\" table runs to byte ${offset + length} but the file is ${ttf.length} bytes \\u2014 truncated.`\n );\n }\n tags.add(tag);\n }\n for (const required of [\"name\", \"head\"]) {\n if (!tags.has(required)) {\n return unreadable(`it has no \"${required}\" table.`);\n }\n }\n const hasTrueTypeOutlines = tags.has(\"glyf\") && tags.has(\"loca\");\n const hasCffOutlines = tags.has(\"CFF \") || tags.has(\"CFF2\");\n if (!hasTrueTypeOutlines && !hasCffOutlines) {\n return unreadable(\n 'it carries no glyph outlines (neither \"glyf\" + \"loca\" nor \"CFF \").'\n );\n }\n if (readNameRecords(ttf).length === 0) {\n return unreadable('its \"name\" table carries no readable records.');\n }\n return null;\n}\n\n// src/fonts/cache/memory-cache.ts\nvar FontMemoryCache = class {\n store = /* @__PURE__ */ new Map();\n bytes = 0;\n maxBytes;\n constructor(opts = {}) {\n this.maxBytes = opts.maxBytes ?? 20 * 1024 * 1024;\n }\n get(key) {\n const v = this.store.get(key);\n if (!v) return void 0;\n this.store.delete(key);\n this.store.set(key, v);\n return v;\n }\n set(key, value) {\n const existing = this.store.get(key);\n if (existing) this.bytes -= existing.byteLength;\n this.store.set(key, value);\n this.bytes += value.byteLength;\n while (this.bytes > this.maxBytes && this.store.size > 0) {\n const oldest = this.store.keys().next().value;\n if (!oldest) break;\n const removed = this.store.get(oldest);\n this.store.delete(oldest);\n if (removed) this.bytes -= removed.byteLength;\n }\n }\n size() {\n return this.store.size;\n }\n};\n\n// src/fonts/registry.ts\nfunction stampResolvedFamily(source, family) {\n if (source.format !== \"ttf\" && source.format !== \"otf\") return source;\n const declared = readFontFamilyNames(source.data);\n if (declared.length === 0 || declared.includes(family)) return source;\n const subfamily = standardSubfamilyNames(\n source.weight,\n source.italic\n )?.legacy;\n return {\n ...source,\n data: rewriteFontFamilyName(source.data, family, subfamily)\n };\n}\nvar FontRegistry = class {\n index;\n cache;\n opts;\n memoryCache;\n diskCache;\n fileLoader;\n variableLoader;\n constructor(input = {}) {\n this.opts = input.opts ?? {};\n this.index = /* @__PURE__ */ new Map();\n this.cache = /* @__PURE__ */ new Map();\n this.memoryCache = new FontMemoryCache();\n this.diskCache = input.diskCache;\n this.fileLoader = input.fileLoader;\n this.variableLoader = input.variableLoader;\n for (const e of this.opts.extraEntries ?? []) this.addEntry(e);\n }\n addEntry(entry) {\n this.index.set(entry.family.toLowerCase(), entry);\n this.index.set(entry.id.toLowerCase(), entry);\n }\n /** Resolve every referenced name in one pass. Order preserved. */\n async resolveMany(names) {\n const out = [];\n for (const n of names) out.push(await this.resolve(n));\n return out;\n }\n async resolve(name) {\n const key = name.toLowerCase();\n const cached = this.cache.get(key);\n if (cached) return cached;\n const entry = this.index.get(key);\n let result;\n if (entry) {\n result = await this.materializeEntry(entry);\n } else if (isSafeFont(name)) {\n result = { family: name, sources: [], warnings: [] };\n } else {\n result = {\n family: name,\n sources: [],\n warnings: [\n `Font \"${name}\" is not registered and not in SAFE_FONTS; will rely on host fallback.`\n ]\n };\n }\n this.cache.set(key, result);\n return result;\n }\n async materializeEntry(entry) {\n const sources = [];\n const warnings = [];\n for (const source of entry.sources) {\n try {\n const materialized = await this.materializeSource(source, warnings);\n for (const raw of materialized) {\n const sfnt = raw.format === \"ttf\" || raw.format === \"otf\";\n const broken = sfnt ? validateFontStructure(\n raw.data,\n raw.weight,\n raw.italic,\n entry.family\n ) : null;\n if (broken) {\n warnings.push(`[${broken.code}] ${broken.message}`);\n sources.push(raw);\n continue;\n }\n const s = stampResolvedFamily(raw, entry.family);\n if (sfnt) {\n for (const d of validateFontMetadata(\n s.data,\n s.weight,\n s.italic,\n entry.family\n )) {\n warnings.push(`[FONT_METADATA_DEFECT:${d.code}] ${d.message}`);\n }\n }\n sources.push(s);\n }\n } catch (err) {\n warnings.push(\n `Font \"${entry.family}\" source (${source.kind}) failed: ${err.message}`\n );\n }\n }\n return {\n family: entry.family,\n sources,\n warnings\n };\n }\n async materializeSource(source, warnings) {\n switch (source.kind) {\n case \"safe\":\n return [];\n case \"file\": {\n if (!this.fileLoader) {\n warnings.push(\n `kind:\"file\" source for \"${source.path}\" requires a fileLoader (Node-only); skipping.`\n );\n return [];\n }\n return [\n await this.fileLoader({\n path: source.path,\n weight: source.weight,\n italic: source.italic,\n baseDir: this.opts.baseDir\n })\n ];\n }\n case \"data\":\n return [\n loadDataFontSource({\n data: source.data,\n weight: source.weight,\n italic: source.italic\n })\n ];\n case \"google\": {\n const gf = this.opts.googleFonts;\n if (gf?.enabled === false) {\n warnings.push(\n `Google Fonts fetch disabled \\u2014 skipping \"${source.family}\".`\n );\n return [];\n }\n const { sources: fetched, warnings: fetchWarnings } = await fetchGoogleFontSources({\n family: source.family,\n weights: source.weights ?? [400, 700],\n italics: source.italics ?? false,\n memoryCache: this.memoryCache,\n diskCache: this.diskCache,\n fetchTimeoutMs: gf?.fetchTimeoutMs\n });\n warnings.push(...fetchWarnings);\n return fetched;\n }\n case \"url\": {\n const gf = this.opts.googleFonts;\n const { source: fetched, warnings: fetchWarnings } = await fetchUrlFontSource({\n url: source.url,\n weight: source.weight ?? 400,\n italic: source.italic ?? false,\n memoryCache: this.memoryCache,\n diskCache: this.diskCache,\n fetchTimeoutMs: gf?.fetchTimeoutMs\n });\n if (fetchWarnings) warnings.push(...fetchWarnings);\n return fetched ? [fetched] : [];\n }\n case \"variable\": {\n if (!this.variableLoader) {\n warnings.push(\n `kind:\"variable\" source for \"${source.url}\" requires a variableLoader (Node-only); skipping.`\n );\n return [];\n }\n const gf = this.opts.googleFonts;\n const { source: fetched, warnings: fetchWarnings } = await this.variableLoader({\n url: source.url,\n weight: source.weight,\n italic: source.italic ?? false,\n axes: source.axes,\n memoryCache: this.memoryCache,\n diskCache: this.diskCache,\n fetchTimeoutMs: gf?.fetchTimeoutMs\n });\n if (fetchWarnings) warnings.push(...fetchWarnings);\n return fetched ? [fetched] : [];\n }\n default:\n throw new Error(\n `Unknown font source kind: ${source.kind}`\n );\n }\n }\n};\n\n// src/fonts/catalog/popular-google.ts\nvar POPULAR_GOOGLE_FONTS = [\n // Sans-serif\n {\n family: \"Inter\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: false\n },\n {\n family: \"Roboto\",\n category: \"sans\",\n weights: [100, 300, 400, 500, 700, 900],\n hasItalic: true\n },\n {\n family: \"Open Sans\",\n category: \"sans\",\n weights: [300, 400, 500, 600, 700, 800],\n hasItalic: true\n },\n {\n family: \"Lato\",\n category: \"sans\",\n weights: [100, 300, 400, 700, 900],\n hasItalic: true\n },\n {\n family: \"Montserrat\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Poppins\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Work Sans\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Nunito\",\n category: \"sans\",\n weights: [200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"DM Sans\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Rubik\",\n category: \"sans\",\n weights: [300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Source Sans 3\",\n category: \"sans\",\n weights: [200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Manrope\",\n category: \"sans\",\n weights: [200, 300, 400, 500, 600, 700, 800],\n hasItalic: false\n },\n {\n family: \"Plus Jakarta Sans\",\n category: \"sans\",\n weights: [200, 300, 400, 500, 600, 700, 800],\n hasItalic: true\n },\n {\n family: \"IBM Plex Sans\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700],\n hasItalic: true\n },\n {\n family: \"Archivo\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Geist\",\n category: \"sans\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Space Grotesk\",\n category: \"sans\",\n weights: [300, 400, 500, 600, 700],\n hasItalic: false\n },\n // Serif\n {\n family: \"Playfair Display\",\n category: \"serif\",\n weights: [400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Merriweather\",\n category: \"serif\",\n weights: [300, 400, 700, 900],\n hasItalic: true\n },\n {\n family: \"Lora\",\n category: \"serif\",\n weights: [400, 500, 600, 700],\n hasItalic: true\n },\n {\n family: \"Source Serif 4\",\n category: \"serif\",\n weights: [200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"DM Serif Display\",\n category: \"serif\",\n weights: [400],\n hasItalic: true\n },\n {\n family: \"Crimson Pro\",\n category: \"serif\",\n weights: [200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Cormorant Garamond\",\n category: \"serif\",\n weights: [300, 400, 500, 600, 700],\n hasItalic: true\n },\n // Monospace\n {\n family: \"JetBrains Mono\",\n category: \"mono\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800],\n hasItalic: true\n },\n {\n family: \"Fira Code\",\n category: \"mono\",\n weights: [300, 400, 500, 600, 700],\n hasItalic: false\n },\n {\n family: \"IBM Plex Mono\",\n category: \"mono\",\n weights: [100, 200, 300, 400, 500, 600, 700],\n hasItalic: true\n },\n {\n family: \"Source Code Pro\",\n category: \"mono\",\n weights: [200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n {\n family: \"Space Mono\",\n category: \"mono\",\n weights: [400, 700],\n hasItalic: true\n },\n {\n family: \"Geist Mono\",\n category: \"mono\",\n weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],\n hasItalic: true\n },\n // Display\n {\n family: \"Bebas Neue\",\n category: \"display\",\n weights: [400],\n hasItalic: false\n },\n {\n family: \"Abril Fatface\",\n category: \"display\",\n weights: [400],\n hasItalic: false\n },\n {\n family: \"Archivo Black\",\n category: \"display\",\n weights: [400],\n hasItalic: false\n },\n {\n family: \"Oswald\",\n category: \"display\",\n weights: [200, 300, 400, 500, 600, 700],\n hasItalic: false\n },\n // Handwriting\n {\n family: \"Caveat\",\n category: \"handwriting\",\n weights: [400, 500, 600, 700],\n hasItalic: false\n },\n {\n family: \"Pacifico\",\n category: \"handwriting\",\n weights: [400],\n hasItalic: false\n }\n];\n\n// src/fonts/catalog/upstream-overrides.ts\nvar INTER_VARIABLE_URL = \"https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf\";\nvar INTER_VARIABLE_ITALIC_URL = \"https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2\";\nfunction interVariants() {\n const weights = [100, 200, 300, 400, 500, 600, 700, 800, 900];\n const upright = weights.map((weight2) => ({\n kind: \"variable\",\n url: INTER_VARIABLE_URL,\n weight: weight2,\n italic: false\n }));\n const italic = weights.map((weight2) => ({\n kind: \"variable\",\n url: INTER_VARIABLE_ITALIC_URL,\n weight: weight2,\n italic: true\n }));\n return [...upright, ...italic];\n}\nvar UPSTREAM_OVERRIDES = {\n inter: {\n 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.\",\n variants: interVariants()\n }\n};\nfunction getUpstreamOverride(family) {\n return UPSTREAM_OVERRIDES[family.toLowerCase()];\n}\n\n// src/fonts/substitute.ts\nfunction applyFontSubstitution(doc, mapping) {\n const seen = /* @__PURE__ */ new Map();\n const rewritten = rewrite(doc, mapping, seen);\n const substitutions = [];\n for (const [from, to] of seen) substitutions.push({ from, to });\n return { doc: rewritten, substitutions };\n}\nfunction rewrite(node, mapping, seen, parentKey) {\n if (node == null) return node;\n if (typeof node === \"string\") {\n if (parentKey && (FONT_NAME_KEYS.has(parentKey) || THEME_FONT_KEYS.has(parentKey))) {\n return maybeSwap(node, mapping, seen);\n }\n return node;\n }\n if (Array.isArray(node)) {\n return node.map((item) => rewrite(item, mapping, seen, parentKey));\n }\n if (typeof node === \"object\") {\n const out = {};\n for (const [k, v] of Object.entries(node)) {\n if (FONT_DECLARATION_KEYS.has(k)) {\n out[k] = v;\n continue;\n }\n if (parentKey === \"theme\" && k === \"fonts\" && v && typeof v === \"object\") {\n const nextFonts = {};\n for (const [fk, fv] of Object.entries(v)) {\n if (typeof fv === \"string\") {\n nextFonts[fk] = maybeSwap(fv, mapping, seen);\n } else if (fv && typeof fv === \"object\") {\n const fam = fv.family;\n nextFonts[fk] = typeof fam === \"string\" ? { ...fv, family: maybeSwap(fam, mapping, seen) } : rewrite(fv, mapping, seen, fk);\n } else {\n nextFonts[fk] = fv;\n }\n }\n out[k] = nextFonts;\n continue;\n }\n out[k] = rewrite(v, mapping, seen, k);\n }\n return out;\n }\n return node;\n}\nfunction maybeSwap(name, mapping, seen) {\n const trimmed = name.trim();\n if (trimmed.length === 0) return name;\n if (isSafeFont(trimmed)) return name;\n const lowered = trimmed.toLowerCase();\n for (const [from, to] of Object.entries(mapping)) {\n if (from.toLowerCase() === lowered) {\n seen.set(trimmed, to);\n return to;\n }\n }\n return name;\n}\nvar EXPLICIT_OVERRIDES = {\n Inter: \"Calibri\",\n Roboto: \"Calibri\",\n \"Open Sans\": \"Calibri\",\n Lato: \"Calibri\",\n \"Source Sans 3\": \"Calibri\",\n \"Source Sans Pro\": \"Calibri\",\n \"IBM Plex Sans\": \"Calibri\",\n Archivo: \"Calibri\",\n Geist: \"Calibri\",\n \"Space Grotesk\": \"Calibri\",\n \"Work Sans\": \"Calibri\",\n Manrope: \"Calibri\",\n Nunito: \"Calibri\",\n \"Nunito Sans\": \"Calibri\",\n Poppins: \"Calibri\",\n Montserrat: \"Calibri\",\n \"Playfair Display\": \"Georgia\",\n Merriweather: \"Georgia\",\n \"Source Serif 4\": \"Cambria\",\n \"Source Serif Pro\": \"Cambria\",\n \"IBM Plex Serif\": \"Cambria\",\n \"Crimson Pro\": \"Cambria\",\n Lora: \"Georgia\",\n \"PT Serif\": \"Georgia\",\n \"Cormorant Garamond\": \"Cambria\",\n \"JetBrains Mono\": \"Consolas\",\n \"Fira Code\": \"Consolas\",\n \"IBM Plex Mono\": \"Consolas\",\n \"Source Code Pro\": \"Consolas\",\n \"Roboto Mono\": \"Consolas\",\n \"Geist Mono\": \"Consolas\"\n};\nvar CATEGORY_FALLBACK = {\n sans: \"Calibri\",\n serif: \"Georgia\",\n mono: \"Consolas\",\n display: \"Georgia\",\n handwriting: \"Segoe UI\"\n};\nfunction defaultSubstituteFor(family) {\n const trimmed = family.trim();\n for (const [from, to] of Object.entries(EXPLICIT_OVERRIDES)) {\n if (from.toLowerCase() === trimmed.toLowerCase()) return to;\n }\n const catalog = POPULAR_GOOGLE_FONTS.find(\n (f) => f.family.toLowerCase() === trimmed.toLowerCase()\n );\n if (catalog) {\n const cat = CATEGORY_FALLBACK[catalog.category];\n if (cat) return cat;\n }\n return \"Calibri\";\n}\nfunction buildDefaultSubstitutionMap(referencedNames) {\n const out = {};\n for (const raw of referencedNames) {\n const name = raw.trim();\n if (name.length === 0) continue;\n if (isSafeFont(name)) continue;\n if (out[name]) continue;\n out[name] = defaultSubstituteFor(name);\n }\n return out;\n}\nfunction applyExportMode(input) {\n const mode = input.fonts?.mode ?? \"custom\";\n if (mode === \"custom\") {\n if (!input.fonts) {\n return { doc: input.doc, theme: input.theme, warnings: [] };\n }\n const referenced2 = /* @__PURE__ */ new Set([\n ...collectFontNames(input.doc),\n ...collectFontNames(input.theme)\n ]);\n const nonSafe = [...referenced2].filter((name) => !isSafeFont(name.trim()));\n const warnings2 = nonSafe.length > 0 ? [\n {\n code: \"FONT_MODE_CUSTOM\",\n message: `Export mode \"custom\": non-safe font references (${nonSafe.join(\", \")}) kept as-is. Recipients need these fonts installed locally; Word falls back to a generic substitute otherwise.`\n }\n ] : [];\n return {\n doc: input.doc,\n theme: input.theme,\n warnings: warnings2\n };\n }\n const referenced = /* @__PURE__ */ new Set([\n ...collectFontNames(input.doc),\n ...collectFontNames(input.theme)\n ]);\n const defaults = buildDefaultSubstitutionMap(referenced);\n const mapping = {\n ...defaults,\n ...input.fonts?.substitution ?? {}\n };\n const docRewrite = applyFontSubstitution(input.doc, mapping);\n const themeRewrite = applyFontSubstitution(input.theme, mapping);\n const combined = /* @__PURE__ */ new Map();\n for (const s of docRewrite.substitutions) combined.set(s.from, s.to);\n for (const s of themeRewrite.substitutions) combined.set(s.from, s.to);\n const warnings = [];\n if (combined.size > 0) {\n const list = [...combined].map(([from, to]) => `${from} \\u2192 ${to}`).join(\", \");\n warnings.push({\n code: \"FONT_MODE_SUBSTITUTED\",\n message: `Export mode \"substitute\": rewrote non-safe families to safe equivalents \\u2014 ${list}. No fonts embedded; document renders identically on every machine.`\n });\n }\n return {\n doc: docRewrite.doc,\n theme: themeRewrite.doc,\n warnings\n };\n}\n\n// src/theme/chart-palette.ts\nvar DEFAULT_CHART_THEME_COLORS = [\n \"primary\",\n \"secondary\",\n \"accent\",\n \"accent4\",\n \"accent5\",\n \"accent6\"\n];\n\n// src/theme/chart-typography.ts\nvar POINTS_PER_PIXEL_96DPI = 0.75;\nfunction chartPointsPerPixel(chartWidthPx, placedWidthPt) {\n if (!Number.isFinite(chartWidthPx) || chartWidthPx <= 0 || placedWidthPt === void 0 || !Number.isFinite(placedWidthPt) || placedWidthPt <= 0) {\n return POINTS_PER_PIXEL_96DPI;\n }\n return placedWidthPt / chartWidthPx;\n}\nvar SERIF_FAMILIES = /* @__PURE__ */ new Set([\"georgia\", \"times new roman\", \"cambria\"]);\nvar MONO_FAMILIES = /* @__PURE__ */ new Set([\"consolas\", \"courier new\", \"menlo\", \"monaco\"]);\nfunction cssFontFamily(family, category) {\n const generic = category === \"serif\" ? \"serif\" : category === \"mono\" ? \"monospace\" : category === \"handwriting\" ? \"cursive\" : category === void 0 && SERIF_FAMILIES.has(family.toLowerCase()) ? \"serif\" : category === void 0 && MONO_FAMILIES.has(family.toLowerCase()) ? \"monospace\" : \"sans-serif\";\n return `\"${family.replace(/[\"\\\\]/g, \"\\\\$&\")}\", ${generic}`;\n}\nfunction chartFamilyResolver(theme) {\n const categories = new Map(\n themeFontRegistry(theme).map((entry) => [\n entry.family.toLowerCase(),\n entry.category\n ])\n );\n return (family) => cssFontFamily(family, categories.get(family.toLowerCase()));\n}\nfunction isPlainObject(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction fill(authored, defaults) {\n if (authored !== void 0 && !isPlainObject(authored)) return authored;\n const base = isPlainObject(authored) ? { ...authored } : {};\n for (const [key, value] of Object.entries(defaults)) {\n if (value === void 0) continue;\n const current = base[key];\n if (current === void 0) {\n base[key] = isPlainObject(value) ? fill(void 0, value) : value;\n } else if (isPlainObject(current) && isPlainObject(value)) {\n base[key] = fill(current, value);\n }\n }\n return base;\n}\nfunction fillAxis(authored, defaults) {\n if (Array.isArray(authored)) {\n return authored.map((axis) => fill(axis, defaults));\n }\n return fill(authored, defaults);\n}\nfunction weight(value) {\n return value === void 0 ? void 0 : String(value);\n}\nfunction withChartTypography(options, typography, ptPerPx) {\n const px = (points) => `${Math.round(points / ptPerPx * 10) / 10}px`;\n const labelPx = px(typography.labelPt);\n const sourcePx = px(typography.sourcePt);\n const mutedText = { fontSize: labelPx, color: typography.mutedColor };\n const mutedSource = { fontSize: sourcePx, color: typography.mutedColor };\n const labelText = {\n fontSize: labelPx,\n color: typography.textColor,\n fontWeight: weight(typography.labelWeight)\n };\n const axis = { labels: { style: mutedText }, title: { style: mutedText } };\n return {\n ...options,\n chart: fill(options.chart, {\n style: { fontFamily: typography.bodyFamily }\n }),\n title: fill(options.title, {\n style: {\n fontFamily: typography.headingFamily,\n fontSize: px(typography.titlePt),\n fontWeight: weight(typography.titleWeight),\n color: typography.textColor\n }\n }),\n subtitle: fill(options.subtitle, { style: mutedText }),\n caption: fill(options.caption, { style: mutedSource }),\n xAxis: fillAxis(options.xAxis, axis),\n yAxis: fillAxis(options.yAxis, axis),\n legend: fill(options.legend, { itemStyle: labelText }),\n plotOptions: fill(options.plotOptions, {\n series: { dataLabels: { style: labelText } }\n }),\n // The library credit is a link to highcharts.com drawn into the plot\n // area; a client document never carries it unless the author asks. An\n // authored `enabled` — true included — wins, as every other key does.\n credits: fill(options.credits, { enabled: false, style: mutedSource })\n };\n}\nvar FONT_FORMATS = {\n ttf: { mime: \"font/ttf\", format: \"truetype\" },\n otf: { mime: \"font/otf\", format: \"opentype\" },\n woff: { mime: \"font/woff\", format: \"woff\" },\n woff2: { mime: \"font/woff2\", format: \"woff2\" }\n};\nfunction chartFontFaceCss(faces, families) {\n const wanted = new Set(families.map((family) => family.toLowerCase()));\n return faces.filter((face) => wanted.has(face.family.toLowerCase())).map((face) => {\n const { mime, format } = FONT_FORMATS[face.format ?? \"ttf\"];\n return `@font-face{font-family:\"${face.family.replace(/[\"\\\\]/g, \"\\\\$&\")}\";font-weight:${face.weight};font-style:${face.italic ? \"italic\" : \"normal\"};src:url(data:${mime};base64,${face.data}) format(\"${format}\")}`;\n }).join(\"\\n\");\n}\nfunction withChartFontFaceCss(props, faces, families) {\n const css = chartFontFaceCss(faces, families);\n if (!css) return props;\n const authored = props.resources?.css;\n return {\n ...props,\n resources: {\n ...props.resources,\n css: authored ? `${css}\n${authored}` : css\n }\n };\n}\n\n// src/blocks/schema.ts\nimport { Type } from \"@sinclair/typebox\";\nvar BLOCK_SLOT_ROLES = [\n \"actionTitle\",\n \"takeaway\",\n \"source\",\n \"tracker\",\n \"footer\"\n];\nvar BlockSlotSchema = Type.Recursive(\n (Self) => Type.Object(\n {\n type: Type.Union(\n [\n \"string\",\n \"number\",\n \"integer\",\n \"boolean\",\n \"object\",\n \"array\",\n \"component\"\n ].map((v) => Type.Literal(v)),\n {\n description: \"Content type accepted by this slot. Use component for a document component or registered plugin.\"\n }\n ),\n description: Type.Optional(\n Type.String({\n description: \"Explain this slot\\u2019s content and purpose to authors.\"\n })\n ),\n required: Type.Optional(\n Type.Boolean({\n description: \"Require a value when no default is provided. Defaults to false.\"\n })\n ),\n default: Type.Optional(\n Type.Unknown({\n description: \"Value used when the caller omits this slot. Must satisfy the slot\\u2019s type and constraints.\"\n })\n ),\n enum: Type.Optional(\n Type.Array(\n Type.Union([Type.String(), Type.Number(), Type.Boolean()]),\n {\n minItems: 1,\n description: \"Allowed scalar values for this slot.\"\n }\n )\n ),\n minItems: Type.Optional(\n Type.Integer({\n minimum: 0,\n description: \"Minimum number of array entries, inclusive.\"\n })\n ),\n maxItems: Type.Optional(\n Type.Integer({\n minimum: 0,\n description: \"Maximum number of array entries, inclusive.\"\n })\n ),\n minLength: Type.Optional(\n Type.Integer({\n minimum: 0,\n description: \"Minimum string length in characters, inclusive.\"\n })\n ),\n maxLength: Type.Optional(\n Type.Integer({\n minimum: 0,\n description: \"Maximum string length in characters, inclusive.\"\n })\n ),\n minimum: Type.Optional(\n Type.Number({ description: \"Minimum numeric value, inclusive.\" })\n ),\n maximum: Type.Optional(\n Type.Number({ description: \"Maximum numeric value, inclusive.\" })\n ),\n maxWords: Type.Optional(\n Type.Integer({\n minimum: 1,\n description: \"Maximum whitespace-separated word count. Exceeding it fails validation.\"\n })\n ),\n oneLine: Type.Optional(\n Type.Boolean({\n description: \"Reject newline characters in string values. Does not prevent visual line wrapping.\"\n })\n ),\n items: Type.Optional({\n ...Self,\n description: \"Slot type and constraints for each array entry.\"\n }),\n properties: Type.Optional(\n Type.Record(Type.String(), Self, {\n description: \"Named child slots accepted by an object slot. Undeclared properties are rejected.\"\n })\n ),\n role: Type.Optional(\n Type.Union(\n BLOCK_SLOT_ROLES.map((role) => Type.Literal(role)),\n {\n description: \"Content role for quality profiles: actionTitle, takeaway, source, tracker or footer. A profile may require or measure it; the theme only styles it.\"\n }\n )\n )\n },\n { additionalProperties: false }\n ),\n // Named so the export hoists it under a stable definition rather than a\n // TypeBox ordinal that shifts with what the process built before it.\n { $id: \"BlockSlot\" }\n);\nvar JsonBlockDefinitionSchema = Type.Unsafe(\n Type.Object(\n {\n description: Type.Optional(\n Type.String({\n description: \"Describe what this reusable block renders and when to use it.\"\n })\n ),\n slots: Type.Record(Type.String(), BlockSlotSchema, {\n description: \"Named inputs and their types, defaults and constraints. Use an empty object for a block with no inputs.\"\n }),\n body: Type.Array(Type.Unknown(), {\n description: \"Components and binding directives expanded in order when this block is invoked.\"\n }),\n section: Type.Optional(\n Type.Object(\n {\n tracker: Type.Optional(\n Type.Unknown({\n description: \"Section tracker value or binding, available to headers and footers through $context at /section/tracker.\"\n })\n ),\n header: Type.Optional(\n Type.Array(Type.Unknown(), {\n description: \"Header component templates. Explicit header settings on the section take precedence.\"\n })\n ),\n footer: Type.Optional(\n Type.Array(Type.Unknown(), {\n description: \"Footer component templates. Explicit footer settings on the section take precedence.\"\n })\n ),\n pageBreak: Type.Optional(\n Type.Boolean({\n description: \"Start the containing section on a new page. An explicit section pageBreak setting takes precedence.\"\n })\n ),\n scope: Type.Optional(\n Type.Union([Type.Literal(\"section\"), Type.Literal(\"following\")], {\n description: \"Apply header/footer templates to this section only, or inherit them in following sections. Defaults to section.\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"DOCX section tracker, header/footer templates and page-break behavior. Place this block at the section boundary.\"\n }\n )\n ),\n slide: Type.Optional(\n Type.Object(\n {\n background: Type.Optional(\n Type.Unknown({\n description: \"Slide background (color, gradient or image) or a binding. A background the slide states itself takes precedence.\"\n })\n ),\n grid: Type.Optional(\n Type.Unknown({\n description: \"Grid configuration merged over the presentation grid when resolving grid placements in this block\\u2019s body.\"\n })\n ),\n notes: Type.Optional(\n Type.Unknown({\n description: \"Speaker notes or a binding. Notes the slide states itself take precedence.\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"PPTX slide background, grid and notes supplied by this block. Invoke the block as a direct child of a slide.\"\n }\n )\n )\n },\n { additionalProperties: false }\n )\n);\nvar BlockDefinitionsSchema = Type.Record(\n Type.String({ pattern: \"^[a-zA-Z][a-zA-Z0-9_-]*$\" }),\n JsonBlockDefinitionSchema,\n {\n description: \"Document-local JSON block definitions. Names are not built into the engine.\"\n }\n);\nvar BlockInvocationPropsSchema = Type.Object(\n {\n ref: Type.String({\n minLength: 1,\n description: \"Name in this document\\u2019s props.blocks.\"\n }),\n slots: Type.Optional(\n Type.Record(Type.String(), Type.Unknown(), {\n description: \"Input values keyed by the slot names declared in the referenced block definition.\"\n })\n )\n },\n { additionalProperties: false }\n);\nfunction blockSlotJsonSchema(slot) {\n const { oneLine, properties, items, role: _role, ...rest } = slot;\n delete rest.required;\n delete rest.maxWords;\n if (slot.type === \"component\") {\n return {\n type: \"object\",\n properties: { name: { type: \"string\" } },\n required: [\"name\"],\n description: slot.description\n };\n }\n return {\n ...rest,\n ...oneLine && { pattern: \"^[^\\\\r\\\\n]*$\" },\n ...items && { items: blockSlotJsonSchema(items) },\n ...properties && {\n properties: Object.fromEntries(\n Object.entries(properties).map(([key, value]) => [\n key,\n blockSlotJsonSchema(value)\n ])\n ),\n required: Object.entries(properties).filter(([, value]) => value.required && value.default === void 0).map(([key]) => key),\n additionalProperties: false\n }\n };\n}\n\n// src/blocks/evaluator.ts\nimport { isScaffoldMarker } from \"@json-to-office/quality\";\n\n// src/blocks/directives.ts\nvar BLOCK_DIRECTIVES = {\n $slot: { keys: [\"$slot\", \"default\", \"props\"], result: \"dynamic\" },\n $item: { keys: [\"$item\", \"default\", \"props\"], result: \"dynamic\" },\n $theme: { keys: [\"$theme\", \"default\"], result: \"dynamic\" },\n $context: { keys: [\"$context\", \"default\"], result: \"dynamic\" },\n $count: { keys: [\"$count\"], result: \"number\" },\n $if: { keys: [\"$if\", \"then\", \"else\"], result: \"dynamic\" },\n $each: { keys: [\"$each\", \"template\"], result: \"array\" },\n $join: { keys: [\"$join\", \"separator\", \"keepEmpty\"], result: \"string\" },\n $measure: { keys: [\"$measure\", \"fraction\", \"unit\"], result: \"number\" }\n};\nvar BLOCK_OPERAND_ROOTS = [\n \"$item\",\n \"$slot\",\n \"$context\",\n \"$theme\"\n];\n\n// src/blocks/evaluator.ts\nimport { Value } from \"@sinclair/typebox/value\";\nvar BlockEvaluationError = class extends Error {\n constructor(issues) {\n super(issues.map((i) => `${i.path}: ${i.message}`).join(\"\\n\"));\n this.issues = issues;\n this.name = \"BlockEvaluationError\";\n }\n};\nvar isBlockRecord = (v) => typeof v === \"object\" && v !== null && !Array.isArray(v);\nvar blockPointerKey = (s) => s.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\nvar own = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);\nfunction blockValueAt(root, path) {\n if (path === \"\") return root;\n if (!path.startsWith(\"/\")) return void 0;\n let value = root;\n for (const part of path.slice(1).split(\"/\")) {\n const key = part.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n if (!isBlockRecord(value) && !Array.isArray(value) || !own(value, key))\n return void 0;\n value = value[key];\n }\n return value;\n}\nfunction toAuthoredBlockPointer(map, pointer2) {\n let best;\n for (const path of Object.keys(map)) {\n if ((pointer2 === path || pointer2.startsWith(`${path}/`)) && (best === void 0 || path.length > best.length))\n best = path;\n }\n return best === void 0 ? pointer2 : `${map[best]}${pointer2.slice(best.length)}`;\n}\nvar BLOCK_SLOT_PLACEMENT_PROPS = [\n \"x\",\n \"y\",\n \"w\",\n \"h\",\n \"position\",\n \"grid\",\n \"gridConfig\",\n \"direction\",\n \"gap\",\n \"weights\",\n \"alignment\",\n \"spacing\"\n];\nvar blockWordCount = (text) => text.trim() === \"\" ? 0 : text.trim().split(/\\s+/).length;\nvar present = (value) => value !== void 0 && value !== null && value !== \"\" && value !== false && (!Array.isArray(value) || value.length > 0);\nvar fail = (path, code, message) => {\n throw new BlockEvaluationError([{ path, code, message }]);\n};\nfunction resolveBlockSlot(slot, input, path, issues) {\n const value = input === void 0 && slot.default !== void 0 ? structuredClone(slot.default) : input;\n if (value === void 0) {\n if (slot.required)\n issues.push({\n path,\n code: \"block_required_slot\",\n message: \"Required block slot is missing.\"\n });\n return void 0;\n }\n const validType = slot.type === \"array\" ? Array.isArray(value) : slot.type === \"component\" ? isBlockRecord(value) && typeof value.name === \"string\" : slot.type === \"object\" ? isBlockRecord(value) : slot.type === \"integer\" ? typeof value === \"number\" && Number.isInteger(value) : typeof value === slot.type && (typeof value !== \"number\" || Number.isFinite(value));\n if (!validType) {\n issues.push({\n path,\n code: \"block_slot_type\",\n message: `Expected ${slot.type}.`\n });\n return value;\n }\n const issue = (message) => issues.push({ path, code: \"block_slot_budget\", message });\n const marker = typeof value === \"string\" && isScaffoldMarker(value);\n if (!marker && slot.enum && !slot.enum.includes(value))\n issue(\"Value is not one of the declared choices.\");\n if (typeof value === \"string\" && !marker) {\n if (slot.oneLine && /[\\r\\n]/.test(value))\n issue(\"Slot must contain one line.\");\n if (slot.minLength !== void 0 && value.length < slot.minLength)\n issue(`Minimum length is ${slot.minLength}.`);\n if (slot.maxLength !== void 0 && value.length > slot.maxLength)\n issue(`Maximum length is ${slot.maxLength}.`);\n if (slot.maxWords !== void 0 && blockWordCount(value) > slot.maxWords)\n issue(`Maximum word count is ${slot.maxWords}.`);\n }\n if (typeof value === \"number\") {\n if (slot.minimum !== void 0 && value < slot.minimum)\n issue(`Minimum value is ${slot.minimum}.`);\n if (slot.maximum !== void 0 && value > slot.maximum)\n issue(`Maximum value is ${slot.maximum}.`);\n }\n if (Array.isArray(value)) {\n if (slot.minItems !== void 0 && value.length < slot.minItems)\n issue(`Minimum item count is ${slot.minItems}.`);\n if (slot.maxItems !== void 0 && value.length > slot.maxItems)\n issue(`Maximum item count is ${slot.maxItems}.`);\n return slot.items ? value.map(\n (v, i) => resolveBlockSlot(slot.items, v, `${path}/${i}`, issues)\n ) : value;\n }\n if (slot.type === \"component\" && isBlockRecord(value)) {\n const checkPlacement = (node, pointer2, depth = 0) => {\n if (depth > 64) {\n issues.push({\n path: pointer2,\n code: \"block_expansion_limit\",\n message: \"Component slot exceeds 64 levels.\"\n });\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(\n (item, i) => checkPlacement(item, `${pointer2}/${i}`, depth + 1)\n );\n return;\n }\n if (!isBlockRecord(node)) return;\n const props = typeof node.name === \"string\" && isBlockRecord(node.props) ? node.props : {};\n for (const key of BLOCK_SLOT_PLACEMENT_PROPS) {\n if (own(props, key))\n issues.push({\n path: `${pointer2}/props/${key}`,\n code: \"block_slot_placement\",\n message: \"Block placement belongs in the definition, not in a component slot.\"\n });\n }\n for (const [key, item] of Object.entries(node))\n checkPlacement(item, `${pointer2}/${blockPointerKey(key)}`, depth + 1);\n };\n checkPlacement(value, path);\n }\n if (slot.type === \"object\" && isBlockRecord(value) && slot.properties)\n return resolveBlockSlots(slot.properties, value, path, issues);\n return value;\n}\nfunction resolveBlockSlots(slots, values, path, issues) {\n const out = {};\n for (const key of Object.keys(values)) {\n if (!own(slots, key))\n issues.push({\n path: `${path}/${blockPointerKey(key)}`,\n code: \"block_unknown_slot\",\n message: `Unknown slot '${key}'. Expected: ${Object.keys(slots).join(\", \")}.`\n });\n }\n for (const [key, slot] of Object.entries(slots)) {\n const value = resolveBlockSlot(\n slot,\n own(values, key) ? values[key] : void 0,\n `${path}/${blockPointerKey(key)}`,\n issues\n );\n if (value !== void 0)\n Object.defineProperty(out, key, {\n value,\n enumerable: true,\n writable: true,\n configurable: true\n });\n }\n return out;\n}\nvar DIRECTIVES = Object.fromEntries(\n Object.entries(BLOCK_DIRECTIVES).map(([key, directive]) => [\n key,\n directive.keys\n ])\n);\nfunction slotDescriptorAt(slots, pointer2) {\n let descriptor = { type: \"object\", properties: slots };\n for (const escaped of pointer2.slice(1).split(\"/\")) {\n const key = escaped.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n if (descriptor?.type === \"object\") {\n if (!descriptor.properties) return { type: \"object\" };\n descriptor = own(descriptor.properties, key) ? descriptor.properties[key] : void 0;\n } else if (descriptor?.type === \"array\" && /^(0|[1-9]\\d*)$/.test(key))\n descriptor = descriptor.items ?? { type: \"object\" };\n else if (descriptor?.type === \"component\") return { type: \"object\" };\n else return void 0;\n }\n return descriptor;\n}\nvar OPERAND_DIRECTIVES = [\"$if\", \"$each\", \"$count\"];\nvar isPointer = (value) => typeof value === \"string\" && (value === \"\" || value.startsWith(\"/\"));\nvar themePointerChain = (value) => isPointer(value) ? [value] : Array.isArray(value) && value.length > 0 && value.every(isPointer) ? value : void 0;\nfunction blockOperand(value, key) {\n if (isPointer(value))\n return {\n root: OPERAND_DIRECTIVES.includes(key) ? \"$slot\" : key,\n pointer: value\n };\n if (!OPERAND_DIRECTIVES.includes(key) || !isBlockRecord(value))\n return void 0;\n const keys = Object.keys(value);\n const root = BLOCK_OPERAND_ROOTS.find((candidate) => candidate === keys[0]);\n if (keys.length !== 1 || !root || !isPointer(value[root])) return void 0;\n return { root, pointer: value[root] };\n}\nfunction checkTemplate(value, path, slots, issues, repeated = false, depth = 0) {\n if (depth > 64) {\n issues.push({\n path,\n code: \"block_depth\",\n message: \"Definition exceeds 64 levels.\"\n });\n return;\n }\n if (Array.isArray(value)) {\n value.forEach(\n (v, i) => checkTemplate(v, `${path}/${i}`, slots, issues, repeated, depth + 1)\n );\n return;\n }\n if (!isBlockRecord(value)) return;\n const keys = Object.keys(value).filter((k) => k.startsWith(\"$\"));\n if (keys.length) {\n const key = keys[0];\n const allowed = DIRECTIVES[key];\n if (!allowed || keys.length !== 1 || Object.keys(value).some((k) => !allowed.includes(k))) {\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"Unknown or malformed block directive.\"\n });\n return;\n }\n if ([\n \"$slot\",\n \"$item\",\n \"$theme\",\n \"$context\",\n \"$if\",\n \"$each\",\n \"$count\"\n ].includes(key)) {\n const operand = blockOperand(value[key], key);\n const chain = key === \"$theme\" ? themePointerChain(value[key]) : void 0;\n if (!operand && !chain)\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: OPERAND_DIRECTIVES.includes(key) ? `${key} takes a slot pointer such as /items, or one reference: ${BLOCK_OPERAND_ROOTS.map((root) => `{ \"${root}\": ... }`).join(\", \")}.` : key === \"$theme\" ? \"Bindings use a JSON Pointer, e.g. /styles/source/size, or a non-empty array of them tried in order.\" : \"Bindings use JSON Pointers, e.g. /title.\"\n });\n else if (operand?.root === \"$slot\") {\n const descriptor = slotDescriptorAt(slots, operand.pointer);\n if (!descriptor)\n issues.push({\n path,\n code: \"block_unknown_binding\",\n message: `No slot field '${operand.pointer}' is declared.`\n });\n else if ([\"$each\", \"$count\"].includes(key) && descriptor.type !== \"array\")\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: `${key} requires an array slot.`\n });\n }\n if (operand?.root === \"$item\" && !repeated)\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"$item is only available inside $each.\"\n });\n if ((key === \"$slot\" || key === \"$item\") && own(value, \"props\") && !isBlockRecord(value.props))\n issues.push({\n path: `${path}/props`,\n code: \"block_invalid_binding\",\n message: \"props must be an object of component props merged beneath a component-slot value.\"\n });\n }\n if (key === \"$join\" && value.keepEmpty !== void 0 && typeof value.keepEmpty !== \"boolean\")\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"keepEmpty must be boolean.\"\n });\n if (key === \"$if\" && !own(value, \"then\"))\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"$if requires then.\"\n });\n if (key === \"$each\" && (!own(value, \"template\") || Array.isArray(value.template)))\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"$each requires one template value; use a group for multiple flow children.\"\n });\n if (key === \"$join\" && (!Array.isArray(value.$join) || value.separator !== void 0 && typeof value.separator !== \"string\"))\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"$join requires an array and an optional string separator.\"\n });\n if (key === \"$measure\" && (![\"width\", \"height\"].includes(String(value.$measure)) || ![\"pt\", \"twip\", \"in\"].includes(String(value.unit ?? \"pt\")) || value.fraction !== void 0 && (typeof value.fraction !== \"number\" || value.fraction < 0 || value.fraction > 1)))\n issues.push({\n path,\n code: \"block_invalid_binding\",\n message: \"$measure requires width/height, pt/twip/in and a fraction between 0 and 1.\"\n });\n }\n for (const [key, item] of Object.entries(value)) {\n if (key.startsWith(\"$\") && key !== \"$join\") continue;\n checkTemplate(\n item,\n `${path}/${blockPointerKey(key)}`,\n slots,\n issues,\n repeated || own(value, \"$each\"),\n depth + 1\n );\n }\n}\nfunction readBlockDefinitions(document) {\n const value = isBlockRecord(document) && isBlockRecord(document.props) ? document.props.blocks : void 0;\n return value ?? {};\n}\nfunction validateBlockDefinitions(definitions, format, reservedNames = []) {\n if (!Value.Check(BlockDefinitionsSchema, definitions))\n return [...Value.Errors(BlockDefinitionsSchema, definitions)].slice(0, 100).map((e) => ({\n path: `/props/blocks${e.path}`,\n code: \"block_invalid_definition\",\n message: e.message\n }));\n const issues = [];\n for (const [name, def] of Object.entries(definitions)) {\n const path = `/props/blocks/${blockPointerKey(name)}`;\n if (reservedNames.includes(name))\n issues.push({\n path,\n code: \"block_name_collision\",\n message: `Block '${name}' conflicts with a registered component.`\n });\n if (format !== \"docx\" && def.section)\n issues.push({\n path: `${path}/section`,\n code: \"block_format\",\n message: \"Section effects are DOCX-only.\"\n });\n if (format !== \"pptx\" && def.slide)\n issues.push({\n path: `${path}/slide`,\n code: \"block_format\",\n message: \"Slide effects are PPTX-only.\"\n });\n const checkSlot = (slot, pointer2) => {\n if (slot.default !== void 0)\n resolveBlockSlot(slot, slot.default, `${pointer2}/default`, issues);\n for (const [minimum, maximum] of [\n [\"minItems\", \"maxItems\"],\n [\"minLength\", \"maxLength\"],\n [\"minimum\", \"maximum\"]\n ]) {\n if (slot[minimum] !== void 0 && slot[maximum] !== void 0 && slot[minimum] > slot[maximum])\n issues.push({\n path: pointer2,\n code: \"block_invalid_definition\",\n message: `${minimum} exceeds ${maximum}.`\n });\n }\n if (slot.items) checkSlot(slot.items, `${pointer2}/items`);\n for (const [key, nested] of Object.entries(slot.properties ?? {}))\n checkSlot(nested, `${pointer2}/properties/${blockPointerKey(key)}`);\n };\n for (const [key, slot] of Object.entries(def.slots))\n checkSlot(slot, `${path}/slots/${blockPointerKey(key)}`);\n checkTemplate(def.body, `${path}/body`, def.slots, issues);\n if (def.section)\n checkTemplate(def.section, `${path}/section`, def.slots, issues);\n if (def.slide) checkTemplate(def.slide, `${path}/slide`, def.slots, issues);\n }\n return issues;\n}\nfunction validateBlockInvocations(document, definitions, format, reservedNames = []) {\n const issues = validateBlockDefinitions(definitions, format, reservedNames);\n if (issues.length) return issues;\n const walk = (v, path) => {\n if (Array.isArray(v)) {\n v.forEach((item, i) => walk(item, `${path}/${i}`));\n return;\n }\n if (!isBlockRecord(v) || v.enabled === false) return;\n if (v.name === \"block\" && isBlockRecord(v.props) && typeof v.props.ref === \"string\") {\n const def = own(definitions, v.props.ref) ? definitions[v.props.ref] : void 0;\n if (!def)\n issues.push({\n path: `${path}/props/ref`,\n code: \"block_unknown_reference\",\n message: `Block '${v.props.ref}' is not defined in this document.`\n });\n else {\n if (v.props.slots === void 0 || isBlockRecord(v.props.slots))\n resolveBlockSlots(\n def.slots,\n v.props.slots ?? {},\n `${path}/props/slots`,\n issues\n );\n if (def.section && !/^\\/children\\/\\d+\\/children\\/\\d+$/.test(path))\n issues.push({\n path,\n code: \"invalid_placement\",\n message: \"A block with section effects must be a direct child of a top-level section.\"\n });\n if (def.slide && !/^\\/children\\/\\d+\\/children\\/\\d+$/.test(path))\n issues.push({\n path,\n code: \"invalid_placement\",\n message: \"A block with slide effects must be a direct child of a slide.\"\n });\n }\n }\n for (const [key, item] of Object.entries(v)) {\n if (path === \"/props\" && key === \"blocks\") continue;\n walk(item, `${path}/${blockPointerKey(key)}`);\n }\n };\n walk(document, \"\");\n return issues;\n}\nvar JsonBlockEvaluator = class {\n constructor(definitions, options) {\n this.definitions = definitions;\n this.options = options;\n const issues = validateBlockDefinitions(\n definitions,\n options.format,\n options.reservedNames\n );\n if (issues.length) throw new BlockEvaluationError(issues);\n }\n sourceMap = {};\n blocks = [];\n blockSources = /* @__PURE__ */ new Set();\n nodes = 0;\n guard(path, depth) {\n if (depth > 64 || ++this.nodes > 5e4)\n fail(\n path,\n \"block_expansion_limit\",\n \"Block expansion exceeds the depth/node limit (64/50000).\"\n );\n }\n /**\n * A directive operand and the authored pointer it came from: the slot the\n * pointer form names, or the current item, slot or context a reference\n * object names. Definitions are validated before this runs, so a malformed\n * operand cannot reach it.\n */\n operand(raw, key, env) {\n const { root, pointer: pointer2 } = blockOperand(raw, key);\n const { value, source } = this.reference(root, pointer2, env);\n return {\n value,\n source,\n // Element i of the array is authored at pointer/i, looked up the same\n // way: a slot the enclosing invocation built from its own repeat maps\n // element by element, and pointer + \"/i\" is not the same as that.\n element: (index) => this.reference(root, `${pointer2}/${index}`, env).source\n };\n }\n /**\n * What a reference reads and where the author wrote it. One resolution for\n * the binding form and the operand form, so `{ \"$context\": ... }` is\n * attributed the same way whichever directive carries it.\n */\n reference(root, pointer2, env) {\n if (root === \"$item\")\n return {\n value: blockValueAt(env.item, pointer2),\n source: `${env.itemSource ?? env.source}${pointer2}`\n };\n if (root === \"$context\") {\n const authored = toAuthoredBlockPointer(\n env.contextSources ?? {},\n pointer2\n );\n return {\n value: blockValueAt(env.context, pointer2),\n source: authored === pointer2 ? env.source : authored\n };\n }\n if (root === \"$theme\")\n return {\n value: blockValueAt(this.options.theme, pointer2),\n source: env.source\n };\n return {\n value: blockValueAt(env.slots, pointer2),\n source: env.slotSources ? toAuthoredBlockPointer(env.slotSources, pointer2) : `${env.source}/props/slots${pointer2}`\n };\n }\n evaluate(value, env, out, definitionPath, depth = 0) {\n this.guard(env.source, depth);\n this.sourceMap[out] = env.source;\n if (Array.isArray(value)) {\n const result2 = [];\n value.forEach((v, i) => {\n const evaluated = this.evaluate(\n v,\n env,\n `${out}/${result2.length}`,\n `${definitionPath}/${i}`,\n depth + 1\n );\n if (evaluated !== void 0) {\n if (isBlockRecord(v) && (\"$if\" in v || \"$each\" in v) && Array.isArray(evaluated)) {\n const base = `${out}/${result2.length}`;\n const maps = Object.entries(this.sourceMap).filter(\n ([key]) => key.startsWith(`${base}/`)\n );\n for (const [key] of maps) delete this.sourceMap[key];\n for (const [key, source] of maps) {\n const rest = key.slice(base.length + 1);\n const [index, ...suffix] = rest.split(\"/\");\n this.sourceMap[`${out}/${result2.length + Number(index)}${suffix.length ? \"/\" + suffix.join(\"/\") : \"\"}`] = source;\n }\n result2.push(...evaluated);\n } else result2.push(evaluated);\n }\n });\n return result2;\n }\n if (!isBlockRecord(value)) return value;\n if (\"$slot\" in value || \"$item\" in value || \"$theme\" in value || \"$context\" in value) {\n const key = [\"$slot\", \"$item\", \"$theme\", \"$context\"].find(\n (k) => k in value\n );\n const chain = (key === \"$theme\" ? themePointerChain(value[key]) : void 0) ?? [];\n const pointer2 = chain[0] ?? value[key];\n let found;\n let source = env.source;\n for (const candidate of chain.length ? chain : [pointer2]) {\n const read = this.reference(key, candidate, env);\n source = read.source;\n if (read.value !== void 0) {\n found = read.value;\n break;\n }\n }\n this.sourceMap[out] = source;\n let result2 = found !== void 0 ? structuredClone(found) : void 0;\n if (result2 === void 0 && own(value, \"default\"))\n result2 = this.evaluate(\n value.default,\n env,\n out,\n `${definitionPath}/default`,\n depth + 1\n );\n if (result2 === void 0 && key === \"$theme\")\n return fail(\n definitionPath,\n \"block_unknown_theme_binding\",\n `Theme value '${chain.length > 1 ? chain.join(\", \") : pointer2}' is missing; declare a fallback or use an existing token.`\n );\n if ((key === \"$slot\" || key === \"$item\") && own(value, \"props\") && isBlockRecord(result2) && typeof result2.name === \"string\") {\n const origin = this.sourceMap[out];\n const defaults = this.evaluate(\n value.props,\n env,\n `${out}/props`,\n `${definitionPath}/props`,\n depth + 1\n );\n const authored = isBlockRecord(result2.props) ? result2.props : {};\n for (const propKey of Object.keys(authored)) {\n const pointerKey = `${out}/props/${blockPointerKey(propKey)}`;\n for (const mapped of Object.keys(this.sourceMap))\n if (mapped === pointerKey || mapped.startsWith(`${pointerKey}/`))\n delete this.sourceMap[mapped];\n this.sourceMap[pointerKey] = `${origin}/props/${blockPointerKey(propKey)}`;\n }\n result2 = {\n ...result2,\n props: {\n ...isBlockRecord(defaults) ? defaults : {},\n ...authored\n }\n };\n }\n return result2;\n }\n if (\"$if\" in value) {\n const operand = this.operand(value.$if, \"$if\", env);\n const branch = present(operand.value) ? value.then : value.else;\n const result2 = this.evaluate(branch, env, out, definitionPath, depth + 1);\n const literal = !isBlockRecord(branch) || !Object.keys(branch).some((k) => k.startsWith(\"$\"));\n if (literal && this.sourceMap[out] === env.source)\n this.sourceMap[out] = operand.source;\n return result2;\n }\n if (\"$count\" in value) {\n const operand = this.operand(value.$count, \"$count\", env);\n if (!Array.isArray(operand.value))\n return fail(\n operand.source,\n \"block_slot_type\",\n \"$count requires an array.\"\n );\n return operand.value.length;\n }\n if (\"$each\" in value) {\n const operand = this.operand(value.$each, \"$each\", env);\n const list = operand.value;\n if (!Array.isArray(list))\n return fail(\n operand.source,\n \"block_slot_type\",\n \"$each requires an array.\"\n );\n const result2 = [];\n list.forEach((item, i) => {\n const pointer2 = `${out}/${result2.length}`;\n const evaluated = this.evaluate(\n value.template,\n {\n ...env,\n item,\n itemSource: operand.element(i)\n },\n pointer2,\n `${definitionPath}/template`,\n depth + 1\n );\n if (evaluated !== void 0) {\n if (this.sourceMap[pointer2] === env.source)\n this.sourceMap[pointer2] = operand.element(i);\n result2.push(evaluated);\n } else\n for (const key of Object.keys(this.sourceMap)) {\n if (key === pointer2 || key.startsWith(`${pointer2}/`))\n delete this.sourceMap[key];\n }\n });\n return result2;\n }\n if (\"$join\" in value) {\n const values = value.$join.map(\n (v, i) => this.evaluate(\n v,\n env,\n `${out}/${i}`,\n `${definitionPath}/$join/${i}`,\n depth + 1\n )\n );\n const first = values.findIndex(present);\n if (first >= 0) this.sourceMap[out] = this.sourceMap[`${out}/${first}`];\n return (value.keepEmpty === true ? values : values.filter(present)).map((v) => String(v ?? \"\")).join(String(value.separator ?? \"\"));\n }\n if (\"$measure\" in value) {\n if (!this.options.measure)\n return fail(\n definitionPath,\n \"block_unsupported_operation\",\n \"This format does not support $measure.\"\n );\n return this.options.measure(\n value.$measure,\n value.unit ?? \"pt\",\n env.context\n ) * Number(value.fraction ?? 1);\n }\n const result = {};\n for (const [key, item] of Object.entries(value)) {\n const evaluated = this.evaluate(\n item,\n env,\n `${out}/${blockPointerKey(key)}`,\n `${definitionPath}/${blockPointerKey(key)}`,\n depth + 1\n );\n if (evaluated !== void 0)\n Object.defineProperty(result, key, {\n value: evaluated,\n enumerable: true,\n configurable: true,\n writable: true\n });\n }\n return result;\n }\n expand(value, path = \"\", depth = 0) {\n this.guard(path, depth);\n if (Array.isArray(value))\n return value.map((v, i) => this.expand(v, `${path}/${i}`, depth + 1));\n if (!isBlockRecord(value)) return value;\n if (value.name === \"block\" && value.enabled !== false) {\n if (!isBlockRecord(value.props) || typeof value.props.ref !== \"string\")\n return fail(\n path,\n \"block_invalid_invocation\",\n \"A block requires props.ref and optional props.slots.\"\n );\n if (Object.keys(value.props).some(\n (key) => ![\"ref\", \"slots\"].includes(key)\n ) || value.props.slots !== void 0 && !isBlockRecord(value.props.slots))\n return fail(\n path,\n \"block_invalid_invocation\",\n \"Block props accept only ref and an object of slots.\"\n );\n const def = own(this.definitions, value.props.ref) ? this.definitions[value.props.ref] : void 0;\n if (!def)\n return fail(\n `${path}/props/ref`,\n \"block_unknown_reference\",\n `Block '${value.props.ref}' is not defined in this document.`\n );\n const issues = [];\n const source = toAuthoredBlockPointer(this.sourceMap, path);\n const slotsPath = `${path}/props/slots`;\n const slots = resolveBlockSlots(\n def.slots,\n value.props.slots ?? {},\n slotsPath,\n issues\n );\n if (issues.length)\n throw new BlockEvaluationError(\n issues.map((issue) => ({\n ...issue,\n path: toAuthoredBlockPointer(this.sourceMap, issue.path)\n }))\n );\n const slotSources = Object.fromEntries([\n [\"\", toAuthoredBlockPointer(this.sourceMap, slotsPath)],\n ...Object.entries(this.sourceMap).filter(([key]) => key.startsWith(`${slotsPath}/`)).map(([key, origin]) => [key.slice(slotsPath.length), origin])\n ]);\n const env = {\n slots,\n slotSources,\n source,\n definition: `/props/blocks/${blockPointerKey(value.props.ref)}`,\n context: this.options.contextAt?.(path) ?? this.options.context ?? {},\n contextSources: this.options.contextSources\n };\n if (def.section)\n this.options.onSection?.({\n settings: def.section,\n environment: env,\n path\n });\n if (def.slide)\n this.options.onSlide?.({ settings: def.slide, environment: env, path });\n if (!this.blockSources.has(source)) {\n this.blockSources.add(source);\n this.blocks.push(source);\n }\n const children = this.evaluate(\n def.body,\n env,\n `${path}/children`,\n `${env.definition}/body`,\n depth + 1\n );\n return {\n name: \"group\",\n ...value.id !== void 0 && { id: value.id },\n children: this.expand(children, `${path}/children`, depth + 1)\n };\n }\n if (value.enabled === false) return { ...value };\n const result = { ...value };\n for (const [key, item] of Object.entries(value)) {\n if (path === \"/props\" && key === \"blocks\") continue;\n Object.defineProperty(result, key, {\n value: this.expand(item, `${path}/${blockPointerKey(key)}`, depth + 1),\n enumerable: true,\n configurable: true,\n writable: true\n });\n }\n return result;\n }\n};\n\n// src/blocks/metadata.ts\nimport { isScaffoldMarker as isScaffoldMarker2 } from \"@json-to-office/quality\";\nimport { Value as Value2 } from \"@sinclair/typebox/value\";\nfunction blockSlotsJsonSchema(definition) {\n return {\n type: \"object\",\n additionalProperties: false,\n properties: Object.fromEntries(\n Object.entries(definition.slots).map(([key, slot]) => [\n key,\n blockSlotJsonSchema(slot)\n ])\n ),\n required: Object.entries(definition.slots).filter(([, slot]) => slot.required && slot.default === void 0).map(([key]) => key)\n };\n}\nfunction documentBlockMetadata(document) {\n const definitions = readBlockDefinitions(document);\n if (!Value2.Check(BlockDefinitionsSchema, definitions))\n return { definitions: [], invocations: [], invalidDefinitions: true };\n const invocations2 = [];\n const walk = (value, path) => {\n if (Array.isArray(value)) {\n value.forEach((item, i) => walk(item, `${path}/${i}`));\n return;\n }\n if (!isBlockRecord(value)) return;\n if (value.name === \"block\" && isBlockRecord(value.props) && typeof value.props.ref === \"string\")\n invocations2.push({\n ref: value.props.ref,\n path,\n slotsPath: `${path}/props/slots`,\n defined: Object.prototype.hasOwnProperty.call(\n definitions,\n value.props.ref\n )\n });\n for (const [key, item] of Object.entries(value)) {\n if (path === \"/props\" && key === \"blocks\") continue;\n walk(item, `${path}/${blockPointerKey(key)}`);\n }\n };\n walk(document, \"\");\n return {\n definitions: Object.entries(definitions).map(([name, definition]) => ({\n name,\n definitionPointer: `/props/blocks/${blockPointerKey(name)}`,\n definition,\n slotsSchema: blockSlotsJsonSchema(definition)\n })),\n invocations: invocations2,\n invalidDefinitions: false\n };\n}\nfunction visitInvocationSlots(document, blocks, visit) {\n const definitions = readBlockDefinitions(document);\n for (const path of blocks) {\n const node = blockValueAt(document, path);\n if (!isBlockRecord(node) || !isBlockRecord(node.props) || typeof node.props.ref !== \"string\")\n continue;\n const ref = node.props.ref;\n const definition = definitions[ref];\n if (!definition) continue;\n const walk = (slot, value, pointer2, name) => {\n visit(ref, slot, value, pointer2, name);\n if (isBlockRecord(value) && slot.properties) {\n for (const [key, property] of Object.entries(slot.properties)) {\n walk(\n property,\n blockValueAt(value, `/${blockPointerKey(key)}`),\n `${pointer2}/${blockPointerKey(key)}`,\n `${name}.${key}`\n );\n }\n }\n if (Array.isArray(value) && slot.items)\n value.forEach(\n (item, i) => walk(slot.items, item, `${pointer2}/${i}`, name)\n );\n };\n for (const [name, slot] of Object.entries(definition.slots)) {\n const authored = blockValueAt(\n node.props.slots,\n `/${blockPointerKey(name)}`\n );\n walk(\n slot,\n authored === void 0 && slot.default !== void 0 ? slot.default : authored,\n `${path}/props/slots/${blockPointerKey(name)}`,\n name\n );\n }\n }\n}\nfunction blockSlotBudgets(document, blocks) {\n const result = [];\n visitInvocationSlots(document, blocks, (ref, slot, value, pointer2, name) => {\n if (typeof value === \"string\" && slot.maxWords !== void 0 && !isScaffoldMarker2(value))\n result.push({\n block: ref,\n slot: name,\n path: pointer2,\n words: blockWordCount(value),\n maxWords: slot.maxWords\n });\n });\n return result;\n}\nfunction blockSlotRoles(document, blocks) {\n const result = [];\n visitInvocationSlots(document, blocks, (ref, slot, value, pointer2, name) => {\n if (!slot.role) return;\n result.push({\n block: ref,\n invocation: pointer2.replace(/\\/props\\/slots\\/.*$/, \"\"),\n slot: name,\n role: slot.role,\n path: pointer2,\n value\n });\n });\n return result;\n}\n\n// src/blocks/schema-types.ts\nvar allTypes = [\n \"null\",\n \"boolean\",\n \"number\",\n \"string\",\n \"array\",\n \"object\"\n];\nvar intersection = (a, b) => new Set([...a].filter((value) => b.has(value)));\nvar union = (sets) => new Set(sets.flatMap((set) => [...set]));\nvar typeOf = (value) => value === null ? \"null\" : Array.isArray(value) ? \"array\" : typeof value;\nfunction possibleValueTypes(schema, resolve, seen = /* @__PURE__ */ new Set()) {\n if (schema === false) return /* @__PURE__ */ new Set();\n if (schema === true || seen.has(schema)) return new Set(allTypes);\n const negated = schema.not;\n if (negated === true || negated && typeof negated === \"object\" && Object.keys(negated).length === 0)\n return /* @__PURE__ */ new Set();\n const next = new Set(seen).add(schema);\n let types = new Set(allTypes);\n if (schema.type) {\n const declared = Array.isArray(schema.type) ? schema.type : [schema.type];\n types = intersection(\n types,\n new Set(\n allTypes.filter(\n (type) => declared.includes(type) || type === \"number\" && declared.includes(\"integer\")\n )\n )\n );\n }\n if (Object.hasOwn(schema, \"const\"))\n types = intersection(types, /* @__PURE__ */ new Set([typeOf(schema.const)]));\n if (Array.isArray(schema.enum))\n types = intersection(types, new Set(schema.enum.map(typeOf)));\n if (typeof schema.$ref === \"string\") {\n const target = resolve(schema.$ref);\n if (target !== void 0)\n types = intersection(types, possibleValueTypes(target, resolve, next));\n }\n for (const key of [\"anyOf\", \"oneOf\"]) {\n if (Array.isArray(schema[key]))\n types = intersection(\n types,\n union(\n schema[key].map(\n (branch) => possibleValueTypes(branch, resolve, next)\n )\n )\n );\n }\n if (Array.isArray(schema.allOf))\n for (const branch of schema.allOf)\n types = intersection(types, possibleValueTypes(branch, resolve, next));\n if (negated && typeof negated === \"object\" && negated.type && Object.keys(negated).every(\n (key) => [\"type\", \"description\", \"title\", \"$comment\"].includes(key)\n )) {\n const excluded = (Array.isArray(negated.type) ? negated.type : [negated.type]).filter((type) => type !== \"integer\");\n types = new Set([...types].filter((type) => !excluded.includes(type)));\n }\n return types;\n}\nfunction arrayItemSchema(schema, resolve, seen = /* @__PURE__ */ new Set()) {\n if (schema === false) return false;\n if (schema === true || seen.has(schema)) return {};\n const next = new Set(seen).add(schema);\n const constraints = [];\n if (typeof schema.$ref === \"string\") {\n const target = resolve(schema.$ref);\n if (target !== void 0)\n constraints.push(arrayItemSchema(target, resolve, next));\n }\n if (schema.items !== void 0)\n constraints.push(\n Array.isArray(schema.items) ? {\n anyOf: [\n ...schema.items,\n ...schema.additionalItems === false ? [] : [schema.additionalItems ?? {}]\n ]\n } : schema.items\n );\n for (const key of [\"anyOf\", \"oneOf\"])\n if (Array.isArray(schema[key])) {\n constraints.push({\n anyOf: schema[key].filter(\n (branch) => possibleValueTypes(branch, resolve).has(\"array\")\n ).map(\n (branch) => arrayItemSchema(branch, resolve, next)\n )\n });\n }\n if (Array.isArray(schema.allOf))\n constraints.push(\n ...schema.allOf.map(\n (branch) => arrayItemSchema(branch, resolve, next)\n )\n );\n return constraints.length === 0 ? {} : constraints.length === 1 ? constraints[0] : { allOf: constraints };\n}\n\n// src/blocks/authoring-schema.ts\nvar object = (properties, required) => ({\n type: \"object\",\n properties,\n required,\n additionalProperties: false\n});\nvar pointer = (description) => ({\n type: \"string\",\n pattern: \"^(|/.*)$\",\n description\n});\nvar pointerChain = (description) => ({\n anyOf: [\n pointer(description),\n {\n type: \"array\",\n minItems: 1,\n items: pointer(description),\n description\n }\n ],\n description\n});\nvar referenceDescriptions = (format) => ({\n $slot: \"Read a named input slot by JSON Pointer, e.g. /title or /client/name.\",\n $item: \"Read the current $each entry by JSON Pointer. Use an empty string for the whole entry or /title for a property.\",\n $theme: 'Read the active theme by JSON Pointer, e.g. /colors/primary, or by a list of pointers tried in order, e.g. [\"/chrome/sourceLine/color\", \"/styles/source/color\"] \\u2014 the chrome recipe if the theme sets one, else the type role. A missing value requires a default.',\n $context: format === \"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.\"\n});\nvar measureDescriptions = (format) => format === \"pptx\" ? {\n axis: \"Measure the slide canvas width or height, in the unit given.\",\n unit: \"Measurement unit: points, twentieths of a point, or inches. Defaults to pt; use in for frame coordinates.\"\n} : {\n axis: \"Measure the usable page width or height after margins, using the containing section\\u2019s page settings.\",\n unit: \"Measurement unit: points, twentieths of a point, or inches. Defaults to pt.\"\n};\nvar describe = (schema, description) => ({\n ...typeof schema === \"boolean\" ? { allOf: [schema] } : schema,\n description\n});\nvar metadata = (schema) => typeof schema === \"boolean\" ? {} : {\n ...schema.description && { description: schema.description },\n ...schema.markdownDescription && {\n markdownDescription: schema.markdownDescription\n }\n};\nvar hasKey = (key) => ({ type: \"object\", required: [key] });\nvar directiveNames = Object.keys(BLOCK_DIRECTIVES);\nfunction createBlockAuthoringSchema(definitions, componentDefinition, excludedComponents = [], format = \"docx\") {\n const prefix = `BlockTemplate_${componentDefinition}`;\n const references = referenceDescriptions(format);\n const measure = measureDescriptions(format);\n const operand = (description) => ({\n description,\n anyOf: [\n pointer(description),\n ...BLOCK_OPERAND_ROOTS.map(\n (root) => object({ [root]: pointer(references[root]) }, [root])\n )\n ]\n });\n const bodyName = `${prefix}_Body`;\n const ref = (name) => ({ $ref: `#/definitions/${name}` });\n if (definitions[bodyName]) return ref(bodyName);\n const originals = { ...definitions };\n const source = originals[componentDefinition];\n originals[componentDefinition] = {\n ...source,\n anyOf: (source.anyOf ?? [source]).filter(\n (branch) => !excludedComponents.includes(branch.properties?.name?.const)\n )\n };\n const resolve = (pointer2) => {\n if (!pointer2.startsWith(\"#/definitions/\")) return void 0;\n let node = originals;\n for (const key of pointer2.slice(\"#/definitions/\".length).split(\"/\")) {\n const decoded = key.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n if (!node || typeof node !== \"object\" || !Object.hasOwn(node, decoded))\n return void 0;\n node = node[decoded];\n }\n return typeof node === \"boolean\" || node && typeof node === \"object\" ? node : void 0;\n };\n const values = /* @__PURE__ */ new Map();\n const literals = /* @__PURE__ */ new Map();\n let nextId = 0;\n const componentRef = ref(componentDefinition);\n const shared = /* @__PURE__ */ new Map();\n const share = (schema) => {\n const key = JSON.stringify(schema);\n let name = shared.get(key);\n if (!name) {\n name = `${prefix}_Shared${nextId++}`;\n shared.set(key, name);\n definitions[name] = schema;\n }\n return ref(name);\n };\n const presence = Object.fromEntries(\n directiveNames.map((key) => [key, share(hasKey(key))])\n );\n const anyDirective = share({ anyOf: Object.values(presence) });\n const starterPrefixes = [\n .../* @__PURE__ */ new Set([\n \"\",\n ...directiveNames.flatMap(\n (key) => Array.from(\n { length: key.length - 1 },\n (_, index) => key.slice(0, index + 1)\n )\n )\n ])\n ];\n const starterObject = share({\n type: \"object\",\n // An enum here would itself become a list of bogus property suggestions.\n propertyNames: {\n pattern: `^(?:${starterPrefixes.map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`\n }\n });\n function literal(schema) {\n if (typeof schema === \"boolean\") return schema;\n const key = JSON.stringify(schema);\n const cached = literals.get(key);\n if (cached) return { ...ref(cached), ...metadata(schema) };\n const name = `${prefix}_Literal${nextId++}`;\n literals.set(key, name);\n const result = definitions[name] = {};\n Object.assign(result, schema);\n if (typeof schema.$ref === \"string\") {\n const target = resolve(schema.$ref);\n if (target !== void 0) {\n const transformed = literal(target);\n if (typeof transformed === \"object\") result.$ref = transformed.$ref;\n else {\n delete result.$ref;\n if (!transformed) result.not = {};\n }\n }\n }\n if (schema.properties)\n result.properties = Object.fromEntries(\n Object.entries(\n schema.properties\n ).map(([key2, value]) => [\n key2,\n // Literal discriminators retain canonical component/version dispatch\n // and their individual choice descriptions.\n [\"name\", \"version\"].includes(key2) && typeof value === \"object\" && typeof value.const === \"string\" ? value : author(value)\n ])\n );\n if (schema.patternProperties)\n result.patternProperties = Object.fromEntries(\n Object.entries(\n schema.patternProperties\n ).map(([key2, value]) => [key2, author(value)])\n );\n if (schema.items !== void 0)\n result.items = Array.isArray(schema.items) ? schema.items.map((item) => author(item, true)) : author(schema.items, true);\n for (const key2 of [\"additionalProperties\", \"additionalItems\"])\n if (typeof schema[key2] === \"object\")\n result[key2] = author(schema[key2], key2 === \"additionalItems\");\n for (const key2 of [\"anyOf\", \"oneOf\", \"allOf\"])\n if (Array.isArray(schema[key2]))\n result[key2] = schema[key2].map((branch) => {\n const transformed = literal(branch);\n return typeof branch === \"object\" && typeof branch.properties?.name?.const === \"string\" && typeof transformed === \"object\" && transformed.$ref ? definitions[transformed.$ref.slice(\"#/definitions/\".length)] : transformed;\n });\n for (const key2 of [\"then\", \"else\"])\n if (schema[key2] !== void 0) result[key2] = literal(schema[key2]);\n return { ...ref(name), ...metadata(schema) };\n }\n function author(input, sequence = false) {\n if (input === false) return false;\n const annotations = metadata(input);\n const schema = typeof input === \"object\" ? { ...input } : input;\n if (typeof schema === \"object\") {\n delete schema.description;\n delete schema.markdownDescription;\n }\n const key = `${sequence ? \"sequence\" : \"value\"}:${JSON.stringify(schema)}`;\n const cached = values.get(key);\n if (cached) return { ...ref(cached), ...annotations };\n const name = `${prefix}_Value${nextId++}`;\n values.set(key, name);\n definitions[name] = {};\n const self = ref(name);\n const types = possibleValueTypes(schema, resolve);\n if (types.size === 0) {\n definitions[name] = { allOf: [literal(schema)] };\n return self;\n }\n const value = () => sequence ? author(schema) : self;\n const branch = () => sequence ? { anyOf: [self, { type: \"array\", items: self }] } : self;\n const item = () => sequence ? value() : author(arrayItemSchema(schema, resolve));\n const specs = {};\n for (const directive of directiveNames) {\n const result = BLOCK_DIRECTIVES[directive].result;\n if (result !== \"dynamic\" && !types.has(result) && !(sequence && result === \"array\"))\n continue;\n switch (directive) {\n case \"$slot\":\n case \"$item\":\n case \"$theme\":\n case \"$context\":\n specs[directive] = object(\n {\n [directive]: directive === \"$theme\" ? pointerChain(references[directive]) : pointer(references[directive]),\n default: describe(\n value(),\n \"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it.\"\n ),\n ...directive === \"$slot\" || directive === \"$item\" ? {\n props: {\n type: \"object\",\n 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.\"\n }\n } : {}\n },\n [directive]\n );\n break;\n case \"$if\":\n specs[directive] = object(\n {\n $if: operand(\n 'Test a slot by JSON Pointer, e.g. /subtitle, or a reference such as { \"$item\": \"/numeric\" } or { \"$theme\": \"/chrome/keyTakeaways/fill\" }. Missing, null, false, empty text and empty arrays select else; zero selects then.'\n ),\n then: describe(\n branch(),\n \"Value or components to emit when the slot tested by $if is present.\"\n ),\n else: describe(\n branch(),\n \"Value or components to emit otherwise. Omit to produce no output.\"\n )\n },\n [\"$if\", \"then\"]\n );\n break;\n case \"$each\":\n specs[directive] = object(\n {\n $each: operand(\n 'Repeat template for each entry in an array slot, e.g. /items, or in an array named by a reference, { \"$item\": \"/cells\" } or { \"$theme\": \"/palette/chart\" }. Read the current entry with $item.'\n ),\n template: describe(\n item(),\n \"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.\"\n )\n },\n [\"$each\", \"template\"]\n );\n break;\n case \"$count\":\n specs[directive] = object(\n {\n $count: operand(\n 'Return the number of entries in an array slot, e.g. /items, or in an array of the current entry, { \"$item\": \"/cells\" }.'\n )\n },\n [\"$count\"]\n );\n break;\n case \"$join\":\n specs[directive] = object(\n {\n $join: {\n type: \"array\",\n items: author({}),\n description: \"Evaluate these values or bindings and join them as text. Empty values are skipped unless keepEmpty is true.\"\n },\n separator: {\n type: \"string\",\n description: \"Text inserted between joined values. Defaults to an empty string.\"\n },\n keepEmpty: {\n type: \"boolean\",\n description: \"Keep missing, null, false, empty text and empty arrays in the join. Defaults to false.\"\n }\n },\n [\"$join\"]\n );\n break;\n case \"$measure\":\n specs[directive] = object(\n {\n $measure: {\n enum: [\"width\", \"height\"],\n description: measure.axis\n },\n fraction: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n description: \"Fraction of the measured dimension, from 0 to 1. Defaults to 1.\"\n },\n unit: {\n enum: [\"pt\", \"twip\", \"in\"],\n description: measure.unit\n }\n },\n [\"$measure\"]\n );\n break;\n default: {\n const exhaustive = directive;\n throw new Error(\n `Missing authoring schema for directive ${exhaustive}`\n );\n }\n }\n }\n definitions[name] = {\n allOf: [\n {\n if: anyDirective,\n then: {\n allOf: directiveNames.map((directive) => ({\n if: presence[directive],\n then: specs[directive] ? share({\n ...specs[directive],\n properties: Object.fromEntries(\n Object.entries(specs[directive].properties).map(\n ([key2, property]) => [key2, share(property)]\n )\n )\n }) : false\n }))\n },\n else: literal(schema)\n },\n {\n // Keep starters while the first key is empty or a partial directive\n // (\"$\", \"$sl\", ...). Any ordinary or completed key ends this phase.\n // Prefixes come from the evaluator's directive registry.\n if: starterObject,\n then: {\n properties: Object.fromEntries(\n Object.entries(specs).map(([key2, spec]) => [\n key2,\n share(spec.properties[key2])\n ])\n )\n }\n }\n ]\n };\n return { ...self, ...annotations };\n }\n definitions[bodyName] = author(componentRef, true);\n return ref(bodyName);\n}\n\n// src/blocks/compose.ts\nasync function composeBlocksWithPlugins(evaluator, document, options) {\n const preserve = options.preserve ?? /* @__PURE__ */ new Set();\n let visited = 0;\n const walk = async (value, path, depth) => {\n if (depth > 64 || ++visited > 1e5)\n throw new BlockEvaluationError([\n {\n path: toAuthoredBlockPointer(evaluator.sourceMap, path),\n code: \"block_expansion_limit\",\n message: \"Combined plugin/block expansion exceeds depth/node limits (64/100000).\"\n }\n ]);\n if (Array.isArray(value)) {\n const children = [];\n for (let i = 0; i < value.length; i++)\n children.push(await walk(value[i], `${path}/${i}`, depth + 1));\n return {\n standard: children.map((c) => c.standard),\n preserved: children.map((c) => c.preserved)\n };\n }\n if (!isBlockRecord(value) || value.enabled === false)\n return { standard: value, preserved: value };\n if (value.name === \"block\")\n return walk(evaluator.expand(value, path, depth), path, depth + 1);\n const standard = { ...value };\n const kept = { ...value };\n for (const [key, item] of Object.entries(value)) {\n if (path === \"/props\" && key === \"blocks\") continue;\n const processed = await walk(item, `${path}/${key}`, depth + 1);\n Object.defineProperty(standard, key, {\n value: processed.standard,\n enumerable: true,\n configurable: true,\n writable: true\n });\n Object.defineProperty(kept, key, {\n value: processed.preserved,\n enumerable: true,\n configurable: true,\n writable: true\n });\n }\n if (typeof value.name === \"string\" && options.plugins.has(value.name)) {\n const source = toAuthoredBlockPointer(evaluator.sourceMap, path);\n const emitted = await options.render(standard, source);\n evaluator.sourceMap[`${path}/children`] = source;\n const processed = await walk(emitted, `${path}/children`, depth + 1);\n return {\n standard: { name: \"group\", children: processed.standard },\n preserved: preserve.has(value.name) ? value : { name: \"group\", children: processed.preserved }\n };\n }\n return { standard, preserved: kept };\n };\n return walk(document, \"\", 0);\n}\n\n// src/blocks/editor.ts\nimport { Value as Value3 } from \"@sinclair/typebox/value\";\nvar SCAFFOLD_MARKER_SCHEMA_PATTERN = \"^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$\";\nvar clone = (value) => JSON.parse(JSON.stringify(value));\nfunction range(minimum, maximum, unit) {\n if (minimum !== void 0 && maximum !== void 0)\n return minimum === maximum ? `${minimum} ${unit}` : `${minimum}\\u2013${maximum} ${unit}`;\n if (minimum !== void 0) return `at least ${minimum} ${unit}`;\n if (maximum !== void 0) return `at most ${maximum} ${unit}`;\n return void 0;\n}\nfunction blockSlotFacts(slot) {\n const facts = [];\n if (slot.required && slot.default === void 0) facts.push(\"Required\");\n if (slot.default !== void 0)\n facts.push(`Default: \\`${JSON.stringify(slot.default)}\\``);\n if (slot.type === \"component\")\n facts.push(\"A component; placement stays in the definition\");\n if (slot.enum)\n facts.push(\n `One of ${slot.enum.map((value) => `\\`${JSON.stringify(value)}\\``).join(\", \")}`\n );\n const length = range(slot.minLength, slot.maxLength, \"characters\");\n if (length) facts.push(length);\n if (slot.maxWords !== void 0) facts.push(`at most ${slot.maxWords} words`);\n if (slot.oneLine) facts.push(\"one line\");\n const bounds = range(slot.minimum, slot.maximum, \"\");\n if (bounds) facts.push(bounds.trim());\n const entries = range(slot.minItems, slot.maxItems, \"entries\");\n if (entries) facts.push(entries);\n if (slot.role) facts.push(`Role: ${slot.role}`);\n return facts;\n}\nfunction blockSlotMarkdown(slot) {\n return [slot.description, blockSlotFacts(slot).join(\" \\xB7 \")].filter(Boolean).join(\"\\n\\n\");\n}\nfunction blockSlotEditorSchema(slot, componentRef) {\n let schema;\n if (slot.type === \"component\") {\n schema = componentRef ? {\n allOf: [\n componentRef,\n {\n properties: {\n props: {\n propertyNames: {\n not: { enum: [...BLOCK_SLOT_PLACEMENT_PROPS] },\n errorMessage: \"Block placement belongs in the definition, not in a component slot.\"\n }\n }\n }\n }\n ]\n } : {\n type: \"object\",\n properties: { name: { type: \"string\" } },\n required: [\"name\"]\n };\n } else {\n const { oneLine, properties, items, ...rest } = slot;\n for (const key of [\"role\", \"required\", \"maxWords\", \"description\"])\n delete rest[key];\n schema = { ...rest };\n if (rest.minLength !== void 0 || rest.maxLength !== void 0 || rest.enum !== void 0) {\n const { minLength, maxLength, enum: choices, ...unbounded } = rest;\n schema = {\n ...unbounded,\n anyOf: [\n {\n ...minLength !== void 0 && { minLength },\n ...maxLength !== void 0 && { maxLength },\n ...choices !== void 0 && { enum: choices }\n },\n { type: \"string\", pattern: SCAFFOLD_MARKER_SCHEMA_PATTERN }\n ]\n };\n }\n if (oneLine) schema.pattern = \"^[^\\\\r\\\\n]*$\";\n if (items) schema.items = blockSlotEditorSchema(items, componentRef);\n if (properties) {\n schema.properties = Object.fromEntries(\n Object.entries(properties).map(([key, value]) => [\n key,\n blockSlotEditorSchema(value, componentRef)\n ])\n );\n schema.required = Object.entries(properties).filter(([, value]) => value.required && value.default === void 0).map(([key]) => key);\n schema.additionalProperties = false;\n }\n }\n if (slot.description) schema.description = slot.description;\n const markdown = blockSlotMarkdown(slot);\n if (markdown) schema.markdownDescription = markdown;\n return schema;\n}\nfunction blockSlotsEditorSchema(definition, componentRef) {\n return {\n type: \"object\",\n additionalProperties: false,\n description: \"Input values keyed by the slot names declared in the referenced block definition.\",\n properties: Object.fromEntries(\n Object.entries(definition.slots).map(([key, slot]) => [\n key,\n blockSlotEditorSchema(slot, componentRef)\n ])\n ),\n required: Object.entries(definition.slots).filter(([, slot]) => slot.required && slot.default === void 0).map(([key]) => key)\n };\n}\nfunction blockInvocationPropsSchema(definitions, componentRef) {\n const names = Object.keys(definitions);\n const schema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"ref\"],\n properties: {\n ref: {\n type: \"string\",\n minLength: 1,\n description: \"Name in this document\\u2019s props.blocks.\",\n ...names.length && {\n anyOf: names.map((name) => ({\n const: name,\n type: \"string\",\n description: definitions[name].description ?? `Block \"${name}\", defined in this document.`\n }))\n }\n },\n slots: {\n type: \"object\",\n description: \"Input values keyed by the slot names declared in the referenced block definition.\"\n }\n }\n };\n if (names.length)\n schema.allOf = names.map((name) => ({\n if: { properties: { ref: { const: name } }, required: [\"ref\"] },\n then: {\n properties: {\n slots: blockSlotsEditorSchema(definitions[name], componentRef)\n }\n }\n }));\n return schema;\n}\nfunction applyDocumentBlocksToSchema(schema, definitions, targets) {\n for (const target of targets) {\n const definition = schema.definitions?.[target.name];\n if (!definition) continue;\n const props = blockInvocationPropsSchema(definitions, target.componentRef);\n const seen = /* @__PURE__ */ new Set();\n const walk = (node) => {\n if (!node || typeof node !== \"object\" || seen.has(node)) return;\n seen.add(node);\n if (Array.isArray(node)) {\n node.forEach(walk);\n return;\n }\n const value = node;\n if (value.properties?.name?.const === \"block\" && value.properties.props) {\n value.properties.props = clone(props);\n return;\n }\n for (const [key, child] of Object.entries(value))\n if (key !== \"$ref\") walk(child);\n };\n walk(definition);\n }\n}\nfunction invocations(node, visit) {\n if (Array.isArray(node)) {\n node.forEach((item) => invocations(item, visit));\n return;\n }\n if (!isBlockRecord(node)) return;\n if (node.name === \"block\" && isBlockRecord(node.props) && typeof node.props.ref === \"string\")\n visit(node.props.ref, node);\n for (const value of Object.values(node)) invocations(value, visit);\n}\nfunction blockDependencies(definitions, name) {\n const order = [];\n const seen = /* @__PURE__ */ new Set([name]);\n const walk = (current) => {\n const definition = Object.prototype.hasOwnProperty.call(\n definitions,\n current\n ) ? definitions[current] : void 0;\n if (!definition) return;\n invocations(\n [definition.body, definition.section, definition.slide],\n (ref) => {\n if (seen.has(ref)) return;\n seen.add(ref);\n if (!Object.prototype.hasOwnProperty.call(definitions, ref)) return;\n walk(ref);\n order.push(ref);\n }\n );\n };\n walk(name);\n return order;\n}\nfunction exampleValue(slot, name, format) {\n if (slot.default !== void 0) return clone(slot.default);\n if (slot.enum?.length) return slot.enum[0];\n switch (slot.type) {\n case \"string\":\n return name;\n case \"number\":\n case \"integer\": {\n const minimum = slot.minimum ?? 0;\n return slot.maximum !== void 0 && slot.maximum < minimum ? slot.maximum : minimum;\n }\n case \"boolean\":\n return true;\n case \"array\": {\n const count = Math.min(\n Math.max(3, slot.minItems ?? 0),\n slot.maxItems ?? Number.POSITIVE_INFINITY\n );\n const item = slot.items ?? { type: \"string\" };\n return Array.from(\n { length: count },\n (_, index) => exampleValue(item, `${name} ${index + 1}`, format)\n );\n }\n case \"object\":\n return exampleSlots(slot.properties ?? {}, format);\n case \"component\":\n return format === \"docx\" ? { name: \"paragraph\", props: { text: name } } : { name: \"text\", props: { text: name } };\n default:\n return name;\n }\n}\nfunction exampleSlots(slots, format) {\n return Object.fromEntries(\n Object.entries(slots).filter(\n ([, slot]) => slot.required && slot.default === void 0 || slot.role\n ).map(([key, slot]) => [key, exampleValue(slot, key, format)])\n );\n}\nfunction blockInvocationExample(name, definition, options) {\n let found;\n if (isBlockRecord(options.document)) {\n const authored = Object.fromEntries(\n Object.entries(options.document).filter(([key]) => key !== \"props\")\n );\n invocations(authored, (ref, invocation) => {\n if (found || ref !== name) return;\n const props = invocation.props;\n found = {\n name: \"block\",\n props: {\n ref,\n ...isBlockRecord(props.slots) && { slots: clone(props.slots) }\n }\n };\n });\n }\n return found ?? {\n name: \"block\",\n props: {\n ref: name,\n slots: exampleSlots(definition.slots, options.format)\n }\n };\n}\nfunction blockReferencesFromDocument(document, source) {\n const definitions = readBlockDefinitions(document);\n if (!Value3.Check(BlockDefinitionsSchema, definitions) || validateBlockDefinitions(definitions, source.format).length > 0)\n return [];\n return Object.entries(definitions).map(([name, definition]) => ({\n name,\n format: source.format,\n template: source.template,\n definitionPointer: `/props/blocks/${blockPointerKey(name)}`,\n description: definition.description ?? \"\",\n definition,\n slotsSchema: blockSlotsJsonSchema(definition),\n example: blockInvocationExample(name, definition, {\n document,\n format: source.format\n }),\n dependencies: blockDependencies(definitions, name)\n }));\n}\n\n// src/blueprints/schema.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nimport { Value as Value4 } from \"@sinclair/typebox/value\";\nvar BLUEPRINT_FORMATS = [\"docx\", \"pptx\"];\nvar Identifier = Type2.String({\n pattern: \"^[a-z][a-z0-9]*(-[a-z0-9]+)*$\",\n description: \"Kebab-case identifier.\"\n});\nvar BlueprintPagesSchema = Type2.Object(\n {\n min: Type2.Integer({ minimum: 1 }),\n max: Type2.Integer({ minimum: 1 })\n },\n {\n additionalProperties: false,\n description: \"Expected length once filled: pages for a document, slides for a deck.\"\n }\n);\nvar BlueprintVariantSchema = Type2.Object(\n {\n description: Type2.String({ minLength: 1 }),\n whenToUse: Type2.String({ minLength: 1 }),\n pages: BlueprintPagesSchema,\n metadata: Type2.Optional(\n Type2.Record(Type2.String(), Type2.String(), {\n description: \"Document metadata the scaffold writes; a value may be a scaffold marker.\"\n })\n ),\n children: Type2.Array(Type2.Unknown(), {\n minItems: 1,\n 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.\"\n })\n },\n { additionalProperties: false }\n);\nvar BlueprintSchema = Type2.Object(\n {\n id: Identifier,\n format: Type2.Union(BLUEPRINT_FORMATS.map((f) => Type2.Literal(f))),\n title: Type2.String({ minLength: 1 }),\n description: Type2.String({ minLength: 1 }),\n whenToUse: Type2.String({ minLength: 1 }),\n theme: Type2.String({\n minLength: 1,\n description: \"Recommended theme. Any theme renders the scaffold; this one is the archetype\\u2019s house look.\"\n }),\n profile: Identifier,\n definitions: Type2.String({\n minLength: 1,\n description: \"The playground template whose props.blocks the variants invoke. The scaffold copies the definitions it needs, and their dependencies, into the document.\"\n }),\n numbering: Type2.Union([Type2.Literal(\"none\"), Type2.Literal(\"sections\")], {\n description: \"Whether section openers carry numbers the reader cites (01, 02, \\u2026).\"\n }),\n toc: Type2.Boolean({\n description: \"Whether the scaffold places a table of contents.\"\n }),\n variants: Type2.Record(Identifier, BlueprintVariantSchema, {\n minProperties: 1,\n description: \"Structural variants of the same archetype, so two documents from one brief do not look alike.\"\n })\n },\n { additionalProperties: false, description: \"A document archetype as data.\" }\n);\nfunction validateBlueprint(value) {\n const issues = [...Value4.Errors(BlueprintSchema, value)].map(\n (error) => ({ path: error.path, message: error.message })\n );\n if (issues.length > 0) return issues;\n for (const [id, variant] of Object.entries(value.variants)) {\n if (variant.pages.min > variant.pages.max)\n issues.push({\n path: `/variants/${id}/pages`,\n message: `min (${variant.pages.min}) exceeds max (${variant.pages.max})`\n });\n }\n return issues;\n}\nfunction isBlueprint(value) {\n return Value4.Check(BlueprintSchema, value);\n}\n\n// src/blueprints/instantiate.ts\nfunction registerBlueprints(format, candidates) {\n const registry = {};\n for (const candidate of candidates) {\n const issues = validateBlueprint(candidate);\n if (issues.length > 0)\n throw new Error(\n `Invalid bundled blueprint: ${issues.map((issue) => `${issue.path}: ${issue.message}`).join(\"; \")}`\n );\n const blueprint = candidate;\n if (blueprint.format !== format)\n throw new Error(\n `Blueprint ${blueprint.id} is not a ${format.toUpperCase()} blueprint.`\n );\n if (registry[blueprint.id])\n throw new Error(\n `Two bundled blueprints share the id \"${blueprint.id}\"; the later one would silently replace the earlier.`\n );\n registry[blueprint.id] = blueprint;\n }\n return registry;\n}\nvar MARKER = /^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;\nfunction selectVariant(blueprint, format, variantId) {\n if (blueprint.format !== format)\n throw new Error(\n `Blueprint ${blueprint.id} is a ${blueprint.format} blueprint; this instantiates ${format.toUpperCase()} ones.`\n );\n const id = variantId ?? Object.keys(blueprint.variants)[0];\n const variant = blueprint.variants[id];\n if (!variant)\n throw new Error(\n `Blueprint ${blueprint.id} has no variant \"${id}\"; it has ${Object.keys(\n blueprint.variants\n ).join(\", \")}.`\n );\n return { id, variant };\n}\nfunction instantiateBlueprint(blueprint, options, root) {\n const { id: variantId, variant } = selectVariant(\n blueprint,\n root.format,\n options.variant\n );\n const children = structuredClone(\n options.children ?? variant.children\n );\n const blocks = definitionsFor(children, options.definitions, blueprint);\n const metadata2 = { ...variant.metadata, ...options.metadata };\n const props = {\n theme: options.theme ?? blueprint.theme,\n qualityProfile: blueprint.profile,\n ...root.props,\n ...Object.keys(blocks).length > 0 && { blocks },\n ...root.metadataPointer === \"/props\" ? metadata2 : { metadata: metadata2 }\n };\n const document = {\n name: root.format,\n props,\n children\n };\n return {\n document,\n fillMap: fillMap(document, blocks, root),\n variant: variantId\n };\n}\nfunction definitionsFor(children, available, blueprint) {\n const refs = /* @__PURE__ */ new Set();\n const visit = (node) => {\n if (Array.isArray(node)) return node.forEach(visit);\n if (!node || typeof node !== \"object\") return;\n const record = node;\n const props = record.props;\n if (record.name === \"block\" && typeof props?.ref === \"string\")\n refs.add(props.ref);\n Object.values(record).forEach(visit);\n };\n visit(children);\n const result = {};\n for (const ref of refs) {\n if (!available[ref])\n throw new Error(\n `Blueprint ${blueprint.id} invokes \"${ref}\", which ${blueprint.definitions} does not define.`\n );\n for (const name of [...blockDependencies(available, ref), ref])\n result[name] ??= structuredClone(available[name]);\n }\n return result;\n}\nfunction fillMap(document, blocks, root) {\n const metadataPrefix = `${root.metadataPointer}/`;\n return root.markers(document).map((occurrence) => {\n const guidance = occurrence.text.match(MARKER)?.[1] ?? occurrence.text;\n const base = { path: occurrence.path, marker: occurrence.text, guidance };\n if (occurrence.path.startsWith(metadataPrefix) && !occurrence.path.slice(metadataPrefix.length).includes(\"/\"))\n return { ...base, kind: \"metadata\" };\n const slot = slotAt(document, occurrence.path, blocks);\n return slot ? { ...base, kind: \"slot\", ...slot } : { ...base, kind: \"text\" };\n });\n}\nfunction slotAt(document, pointer2, blocks) {\n const at = pointer2.lastIndexOf(\"/props/slots/\");\n if (at < 0) return void 0;\n const invocation = valueAt(document, pointer2.slice(0, at));\n const ref = invocation?.props?.ref;\n if (typeof ref !== \"string\" || !blocks[ref]) return void 0;\n const segments = pointer2.slice(at + \"/props/slots/\".length).split(\"/\").map(unescape);\n let slot = blocks[ref].slots[segments[0]];\n const names = [segments[0]];\n for (const segment of segments.slice(1)) {\n if (!slot) break;\n if (slot.type === \"array\" && /^\\d+$/.test(segment)) slot = slot.items;\n else if (slot.type === \"object\") {\n slot = slot.properties?.[segment];\n names.push(segment);\n } else if (slot.type === \"component\")\n break;\n else slot = void 0;\n }\n if (!slot) return void 0;\n return {\n block: ref,\n slot: names.join(\".\"),\n type: slot.type,\n ...slot.maxWords !== void 0 && { maxWords: slot.maxWords },\n ...slot.maxLength !== void 0 && { maxLength: slot.maxLength },\n ...slot.oneLine !== void 0 && { oneLine: slot.oneLine },\n ...slot.required !== void 0 && { required: slot.required }\n };\n}\nfunction unescape(segment) {\n return segment.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}\nfunction valueAt(root, pointer2) {\n if (pointer2 === \"\") return root;\n let current = root;\n for (const segment of pointer2.split(\"/\").slice(1).map(unescape)) {\n if (Array.isArray(current)) current = current[Number(segment)];\n else if (current && typeof current === \"object\")\n current = current[segment];\n else return void 0;\n }\n return current;\n}\n\n// src/blueprints/rubric.ts\nvar RUBRIC = [\n {\n level: 1,\n name: \"Integrity\",\n bar: \"Nothing is clipped, overflowing, overlapping, empty or left as placeholder text. Every page renders what the author meant to put there.\"\n },\n {\n level: 2,\n name: \"Legibility and accessibility\",\n bar: \"Type is large enough to read at the medium it is for, contrast holds, and the reading order is obvious.\"\n },\n {\n level: 3,\n name: \"Visual coherence\",\n bar: \"Hierarchy, grid, rhythm, typography and colour agree across every page. Repeated elements repeat. Nothing looks hand-placed.\"\n },\n {\n level: 4,\n name: \"Communicative effectiveness\",\n bar: \"Density, structure, charts and tables fit the purpose. Titles say what the page concludes. Every chart has a takeaway and a source; every number has a unit.\"\n },\n {\n level: 5,\n name: \"Craft and distinctiveness\",\n bar: \"The composition is refined and intentional, and does not read as a template with the blanks filled in.\"\n }\n];\nvar SHIPPING_QUESTION = \"Would you send this to a client, unchanged, with your name on it?\";\nvar GENERICNESS_PENALTY = \"Separately, rate how generic this looks: whether it reads as a document made for this brief, or as a template that would look identical for any other. A document can be clean, coherent and still generic.\";\n\n// src/utils/deepMerge.ts\nfunction isObject(item) {\n return item !== null && typeof item === \"object\" && !Array.isArray(item);\n}\nfunction deepMerge(target, source) {\n const output = { ...target };\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (isObject(source[key])) {\n if (!(key in target) || !isObject(target[key])) {\n output[key] = source[key];\n } else {\n output[key] = deepMerge(target[key], source[key]);\n }\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}\nfunction mergeWithDefaults(userConfig, themeDefaults) {\n return deepMerge(themeDefaults, userConfig);\n}\n\n// src/utils/serviceUrl.ts\nfunction isPrivateServiceUrl(url) {\n let hostname;\n try {\n hostname = new URL(\n /^https?:\\/\\//i.test(url.trim()) ? url.trim() : `http://${url.trim()}`\n ).hostname.toLowerCase();\n } catch {\n return false;\n }\n const host = hostname.replace(/^\\[|\\]$/g, \"\").replace(/\\.$/, \"\");\n if (host === \"localhost\" || host.endsWith(\".localhost\")) return true;\n if (host === \"::1\" || /^f[cd][0-9a-f]{2}:/.test(host)) return true;\n if (/^fe[89ab][0-9a-f]:/.test(host)) return true;\n const v4 = /^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/.exec(host);\n if (v4) {\n const [a, b] = [Number(v4[1]), Number(v4[2])];\n return a === 127 || a === 10 || a === 172 && b >= 16 && b <= 31 || a === 192 && b === 168 || a === 169 && b === 254;\n }\n return /\\.(local|internal|home\\.arpa)$/.test(host);\n}\nvar REMOTE_EXPORT_WARNING = \"W_HIGHCHARTS_REMOTE_EXPORT\";\nfunction remoteExportNotice(serverUrl, allowRemote) {\n if (isPrivateServiceUrl(serverUrl)) return void 0;\n if (!allowRemote) {\n throw new Error(\n `Highcharts export server ${serverUrl} 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.`\n );\n }\n return `Chart data \\u2014 every series, label and title \\u2014 was sent to ${serverUrl}, outside this machine and its private networks (services.highcharts.allowRemote).`;\n}\n\n// src/utils/serviceClient.ts\nvar DEFAULT_TIMEOUT_MS = 3e4;\nvar DEFAULT_RETRIES = 2;\nvar DEFAULT_RETRY_BASE_DELAY_MS = 250;\nvar MAX_RETRY_DELAY_MS = 2e3;\nfunction resolveServiceUrl(propsUrl, servicesUrl, defaultUrl) {\n const raw = (propsUrl || servicesUrl || defaultUrl).trim();\n const withScheme = /^https?:\\/\\//i.test(raw) ? raw : `http://${raw}`;\n return withScheme.replace(/\\/+$/, \"\");\n}\nvar SERVICE_UNAVAILABLE_CODE = \"SERVICE_UNAVAILABLE\";\nfunction serviceUnavailable(message) {\n return Object.assign(new Error(message), { code: SERVICE_UNAVAILABLE_CODE });\n}\nfunction isRetryable(error) {\n const { code, status } = error;\n if (code === SERVICE_UNAVAILABLE_CODE) return true;\n return status === 429 || status !== void 0 && status >= 500;\n}\nfunction withAttemptCount(error, attempts) {\n const next = new Error(`${error.message} (after ${attempts} attempts)`);\n const { code, status } = error;\n if (code !== void 0) Object.assign(next, { code });\n if (status !== void 0) Object.assign(next, { status });\n return next;\n}\nfunction backoffMs(attempt, baseDelayMs) {\n const ceiling = Math.min(\n baseDelayMs * 2 ** (attempt - 1),\n MAX_RETRY_DELAY_MS\n );\n return Math.round(ceiling * (0.5 + Math.random() * 0.5));\n}\nfunction transportFailure(error, opts, timeoutMs) {\n if (error?.name === \"AbortError\") {\n return serviceUnavailable(\n `${opts.serviceLabel} timed out after ${timeoutMs}ms at ${opts.url}.`\n );\n }\n const cause = error instanceof Error ? error.message : String(error);\n return serviceUnavailable(opts.onUnreachable(opts.url, cause));\n}\nasync function exchange(opts, headers, signal, timeoutMs) {\n let response;\n try {\n response = await fetch(`${opts.url}${opts.path}`, {\n method: \"POST\",\n headers,\n body: JSON.stringify(opts.body),\n signal\n });\n } catch (error) {\n throw transportFailure(error, opts, timeoutMs);\n }\n if (!response.ok) {\n await response.body?.cancel().catch(() => void 0);\n throw Object.assign(\n new Error(\n `${opts.serviceLabel} returned ${response.status}: ${response.statusText}`\n ),\n { status: response.status }\n );\n }\n try {\n return await opts.decode(response);\n } catch (error) {\n throw transportFailure(error, opts, timeoutMs);\n }\n}\nasync function attemptPost(opts, headers, timeoutMs) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n try {\n return await exchange(opts, headers, controller.signal, timeoutMs);\n } finally {\n clearTimeout(timer);\n }\n}\nasync function postJsonToService(opts) {\n const resolvedHeaders = typeof opts.headers === \"function\" ? await opts.headers(opts.body) : opts.headers;\n const headers = {\n \"Content-Type\": \"application/json\",\n ...resolvedHeaders\n };\n const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const baseDelayMs = opts.retryBaseDelayMs ?? DEFAULT_RETRY_BASE_DELAY_MS;\n const attempts = 1 + Math.max(0, opts.retries ?? DEFAULT_RETRIES);\n for (let attempt = 1; ; attempt++) {\n try {\n return await attemptPost(opts, headers, timeoutMs);\n } catch (error) {\n const failure = error;\n if (attempt >= attempts || !isRetryable(failure)) {\n throw attempt === 1 ? failure : withAttemptCount(failure, attempt);\n }\n opts.onRetry?.(attempt, failure);\n await new Promise(\n (resolve) => setTimeout(resolve, backoffMs(attempt, baseDelayMs))\n );\n }\n }\n}\n\n// src/utils/promiseLimiter.ts\nfunction createLimiter(max) {\n let active = 0;\n const queue = [];\n const release = () => {\n active--;\n queue.shift()?.();\n };\n return async function limit(fn) {\n while (active >= max)\n await new Promise((resolve) => queue.push(resolve));\n active++;\n try {\n return await fn();\n } finally {\n release();\n }\n };\n}\n\n// src/utils/chartRequests.ts\nvar DEFAULT_CHART_CONCURRENCY = 4;\nvar stats = {\n collected: 0,\n unique: 0,\n retries: 0,\n maxInFlight: 0\n};\nvar inFlight = 0;\nfunction getChartRequestStats() {\n return { ...stats };\n}\nfunction resetChartRequestStats() {\n stats.collected = 0;\n stats.unique = 0;\n stats.retries = 0;\n stats.maxInFlight = 0;\n}\nfunction recordChartCollected() {\n stats.collected++;\n}\nfunction recordChartRetry() {\n stats.retries++;\n}\nvar gates = /* @__PURE__ */ new Map();\nfunction gateFor(serverUrl, concurrency) {\n const existing = gates.get(serverUrl);\n if (existing) return existing;\n const max = Math.max(\n 1,\n Math.floor(\n Number.isFinite(concurrency) ? concurrency : DEFAULT_CHART_CONCURRENCY\n )\n );\n const gate = createLimiter(max);\n gates.set(serverUrl, gate);\n return gate;\n}\nfunction limitChartRequest(serverUrl, concurrency, fn) {\n return gateFor(serverUrl, concurrency)(fn);\n}\nfunction chartRequestKey(serverUrl, requestBody) {\n return `${serverUrl}\n${JSON.stringify(requestBody)}`;\n}\nfunction dedupeChartRequest(cache, key, send) {\n if (!cache) return send();\n const pending = cache.get(key);\n if (pending) return pending;\n const started = send();\n cache.set(key, started);\n return started;\n}\nfunction sendChartRequest(request) {\n return dedupeChartRequest(\n request.cache,\n chartRequestKey(request.serverUrl, request.requestBody),\n () => limitChartRequest(\n request.serverUrl,\n request.concurrency,\n () => counted(request.send)\n )\n );\n}\nasync function counted(send) {\n stats.unique++;\n inFlight++;\n stats.maxInFlight = Math.max(stats.maxInFlight, inFlight);\n try {\n return await send();\n } finally {\n inFlight--;\n }\n}\nfunction resetChartLimiters() {\n gates.clear();\n}\nexport {\n BLOCK_SLOT_PLACEMENT_PROPS,\n BLOCK_SLOT_ROLES,\n BLUEPRINT_FORMATS,\n BlockDefinitionsSchema,\n BlockEvaluationError,\n BlockInvocationPropsSchema,\n BlockSlotSchema,\n BlueprintPagesSchema,\n BlueprintSchema,\n BlueprintVariantSchema,\n CANVASES,\n ChromeSchema,\n ComponentValidationError,\n DEFAULT_CHART_CONCURRENCY,\n DEFAULT_CHART_THEME_COLORS,\n DEFAULT_ERROR_CONFIG,\n DEFAULT_VISUAL_DPI,\n DesignSpacingSchema,\n DesignSystemProperties,\n DesignSystemSchema,\n DuplicateComponentError,\n ERROR_EMOJIS,\n FONT_URL_ALLOWLIST,\n FeatureRequirementCollector,\n FontFamilyNameSchema,\n FontRegistry,\n FontRegistryEntrySchema,\n FontRegistrySchema,\n FontSourceSchema,\n GENERICNESS_PENALTY,\n JsonBlockDefinitionSchema,\n JsonBlockEvaluator,\n MAX_RASTERIZE_BATCH_SLIDES,\n MAX_RASTERIZE_FONTS,\n MAX_RASTERIZE_FONT_BYTES,\n MAX_VISUAL_DPI,\n MIN_VISUAL_DPI,\n MotifSchema,\n POINTS_PER_PIXEL_96DPI,\n POPULAR_GOOGLE_FONTS,\n PaletteSchema,\n REMOTE_EXPORT_WARNING,\n RENDERER_DEPENDENCY_MISSING,\n ROLE_SCALE_STEPS,\n RUBRIC,\n RendererRegistry,\n SAFE_FONTS,\n SERVICE_UNAVAILABLE_CODE,\n SHIPPING_QUESTION,\n TYPE_ROLES,\n TextCaseSchema,\n TypeRoleNameSchema,\n TypeRoleSchema,\n TypeRolesSchema,\n TypographySchema,\n UPSTREAM_OVERRIDES,\n UnknownPreservedComponentError,\n UnsupportedRendererFeatureError,\n WEIGHT_LABELS,\n applyDocumentBlocksToSchema,\n applyExportMode,\n applyFontSubstitution,\n assertNever,\n assertRendererSupports,\n blockDependencies,\n blockInvocationExample,\n blockInvocationPropsSchema,\n blockPointerKey,\n blockReferencesFromDocument,\n blockSlotBudgets,\n blockSlotEditorSchema,\n blockSlotFacts,\n blockSlotJsonSchema,\n blockSlotMarkdown,\n blockSlotRoles,\n blockSlotsEditorSchema,\n blockSlotsJsonSchema,\n blockValueAt,\n blockWordCount,\n buildDefaultSubstitutionMap,\n calculatePosition,\n capsFormatting,\n chartFamilyResolver,\n chartFontFaceCss,\n chartPointsPerPixel,\n clampVisualDpi,\n clearComponentNamesCache,\n collectFontNamesFromDocx,\n collectFontNamesFromPptx,\n compareSemver,\n composeBlocksWithPlugins,\n convertToJsonSchema,\n createBlockAuthoringSchema,\n createComponent,\n createComponentSchema,\n createComponentSchemaObject,\n createErrorConfig,\n createJsonParseError,\n createLimiter,\n createVersion,\n cssFontFamily,\n defaultSubstituteFor,\n definitionsFor,\n designCanvas,\n designColors,\n detectFontFormat,\n diagnoseUnsupportedFeatures,\n documentBlockMetadata,\n documentFontRegistry,\n exportSchemaToFile,\n extractStandardComponentNames,\n fetchGoogleFontSources,\n fixSchemaReferences,\n formatErrorMessage,\n formatErrorSummary,\n getChartRequestStats,\n getLiteralValue,\n getObjectSchemaPropertyNames,\n getSchemaMetadata,\n getUpstreamOverride,\n getValidationSummary,\n groupErrorsByPath,\n instantiateBlueprint,\n isAllowedFontUrl,\n isBlockRecord,\n isBlueprint,\n isLiteralSchema,\n isObjectSchema,\n isPrivateServiceUrl,\n isSafeFont,\n isUnionSchema,\n isValidSemver,\n isValidationSuccess,\n latestVersion,\n mergeFontRegistries,\n mergeWithDefaults,\n parseSemver,\n partitionDiagnostics,\n postJsonToService,\n readBlockDefinitions,\n recordChartCollected,\n recordChartRetry,\n registerBlueprints,\n remoteExportNotice,\n rendererError,\n rendererWarning,\n resetChartLimiters,\n resetChartRequestStats,\n resolveBlockSlot,\n resolveComponentVersion,\n resolveDesignColor,\n resolveMotif,\n resolveServiceUrl,\n resolveTypeRoles,\n restructureNameDiscriminatedUnions,\n rewriteFontFamilyName,\n selectVariant,\n sendChartRequest,\n slotAt,\n synthesizeFamilyName,\n themeFontRegistry,\n toAuthoredBlockPointer,\n transformValueError,\n transformValueErrors,\n typeScaleSizes,\n unionBranches,\n validateBlockDefinitions,\n validateBlockInvocations,\n validateBlueprint,\n validateCustomComponentProps,\n validateDesignColors,\n validateFontReferences,\n valueAt,\n withChartFontFaceCss,\n withChartTypography\n};\n//# sourceMappingURL=index.js.map","import {\n PptxComponentDefaultsSchema\n} from \"./chunk-Z6NUHS34.js\";\n\n// src/schemas/theme.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { Value } from \"@sinclair/typebox/value\";\nimport {\n FontFamilyNameSchema,\n FontRegistrySchema,\n DesignSystemProperties,\n TextCaseSchema\n} from \"@json-to-office/shared\";\nimport {\n ColorValueSchema,\n STYLE_NAMES\n} from \"@json-to-office/shared/schemas/slide-content\";\nimport {\n ColorValueSchema as ColorValueSchema2,\n SEMANTIC_COLOR_NAMES,\n SEMANTIC_COLOR_ALIASES,\n STYLE_NAMES as STYLE_NAMES2,\n StyleNameSchema\n} from \"@json-to-office/shared/schemas/slide-content\";\nvar BUILT_IN_PPTX_THEME_NAMES = [\n \"consulting\",\n \"dark\",\n \"default\",\n \"devportal\",\n \"minimal\",\n \"vermilion\"\n];\nvar GridMarginSchema = Type.Union(\n [\n Type.Number({ description: \"Margin in inches (all sides)\" }),\n Type.Object(\n {\n top: Type.Number({ description: \"Top margin in inches\" }),\n right: Type.Number({ description: \"Right margin in inches\" }),\n bottom: Type.Number({ description: \"Bottom margin in inches\" }),\n left: Type.Number({ description: \"Left margin in inches\" })\n },\n { additionalProperties: false }\n )\n ],\n { description: \"Slide margins in inches\" }\n);\nvar GridGutterSchema = Type.Union(\n [\n Type.Number({ description: \"Gutter in inches (both axes)\" }),\n Type.Object(\n {\n column: Type.Number({ description: \"Column gutter in inches\" }),\n row: Type.Number({ description: \"Row gutter in inches\" })\n },\n { additionalProperties: false }\n )\n ],\n { description: \"Gaps between grid tracks in inches\" }\n);\nvar GridConfigSchema = Type.Object(\n {\n columns: Type.Optional(\n Type.Number({\n minimum: 1,\n description: \"Number of columns (default: 12)\"\n })\n ),\n rows: Type.Optional(\n Type.Number({ minimum: 1, description: \"Number of rows (default: 6)\" })\n ),\n margin: Type.Optional(GridMarginSchema),\n gutter: Type.Optional(GridGutterSchema)\n },\n { additionalProperties: false, description: \"Grid layout configuration\" }\n);\nvar HexColorSchema = Type.String({\n pattern: \"^#?[0-9A-Fa-f]{6}$\",\n description: \"Hex color (e.g. #FF0000)\"\n});\nvar TextStyleSchema = Type.Object(\n {\n fontSize: Type.Optional(Type.Number()),\n fontFace: Type.Optional(FontFamilyNameSchema),\n fontColor: Type.Optional(ColorValueSchema),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(Type.Integer({ minimum: 100, maximum: 900 })),\n italic: Type.Optional(Type.Boolean()),\n align: Type.Optional(\n Type.Union([\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"justify\")\n ])\n ),\n lineSpacing: Type.Optional(Type.Number()),\n charSpacing: Type.Optional(Type.Number()),\n paraSpaceAfter: Type.Optional(Type.Number()),\n paraSpaceBefore: Type.Optional(Type.Number()),\n case: Type.Optional(TextCaseSchema)\n },\n { additionalProperties: false, description: \"Text style preset\" }\n);\nvar ThemeConfigSchema = Type.Object(\n {\n ...DesignSystemProperties,\n displayName: Type.Optional(Type.String()),\n description: Type.Optional(\n Type.String({\n description: \"The visual voice: what the theme looks like, in one sentence.\"\n })\n ),\n whenToUse: Type.Optional(\n Type.String({\n description: \"The decks the theme suits; discovery and the design guide quote it.\"\n })\n ),\n version: Type.Optional(Type.String()),\n name: Type.String({ description: \"Theme name\" }),\n colors: Type.Object(\n {\n primary: HexColorSchema,\n secondary: HexColorSchema,\n accent: HexColorSchema,\n background: HexColorSchema,\n text: HexColorSchema,\n text2: Type.Optional(HexColorSchema),\n background2: Type.Optional(HexColorSchema),\n accent4: Type.Optional(HexColorSchema),\n accent5: Type.Optional(HexColorSchema),\n accent6: Type.Optional(HexColorSchema)\n },\n {\n additionalProperties: false,\n description: \"Theme color palette (10-slot scheme)\"\n }\n ),\n fonts: Type.Object(\n {\n heading: FontFamilyNameSchema,\n body: FontFamilyNameSchema,\n mono: Type.Optional(FontFamilyNameSchema),\n light: Type.Optional(FontFamilyNameSchema)\n },\n { additionalProperties: false, description: \"Font families\" }\n ),\n fontRegistry: Type.Optional(FontRegistrySchema),\n defaults: Type.Object(\n {\n fontSize: Type.Number({ description: \"Default font size in points\" }),\n fontColor: HexColorSchema\n },\n { additionalProperties: false, description: \"Default text styling\" }\n ),\n styles: Type.Optional(\n Type.Partial(\n Type.Object(\n Object.fromEntries(\n STYLE_NAMES.map((n) => [n, TextStyleSchema])\n )\n ),\n { additionalProperties: false, description: \"Named text style presets\" }\n )\n ),\n componentDefaults: Type.Optional(PptxComponentDefaultsSchema)\n },\n {\n additionalProperties: false,\n description: \"Presentation theme configuration\"\n }\n);\nfunction isValidThemeConfig(data) {\n return Value.Check(ThemeConfigSchema, data);\n}\n\nexport {\n BUILT_IN_PPTX_THEME_NAMES,\n GridMarginSchema,\n GridGutterSchema,\n GridConfigSchema,\n TextStyleSchema,\n ThemeConfigSchema,\n isValidThemeConfig,\n ColorValueSchema2 as ColorValueSchema,\n SEMANTIC_COLOR_NAMES,\n SEMANTIC_COLOR_ALIASES,\n STYLE_NAMES2 as STYLE_NAMES,\n StyleNameSchema\n};\n//# sourceMappingURL=chunk-UUQ2XPUB.js.map","// src/schemas/renderer.ts\nvar PPTX_RENDERER_IDS = [\"pptxgenjs\", \"office-open\"];\nvar DEFAULT_PPTX_RENDERER_ID = \"pptxgenjs\";\nfunction pptxComponentDefinitionName(renderer) {\n return `PptxComponentDefinition_${renderer}`;\n}\nfunction pptxPropsSchemaForRenderer(componentName, schema, renderer) {\n const copy = cloneSchema(schema);\n const properties = objectProperties(copy);\n if (renderer === \"pptxgenjs\") {\n if (componentName === \"slide\") delete properties?.transition;\n return copy;\n }\n switch (componentName) {\n case \"image\":\n for (const key of [\"svg\", \"sizing\", \"rotate\", \"rounding\", \"hyperlink\"]) {\n delete properties?.[key];\n }\n break;\n case \"shape\":\n delete properties?.flipV;\n break;\n case \"table\":\n for (const key of [\n \"autoPage\",\n \"autoPageRepeatHeader\",\n \"margin\",\n \"borderRadius\"\n ]) {\n delete properties?.[key];\n }\n pruneOfficeOpenTableCells(copy);\n break;\n }\n syncRequired(copy);\n return copy;\n}\nfunction collectPptxRendererErrors(data) {\n if (!data || typeof data !== \"object\" || Array.isArray(data)) return [];\n const root = data;\n const renderer = root.renderer ?? DEFAULT_PPTX_RENDERER_ID;\n if (!PPTX_RENDERER_IDS.includes(renderer)) {\n return [\n {\n path: \"/renderer\",\n message: `Invalid renderer \"${String(renderer)}\". Expected \"pptxgenjs\" or \"office-open\".`,\n code: \"invalid_value\"\n }\n ];\n }\n const errors = [];\n const unsupported = (path, feature) => {\n errors.push({\n path,\n message: `The \"${renderer}\" renderer does not support ${feature}.`,\n code: \"unsupported_renderer_feature\"\n });\n };\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n const props = node.props;\n if (renderer === \"pptxgenjs\") {\n if (node.name === \"slide\" && props?.transition !== void 0) {\n unsupported(`${path}/props/transition`, \"slide transitions\");\n }\n } else {\n if (node.name === \"chart\" && props?.type === \"bubble\") {\n unsupported(`${path}/props/type`, \"bubble charts\");\n }\n if (node.name === \"image\") {\n const fields = {\n svg: \"SVG images\",\n sizing: \"image cropping\",\n rotate: \"image transforms\",\n rounding: \"image rounding\",\n hyperlink: \"element hyperlinks\"\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== void 0) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n }\n if (node.name === \"shape\" && props?.flipV !== void 0) {\n unsupported(`${path}/props/flipV`, \"vertical flipping\");\n }\n if (node.name === \"table\") {\n const fields = {\n autoPage: \"table auto-pagination\",\n autoPageRepeatHeader: \"table auto-pagination\",\n margin: \"table insets\",\n borderRadius: \"rounded table corners\"\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== void 0) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n if (Array.isArray(props?.rows)) {\n props.rows.forEach((row, rowIndex) => {\n if (!Array.isArray(row)) return;\n row.forEach((cell, cellIndex) => {\n if (!cell || typeof cell !== \"object\") return;\n for (const [field, feature] of [\n [\"colspan\", \"merged table cells\"],\n [\"rowspan\", \"merged table cells\"],\n [\"margin\", \"table insets\"]\n ]) {\n if (cell[field] !== void 0) {\n unsupported(\n `${path}/props/rows/${rowIndex}/${cellIndex}/${field}`,\n feature\n );\n }\n }\n });\n });\n }\n }\n }\n for (const [key, value] of Object.entries(node)) {\n if (key !== \"renderer\") visit(value, `${path}/${key}`);\n }\n };\n visit(root, \"\");\n return errors;\n}\nfunction pruneOfficeOpenTableCells(schema) {\n const rows = objectProperties(schema)?.rows;\n const cellUnion = rows?.items?.items;\n const branches = cellUnion?.anyOf;\n if (!Array.isArray(branches)) return;\n for (const branch of branches) {\n const properties = objectProperties(branch);\n if (!properties?.text) continue;\n delete properties.colspan;\n delete properties.rowspan;\n delete properties.margin;\n syncRequired(branch);\n }\n}\nfunction objectProperties(schema) {\n if (!schema || typeof schema !== \"object\") return void 0;\n return schema.properties;\n}\nfunction syncRequired(schema) {\n const properties = objectProperties(schema);\n const required = schema.required;\n if (!properties || !required) return;\n const next = required.filter((key) => key in properties);\n if (next.length > 0) schema.required = next;\n else delete schema.required;\n}\nfunction cloneSchema(value) {\n if (Array.isArray(value)) return value.map(cloneSchema);\n if (!value || typeof value !== \"object\") return value;\n const copy = Object.create(Object.getPrototypeOf(value));\n for (const key of Reflect.ownKeys(value)) {\n copy[key] = cloneSchema(value[key]);\n }\n return copy;\n}\n\nexport {\n PPTX_RENDERER_IDS,\n DEFAULT_PPTX_RENDERER_ID,\n pptxComponentDefinitionName,\n pptxPropsSchemaForRenderer,\n collectPptxRendererErrors\n};\n//# sourceMappingURL=chunk-Y2ODB5VW.js.map","import {\n BUILT_IN_PPTX_THEME_NAMES,\n GridConfigSchema,\n ThemeConfigSchema\n} from \"./chunk-UUQ2XPUB.js\";\nimport {\n PptxComponentDefaultsSchema\n} from \"./chunk-Z6NUHS34.js\";\nimport {\n PPTX_RENDERER_IDS,\n pptxPropsSchemaForRenderer\n} from \"./chunk-Y2ODB5VW.js\";\n\n// src/schemas/component-registry.ts\nimport { Type as Type5 } from \"@sinclair/typebox\";\nimport {\n PPTX_SLIDE_CONTENT_COMPONENTS,\n pptxComponentRequiresProps\n} from \"@json-to-office/shared/schemas/slide-content\";\nimport { BlockInvocationPropsSchema } from \"@json-to-office/shared\";\n\n// src/schemas/components/group.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { GridPositionSchema } from \"@json-to-office/shared/schemas/slide-content\";\nvar Coord = (inches, percent) => Type.Union([\n Type.Number({ description: inches }),\n Type.String({ pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\", description: percent })\n]);\nvar PptxGroupPropsSchema = Type.Object(\n {\n x: Type.Optional(\n Coord(\n \"Frame left edge in inches, relative to the enclosing frame or slide\",\n \"Frame left edge as a percentage of the enclosing width\"\n )\n ),\n y: Type.Optional(\n Coord(\n \"Frame top edge in inches, relative to the enclosing frame or slide\",\n \"Frame top edge as a percentage of the enclosing height\"\n )\n ),\n w: Type.Optional(\n Coord(\n \"Frame width in inches\",\n \"Frame width as a percentage of the enclosing width\"\n )\n ),\n h: Type.Optional(\n Coord(\n \"Frame height in inches\",\n \"Frame height as a percentage of the enclosing height\"\n )\n ),\n grid: Type.Optional(GridPositionSchema),\n gridConfig: Type.Optional(\n Type.Object(\n { ...GridConfigSchema.properties },\n {\n additionalProperties: false,\n 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.\"\n }\n )\n ),\n direction: Type.Optional(\n Type.Union([Type.Literal(\"row\"), Type.Literal(\"column\")], {\n 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.\"\n })\n ),\n gap: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Space between distributed cells, in inches. Default 0.\"\n })\n ),\n weights: Type.Optional(\n Type.Array(Type.Number({ exclusiveMinimum: 0 }), {\n minItems: 1,\n description: \"Relative cell sizes in child order (e.g. [1.1, 1] for a 1.1 : 1 split). Missing entries count as 1.\"\n })\n )\n },\n {\n additionalProperties: false,\n 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.\"\n }\n);\n\n// src/schemas/components/presentation.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nimport {\n BlockDefinitionsSchema,\n FontRegistrySchema\n} from \"@json-to-office/shared\";\nvar PresentationPropsSchema = Type2.Object(\n {\n title: Type2.Optional(\n Type2.String({ description: \"Presentation title metadata\" })\n ),\n author: Type2.Optional(\n Type2.String({ description: \"Presentation author metadata\" })\n ),\n subject: Type2.Optional(\n Type2.String({ description: \"Presentation subject metadata\" })\n ),\n company: Type2.Optional(\n Type2.String({ description: \"Company name metadata\" })\n ),\n theme: Type2.Optional(\n Type2.Union(\n [\n Type2.String({\n description: `Theme name to apply (default: \"default\"). Built-ins: ${BUILT_IN_PPTX_THEME_NAMES.join(\", \")} (consulting is the house style).`,\n examples: [...BUILT_IN_PPTX_THEME_NAMES],\n default: \"default\"\n }),\n ThemeConfigSchema\n ],\n {\n description: 'Theme to apply: a built-in/custom theme name (default: \"default\"), or an inline theme config object so the document stays self-contained'\n }\n )\n ),\n fontRegistry: Type2.Optional(FontRegistrySchema),\n slideWidth: Type2.Optional(\n Type2.Number({\n description: \"Slide width in inches (default: 10)\",\n default: 10\n })\n ),\n slideHeight: Type2.Optional(\n Type2.Number({\n description: \"Slide height in inches (default: 7.5)\",\n default: 7.5\n })\n ),\n rtlMode: Type2.Optional(\n Type2.Boolean({ description: \"Right-to-left text direction\" })\n ),\n language: Type2.Optional(\n Type2.String({\n pattern: \"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$\",\n 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.',\n examples: [\"en-US\", \"fr-FR\", \"de-DE\", \"it-IT\", \"es-ES\"]\n })\n ),\n pageNumberFormat: Type2.Optional(\n Type2.Union([Type2.Literal(\"9\"), Type2.Literal(\"09\")], {\n description: 'Format for {PAGE_NUMBER} placeholders: \"9\" = bare number (default), \"09\" = zero-padded',\n default: \"9\"\n })\n ),\n componentDefaults: Type2.Optional(PptxComponentDefaultsSchema),\n grid: Type2.Optional(GridConfigSchema),\n blocks: Type2.Optional(BlockDefinitionsSchema),\n qualityProfile: Type2.Optional(\n Type2.String({\n 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.\",\n examples: [\n \"consulting-deck\",\n \"executive-presentation\",\n \"technical-presentation\"\n ]\n })\n )\n },\n {\n description: \"Presentation container props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/slide.ts\nimport { Type as Type4 } from \"@sinclair/typebox\";\n\n// src/schemas/components/common.ts\nimport { Type as Type3 } from \"@sinclair/typebox\";\nimport {\n ColorValueSchema,\n GradientFillSchema\n} from \"@json-to-office/shared/schemas/slide-content\";\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema as GridPositionSchema2\n} from \"@json-to-office/shared/schemas/slide-content\";\nvar PositionSchema = Type3.Object(\n {\n x: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"X position in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'X position as percentage (e.g., \"10%\")'\n })\n ])\n ),\n y: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Y position in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Y position as percentage (e.g., \"10%\")'\n })\n ])\n ),\n w: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Width in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Width as percentage (e.g., \"80%\")'\n })\n ])\n ),\n h: Type3.Optional(\n Type3.Union([\n Type3.Number({ description: \"Height in inches\" }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Height as percentage (e.g., \"20%\")'\n })\n ])\n )\n },\n {\n description: \"Position and size in inches or percentages\",\n additionalProperties: false\n }\n);\nvar SlideBackgroundSchema = Type3.Object(\n {\n color: Type3.Optional(ColorValueSchema),\n gradient: Type3.Optional(GradientFillSchema),\n image: Type3.Optional(\n Type3.Object(\n {\n path: Type3.Optional(\n Type3.String({ description: \"Image file path or URL\" })\n ),\n base64: Type3.Optional(\n Type3.String({ description: \"Base64-encoded image data\" })\n )\n },\n { description: \"Background image\", additionalProperties: false }\n )\n )\n },\n {\n description: \"Slide background configuration\",\n additionalProperties: false\n }\n);\nvar TransitionSchema = Type3.Object(\n {\n type: Type3.Optional(\n Type3.Union(\n [\n Type3.Literal(\"fade\"),\n Type3.Literal(\"push\"),\n Type3.Literal(\"wipe\"),\n Type3.Literal(\"zoom\"),\n Type3.Literal(\"none\")\n ],\n { description: \"Transition effect type\" }\n )\n ),\n speed: Type3.Optional(\n Type3.Union(\n [Type3.Literal(\"slow\"), Type3.Literal(\"medium\"), Type3.Literal(\"fast\")],\n { description: \"Transition speed\" }\n )\n )\n },\n {\n description: \"Slide transition configuration\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/slide.ts\nvar SlidePropsSchema = Type4.Object(\n {\n meta: Type4.Optional(\n Type4.Object(\n {\n title: Type4.Optional(\n Type4.String({\n description: \"Authoring label for this slide, shown in editors and outlines. Never rendered \\u2014 slide content is unaffected.\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"Authoring metadata; has no effect on the presentation.\"\n }\n )\n ),\n background: Type4.Optional(SlideBackgroundSchema),\n transition: Type4.Optional(TransitionSchema),\n notes: Type4.Optional(\n Type4.String({ description: \"Speaker notes for this slide\" })\n ),\n hidden: Type4.Optional(\n Type4.Boolean({ description: \"Hide this slide from presentation\" })\n )\n },\n {\n description: \"Slide container props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/component-registry.ts\nvar SLIDE_CHILDREN = [\n ...PPTX_SLIDE_CONTENT_COMPONENTS.map(({ name }) => name),\n \"block\",\n \"group\"\n];\nvar PPTX_STANDARD_COMPONENTS_REGISTRY = [\n // ========================================================================\n // Container Components (can contain children)\n // ========================================================================\n {\n name: \"pptx\",\n propsSchema: PresentationPropsSchema,\n hasChildren: true,\n allowedChildren: [\"slide\"],\n category: \"container\",\n // Every presentation prop is optional, but the root is where a deck\n // states its title, size and theme, and both the published schema and\n // the deep validator have always demanded the key. Keeping it required\n // is a decision, not the schema's own answer, so it is declared.\n propsRequired: true,\n 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.\",\n special: {\n hasSchemaField: true\n }\n },\n {\n name: \"slide\",\n propsSchema: SlidePropsSchema,\n hasChildren: true,\n allowedChildren: SLIDE_CHILDREN,\n category: \"container\",\n // No `propsRequired`: every slide prop is optional and nothing outside\n // the schema asks for one, so `{ \"name\": \"slide\", \"children\": [...] }`\n // is a whole slide and the published schema says so.\n 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.\"\n },\n {\n name: \"group\",\n propsSchema: PptxGroupPropsSchema,\n hasChildren: true,\n allowedChildren: SLIDE_CHILDREN,\n category: \"layout\",\n 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.\"\n },\n {\n name: \"block\",\n propsSchema: BlockInvocationPropsSchema,\n hasChildren: false,\n category: \"layout\",\n 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.\"\n },\n // Content components are canonical in @json-to-office/shared so DOCX\n // visuals can reuse the exact schemas without depending on shared-pptx.\n ...PPTX_SLIDE_CONTENT_COMPONENTS\n];\nfunction getPptxStandardComponent(name) {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.find((c) => c.name === name);\n}\nfunction getAllPptxComponentNames() {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map((c) => c.name);\n}\nfunction getPptxComponentsByCategory(category) {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.category === category\n );\n}\nfunction getPptxContainerComponents() {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n}\nfunction getPptxContentComponents() {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => !c.hasChildren);\n}\nfunction isPptxStandardComponent(name) {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.some((c) => c.name === name);\n}\nfunction createPptxComponentSchemaObject(component, recursiveRef, profile) {\n const schema = {\n name: Type5.Literal(component.name),\n id: Type5.Optional(Type5.String()),\n enabled: Type5.Optional(\n Type5.Boolean({\n default: true,\n description: \"When false, this component is filtered out and not rendered. Defaults to true.\"\n })\n )\n };\n if (component.special?.hasSchemaField) {\n schema.$schema = Type5.Optional(Type5.String({ format: \"uri\" }));\n schema.renderer = profile ? profile.requireDiscriminator ? Type5.Literal(profile.renderer, {\n description: \"Renderer backend for this presentation\"\n }) : Type5.Optional(\n Type5.Literal(profile.renderer, {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".'\n })\n ) : Type5.Optional(\n Type5.Union(\n PPTX_RENDERER_IDS.map((renderer) => Type5.Literal(renderer)),\n {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".'\n }\n )\n );\n }\n schema.props = profile ? pptxPropsSchemaForRenderer(\n component.name,\n component.propsSchema,\n profile.renderer\n ) : component.propsSchema;\n if (component.hasChildren && recursiveRef) {\n schema.children = Type5.Optional(Type5.Array(recursiveRef));\n }\n if (!pptxComponentRequiresProps(component)) {\n schema.props = Type5.Optional(schema.props);\n }\n return Type5.Object(schema, {\n additionalProperties: false,\n description: component.description\n });\n}\nfunction createAllPptxComponentSchemas(recursiveRef) {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map(\n (component) => createPptxComponentSchemaObject(component, recursiveRef)\n );\n}\nfunction createAllPptxComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile) {\n const leafSchemas = /* @__PURE__ */ new Map();\n for (const comp of PPTX_STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createPptxComponentSchemaObject(comp, void 0, profile)\n );\n }\n }\n const containers = PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.hasChildren\n );\n const resolved = /* @__PURE__ */ new Map();\n const pending = [...containers];\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n if (comp.name === \"group\") {\n const content = Type5.Intersect([\n selfRef,\n Type5.Object({\n name: Type5.Union([\n ...comp.allowedChildren.map((name) => Type5.Literal(name)),\n ...pluginSchemas.map(\n (schema) => schema.properties?.name ?? Type5.String()\n )\n ])\n })\n ]);\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(comp, content, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n if (!comp.allowedChildren) {\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(comp, selfRef, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n const containerDeps = comp.allowedChildren.filter(\n (name) => containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n const childSchemas = comp.allowedChildren.map((name) => resolved.get(name) ?? leafSchemas.get(name)).filter((s) => s !== void 0);\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType = allChildSchemas.length === 1 ? allChildSchemas[0] : Type5.Union(allChildSchemas);\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(comp, childrenType, profile)\n );\n pending.splice(i, 1);\n }\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(\", \")}`\n );\n }\n }\n return [...resolved.values(), ...leafSchemas.values()];\n}\n\nexport {\n PositionSchema,\n SlideBackgroundSchema,\n TransitionSchema,\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema2 as GridPositionSchema,\n PresentationPropsSchema,\n SlidePropsSchema,\n PptxGroupPropsSchema,\n pptxComponentRequiresProps,\n PPTX_STANDARD_COMPONENTS_REGISTRY,\n getPptxStandardComponent,\n getAllPptxComponentNames,\n getPptxComponentsByCategory,\n getPptxContainerComponents,\n getPptxContentComponents,\n isPptxStandardComponent,\n createPptxComponentSchemaObject,\n createAllPptxComponentSchemas,\n createAllPptxComponentSchemasNarrowed\n};\n//# sourceMappingURL=chunk-WUU5BXQJ.js.map","import {\n createAllPptxComponentSchemasNarrowed\n} from \"./chunk-WUU5BXQJ.js\";\nimport {\n DEFAULT_PPTX_RENDERER_ID,\n PPTX_RENDERER_IDS,\n pptxComponentDefinitionName\n} from \"./chunk-Y2ODB5VW.js\";\n\n// src/schemas/generator.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { latestVersion } from \"@json-to-office/shared\";\nfunction createPluginVersionSchema(custom, entry, recursiveRef, isLatest) {\n const fields = {\n name: Type.Literal(custom.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description: \"When false, this component is filtered out and not rendered. Defaults to true.\"\n })\n ),\n // Omitting version selects the latest release at runtime. Explicit older\n // versions remain discriminated so their own props schema is enforced.\n version: isLatest ? Type.Optional(Type.Literal(entry.version)) : Type.Literal(entry.version),\n props: entry.propsSchema\n };\n if (entry.hasChildren) {\n fields.children = Type.Optional(Type.Array(recursiveRef));\n }\n return Type.Object(fields, {\n additionalProperties: false,\n description: entry.description ?? custom.name\n });\n}\nfunction generateUnifiedDocumentSchema(options = {}) {\n const { customComponents = [] } = options;\n const branches = PPTX_RENDERER_IDS.map(\n (renderer) => generateRendererSchema(\n customComponents,\n renderer,\n renderer !== DEFAULT_PPTX_RENDERER_ID\n )\n );\n return Type.Union(branches, {\n description: \"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs.\"\n });\n}\nfunction generateRendererSchema(customComponents, renderer, requireDiscriminator) {\n return Type.Recursive(\n (Self) => {\n const pluginSchemas = [];\n for (const custom of customComponents) {\n if (custom.versions.length > 0) {\n const latest = latestVersion(\n custom.versions.map((entry) => entry.version)\n );\n const versions = custom.versions.map(\n (entry) => createPluginVersionSchema(\n custom,\n entry,\n Self,\n entry.version === latest\n )\n );\n pluginSchemas.push(...versions);\n }\n }\n const standardSchemas = createAllPptxComponentSchemasNarrowed(\n Self,\n pluginSchemas,\n { renderer, requireDiscriminator }\n );\n const componentSchemas = [...standardSchemas, ...pluginSchemas];\n if (componentSchemas.length === 0) {\n return Type.Object({});\n }\n return Type.Union(componentSchemas);\n },\n // Named per renderer so the export keys `definitions` by a stable name.\n { $id: pptxComponentDefinitionName(renderer) }\n );\n}\n\nexport {\n generateUnifiedDocumentSchema\n};\n//# sourceMappingURL=chunk-BYXJ2AOZ.js.map","import {\n createAllPptxComponentSchemas,\n createAllPptxComponentSchemasNarrowed\n} from \"./chunk-WUU5BXQJ.js\";\n\n// src/schemas/component-union.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { PptxSlideContentSchema } from \"@json-to-office/shared/schemas/slide-content\";\nvar PptxStandardComponentDefinitionSchema = Type.Union(\n [...createAllPptxComponentSchemas(Type.Any())],\n {\n discriminator: { propertyName: \"name\" },\n description: \"Standard PPTX component definition with discriminated union\"\n }\n);\nvar PptxComponentDefinitionSchema = Type.Recursive(\n (This) => Type.Union([...createAllPptxComponentSchemasNarrowed(This)], {\n discriminator: { propertyName: \"name\" },\n description: \"PPTX component definition with discriminated union\"\n })\n);\n\nexport {\n PptxStandardComponentDefinitionSchema,\n PptxComponentDefinitionSchema,\n PptxSlideContentSchema\n};\n//# sourceMappingURL=chunk-WFJI4YP3.js.map","import {\n DEFAULT_PPTX_RENDERER_ID,\n PPTX_RENDERER_IDS,\n pptxComponentDefinitionName\n} from \"./chunk-Y2ODB5VW.js\";\n\n// src/schemas/block-authoring.ts\nimport {\n createBlockAuthoringSchema,\n unionBranches\n} from \"@json-to-office/shared\";\nfunction addPptxBlockAuthoringSchemas(schema) {\n const definitions = schema.definitions ?? {};\n const bodies = /* @__PURE__ */ new Map();\n for (const renderer of PPTX_RENDERER_IDS) {\n const name = pptxComponentDefinitionName(renderer);\n if (definitions[name])\n bodies.set(\n renderer,\n createBlockAuthoringSchema(definitions, name, [\"pptx\", \"slide\"], \"pptx\")\n );\n }\n const visit = (node) => {\n if (!node || typeof node !== \"object\") return;\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n const value = node;\n if (value.properties?.name?.const === \"pptx\") {\n const body = bodies.get(value.properties.renderer?.const);\n const blocks = value.properties.props?.properties?.blocks?.patternProperties;\n if (body && blocks)\n for (const block of Object.values(blocks))\n block.properties.body.items = body;\n }\n Object.values(value).forEach(visit);\n };\n visit(schema);\n}\nfunction dispatchPptxRootByRenderer(schema) {\n const branches = schema.anyOf;\n if (!Array.isArray(branches)) return;\n const refs = /* @__PURE__ */ new Map();\n for (const renderer of PPTX_RENDERER_IDS) {\n const ref = `#/definitions/${pptxComponentDefinitionName(renderer)}`;\n const branch = branches.find(\n (entry) => entry && entry.$ref === ref\n );\n if (branch) refs.set(renderer, branch);\n }\n if (refs.size !== branches.length || !refs.has(DEFAULT_PPTX_RENDERER_ID))\n return;\n const named = (renderer) => ({\n properties: { renderer: { const: renderer } },\n required: [\"renderer\"]\n });\n const others = PPTX_RENDERER_IDS.filter(\n (renderer) => renderer !== DEFAULT_PPTX_RENDERER_ID && refs.has(renderer)\n );\n delete schema.anyOf;\n schema.type = \"object\";\n schema.properties = {\n renderer: {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".',\n anyOf: PPTX_RENDERER_IDS.filter((renderer) => refs.has(renderer)).map(\n (renderer) => ({ const: renderer, type: \"string\" })\n )\n }\n };\n schema.allOf = [\n ...others.map((renderer) => ({\n if: named(renderer),\n then: refs.get(renderer)\n })),\n {\n if: { not: { anyOf: others.map(named) } },\n then: refs.get(DEFAULT_PPTX_RENDERER_ID)\n }\n ];\n}\nfunction preparePptxDocumentBlockTargets(schema) {\n const definitions = schema.definitions ?? {};\n const targets = [];\n for (const renderer of PPTX_RENDERER_IDS) {\n const name = pptxComponentDefinitionName(renderer);\n const definition = definitions[name];\n if (!definition) continue;\n const contentName = `PptxSlotContent_${renderer}`;\n if (!definitions[contentName]) {\n const slide = unionBranches(definition).find(\n (branch) => branch.properties?.name?.const === \"slide\"\n );\n const items = slide?.properties?.children?.items;\n if (items) definitions[contentName] = JSON.parse(JSON.stringify(items));\n }\n if (!definitions[contentName]) {\n targets.push({ name });\n continue;\n }\n const componentRef = { $ref: `#/definitions/${contentName}` };\n targets.push({ name, componentRef }, { name: contentName, componentRef });\n }\n return targets;\n}\n\nexport {\n addPptxBlockAuthoringSchemas,\n dispatchPptxRootByRenderer,\n preparePptxDocumentBlockTargets\n};\n//# sourceMappingURL=chunk-4FGNUZM3.js.map","import {\n addPptxBlockAuthoringSchemas,\n dispatchPptxRootByRenderer\n} from \"./chunk-4FGNUZM3.js\";\n\n// src/schemas/export.ts\nimport { convertToJsonSchema as convertSharedToJsonSchema } from \"@json-to-office/shared\";\nfunction convertToJsonSchema(schema, options = {}) {\n return convertSharedToJsonSchema(schema, {\n ...options,\n enrich: (json) => {\n addPptxBlockAuthoringSchemas(json);\n dispatchPptxRootByRenderer(json);\n }\n });\n}\nvar PPTX_COMPONENT_METADATA = {\n presentation: {\n title: \"Presentation Component\",\n description: \"Top-level presentation container with metadata and settings\"\n },\n slide: {\n title: \"Slide Component\",\n description: \"Slide container for organizing content elements\"\n },\n text: {\n title: \"Text Component\",\n description: \"Text element with formatting and positioning\"\n },\n image: {\n title: \"Image Component\",\n description: \"Image element with sizing and positioning\"\n },\n shape: {\n title: \"Shape Component\",\n description: \"Geometric shape with optional text and styling\"\n },\n table: {\n title: \"Table Component\",\n description: \"Tabular data display with rows and columns\"\n }\n};\nvar PPTX_BASE_SCHEMA_METADATA = {\n position: {\n title: \"Position\",\n description: \"Position and size in inches or percentages\"\n },\n \"slide-background\": {\n title: \"Slide Background\",\n description: \"Slide background configuration\"\n },\n transition: {\n title: \"Transition\",\n description: \"Slide transition effect configuration\"\n },\n shadow: {\n title: \"Shadow\",\n description: \"Shadow configuration for elements\"\n }\n};\n\nexport {\n convertToJsonSchema,\n PPTX_COMPONENT_METADATA,\n PPTX_BASE_SCHEMA_METADATA\n};\n//# sourceMappingURL=chunk-AD6NRP7M.js.map","import {\n generateUnifiedDocumentSchema\n} from \"./chunk-BYXJ2AOZ.js\";\nimport {\n PPTX_JSON_SCHEMA_URLS,\n PptxJsonComponentDefinitionSchema\n} from \"./chunk-LBSRVW6A.js\";\nimport \"./chunk-RLXWATX4.js\";\nimport {\n PptxComponentDefinitionSchema,\n PptxSlideContentSchema,\n PptxStandardComponentDefinitionSchema\n} from \"./chunk-WFJI4YP3.js\";\nimport {\n PPTX_STANDARD_COMPONENTS_REGISTRY,\n PositionSchema,\n PresentationPropsSchema,\n ShadowSchema,\n SlideBackgroundSchema,\n SlidePropsSchema,\n TransitionSchema,\n VerticalAlignmentSchema,\n createAllPptxComponentSchemas,\n createPptxComponentSchemaObject,\n getAllPptxComponentNames,\n getPptxComponentsByCategory,\n getPptxContainerComponents,\n getPptxContentComponents,\n getPptxStandardComponent,\n isPptxStandardComponent,\n pptxComponentRequiresProps\n} from \"./chunk-WUU5BXQJ.js\";\nimport {\n BUILT_IN_PPTX_THEME_NAMES,\n ColorValueSchema,\n SEMANTIC_COLOR_ALIASES,\n SEMANTIC_COLOR_NAMES,\n STYLE_NAMES,\n StyleNameSchema,\n TextStyleSchema,\n ThemeConfigSchema,\n isValidThemeConfig\n} from \"./chunk-UUQ2XPUB.js\";\nimport {\n ChartComponentDefaultsSchema,\n GradientFillSchema,\n GradientStopSchema,\n HighchartsComponentDefaultsSchema,\n ImageComponentDefaultsSchema,\n PATTERN_FILL_PRESETS,\n PatternFillSchema,\n PptxChartPropsSchema,\n PptxComponentDefaultsSchema,\n PptxHighchartsPropsSchema,\n PptxImagePropsSchema,\n PptxTablePropsSchema,\n ShapeComponentDefaultsSchema,\n ShapePropsSchema,\n ShapeTypeSchema,\n TableComponentDefaultsSchema,\n TextComponentDefaultsSchema,\n TextPropsSchema,\n TextRunSchema\n} from \"./chunk-Z6NUHS34.js\";\nimport {\n PPTX_BASE_SCHEMA_METADATA,\n PPTX_COMPONENT_METADATA,\n convertToJsonSchema\n} from \"./chunk-AD6NRP7M.js\";\nimport {\n addPptxBlockAuthoringSchemas,\n dispatchPptxRootByRenderer,\n preparePptxDocumentBlockTargets\n} from \"./chunk-4FGNUZM3.js\";\nimport {\n DEFAULT_PPTX_RENDERER_ID,\n PPTX_RENDERER_IDS,\n collectPptxRendererErrors,\n pptxComponentDefinitionName\n} from \"./chunk-Y2ODB5VW.js\";\n\n// src/validation/image-source-conflicts.ts\nvar IMAGE_SOURCE_FIELDS = [\"path\", \"base64\", \"svg\"];\nfunction presentImageSources(props) {\n if (!props || typeof props !== \"object\") return [];\n const p = props;\n return IMAGE_SOURCE_FIELDS.filter((f) => {\n const v = p[f];\n return typeof v === \"string\" && v.trim().length > 0;\n });\n}\nfunction collectImageSourceConflicts(data) {\n const errors = [];\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n if (node.name === \"image\") {\n const present = presentImageSources(node.props);\n if (present.length > 1) {\n errors.push({\n path: `${path}/props`,\n message: `Image component accepts only one source, but found ${present.map((f) => `\"${f}\"`).join(\", \")}. Use exactly one of \"path\", \"base64\", or \"svg\".`,\n code: \"mutually_exclusive\"\n });\n }\n }\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n visit(data, \"\");\n return errors;\n}\n\n// src/validation/text-content-conflicts.ts\nfunction collectTextContentConflicts(data) {\n const errors = [];\n const visit = (node, path, inDefinition) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`, inDefinition));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n if (!inDefinition && node.name === \"text\" && node.props && typeof node.props === \"object\") {\n const hasText = typeof node.props.text === \"string\";\n const hasRuns = Array.isArray(node.props.runs);\n if (hasText && hasRuns) {\n errors.push({\n path: `${path}/props`,\n message: 'Text component accepts either \"text\" or \"runs\", not both. Use exactly one of the two.',\n code: \"mutually_exclusive\"\n });\n } else if (!hasText && !hasRuns) {\n errors.push({\n path: `${path}/props`,\n message: 'Text component requires content: set either \"text\" or \"runs\".',\n code: \"required_property\"\n });\n }\n }\n for (const key of Object.keys(node)) {\n visit(\n node[key],\n `${path}/${key}`,\n inDefinition || path === \"/props\" && key === \"blocks\"\n );\n }\n };\n visit(data, \"\", false);\n return errors;\n}\n\n// src/validation/unified/index.ts\nimport { Value as Value2 } from \"@sinclair/typebox/value\";\nimport {\n readBlockDefinitions,\n transformValueErrors as transformValueErrors2,\n validateBlockInvocations\n} from \"@json-to-office/shared\";\n\n// src/validation/unified/deep-validator.ts\nimport { Value } from \"@sinclair/typebox/value\";\nimport { transformValueErrors } from \"@json-to-office/shared\";\nvar COMPONENT_SCHEMAS = Object.fromEntries(\n PPTX_STANDARD_COMPONENTS_REGISTRY.map((c) => [c.name, c.propsSchema])\n);\nvar ROOT_COMPONENT_NAMES = new Set(\n PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => Boolean(c.special?.hasSchemaField)\n ).map((c) => c.name)\n);\nvar COMPONENT_OBJECT_KEYS = /* @__PURE__ */ new Set([\n \"name\",\n \"id\",\n \"enabled\",\n \"props\",\n \"children\"\n]);\nvar CUSTOM_COMPONENT_OBJECT_KEYS = /* @__PURE__ */ new Set([\n ...COMPONENT_OBJECT_KEYS,\n \"version\"\n]);\nvar ROOT_OBJECT_KEYS = /* @__PURE__ */ new Set([...COMPONENT_OBJECT_KEYS, \"$schema\"]);\nROOT_OBJECT_KEYS.add(\"renderer\");\nvar SIBLING_KEY_TYPES = {\n id: \"string\",\n enabled: \"boolean\",\n $schema: \"string\",\n version: \"string\"\n};\nfunction collectSiblingKeyErrors(node, path, allowedKeys, label, errors) {\n for (const key of Object.keys(node)) {\n if (!allowedKeys.has(key)) {\n errors.push({\n path: `${path}/${key}`,\n message: `Unknown field \"${key}\" on ${label}`,\n code: \"unknown_field\"\n });\n continue;\n }\n const expected = SIBLING_KEY_TYPES[key];\n if (expected && typeof node[key] !== expected) {\n errors.push({\n path: `${path}/${key}`,\n message: `Field \"${key}\" on ${label} must be a ${expected}`,\n code: \"invalid_type\"\n });\n }\n }\n}\nfunction deepValidatePresentation(data, opts = {}) {\n const allErrors = [];\n if (!data || typeof data !== \"object\") {\n allErrors.push({\n path: \"root\",\n message: \"Presentation must be an object\",\n code: \"invalid_type\"\n });\n return allErrors;\n }\n if (!data.name) {\n allErrors.push({\n path: \"/name\",\n message: 'Missing required field \"name\"',\n code: \"required_property\"\n });\n } else if (!ROOT_COMPONENT_NAMES.has(data.name)) {\n const expected = [...ROOT_COMPONENT_NAMES].map((n) => `\"${n}\"`).join(\", \");\n allErrors.push({\n path: \"/name\",\n message: `Invalid name \"${data.name}\". Expected ${expected}`,\n code: \"invalid_value\"\n });\n }\n collectSiblingKeyErrors(\n data,\n \"\",\n ROOT_OBJECT_KEYS,\n \"the root component\",\n allErrors\n );\n const rootDef = getPptxStandardComponent(data.name);\n if (!(\"props\" in data)) {\n if (!rootDef || pptxComponentRequiresProps(rootDef)) {\n allErrors.push({\n path: \"/props\",\n message: 'Missing required field \"props\"',\n code: \"required_property\"\n });\n }\n } else if (ROOT_COMPONENT_NAMES.has(data.name)) {\n allErrors.push(\n ...validateComponentProps(data.name, data.props, \"/props\", opts)\n );\n }\n if (!data.children) {\n allErrors.push({\n path: \"/children\",\n message: 'Missing required field \"children\"',\n code: \"required_property\"\n });\n } else if (!Array.isArray(data.children)) {\n allErrors.push({\n path: \"/children\",\n message: 'Field \"children\" must be an array',\n code: \"invalid_type\"\n });\n }\n walkComponentTree(data, \"\", opts, allErrors);\n return allErrors;\n}\nfunction walkComponentTree(node, path, opts, errors) {\n if (!node || typeof node !== \"object\") return;\n const validateEntry = (child, childPath) => {\n if (!child || typeof child !== \"object\" || Array.isArray(child)) {\n errors.push({\n path: childPath,\n message: \"Component must be an object\",\n code: \"invalid_type\"\n });\n return;\n }\n if (typeof child.name !== \"string\" || child.name.length === 0) {\n errors.push({\n path: `${childPath}/name`,\n message: 'Component missing required field \"name\"',\n code: \"required_property\"\n });\n return;\n }\n const isCustomComponent = opts.knownCustomNames?.has(child.name) ?? false;\n const allowedObjectKeys = isCustomComponent ? CUSTOM_COMPONENT_OBJECT_KEYS : COMPONENT_OBJECT_KEYS;\n collectSiblingKeyErrors(\n child,\n childPath,\n allowedObjectKeys,\n `component \"${child.name}\"`,\n errors\n );\n if (isCustomComponent) {\n if (!(\"props\" in child)) {\n errors.push({\n path: `${childPath}/props`,\n message: `Component \"${child.name}\" is missing required field \"props\"`,\n code: \"required_property\",\n suggestion: `Add a \"props\" object holding the content \"${child.name}\" renders.`\n });\n }\n walkComponentTree(child, childPath, opts, errors);\n return;\n }\n const def = getPptxStandardComponent(child.name);\n const propsPath = `${childPath}/props`;\n if (\"props\" in child) {\n errors.push(\n ...validateComponentProps(child.name, child.props, propsPath, opts)\n );\n } else if (def && pptxComponentRequiresProps(def)) {\n const declared = def.propsSchema.required ?? [];\n errors.push({\n path: propsPath,\n message: `Component \"${child.name}\" is missing required field \"props\"`,\n code: \"required_property\",\n suggestion: declared.length > 0 ? `Add \"props\" carrying ${declared.map((f) => `\"${f}\"`).join(\", \")}.` : `Add a \"props\" object holding the content \"${child.name}\" renders.`\n });\n } else {\n errors.push(...validateComponentProps(child.name, {}, propsPath, opts));\n }\n if (def && !def.hasChildren && child.children != null) {\n errors.push({\n path: `${childPath}/children`,\n message: `Component \"${child.name}\" does not accept children`,\n code: \"invalid_value\"\n });\n return;\n }\n walkComponentTree(child, childPath, opts, errors);\n };\n const parentDef = getPptxStandardComponent(node.name);\n const checkAllowedChild = (child, childPath) => {\n if (parentDef?.allowedChildren && child && typeof child === \"object\" && typeof child.name === \"string\" && getPptxStandardComponent(child.name) && !parentDef.allowedChildren.includes(child.name)) {\n const expected = parentDef.allowedChildren.map((n) => `\"${n}\"`).join(\", \");\n errors.push({\n path: `${childPath}/name`,\n message: `Component \"${child.name}\" is not allowed inside \"${node.name}\". Expected ${expected}`,\n code: \"invalid_value\"\n });\n }\n };\n if (Array.isArray(node.children)) {\n node.children.forEach((child, i) => {\n const childPath = `${path}/children/${i}`;\n checkAllowedChild(child, childPath);\n validateEntry(child, childPath);\n });\n } else if (node.children != null && path !== \"\") {\n errors.push({\n path: `${path}/children`,\n message: 'Field \"children\" must be an array',\n code: \"invalid_type\"\n });\n }\n}\nfunction validateComponentProps(componentName, props, basePath, opts = {}) {\n const errors = [];\n const schema = COMPONENT_SCHEMAS[componentName];\n if (!schema) {\n errors.push({\n path: basePath.replace(/\\/props$/, \"/name\"),\n message: `Unknown component \"${componentName}\"`,\n code: \"unknown_component\"\n });\n return errors;\n }\n let toCheck = props;\n if (opts.allowUnknownFields) {\n toCheck = Value.Clean(schema, Value.Clone(toCheck));\n }\n if (!Value.Check(schema, toCheck)) {\n const valueErrors = [...Value.Errors(schema, toCheck)];\n const transformedErrors = transformValueErrors(valueErrors, {\n maxErrors: 100\n });\n transformedErrors.forEach((error) => {\n const fullPath = error.path === \"root\" ? basePath : `${basePath}${error.path.startsWith(\"/\") ? error.path : \"/\" + error.path}`;\n errors.push({\n ...error,\n path: fullPath\n });\n });\n }\n return errors;\n}\nfunction comprehensiveValidatePresentation(data, existingErrors = [], opts = {}) {\n const deepErrors = deepValidatePresentation(data, opts);\n const filteredExisting = existingErrors.filter(\n (e) => !isGenericUnionCatchAll(e)\n );\n return deduplicateErrors([...filteredExisting, ...deepErrors]);\n}\nfunction isGenericUnionCatchAll(error) {\n const atRoot = !error.path || error.path === \"root\" || error.path === \"/\";\n if (!atRoot) return false;\n const msg = error.message || \"\";\n return /invalid component configurations?/i.test(msg) || /invalid document structure/i.test(msg);\n}\nfunction deduplicateErrors(errors) {\n const seen = /* @__PURE__ */ new Set();\n const unique = [];\n for (const error of errors) {\n const key = `${error.path}:${error.message}`;\n if (!seen.has(key)) {\n seen.add(key);\n unique.push(error);\n }\n }\n return unique;\n}\n\n// src/validation/unified/index.ts\nfunction parseJsonInput(jsonInput) {\n if (typeof jsonInput !== \"string\") return { parsed: jsonInput };\n try {\n return { parsed: JSON.parse(jsonInput) };\n } catch (err) {\n return {\n error: {\n path: \"root\",\n message: `Invalid JSON: ${err?.message ?? String(err)}`,\n code: \"json_parse_error\"\n }\n };\n }\n}\nfunction validatePresentationDocument(data, opts = {}) {\n const errors = comprehensiveValidatePresentation(data, [], opts);\n errors.push(...collectImageSourceConflicts(data));\n errors.push(...collectTextContentConflicts(data));\n errors.push(...collectPptxRendererErrors(data));\n errors.push(\n ...validateBlockInvocations(data, readBlockDefinitions(data), \"pptx\", [\n ...opts.knownCustomNames ?? []\n ])\n );\n const valid = errors.length === 0;\n return {\n valid,\n errors,\n documentType: \"pptx\",\n data: valid ? data : void 0\n };\n}\nfunction validateJsonPresentationDocument(jsonInput, opts = {}) {\n const { parsed, error } = parseJsonInput(jsonInput);\n if (error) return { valid: false, errors: [error], documentType: \"pptx\" };\n return validatePresentationDocument(parsed, opts);\n}\nfunction validatePptxTheme(data) {\n if (Value2.Check(ThemeConfigSchema, data)) {\n return { valid: true, errors: [], data };\n }\n const valueErrors = [...Value2.Errors(ThemeConfigSchema, data)];\n const errors = transformValueErrors2(valueErrors, { maxErrors: 100 });\n return { valid: false, errors };\n}\nfunction validateJsonPptxTheme(jsonInput) {\n const { parsed, error } = parseJsonInput(jsonInput);\n if (error) return { valid: false, errors: [error] };\n return validatePptxTheme(parsed);\n}\nvar validate = {\n document: (data) => validatePresentationDocument(data),\n jsonDocument: (jsonInput) => validateJsonPresentationDocument(jsonInput),\n theme: (data) => validatePptxTheme(data),\n jsonTheme: (jsonInput) => validateJsonPptxTheme(jsonInput),\n isDocument: (data) => validatePresentationDocument(data).valid,\n isTheme: (data) => validatePptxTheme(data).valid\n};\nvar validateStrict = {\n document: (data) => validatePresentationDocument(data),\n jsonDocument: (jsonInput) => validateJsonPresentationDocument(jsonInput),\n theme: (data) => validatePptxTheme(data),\n jsonTheme: (jsonInput) => validateJsonPptxTheme(jsonInput)\n};\n\n// src/index.ts\nimport {\n transformValueError,\n transformValueErrors as transformValueErrors3,\n DEFAULT_ERROR_CONFIG,\n createErrorConfig\n} from \"@json-to-office/shared\";\nimport {\n latestVersion,\n isValidSemver,\n parseSemver,\n compareSemver\n} from \"@json-to-office/shared\";\nimport {\n fixSchemaReferences,\n createComponentSchema,\n exportSchemaToFile\n} from \"@json-to-office/shared\";\nvar PPTX_SHARED_VERSION = \"1.0.0\";\nexport {\n BUILT_IN_PPTX_THEME_NAMES,\n ChartComponentDefaultsSchema,\n ColorValueSchema,\n DEFAULT_ERROR_CONFIG,\n DEFAULT_PPTX_RENDERER_ID,\n GradientFillSchema,\n GradientStopSchema,\n HighchartsComponentDefaultsSchema,\n ImageComponentDefaultsSchema,\n PATTERN_FILL_PRESETS,\n PPTX_BASE_SCHEMA_METADATA,\n PPTX_COMPONENT_METADATA,\n PPTX_JSON_SCHEMA_URLS,\n PPTX_RENDERER_IDS,\n PPTX_SHARED_VERSION,\n PPTX_STANDARD_COMPONENTS_REGISTRY,\n PatternFillSchema,\n PositionSchema,\n PptxChartPropsSchema,\n PptxComponentDefaultsSchema,\n PptxComponentDefinitionSchema,\n PptxHighchartsPropsSchema,\n PptxImagePropsSchema,\n PptxJsonComponentDefinitionSchema,\n PptxSlideContentSchema,\n PptxStandardComponentDefinitionSchema,\n PptxTablePropsSchema,\n PresentationPropsSchema,\n SEMANTIC_COLOR_ALIASES,\n SEMANTIC_COLOR_NAMES,\n STYLE_NAMES,\n ShadowSchema,\n ShapeComponentDefaultsSchema,\n ShapePropsSchema,\n ShapeTypeSchema,\n SlideBackgroundSchema,\n SlidePropsSchema,\n StyleNameSchema,\n TableComponentDefaultsSchema,\n TextComponentDefaultsSchema,\n TextPropsSchema,\n TextRunSchema,\n TextStyleSchema,\n ThemeConfigSchema,\n TransitionSchema,\n VerticalAlignmentSchema,\n addPptxBlockAuthoringSchemas,\n collectImageSourceConflicts,\n collectPptxRendererErrors,\n collectTextContentConflicts,\n compareSemver,\n comprehensiveValidatePresentation,\n convertToJsonSchema,\n createAllPptxComponentSchemas,\n createComponentSchema,\n createErrorConfig,\n createPptxComponentSchemaObject,\n deepValidatePresentation,\n dispatchPptxRootByRenderer,\n exportSchemaToFile,\n fixSchemaReferences,\n generateUnifiedDocumentSchema,\n getAllPptxComponentNames,\n getPptxComponentsByCategory,\n getPptxContainerComponents,\n getPptxContentComponents,\n getPptxStandardComponent,\n isPptxStandardComponent,\n isValidSemver,\n isValidThemeConfig,\n latestVersion,\n parseSemver,\n pptxComponentDefinitionName,\n pptxComponentRequiresProps,\n preparePptxDocumentBlockTargets,\n presentImageSources,\n transformValueError,\n transformValueErrors3 as transformValueErrors,\n validate,\n validateJsonPptxTheme,\n validateJsonPresentationDocument,\n validatePptxTheme,\n validatePresentationDocument,\n validateStrict\n};\n//# sourceMappingURL=index.js.map","// src/schemas/font.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { FontFamilyNameSchema, TextCaseSchema } from \"@json-to-office/shared\";\nvar HexColorSchema = Type.String({\n pattern: \"^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$\",\n description: 'Hex color with # prefix (e.g. \"#000000\") or theme color name'\n});\nvar HexColorOrTransparentSchema = Type.String({\n pattern: \"^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$\",\n description: 'Hex color with # prefix, theme color name, or \"transparent\"'\n});\nvar LanguageSchema = Type.String({\n pattern: \"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$\",\n description: 'BCP-47 language tag for spell/grammar checking (e.g. \"en-US\", \"fr-FR\", \"de-DE\")',\n examples: [\"en-US\", \"fr-FR\", \"de-DE\", \"it-IT\", \"es-ES\"]\n});\nvar NoProofSchema = Type.Boolean({\n description: \"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)\"\n});\nvar NoProofWordsSchema = Type.Array(Type.String({ minLength: 1 }), {\n description: \"Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.\",\n examples: [[\"Wiseair\", \"json-to-office\", \"pptx\"]]\n});\nvar TextFormattingPropertiesSchema = Type.Object(\n {\n case: Type.Optional(TextCaseSchema),\n size: Type.Optional(Type.Number({ minimum: 8, maximum: 1638 })),\n color: Type.Optional(HexColorSchema),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n 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.\"\n })\n ),\n italic: Type.Optional(Type.Boolean()),\n underline: Type.Optional(Type.Boolean()),\n lineSpacing: Type.Optional(\n Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal(\"single\"),\n Type.Literal(\"atLeast\"),\n Type.Literal(\"exactly\"),\n Type.Literal(\"double\"),\n Type.Literal(\"multiple\")\n ],\n {\n 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.\"\n }\n ),\n value: Type.Optional(\n Type.Number({\n minimum: 0,\n 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.\"\n })\n )\n },\n { additionalProperties: false }\n )\n ),\n spacing: Type.Optional(\n Type.Object(\n {\n before: Type.Optional(Type.Number({ minimum: 0 })),\n after: Type.Optional(Type.Number({ minimum: 0 }))\n },\n { additionalProperties: false }\n )\n ),\n characterSpacing: Type.Optional(\n Type.Object(\n {\n type: Type.Union([\n Type.Literal(\"condensed\"),\n Type.Literal(\"expanded\")\n ]),\n value: Type.Number()\n },\n { additionalProperties: false }\n )\n ),\n scale: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 600,\n description: \"Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115).\"\n })\n )\n },\n { additionalProperties: false }\n);\nvar FontDefinitionSchema = Type.Object(\n {\n family: FontFamilyNameSchema,\n ...TextFormattingPropertiesSchema.properties\n },\n {\n description: \"Font definition with family and optional formatting properties\",\n additionalProperties: false\n }\n);\n\nexport {\n HexColorSchema,\n HexColorOrTransparentSchema,\n LanguageSchema,\n NoProofSchema,\n NoProofWordsSchema,\n TextFormattingPropertiesSchema,\n FontDefinitionSchema\n};\n//# sourceMappingURL=chunk-XRVPNHNS.js.map","import {\n HexColorSchema\n} from \"./chunk-XRVPNHNS.js\";\n\n// src/schemas/components/common.ts\nimport { Type } from \"@sinclair/typebox\";\nvar AlignmentSchema = Type.Union(\n [Type.Literal(\"left\"), Type.Literal(\"center\"), Type.Literal(\"right\")],\n { description: \"Text alignment options\" }\n);\nvar JustifiedAlignmentSchema = Type.Union(\n [\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"justify\")\n ],\n { description: \"Text alignment options including justify\" }\n);\nvar HeadingLevelSchema = Type.Union(\n [\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6)\n ],\n { description: \"Heading level (1-6)\" }\n);\nvar SpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing before element in points\"\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing after element in points\"\n })\n )\n },\n {\n description: \"Spacing configuration\",\n additionalProperties: false\n }\n);\nvar ListSpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing before list in points\"\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing after list in points\"\n })\n ),\n item: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing between list items in points\"\n })\n )\n },\n {\n description: \"List spacing configuration with item spacing\",\n additionalProperties: false\n }\n);\nvar MarginsSchema = Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 }))\n },\n { description: \"Margin configuration\", additionalProperties: false }\n);\nvar BorderSchema = Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal(\"solid\"),\n Type.Literal(\"dashed\"),\n Type.Literal(\"dotted\"),\n Type.Literal(\"double\"),\n Type.Literal(\"none\")\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema)\n },\n { description: \"Border configuration\", additionalProperties: false }\n);\nvar LineSpacingSchema = Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal(\"single\"),\n Type.Literal(\"atLeast\"),\n Type.Literal(\"exactly\"),\n Type.Literal(\"double\"),\n Type.Literal(\"multiple\")\n ],\n {\n 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.\"\n }\n ),\n value: Type.Optional(\n Type.Number({\n minimum: 0,\n 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.\"\n })\n )\n },\n { description: \"Line spacing configuration\", additionalProperties: false }\n);\nvar IndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level.\"\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Hanging indent in points \\u2014 how far the marker sits left of the text. Omit for the 18pt default.\"\n })\n )\n },\n {\n description: \"Indentation configuration, in points\",\n additionalProperties: false\n }\n);\nvar ParagraphIndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n description: \"Left indentation in twips (1/20 of a point)\"\n })\n ),\n right: Type.Optional(\n Type.Number({\n description: \"Right indentation in twips (1/20 of a point)\"\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine.\"\n })\n ),\n firstLine: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"First-line indent in twips: only the first line is indented. Mutually exclusive with hanging.\"\n })\n )\n },\n {\n description: \"Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.\",\n additionalProperties: false\n }\n);\nvar TabStopTypeSchema = Type.Union(\n [\n Type.Literal(\"left\"),\n Type.Literal(\"right\"),\n Type.Literal(\"center\"),\n Type.Literal(\"decimal\"),\n Type.Literal(\"bar\")\n ],\n { description: \"Tab stop alignment type\" }\n);\nvar TabStopLeaderSchema = Type.Union(\n [\n Type.Literal(\"dot\"),\n Type.Literal(\"hyphen\"),\n Type.Literal(\"underscore\"),\n Type.Literal(\"middleDot\"),\n Type.Literal(\"none\")\n ],\n { description: \"Leader character filling the space before the tab stop\" }\n);\nvar TabStopSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Number({\n minimum: 0,\n description: \"Tab stop position in twips (1/20 of a point)\"\n }),\n leader: Type.Optional(TabStopLeaderSchema)\n },\n {\n description: \"Tab stop definition (w:tab in w:tabs)\",\n additionalProperties: false\n }\n);\nvar oneLineText = (description) => Type.String({\n minLength: 1,\n pattern: \"^[^\\\\r\\\\n]+$\",\n description\n});\nvar TabStopsSchema = Type.Array(TabStopSchema, {\n description: \"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions.\"\n});\nvar HorizontalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal(\"character\"),\n Type.Literal(\"column\"),\n Type.Literal(\"margin\"),\n Type.Literal(\"page\"),\n Type.Literal(\"text\")\n // VML compatibility for text-box\n ],\n {\n description: \"Horizontal position relative to\"\n }\n);\nvar VerticalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal(\"margin\"),\n Type.Literal(\"page\"),\n Type.Literal(\"paragraph\"),\n Type.Literal(\"line\"),\n Type.Literal(\"text\")\n // VML compatibility for text-box\n ],\n {\n description: \"Vertical position relative to\"\n }\n);\nvar HorizontalPositionAlignSchema = Type.Union(\n [\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"inside\"),\n Type.Literal(\"outside\")\n ],\n {\n description: \"Horizontal alignment\"\n }\n);\nvar VerticalPositionAlignSchema = Type.Union(\n [\n Type.Literal(\"top\"),\n Type.Literal(\"center\"),\n Type.Literal(\"bottom\"),\n Type.Literal(\"inside\"),\n Type.Literal(\"outside\")\n ],\n {\n description: \"Vertical alignment\"\n }\n);\nvar TextWrappingTypeSchema = Type.Union(\n [\n Type.Literal(\"none\"),\n Type.Literal(\"square\"),\n Type.Literal(\"topAndBottom\"),\n Type.Literal(\"around\"),\n // VML compatibility for text-box\n Type.Literal(\"tight\"),\n // VML compatibility for text-box\n Type.Literal(\"through\")\n // VML compatibility for text-box\n ],\n {\n description: \"Text wrapping type\"\n }\n);\nvar TextWrappingSideSchema = Type.Union(\n [\n Type.Literal(\"bothSides\"),\n Type.Literal(\"left\"),\n Type.Literal(\"right\"),\n Type.Literal(\"largest\")\n ],\n {\n description: \"Text wrapping side\"\n }\n);\nvar FloatingPropertiesSchema = Type.Object(\n {\n horizontalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(HorizontalPositionRelativeFromSchema),\n align: Type.Optional(HorizontalPositionAlignSchema),\n offset: Type.Optional(\n Type.Union([\n Type.Number({\n description: \"Horizontal offset in twips (1/20 of a point)\"\n }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Horizontal offset as percentage (e.g., \"50%\") relative to page or margin width'\n })\n ])\n )\n },\n {\n description: \"Horizontal positioning (use either align or offset, not both)\",\n additionalProperties: false\n }\n )\n ),\n verticalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(VerticalPositionRelativeFromSchema),\n align: Type.Optional(VerticalPositionAlignSchema),\n offset: Type.Optional(\n Type.Union([\n Type.Number({\n description: \"Vertical offset in twips (1/20 of a point)\"\n }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Vertical offset as percentage (e.g., \"50%\") relative to page or margin height'\n })\n ])\n )\n },\n {\n description: \"Vertical positioning (use either align or offset, not both)\",\n additionalProperties: false\n }\n )\n ),\n wrap: Type.Optional(\n Type.Object(\n {\n type: TextWrappingTypeSchema,\n side: Type.Optional(TextWrappingSideSchema),\n margins: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n Type.Union([\n Type.Number({ description: \"Top margin in twips\" }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Top margin as percentage of page height\"\n })\n ])\n ),\n bottom: Type.Optional(\n Type.Union([\n Type.Number({ description: \"Bottom margin in twips\" }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Bottom margin as percentage of page height\"\n })\n ])\n ),\n left: Type.Optional(\n Type.Union([\n Type.Number({ description: \"Left margin in twips\" }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Left margin as percentage of page width\"\n })\n ])\n ),\n right: Type.Optional(\n Type.Union([\n Type.Number({ description: \"Right margin in twips\" }),\n Type.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: \"Right margin as percentage of page width\"\n })\n ])\n )\n },\n {\n description: \"Distance from text margins\",\n additionalProperties: false\n }\n )\n )\n },\n {\n description: \"Text wrapping configuration\",\n additionalProperties: false\n }\n )\n ),\n allowOverlap: Type.Optional(\n Type.Boolean({\n description: \"Allow element to overlap with other elements\"\n })\n ),\n behindDocument: Type.Optional(\n Type.Boolean({\n description: \"Place element behind document text\"\n })\n ),\n lockAnchor: Type.Optional(\n Type.Boolean({\n description: \"Lock the anchor position\"\n })\n ),\n layoutInCell: Type.Optional(\n Type.Boolean({\n description: \"Layout element within table cell\"\n })\n ),\n zIndex: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Z-order for overlapping elements (must be non-negative)\"\n })\n ),\n rotation: Type.Optional(\n Type.Number({\n description: \"Rotation angle in degrees\"\n })\n ),\n visibility: Type.Optional(\n Type.Union([Type.Literal(\"hidden\"), Type.Literal(\"inherit\")], {\n description: \"Visibility of the floating element\"\n })\n )\n },\n {\n description: \"Floating element properties\",\n additionalProperties: false\n }\n);\nvar NumberingSchema = Type.Object(\n {\n start: Type.Optional(Type.Number({ minimum: 1 })),\n style: Type.Optional(\n Type.Union([\n Type.Literal(\"decimal\"),\n Type.Literal(\"lowerLetter\"),\n Type.Literal(\"upperLetter\"),\n Type.Literal(\"lowerRoman\"),\n Type.Literal(\"upperRoman\")\n ])\n ),\n separator: Type.Optional(Type.String())\n },\n {\n description: \"Numbering configuration for lists\",\n additionalProperties: false\n }\n);\nvar BaseComponentFields = {};\nvar BaseComponentPropsSchema = Type.Object(BaseComponentFields, {\n description: \"Base component props\",\n additionalProperties: true\n});\n\nexport {\n AlignmentSchema,\n JustifiedAlignmentSchema,\n HeadingLevelSchema,\n SpacingSchema,\n ListSpacingSchema,\n MarginsSchema,\n BorderSchema,\n LineSpacingSchema,\n IndentSchema,\n ParagraphIndentSchema,\n TabStopTypeSchema,\n TabStopLeaderSchema,\n TabStopSchema,\n oneLineText,\n TabStopsSchema,\n HorizontalPositionRelativeFromSchema,\n VerticalPositionRelativeFromSchema,\n HorizontalPositionAlignSchema,\n VerticalPositionAlignSchema,\n TextWrappingTypeSchema,\n TextWrappingSideSchema,\n FloatingPropertiesSchema,\n NumberingSchema,\n BaseComponentFields,\n BaseComponentPropsSchema\n};\n//# sourceMappingURL=chunk-FYJOHPU2.js.map","import {\n AlignmentSchema,\n FloatingPropertiesSchema,\n SpacingSchema\n} from \"./chunk-FYJOHPU2.js\";\n\n// src/schemas/renderer.ts\nimport { Kind } from \"@sinclair/typebox\";\n\n// src/schemas/components/visual.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nimport {\n MIN_VISUAL_DPI,\n MAX_VISUAL_DPI,\n DEFAULT_VISUAL_DPI\n} from \"@json-to-office/shared\";\nimport { PptxSlideContentSchema } from \"@json-to-office/shared/schemas/slide-content\";\n\n// src/schemas/components/visual-native.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { ShapeTypeSchema } from \"@json-to-office/shared/schemas/slide-content\";\nvar NativeVisualColorSchema = Type.String({\n pattern: \"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$\",\n description: 'Hex colour (\"#0F172A\" or \"0F172A\") or a docx theme colour name (e.g. \"primary\")'\n});\nvar SIGNED_PERCENT_PATTERN = \"^-?\\\\d+(\\\\.\\\\d+)?%$\";\nvar PERCENT_PATTERN = \"^\\\\d+(\\\\.\\\\d+)?%$\";\nvar NativeVisualOffsetSchema = Type.Union(\n [\n Type.Number({ description: \"Inches from the canvas origin\" }),\n Type.String({\n pattern: SIGNED_PERCENT_PATTERN,\n description: 'Percentage of the canvas extent on this axis, e.g. \"25%\"'\n })\n ],\n { description: \"Position in inches (number) or as a canvas percentage\" }\n);\nvar NativeVisualExtentSchema = Type.Union(\n [\n Type.Number({ minimum: 0, description: \"Size in inches\" }),\n Type.String({\n pattern: PERCENT_PATTERN,\n description: 'Percentage of the canvas extent on this axis, e.g. \"50%\"'\n })\n ],\n { description: \"Size in inches (number) or as a canvas percentage\" }\n);\nvar FrameProps = {\n x: Type.Optional(NativeVisualOffsetSchema),\n y: Type.Optional(NativeVisualOffsetSchema),\n w: Type.Optional(NativeVisualExtentSchema),\n h: Type.Optional(NativeVisualExtentSchema),\n rotate: Type.Optional(\n Type.Number({ description: \"Clockwise rotation in degrees\" })\n )\n};\nvar NativeVisualUnderlineSchema = Type.Union(\n [\n Type.Boolean({ description: \"Single underline in the text colour\" }),\n Type.Object(\n {\n style: Type.Optional(\n Type.Union(\n [\n Type.Literal(\"sng\"),\n Type.Literal(\"dbl\"),\n Type.Literal(\"dash\"),\n Type.Literal(\"dotted\")\n ],\n { description: 'Underline style (default \"sng\")' }\n )\n ),\n color: Type.Optional(NativeVisualColorSchema)\n },\n { additionalProperties: false }\n )\n ],\n { description: \"Underline: true for a single line, or a style/colour object\" }\n);\nvar InlineTextProps = {\n fontFace: Type.Optional(Type.String({ description: \"Font family name\" })),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: \"Font size in points\" })\n ),\n bold: Type.Optional(Type.Boolean()),\n italic: Type.Optional(Type.Boolean())\n};\nvar NativeVisualTextRunSchema = Type.Object(\n {\n text: Type.String({ description: \"Run text\" }),\n color: Type.Optional(NativeVisualColorSchema),\n ...InlineTextProps,\n underline: Type.Optional(NativeVisualUnderlineSchema),\n strike: Type.Optional(Type.Boolean({ description: \"Strikethrough\" })),\n breakLine: Type.Optional(\n Type.Boolean({ description: \"Start a new line after this run\" })\n )\n },\n {\n additionalProperties: false,\n description: \"A formatted run inside a native visual text element\"\n }\n);\nvar NativeVisualTextSegmentSchema = Type.Object(\n {\n text: Type.String({ description: \"Segment text\" }),\n color: Type.Optional(NativeVisualColorSchema),\n ...InlineTextProps,\n breakLine: Type.Optional(\n Type.Boolean({ description: \"Start a new line after this segment\" })\n )\n },\n {\n additionalProperties: false,\n description: \"A formatted segment of a native visual shape\\u2019s text\"\n }\n);\nvar NativeVisualFillSchema = Type.Object(\n {\n color: Type.Optional(NativeVisualColorSchema),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: \"Fill transparency, 0 (opaque) to 100 (invisible)\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"Solid fill. Omit the whole property for no fill; gradients and patterns are raster-only.\"\n }\n);\nvar NativeVisualLineSchema = Type.Object(\n {\n color: Type.Optional(NativeVisualColorSchema),\n width: Type.Optional(\n Type.Number({ minimum: 0, description: \"Outline width in points\" })\n ),\n dashType: Type.Optional(\n Type.Union(\n [\n Type.Literal(\"solid\"),\n Type.Literal(\"dash\"),\n Type.Literal(\"dot\"),\n Type.Literal(\"dashDot\")\n ],\n { description: 'Outline dash pattern (default \"solid\")' }\n )\n )\n },\n { additionalProperties: false, description: \"Shape outline\" }\n);\nvar NativeVisualAlignmentSchema = Type.Union(\n [\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"justify\")\n ],\n { description: \"Horizontal text alignment\" }\n);\nvar NativeVisualVerticalAlignmentSchema = Type.Union(\n [Type.Literal(\"top\"), Type.Literal(\"middle\"), Type.Literal(\"bottom\")],\n { description: \"Vertical text anchoring inside the box\" }\n);\nvar NativeVisualMarginSchema = Type.Union(\n [\n Type.Number({ minimum: 0, description: \"Inset on every side, in points\" }),\n Type.Array(Type.Number({ minimum: 0 }), {\n minItems: 4,\n maxItems: 4,\n description: \"Insets as [top, right, bottom, left], in points\"\n })\n ],\n { description: \"Text insets in points\" }\n);\nvar NativeVisualTextPropsSchema = Type.Object(\n {\n text: Type.Optional(Type.String({ description: \"Plain text content\" })),\n runs: Type.Optional(\n Type.Array(NativeVisualTextRunSchema, {\n minItems: 1,\n description: 'Formatted runs, as an alternative to \"text\"'\n })\n ),\n ...FrameProps,\n color: Type.Optional(NativeVisualColorSchema),\n ...InlineTextProps,\n underline: Type.Optional(NativeVisualUnderlineSchema),\n strike: Type.Optional(Type.Boolean({ description: \"Strikethrough\" })),\n align: Type.Optional(NativeVisualAlignmentSchema),\n valign: Type.Optional(NativeVisualVerticalAlignmentSchema),\n margin: Type.Optional(NativeVisualMarginSchema),\n fill: Type.Optional(NativeVisualFillSchema)\n },\n {\n additionalProperties: false,\n description: \"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group\"\n }\n);\nvar NativeVisualShapePropsSchema = Type.Object(\n {\n type: ShapeTypeSchema,\n ...FrameProps,\n fill: Type.Optional(NativeVisualFillSchema),\n line: Type.Optional(NativeVisualLineSchema),\n text: Type.Optional(\n Type.Union(\n [\n Type.String(),\n Type.Array(NativeVisualTextSegmentSchema, { minItems: 1 })\n ],\n { description: \"Text drawn inside the shape\" }\n )\n ),\n ...InlineTextProps,\n fontColor: Type.Optional(NativeVisualColorSchema),\n align: Type.Optional(NativeVisualAlignmentSchema),\n valign: Type.Optional(NativeVisualVerticalAlignmentSchema),\n margin: Type.Optional(NativeVisualMarginSchema),\n flipH: Type.Optional(Type.Boolean({ description: \"Mirror horizontally\" })),\n flipV: Type.Optional(Type.Boolean({ description: \"Mirror vertically\" }))\n },\n {\n additionalProperties: false,\n description: \"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group\"\n }\n);\nvar NativeVisualImagePropsSchema = Type.Object(\n {\n path: Type.Optional(\n Type.String({ description: \"File path or http(s) URL\" })\n ),\n base64: Type.Optional(Type.String({ description: \"Base64 data URI\" })),\n svg: Type.Optional(Type.String({ description: \"Raw SVG markup\" })),\n ...FrameProps,\n sizing: Type.Optional(\n Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal(\"contain\"),\n Type.Literal(\"cover\"),\n Type.Literal(\"crop\")\n ],\n { description: \"How the image fills its box\" }\n ),\n w: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Box width in inches; overrides the element\\u2019s own \"w\"'\n })\n ),\n h: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Box height in inches; overrides the element\\u2019s own \"h\"'\n })\n )\n },\n {\n additionalProperties: false,\n 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.'\n }\n )\n ),\n alt: Type.Optional(\n Type.String({ description: \"Alternative text for accessibility\" })\n )\n },\n {\n additionalProperties: false,\n description: \"Native visual image element \\u2014 becomes a native picture inside the drawing group\"\n }\n);\nvar NATIVE_VISUAL_ELEMENT_NAMES = [\"text\", \"shape\", \"image\"];\nfunction nativeElement(name, propsSchema, description) {\n return Type.Object(\n {\n name: Type.Literal(name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description: \"When false, this element is filtered out and not drawn. Defaults to true.\"\n })\n ),\n props: propsSchema\n },\n { additionalProperties: false, description }\n );\n}\nvar NativeVisualElementSchema = Type.Union(\n [\n nativeElement(\n \"text\",\n NativeVisualTextPropsSchema,\n \"Text element - a native Word text box drawn on the visual canvas.\"\n ),\n nativeElement(\n \"shape\",\n NativeVisualShapePropsSchema,\n \"Shape element - a native preset-geometry shape, optionally holding text.\"\n ),\n nativeElement(\n \"image\",\n NativeVisualImagePropsSchema,\n \"Image element - a native picture; an SVG stays vector.\"\n )\n ],\n {\n $id: \"DocxNativeVisualContent\",\n discriminator: { propertyName: \"name\" },\n description: \"A single native visual element (text, shape, or image).\"\n }\n);\nvar NativeVisualCanvasSchema = Type.Object(\n {\n width: Type.Number({\n minimum: 0.1,\n description: \"Canvas width in inches\"\n }),\n height: Type.Number({\n minimum: 0.1,\n description: \"Canvas height in inches\"\n }),\n background: Type.Optional(\n Type.Object(\n {\n color: Type.Optional(NativeVisualColorSchema),\n image: Type.Optional(\n Type.Object(\n {\n path: Type.Optional(Type.String()),\n base64: Type.Optional(Type.String())\n },\n { additionalProperties: false }\n )\n )\n },\n {\n additionalProperties: false,\n description: \"Canvas background. A colour becomes the bottom-most rectangle; an image becomes the bottom-most picture.\"\n }\n )\n )\n },\n {\n additionalProperties: false,\n description: \"Drawing canvas for a native visual\"\n }\n);\n\n// src/schemas/components/visual.ts\nvar VisualCanvasBackgroundSchema = Type2.Object(\n {\n color: Type2.Optional(\n Type2.String({\n description: 'Background color (hex like \"#FFFFFF\" or a theme color name)'\n })\n ),\n image: Type2.Optional(\n Type2.Object(\n {\n path: Type2.Optional(Type2.String()),\n base64: Type2.Optional(Type2.String())\n },\n { additionalProperties: false }\n )\n )\n },\n { additionalProperties: false }\n);\nvar VisualCanvasSchema = Type2.Object(\n {\n width: Type2.Number({\n minimum: 0.1,\n description: \"Canvas width in inches (pptx slideWidth)\"\n }),\n height: Type2.Number({\n minimum: 0.1,\n description: \"Canvas height in inches (pptx slideHeight)\"\n }),\n theme: Type2.Optional(\n Type2.String({ description: \"pptx theme name applied to the slide\" })\n ),\n background: Type2.Optional(VisualCanvasBackgroundSchema)\n },\n {\n description: \"pptx canvas definition for the visual\",\n additionalProperties: false\n }\n);\nvar PlacementProps = {\n width: Type2.Optional(\n Type2.Union(\n [\n Type2.Number({ minimum: 1, description: \"Rendered width in pixels\" }),\n Type2.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Rendered width as percentage (e.g. \"90%\")'\n })\n ],\n {\n description: \"Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size.\"\n }\n )\n ),\n height: Type2.Optional(\n Type2.Union([\n Type2.Number({ minimum: 1, description: \"Rendered height in pixels\" }),\n Type2.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Rendered height as percentage (e.g. \"90%\")'\n })\n ])\n ),\n alignment: Type2.Optional(AlignmentSchema),\n caption: Type2.Optional(\n Type2.String({\n description: \"Caption (supports rich text with **bold**, *italic*, ***both***)\"\n })\n ),\n alt: Type2.Optional(\n Type2.String({ description: \"Alternative text for accessibility\" })\n ),\n spacing: Type2.Optional(SpacingSchema),\n floating: Type2.Optional(FloatingPropertiesSchema),\n keepNext: Type2.Optional(\n Type2.Boolean({\n description: \"Keep paragraph with next paragraph on same page\"\n })\n ),\n keepLines: Type2.Optional(\n Type2.Boolean({\n description: \"Keep all lines of paragraph together on same page\"\n })\n )\n};\nvar VisualRasterPropsSchema = Type2.Object(\n {\n renderMode: Type2.Optional(\n Type2.Literal(\"raster\", {\n description: \"Render as a rasterized pptx slide (the default when omitted).\"\n })\n ),\n // ── canvas (drives aspect ratio + physical size) ──\n canvas: VisualCanvasSchema,\n // pptx slide content elements, absolutely positioned on the canvas\n elements: Type2.Optional(\n Type2.Array(PptxSlideContentSchema, {\n description: \"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches\"\n })\n ),\n // ── rasterization ──\n dpi: Type2.Optional(\n Type2.Number({\n minimum: MIN_VISUAL_DPI,\n maximum: MAX_VISUAL_DPI,\n default: DEFAULT_VISUAL_DPI,\n description: `Raster resolution in DPI (default ${DEFAULT_VISUAL_DPI}, range ${MIN_VISUAL_DPI}-${MAX_VISUAL_DPI}). Higher = sharper + larger.`\n })\n ),\n serverUrl: Type2.Optional(\n Type2.String({\n description: \"Rasterization service URL override (default from services.pptx)\"\n })\n ),\n // ── placement in the document (mirrors `image`) ──\n ...PlacementProps\n },\n {\n // Hoisted into its own JSON-Schema definition rather than inlined at every\n // position a component can appear. `visual.props` is by far the largest\n // props schema in the registry, and inlining two of them pushed the\n // exported `ComponentDefinition` past the depth Ajv can compile.\n $id: \"DocxVisualRasterProps\",\n description: \"Visual component props (pptx-rendered graphic)\",\n additionalProperties: false\n }\n);\nvar VisualNativePropsSchema = Type2.Object(\n {\n renderMode: Type2.Literal(\"native\", {\n description: 'Draw natively as a Word DrawingML group. Requires the \"office-open\" renderer.'\n }),\n canvas: NativeVisualCanvasSchema,\n elements: Type2.Optional(\n Type2.Array(NativeVisualElementSchema, {\n description: \"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages\"\n })\n ),\n ...PlacementProps\n },\n {\n // Hoisted for the same reason as the raster branch above.\n $id: \"DocxVisualNativeProps\",\n description: 'Visual component props (native Word drawing group; requires renderer \"office-open\")',\n additionalProperties: false\n }\n);\nvar VisualPropsSchema = Type2.Union(\n [VisualRasterPropsSchema, VisualNativePropsSchema],\n {\n description: \"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group\"\n }\n);\nvar NATIVE_RENDER_MODE = \"native\";\nfunction isNativeVisualProps(props) {\n return !!props && props.renderMode === NATIVE_RENDER_MODE;\n}\n\n// src/schemas/renderer.ts\nvar DOCX_RENDERER_IDS = [\"docxjs\", \"office-open\"];\nvar DEFAULT_DOCX_RENDERER_ID = \"docxjs\";\nvar NATIVE_VISUAL_ELEMENTS = /* @__PURE__ */ new Set([\n \"text\",\n \"shape\",\n \"image\"\n]);\nfunction docxComponentDefinitionName(renderer) {\n return `ComponentDefinition_${renderer}`;\n}\nfunction docxFlowDefinitionName(renderer) {\n return renderer ? `FlowContent_${renderer}` : \"FlowContent\";\n}\nfunction docxPropsSchemaForRenderer(componentName, schema, renderer) {\n const copy = cloneSchema(schema);\n nameComponentPlaceholders(copy, docxComponentDefinitionName(renderer));\n if (componentName === \"visual\" && renderer !== \"office-open\") {\n return firstUnionBranch(copy) ?? copy;\n }\n if (renderer === \"office-open\") pruneThreadFields(copy);\n return copy;\n}\nfunction collectDocxRendererErrors(data) {\n if (!data || typeof data !== \"object\" || Array.isArray(data)) return [];\n const root = data;\n const renderer = root.renderer ?? DEFAULT_DOCX_RENDERER_ID;\n if (!DOCX_RENDERER_IDS.includes(renderer)) {\n return [\n {\n path: \"/renderer\",\n message: `Invalid renderer \"${String(renderer)}\". Expected \"docxjs\" or \"office-open\".`,\n code: \"invalid_value\"\n }\n ];\n }\n const errors = [];\n const isOfficeOpen = renderer === \"office-open\";\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n const object = node;\n if (isOfficeOpen) {\n const comment = object.comment;\n if (comment && typeof comment === \"object\" && !Array.isArray(comment)) {\n const value = comment;\n for (const field of [\"replies\", \"resolved\"]) {\n if (value[field] !== void 0) {\n errors.push({\n path: `${path}/comment/${field}`,\n message: `The \"office-open\" renderer does not support comment threads.`,\n code: \"unsupported_renderer_feature\"\n });\n }\n }\n }\n }\n if (object.name === \"visual\") {\n collectVisualErrors(object, `${path}`, isOfficeOpen, errors);\n }\n if (object.name === \"chart\" && !isOfficeOpen) {\n errors.push({\n path: `${path}/name`,\n 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.`,\n code: \"unsupported_renderer_feature\"\n });\n }\n for (const [key, value] of Object.entries(object)) {\n if (key !== \"renderer\") visit(value, `${path}/${key}`);\n }\n };\n visit(root, \"\");\n return errors;\n}\nfunction collectVisualErrors(node, path, isOfficeOpen, errors) {\n const props = node.props;\n if (!props || typeof props !== \"object\" || Array.isArray(props)) return;\n const value = props;\n if (value.renderMode !== NATIVE_RENDER_MODE) return;\n if (!isOfficeOpen) {\n errors.push({\n path: `${path}/props/renderMode`,\n message: `Only the \"office-open\" renderer draws a native visual. Set the document's \"renderer\" to \"office-open\", or drop \"renderMode\" to rasterize.`,\n code: \"unsupported_renderer_feature\"\n });\n return;\n }\n const elements = value.elements;\n if (!Array.isArray(elements)) return;\n elements.forEach((element, index) => {\n if (!element || typeof element !== \"object\" || Array.isArray(element)) {\n return;\n }\n const name = element.name;\n if (typeof name !== \"string\" || NATIVE_VISUAL_ELEMENTS.has(name)) return;\n errors.push({\n path: `${path}/props/elements/${index}/name`,\n message: `A native visual cannot draw \"${name}\". Native mode holds \"text\", \"shape\" and \"image\"; use renderMode \"raster\" for anything else.`,\n code: \"unsupported_renderer_feature\"\n });\n });\n}\nfunction firstUnionBranch(schema) {\n const branches = schema.anyOf;\n return Array.isArray(branches) && branches.length > 0 ? branches[0] : void 0;\n}\nfunction pruneThreadFields(node) {\n if (Array.isArray(node)) {\n node.forEach(pruneThreadFields);\n return;\n }\n if (!node || typeof node !== \"object\") return;\n const schema = node;\n const properties = schema.properties;\n if (properties?.text && properties?.author && (properties.replies || properties.resolved) && typeof schema.description === \"string\" && schema.description.includes(\"Word review comment\")) {\n delete properties.replies;\n delete properties.resolved;\n const required = schema.required;\n if (required) {\n schema.required = required.filter(\n (key) => key !== \"replies\" && key !== \"resolved\"\n );\n }\n }\n for (const key of Reflect.ownKeys(schema)) {\n pruneThreadFields(schema[key]);\n }\n}\nfunction nameComponentPlaceholders(node, definitionName) {\n if (Array.isArray(node)) {\n node.forEach((entry) => nameComponentPlaceholders(entry, definitionName));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n const schema = node;\n if (schema.type === \"array\" && schema.items && typeof schema.items === \"object\" && Object.keys(schema.items).length === 0 && schema.items[Kind] === \"Any\") {\n schema.items = { $ref: definitionName };\n }\n for (const key of Reflect.ownKeys(schema)) {\n nameComponentPlaceholders(schema[key], definitionName);\n }\n}\nfunction cloneSchema(value) {\n if (Array.isArray(value)) return value.map(cloneSchema);\n if (!value || typeof value !== \"object\") return value;\n const copy = Object.create(Object.getPrototypeOf(value));\n for (const key of Reflect.ownKeys(value)) {\n copy[key] = cloneSchema(value[key]);\n }\n return copy;\n}\n\nexport {\n NativeVisualColorSchema,\n NativeVisualOffsetSchema,\n NativeVisualExtentSchema,\n NativeVisualUnderlineSchema,\n NativeVisualTextRunSchema,\n NativeVisualTextSegmentSchema,\n NativeVisualFillSchema,\n NativeVisualLineSchema,\n NativeVisualAlignmentSchema,\n NativeVisualVerticalAlignmentSchema,\n NativeVisualMarginSchema,\n NativeVisualTextPropsSchema,\n NativeVisualShapePropsSchema,\n NativeVisualImagePropsSchema,\n NATIVE_VISUAL_ELEMENT_NAMES,\n NativeVisualElementSchema,\n NativeVisualCanvasSchema,\n VisualCanvasBackgroundSchema,\n VisualCanvasSchema,\n VisualRasterPropsSchema,\n VisualNativePropsSchema,\n VisualPropsSchema,\n NATIVE_RENDER_MODE,\n isNativeVisualProps,\n DOCX_RENDERER_IDS,\n DEFAULT_DOCX_RENDERER_ID,\n docxComponentDefinitionName,\n docxFlowDefinitionName,\n docxPropsSchemaForRenderer,\n collectDocxRendererErrors\n};\n//# sourceMappingURL=chunk-HDFGXHUB.js.map","import {\n DOCX_RENDERER_IDS,\n docxComponentDefinitionName\n} from \"./chunk-HDFGXHUB.js\";\n\n// src/schemas/block-authoring.ts\nimport {\n createBlockAuthoringSchema\n} from \"@json-to-office/shared\";\nfunction addDocxBlockAuthoringSchemas(schema) {\n const definitions = schema.definitions ?? {};\n const bodies = /* @__PURE__ */ new Map();\n for (const renderer of DOCX_RENDERER_IDS) {\n const name = docxComponentDefinitionName(renderer);\n if (definitions[name])\n bodies.set(\n renderer,\n createBlockAuthoringSchema(definitions, name, [\"docx\", \"section\"])\n );\n }\n const visit = (node) => {\n if (!node || typeof node !== \"object\") return;\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n const value = node;\n if (value.properties?.name?.const === \"docx\") {\n const body = bodies.get(value.properties.renderer?.const);\n const blocks = value.properties.props?.properties?.blocks?.patternProperties;\n if (body && blocks)\n for (const block of Object.values(blocks)) {\n block.properties.body.items = body;\n for (const part of [\"header\", \"footer\"])\n block.properties.section.properties[part].items = body;\n }\n }\n Object.values(value).forEach(visit);\n };\n visit(schema);\n}\nfunction docxDocumentBlockTargets(schema) {\n const definitions = schema.definitions ?? {};\n return DOCX_RENDERER_IDS.filter(\n (renderer) => definitions[docxComponentDefinitionName(renderer)]\n ).map((renderer) => {\n const name = docxComponentDefinitionName(renderer);\n return { name, componentRef: { $ref: `#/definitions/${name}` } };\n });\n}\n\nexport {\n addDocxBlockAuthoringSchemas,\n docxDocumentBlockTargets\n};\n//# sourceMappingURL=chunk-N3KCALAB.js.map","import {\n AlignmentSchema,\n FloatingPropertiesSchema,\n HeadingLevelSchema,\n IndentSchema,\n JustifiedAlignmentSchema,\n LineSpacingSchema,\n ListSpacingSchema,\n ParagraphIndentSchema,\n SpacingSchema,\n TabStopsSchema\n} from \"./chunk-FYJOHPU2.js\";\nimport {\n FontDefinitionSchema,\n HexColorOrTransparentSchema,\n HexColorSchema,\n LanguageSchema,\n NoProofSchema,\n NoProofWordsSchema\n} from \"./chunk-XRVPNHNS.js\";\n\n// src/schemas/component-defaults.ts\nimport { Type as Type12 } from \"@sinclair/typebox\";\n\n// src/schemas/components/heading.ts\nimport { Type as Type3 } from \"@sinclair/typebox\";\n\n// src/schemas/components/revision.ts\nimport { Type } from \"@sinclair/typebox\";\nvar RevisionSegmentSchema = Type.Object(\n {\n type: Type.Union(\n [Type.Literal(\"equal\"), Type.Literal(\"insert\"), Type.Literal(\"delete\")],\n {\n description: \"Segment kind: 'equal' renders as normal text, 'insert' as a tracked insertion, 'delete' as a tracked deletion\"\n }\n ),\n text: Type.String({\n description: \"Literal text of this segment (rendered without markdown)\"\n })\n },\n {\n description: \"A contiguous run of text sharing one revision state\",\n additionalProperties: false\n }\n);\nvar RevisionSchema = Type.Object(\n {\n author: Type.Optional(\n Type.String({\n description: 'Revision author shown in Word (default: \"json-to-office\")'\n })\n ),\n date: Type.Optional(\n Type.String({\n format: \"date-time\",\n description: \"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output\"\n })\n ),\n segments: Type.Array(RevisionSegmentSchema, {\n minItems: 1,\n description: \"Ordered text segments; concatenating equal+insert segments yields the new text, equal+delete the old text\"\n })\n },\n {\n description: \"Tracked-change data: renders the component text as native Word revisions (accept/reject in Word)\",\n additionalProperties: false\n }\n);\nvar RevisionMarkSchema = Type.Object(\n {\n type: Type.Union([Type.Literal(\"insert\"), Type.Literal(\"delete\")], {\n description: \"Whether the element was inserted or deleted\"\n }),\n author: Type.Optional(\n Type.String({\n description: 'Revision author shown in Word (default: \"json-to-office\")'\n })\n ),\n date: Type.Optional(\n Type.String({\n format: \"date-time\",\n description: \"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output\"\n })\n )\n },\n {\n description: \"Structural tracked change: the element itself was inserted or deleted\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/comment.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nvar CommentBodyFields = {\n text: Type2.String({\n minLength: 1,\n description: \"Comment body. Newlines split it into separate paragraphs in the comment pane.\"\n }),\n author: Type2.Optional(\n Type2.String({\n description: 'Comment author shown in Word (default: \"json-to-office\")'\n })\n ),\n initials: Type2.Optional(\n Type2.String({\n description: \"Author initials shown on the comment bubble (derived from the author when omitted)\"\n })\n ),\n date: Type2.Optional(\n Type2.String({\n format: \"date-time\",\n description: \"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output\"\n })\n )\n};\nvar CommentReplySchema = Type2.Object(CommentBodyFields, {\n description: \"A reply within a comment thread\",\n additionalProperties: false\n});\nvar CommentSchema = Type2.Object(\n {\n ...CommentBodyFields,\n replies: Type2.Optional(\n Type2.Array(CommentReplySchema, {\n minItems: 1,\n description: \"Replies, in order. They anchor to the same text and Word shows them as one thread.\"\n })\n ),\n resolved: Type2.Optional(\n Type2.Boolean({\n description: \"Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply.\"\n })\n )\n },\n {\n description: \"A Word review comment anchored to this component's text\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/heading.ts\nvar HeadingPropsSchema = Type3.Object(\n {\n text: Type3.String({\n description: \"Heading text (required)\"\n }),\n level: Type3.Optional(HeadingLevelSchema),\n // Local font override: allows customizing family/size/color/bold/italic/underline\n // without modifying theme styles. Supports partial overrides.\n font: Type3.Optional(Type3.Partial(FontDefinitionSchema)),\n // Local language override (BCP-47). Falls back to the document default when omitted.\n language: Type3.Optional(LanguageSchema),\n // Disable spell/grammar checking for this heading's text\n noProof: Type3.Optional(NoProofSchema),\n // Known-words allowlist for this heading (merged with the document list)\n noProofWords: Type3.Optional(NoProofWordsSchema),\n alignment: Type3.Optional(JustifiedAlignmentSchema),\n spacing: Type3.Optional(SpacingSchema),\n // Paragraph indentation (w:ind) in twips\n indent: Type3.Optional(ParagraphIndentSchema),\n lineSpacing: Type3.Optional(\n Type3.Union([Type3.Number({ minimum: 0 }), LineSpacingSchema], {\n 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.\"\n })\n ),\n pageBreak: Type3.Optional(\n Type3.Boolean({\n description: \"Insert page break before heading\"\n })\n ),\n columnBreak: Type3.Optional(\n Type3.Boolean({\n description: \"Insert column break before heading\"\n })\n ),\n numbering: Type3.Optional(\n Type3.Boolean({\n 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.\"\n })\n ),\n keepNext: Type3.Optional(\n Type3.Boolean({\n description: \"Keep heading with next paragraph on same page\"\n })\n ),\n keepLines: Type3.Optional(\n Type3.Boolean({\n description: \"Keep all lines of heading together on same page\"\n })\n ),\n revision: Type3.Optional(RevisionSchema),\n comment: Type3.Optional(CommentSchema)\n },\n {\n description: \"Heading component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/paragraph.ts\nimport { Type as Type5 } from \"@sinclair/typebox\";\n\n// src/schemas/components/note.ts\nimport { Type as Type4 } from \"@sinclair/typebox\";\nvar NoteSchema = Type4.Object(\n {\n id: Type4.String({\n minLength: 1,\n pattern: \"^[^\\\\]\\\\s]+$\",\n description: 'Marker id referenced from the text as `[^id]`. Any characters except whitespace and \"]\".'\n }),\n text: Type4.String({\n minLength: 1,\n description: \"Note body. Newlines split it into separate paragraphs where the note is placed.\"\n })\n },\n {\n description: \"A note body bound to an inline `[^id]` marker\",\n additionalProperties: false\n }\n);\nvar FootnotesSchema = Type4.Array(NoteSchema, {\n description: \"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.\",\n minItems: 1\n});\nvar EndnotesSchema = Type4.Array(NoteSchema, {\n description: \"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.\",\n minItems: 1\n});\n\n// src/schemas/components/paragraph.ts\nvar FrameWrapTypeSchema = Type5.Union(\n [\n Type5.Literal(\"around\"),\n Type5.Literal(\"none\"),\n Type5.Literal(\"notBeside\"),\n Type5.Literal(\"through\"),\n Type5.Literal(\"tight\"),\n Type5.Literal(\"auto\")\n ],\n {\n description: \"Frame text wrapping type\"\n }\n);\nvar FrameAnchorTypeSchema = Type5.Union(\n [Type5.Literal(\"margin\"), Type5.Literal(\"page\"), Type5.Literal(\"text\")],\n {\n description: \"Frame anchor type\"\n }\n);\nvar FrameHorizontalAlignSchema = Type5.Union(\n [\n Type5.Literal(\"left\"),\n Type5.Literal(\"center\"),\n Type5.Literal(\"right\"),\n Type5.Literal(\"inside\"),\n Type5.Literal(\"outside\")\n ],\n {\n description: \"Frame horizontal alignment\"\n }\n);\nvar FrameVerticalAlignSchema = Type5.Union(\n [\n Type5.Literal(\"top\"),\n Type5.Literal(\"center\"),\n Type5.Literal(\"bottom\"),\n Type5.Literal(\"inside\"),\n Type5.Literal(\"outside\")\n ],\n {\n description: \"Frame vertical alignment\"\n }\n);\nvar FloatingFramePropertiesSchema = Type5.Object(\n {\n horizontalPosition: Type5.Optional(\n Type5.Object(\n {\n relative: Type5.Optional(FrameAnchorTypeSchema),\n align: Type5.Optional(FrameHorizontalAlignSchema),\n offset: Type5.Optional(\n Type5.Union([\n Type5.Number({\n description: \"Horizontal offset in twips (1/20 of a point)\"\n }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Horizontal offset as percentage (e.g., \"50%\") relative to page or margin width'\n })\n ])\n )\n },\n {\n description: \"Horizontal positioning (use either align or offset, not both)\",\n additionalProperties: false\n }\n )\n ),\n verticalPosition: Type5.Optional(\n Type5.Object(\n {\n relative: Type5.Optional(FrameAnchorTypeSchema),\n align: Type5.Optional(FrameVerticalAlignSchema),\n offset: Type5.Optional(\n Type5.Union([\n Type5.Number({\n description: \"Vertical offset in twips (1/20 of a point)\"\n }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Vertical offset as percentage (e.g., \"50%\") relative to page or margin height'\n })\n ])\n )\n },\n {\n description: \"Vertical positioning (use either align or offset, not both)\",\n additionalProperties: false\n }\n )\n ),\n wrap: Type5.Optional(\n Type5.Object(\n {\n type: FrameWrapTypeSchema\n },\n {\n description: \"Text wrapping configuration\",\n additionalProperties: false\n }\n )\n ),\n lockAnchor: Type5.Optional(\n Type5.Boolean({\n description: \"Lock the anchor position\"\n })\n ),\n width: Type5.Optional(\n Type5.Number({\n minimum: 1,\n description: \"Frame width in twips (DXA units)\"\n })\n ),\n height: Type5.Optional(\n Type5.Number({\n minimum: 1,\n description: \"Frame height in twips (DXA units)\"\n })\n )\n },\n {\n description: \"Floating text frame properties\",\n additionalProperties: false\n }\n);\nvar AlignmentSchema2 = Type5.Union(\n [\n Type5.Literal(\"left\"),\n Type5.Literal(\"center\"),\n Type5.Literal(\"right\"),\n Type5.Literal(\"justify\")\n ],\n {\n description: \"Paragraph text alignment\"\n }\n);\nvar ParagraphPropsSchema = Type5.Object(\n {\n text: Type5.String({\n description: \"Text content (required)\"\n }),\n // New nested font object, aligned with theme's FontDefinitionSchema\n // Allow partial overrides (family not required when overriding a subset)\n font: Type5.Optional(Type5.Partial(FontDefinitionSchema)),\n // Optional reference to a named style from theme.styles (e.g., 'heading1', 'normal')\n themeStyle: Type5.Optional(Type5.String()),\n // Local language override (BCP-47). Falls back to the document default when omitted.\n language: Type5.Optional(LanguageSchema),\n // Disable spell/grammar checking for this paragraph's text\n noProof: Type5.Optional(NoProofSchema),\n // Known-words allowlist for this paragraph (merged with the document list)\n noProofWords: Type5.Optional(NoProofWordsSchema),\n // Rich-text decoration color for bold segments (kept as top-level behavior\n // option). Same value space as font.color: hex or theme color token.\n boldColor: Type5.Optional(HexColorSchema),\n // Paragraph spacing (in points) — limited paragraph-level option allowed\n spacing: Type5.Optional(SpacingSchema),\n // Paragraph alignment (moved from font to config level)\n alignment: Type5.Optional(AlignmentSchema2),\n // Paragraph indentation (w:ind) in twips\n indent: Type5.Optional(ParagraphIndentSchema),\n // Tab stops (w:tabs); tab characters (\\t) in text jump to these positions\n tabStops: Type5.Optional(TabStopsSchema),\n pageBreak: Type5.Optional(\n Type5.Boolean({\n description: \"Insert page break before paragraph\"\n })\n ),\n columnBreak: Type5.Optional(\n Type5.Boolean({\n description: \"Insert column break before paragraph\"\n })\n ),\n floating: Type5.Optional(FloatingFramePropertiesSchema),\n keepNext: Type5.Optional(\n Type5.Boolean({\n description: \"Keep paragraph with next paragraph on same page\"\n })\n ),\n keepLines: Type5.Optional(\n Type5.Boolean({\n description: \"Keep all lines of paragraph together on same page\"\n })\n ),\n id: Type5.Optional(\n Type5.String({\n description: \"Unique identifier for internal linking (bookmark anchor)\"\n })\n ),\n revision: Type5.Optional(RevisionSchema),\n comment: Type5.Optional(CommentSchema),\n footnotes: Type5.Optional(FootnotesSchema),\n endnotes: Type5.Optional(EndnotesSchema)\n },\n {\n description: \"Paragraph component props (font nested for theme consistency; no flat font properties)\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/image.ts\nimport { Type as Type6 } from \"@sinclair/typebox\";\nvar ImagePropsSchema = Type6.Object(\n {\n path: Type6.Optional(\n Type6.String({\n description: \"Image source URL or file path (mutually exclusive with base64 and svg)\"\n })\n ),\n base64: Type6.Optional(\n Type6.String({\n description: 'Base64-encoded image data in data URI format (e.g., \"data:image/png;base64,iVBORw0KGgo...\") (mutually exclusive with path and svg)'\n })\n ),\n svg: Type6.Optional(\n Type6.String({\n 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.'\n })\n ),\n alt: Type6.Optional(\n Type6.String({\n description: \"Alternative text for accessibility\"\n })\n ),\n width: Type6.Optional(\n Type6.Union(\n [\n Type6.Number({\n minimum: 1,\n description: \"Image width in pixels\"\n }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Image width as percentage (e.g., \"90%\") relative to widthRelativeTo (defaults to content width)'\n })\n ],\n {\n description: 'Image width in pixels (number) or as percentage string (e.g., \"90%\")',\n default: \"100%\"\n }\n )\n ),\n height: Type6.Optional(\n Type6.Union(\n [\n Type6.Number({\n minimum: 1,\n description: \"Image height in pixels\"\n }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Image height as percentage (e.g., \"90%\") relative to heightRelativeTo (defaults to content height)'\n })\n ],\n {\n description: 'Image height in pixels (number) or as percentage string (e.g., \"90%\")'\n }\n )\n ),\n widthRelativeTo: Type6.Optional(\n Type6.Union([Type6.Literal(\"content\"), Type6.Literal(\"page\")], {\n description: \"Reference for width percentages: content (page width minus margins) or page (full page width)\",\n default: \"content\"\n })\n ),\n heightRelativeTo: Type6.Optional(\n Type6.Union([Type6.Literal(\"content\"), Type6.Literal(\"page\")], {\n description: \"Reference for height percentages: content (page height minus margins) or page (full page height)\",\n default: \"content\"\n })\n ),\n alignment: Type6.Optional(AlignmentSchema),\n caption: Type6.Optional(\n Type6.String({\n description: \"Image caption (supports rich text with **bold**, *italic*, ***both***)\"\n })\n ),\n spacing: Type6.Optional(SpacingSchema),\n floating: Type6.Optional(FloatingPropertiesSchema),\n keepNext: Type6.Optional(\n Type6.Boolean({\n description: \"Keep paragraph with next paragraph on same page\"\n })\n ),\n keepLines: Type6.Optional(\n Type6.Boolean({\n description: \"Keep all lines of paragraph together on same page\"\n })\n )\n },\n {\n description: \"Image component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/statistic.ts\nimport { Type as Type7 } from \"@sinclair/typebox\";\nvar StatisticPropsSchema = Type7.Object(\n {\n number: Type7.String({\n description: \"Statistic number/value (required)\"\n }),\n description: Type7.String({\n description: \"Statistic description (required)\"\n }),\n unit: Type7.Optional(\n Type7.String({\n description: \"Unit of measurement\"\n })\n ),\n format: Type7.Optional(\n Type7.String({\n description: \"Number format pattern\"\n })\n ),\n trend: Type7.Optional(\n Type7.Union([\n Type7.Literal(\"up\"),\n Type7.Literal(\"down\"),\n Type7.Literal(\"neutral\")\n ])\n ),\n trendValue: Type7.Optional(Type7.Union([Type7.String(), Type7.Number()])),\n alignment: Type7.Optional(AlignmentSchema),\n spacing: Type7.Optional(SpacingSchema),\n size: Type7.Optional(\n Type7.Union([\n Type7.Literal(\"small\"),\n Type7.Literal(\"medium\"),\n Type7.Literal(\"large\")\n ])\n )\n },\n {\n description: \"Statistic component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/table.ts\nimport { Type as Type8 } from \"@sinclair/typebox\";\nvar CellContentSchema = Type8.Recursive(\n (This) => Type8.Union([\n Type8.String(),\n Type8.Object(\n {\n name: Type8.String(),\n props: Type8.Object({}, { additionalProperties: true }),\n children: Type8.Optional(Type8.Array(This))\n },\n { additionalProperties: false }\n )\n ])\n);\nvar HorizontalAlignmentSchema = Type8.Union(\n [\n Type8.Literal(\"left\"),\n Type8.Literal(\"center\"),\n Type8.Literal(\"right\"),\n Type8.Literal(\"justify\")\n ],\n { description: \"Horizontal text alignment\" }\n);\nvar VerticalAlignmentSchema = Type8.Union(\n [Type8.Literal(\"top\"), Type8.Literal(\"middle\"), Type8.Literal(\"bottom\")],\n { description: \"Vertical cell alignment\" }\n);\nvar FontConfigSchema = Type8.Object(\n {\n family: Type8.Optional(Type8.String({ description: \"Font family name\" })),\n size: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Font size in points\" })\n ),\n bold: Type8.Optional(Type8.Boolean({ description: \"Bold text\" })),\n fontWeight: Type8.Optional(\n Type8.Integer({\n minimum: 100,\n maximum: 900,\n description: \"Per-cell weight (100\\u2013900). Overrides `bold` when set.\"\n })\n ),\n italic: Type8.Optional(Type8.Boolean({ description: \"Italic text\" })),\n underline: Type8.Optional(Type8.Boolean({ description: \"Underlined text\" })),\n lineSpacing: Type8.Optional(\n Type8.Object(\n { ...LineSpacingSchema.properties },\n {\n description: \"Line spacing of the cell's paragraph. Overrides the theme's tableCell style; `exactly` gives dense, fixed-height rows.\",\n additionalProperties: false\n }\n )\n )\n },\n { additionalProperties: false }\n);\nvar BorderColorSchema = Type8.Union([\n Type8.String({ description: \"Border color for all sides (hex without #)\" }),\n Type8.Object(\n {\n bottom: Type8.Optional(\n Type8.String({ description: \"Bottom border color (hex without #)\" })\n ),\n top: Type8.Optional(\n Type8.String({ description: \"Top border color (hex without #)\" })\n ),\n right: Type8.Optional(\n Type8.String({ description: \"Right border color (hex without #)\" })\n ),\n left: Type8.Optional(\n Type8.String({ description: \"Left border color (hex without #)\" })\n )\n },\n { additionalProperties: false }\n )\n]);\nvar BorderSizeSchema = Type8.Union([\n Type8.Number({\n minimum: 0,\n description: \"Border size for all sides in points\"\n }),\n Type8.Object(\n {\n bottom: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Bottom border size in points\" })\n ),\n top: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Top border size in points\" })\n ),\n right: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Right border size in points\" })\n ),\n left: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Left border size in points\" })\n )\n },\n { additionalProperties: false }\n )\n]);\nvar HideBordersSchema = Type8.Union([\n Type8.Boolean({\n description: \"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border\"\n }),\n Type8.Object(\n {\n bottom: Type8.Optional(\n Type8.Boolean({ description: \"Hide bottom border\" })\n ),\n top: Type8.Optional(Type8.Boolean({ description: \"Hide top border\" })),\n right: Type8.Optional(Type8.Boolean({ description: \"Hide right border\" })),\n left: Type8.Optional(Type8.Boolean({ description: \"Hide left border\" })),\n insideHorizontal: Type8.Optional(\n Type8.Boolean({ description: \"Hide horizontal borders between rows\" })\n ),\n insideVertical: Type8.Optional(\n Type8.Boolean({ description: \"Hide vertical borders between columns\" })\n )\n },\n {\n description: \"Selectively hide specific borders\",\n additionalProperties: false\n }\n )\n]);\nvar PaddingSchema = Type8.Union([\n Type8.Number({ minimum: 0, description: \"Padding for all sides in points\" }),\n Type8.Object(\n {\n bottom: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Bottom padding in points\" })\n ),\n top: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Top padding in points\" })\n ),\n right: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Right padding in points\" })\n ),\n left: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Left padding in points\" })\n )\n },\n { additionalProperties: false }\n )\n]);\nvar CellDefaultsSchema = Type8.Object(\n {\n color: Type8.Optional(HexColorSchema),\n backgroundColor: Type8.Optional(HexColorOrTransparentSchema),\n horizontalAlignment: Type8.Optional(HorizontalAlignmentSchema),\n verticalAlignment: Type8.Optional(VerticalAlignmentSchema),\n font: Type8.Optional(FontConfigSchema),\n borderColor: Type8.Optional(BorderColorSchema),\n borderSize: Type8.Optional(BorderSizeSchema),\n padding: Type8.Optional(PaddingSchema),\n height: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Cell height in points\" })\n )\n },\n { additionalProperties: false }\n);\nfunction createTablePropsSchema(componentRef) {\n const cellContent = Type8.Union([Type8.String(), componentRef]);\n const cellFields = {\n color: Type8.Optional(HexColorSchema),\n backgroundColor: Type8.Optional(HexColorOrTransparentSchema),\n horizontalAlignment: Type8.Optional(HorizontalAlignmentSchema),\n verticalAlignment: Type8.Optional(VerticalAlignmentSchema),\n font: Type8.Optional(FontConfigSchema),\n borderColor: Type8.Optional(BorderColorSchema),\n borderSize: Type8.Optional(BorderSizeSchema),\n padding: Type8.Optional(PaddingSchema),\n height: Type8.Optional(\n Type8.Number({ minimum: 0, description: \"Cell height in points\" })\n ),\n comment: Type8.Optional(CommentSchema),\n revision: Type8.Optional(RevisionSchema)\n };\n const headerSchema = Type8.Object(\n {\n ...cellFields,\n content: Type8.Optional(cellContent)\n },\n { additionalProperties: false }\n );\n const cellSchema = Type8.Object(\n {\n ...cellFields,\n content: Type8.Optional(cellContent)\n },\n { additionalProperties: false }\n );\n const columnSchema = Type8.Object(\n {\n width: Type8.Optional(\n Type8.Union([\n Type8.Number({\n minimum: 0,\n description: \"Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns.\"\n }),\n Type8.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Column width as percentage of available width (e.g., \"40%\")'\n })\n ])\n ),\n cellDefaults: Type8.Optional(CellDefaultsSchema),\n header: Type8.Optional(headerSchema),\n cells: Type8.Optional(Type8.Array(cellSchema))\n },\n { additionalProperties: false }\n );\n return Type8.Object(\n {\n borderColor: Type8.Optional(BorderColorSchema),\n borderSize: Type8.Optional(BorderSizeSchema),\n hideBorders: Type8.Optional(HideBordersSchema),\n cellDefaults: Type8.Optional(CellDefaultsSchema),\n headerCellDefaults: Type8.Optional(CellDefaultsSchema),\n width: Type8.Optional(\n Type8.Number({\n minimum: 0,\n maximum: 100,\n description: \"Table width in percentage (0-100)\"\n })\n ),\n columns: Type8.Array(columnSchema, {\n description: \"Table columns with headers and cells\",\n minItems: 1\n }),\n rows: Type8.Optional(\n Type8.Array(\n Type8.Object(\n {\n revision: Type8.Optional(RevisionMarkSchema),\n cantSplit: Type8.Optional(\n Type8.Boolean({\n description: \"Keep this row on one page\"\n })\n ),\n tableHeader: Type8.Optional(\n Type8.Boolean({\n description: \"Repeat this row as a header on each page\"\n })\n )\n },\n { additionalProperties: false }\n ),\n {\n description: \"Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here.\"\n }\n )\n ),\n keepInOnePage: Type8.Optional(\n Type8.Boolean({\n description: \"Keep table rows together on the same page by setting keepNext on all paragraphs\"\n })\n ),\n keepNext: Type8.Optional(\n Type8.Boolean({\n description: \"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false.\"\n })\n ),\n repeatHeaderOnPageBreak: Type8.Optional(\n Type8.Boolean({\n description: \"Repeat the header row on each page when the table spans multiple pages. Defaults to true.\",\n default: true\n })\n )\n },\n {\n description: \"Table component props with column-based structure\",\n additionalProperties: false\n }\n );\n}\nvar TablePropsSchema = createTablePropsSchema(CellContentSchema);\n\n// src/schemas/components/section.ts\nimport { Type as Type9 } from \"@sinclair/typebox\";\nvar createSectionPropsSchema = (componentRef) => Type9.Object(\n {\n meta: Type9.Optional(\n Type9.Object(\n {\n title: Type9.Optional(\n Type9.String({\n description: \"Authoring label for this section, shown in editors and outlines. Never rendered \\u2014 add a heading child for a visible title.\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"Authoring metadata; has no effect on the document.\"\n }\n )\n ),\n header: Type9.Optional(\n Type9.Union([\n Type9.Array(componentRef || Type9.Any(), {\n description: \"Section header components\"\n }),\n Type9.Literal(\"linkToPrevious\", {\n description: \"Link header to previous section\"\n })\n ])\n ),\n footer: Type9.Optional(\n Type9.Union([\n Type9.Array(componentRef || Type9.Any(), {\n description: \"Section footer components\"\n }),\n Type9.Literal(\"linkToPrevious\", {\n description: \"Link footer to previous section\"\n })\n ])\n ),\n pageBreak: Type9.Optional(\n Type9.Boolean({\n description: \"Insert page break before section\",\n default: true\n })\n ),\n spacing: Type9.Optional(SpacingSchema),\n page: Type9.Optional(\n Type9.Object(\n {\n size: Type9.Optional(\n Type9.Union([\n Type9.Literal(\"A4\"),\n Type9.Literal(\"A3\"),\n Type9.Literal(\"LETTER\"),\n Type9.Literal(\"LEGAL\"),\n Type9.Object({\n width: Type9.Number({ minimum: 0 }),\n height: Type9.Number({ minimum: 0 })\n })\n ])\n ),\n margins: Type9.Optional(\n Type9.Object(\n {\n top: Type9.Optional(Type9.Number({ minimum: 0 })),\n bottom: Type9.Optional(Type9.Number({ minimum: 0 })),\n left: Type9.Optional(Type9.Number({ minimum: 0 })),\n right: Type9.Optional(Type9.Number({ minimum: 0 })),\n header: Type9.Optional(Type9.Number({ minimum: 0 })),\n footer: Type9.Optional(Type9.Number({ minimum: 0 })),\n gutter: Type9.Optional(Type9.Number({ minimum: 0 }))\n },\n {\n additionalProperties: false\n }\n )\n )\n },\n {\n description: \"Page configuration override for this section (overrides theme page settings)\",\n additionalProperties: false\n }\n )\n )\n },\n {\n description: \"Section component props\",\n additionalProperties: false\n }\n);\nvar SectionPropsSchema = createSectionPropsSchema();\n\n// src/schemas/components/columns.ts\nimport { Type as Type10 } from \"@sinclair/typebox\";\nvar ColumnDescriptorSchema = Type10.Object(\n {\n width: Type10.Optional(\n Type10.Union([\n Type10.Number({\n minimum: 1,\n description: \"Column width in points\"\n }),\n Type10.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Column width as percentage of available width (e.g., \"30%\")'\n }),\n Type10.Literal(\"auto\", {\n description: \"Auto width: consume remaining space after fixed widths and gaps\"\n })\n ])\n ),\n gap: Type10.Optional(\n Type10.Union([\n Type10.Number({\n minimum: 0,\n description: \"Gap after this column in points\"\n }),\n Type10.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Gap after this column as percentage of available width (e.g., \"5%\")'\n })\n ])\n )\n },\n { additionalProperties: false }\n);\nvar ColumnsPropsSchema = Type10.Object(\n {\n columns: Type10.Union([\n Type10.Number({\n minimum: 1,\n description: \"Number of equal-width columns (converter will normalize to array)\"\n }),\n Type10.Array(ColumnDescriptorSchema, {\n minItems: 1,\n description: \"List of columns in order; width and gap can be points, percentages, or auto width\"\n })\n ]),\n gap: Type10.Optional(\n Type10.Union([\n Type10.Number({\n minimum: 0,\n description: \"Default gap applied after each column except the last (points)\"\n }),\n Type10.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Default gap applied after each column except the last as percentage of available width (e.g., \"5%\")'\n })\n ])\n )\n },\n {\n description: \"Columns component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/list.ts\nimport { Type as Type11 } from \"@sinclair/typebox\";\nvar LevelFormatSchema = Type11.Union(\n [\n Type11.Literal(\"decimal\"),\n Type11.Literal(\"upperRoman\"),\n Type11.Literal(\"lowerRoman\"),\n Type11.Literal(\"upperLetter\"),\n Type11.Literal(\"lowerLetter\"),\n Type11.Literal(\"bullet\"),\n Type11.Literal(\"ordinal\"),\n Type11.Literal(\"cardinalText\"),\n Type11.Literal(\"ordinalText\"),\n Type11.Literal(\"hex\"),\n Type11.Literal(\"chicago\"),\n Type11.Literal(\"ideographDigital\"),\n Type11.Literal(\"japaneseCounting\"),\n Type11.Literal(\"aiueo\"),\n Type11.Literal(\"iroha\"),\n Type11.Literal(\"decimalFullWidth\"),\n Type11.Literal(\"decimalHalfWidth\"),\n Type11.Literal(\"japaneseLegal\"),\n Type11.Literal(\"japaneseDigitalTenThousand\"),\n Type11.Literal(\"decimalEnclosedCircle\"),\n Type11.Literal(\"decimalFullWidth2\"),\n Type11.Literal(\"aiueoFullWidth\"),\n Type11.Literal(\"irohaFullWidth\"),\n Type11.Literal(\"decimalZero\"),\n Type11.Literal(\"ganada\"),\n Type11.Literal(\"chosung\"),\n Type11.Literal(\"decimalEnclosedFullstop\"),\n Type11.Literal(\"decimalEnclosedParen\"),\n Type11.Literal(\"decimalEnclosedCircleChinese\"),\n Type11.Literal(\"ideographEnclosedCircle\"),\n Type11.Literal(\"ideographTraditional\"),\n Type11.Literal(\"ideographZodiac\"),\n Type11.Literal(\"ideographZodiacTraditional\"),\n Type11.Literal(\"taiwaneseCounting\"),\n Type11.Literal(\"ideographLegalTraditional\"),\n Type11.Literal(\"taiwaneseCountingThousand\"),\n Type11.Literal(\"taiwaneseDigital\"),\n Type11.Literal(\"chineseCounting\"),\n Type11.Literal(\"chineseLegalSimplified\"),\n Type11.Literal(\"chineseCountingThousand\"),\n Type11.Literal(\"koreanDigital\"),\n Type11.Literal(\"koreanCounting\"),\n Type11.Literal(\"koreanLegal\"),\n Type11.Literal(\"koreanDigital2\"),\n Type11.Literal(\"vietnameseCounting\"),\n Type11.Literal(\"russianLower\"),\n Type11.Literal(\"russianUpper\"),\n Type11.Literal(\"none\"),\n Type11.Literal(\"numberInDash\"),\n Type11.Literal(\"hebrew1\"),\n Type11.Literal(\"hebrew2\"),\n Type11.Literal(\"arabicAlpha\"),\n Type11.Literal(\"arabicAbjad\"),\n Type11.Literal(\"hindiVowels\"),\n Type11.Literal(\"hindiConsonants\"),\n Type11.Literal(\"hindiNumbers\"),\n Type11.Literal(\"hindiCounting\"),\n Type11.Literal(\"thaiLetters\"),\n Type11.Literal(\"thaiNumbers\"),\n Type11.Literal(\"thaiCounting\")\n ],\n {\n description: \"Number or bullet format for list levels\"\n }\n);\nvar ListMarkerFontSchema = Type11.Object(\n {\n family: Type11.Optional(Type11.String({ description: \"Font family name\" })),\n size: Type11.Optional(\n Type11.Number({ minimum: 1, description: \"Marker size in points\" })\n ),\n color: Type11.Optional(HexColorSchema),\n bold: Type11.Optional(Type11.Boolean({ description: \"Bold marker\" })),\n italic: Type11.Optional(Type11.Boolean({ description: \"Italic marker\" })),\n underline: Type11.Optional(\n Type11.Boolean({ description: \"Underlined marker\" })\n )\n },\n {\n description: \"Styling for the number/bullet glyph only. The list text is unaffected.\",\n additionalProperties: false\n }\n);\nvar ListLevelPropsSchema = Type11.Object(\n {\n level: Type11.Number({\n minimum: 0,\n maximum: 8,\n description: \"Nesting level (0 = root, 1 = first sublevel, etc.)\"\n }),\n format: Type11.Optional(LevelFormatSchema),\n text: Type11.Optional(\n Type11.String({\n description: 'Number format string (e.g., \"%1.\" for \"1.\", \"%1)\" for \"1)\", custom bullet character for bullet format)'\n })\n ),\n alignment: Type11.Optional(\n Type11.Union(\n [\n Type11.Literal(\"start\"),\n Type11.Literal(\"end\"),\n Type11.Literal(\"left\"),\n Type11.Literal(\"right\"),\n Type11.Literal(\"center\")\n ],\n {\n description: \"Alignment of the numbering/bullet\"\n }\n )\n ),\n indent: Type11.Optional(IndentSchema),\n start: Type11.Optional(\n Type11.Number({\n minimum: 1,\n description: \"Starting number for this level (default: 1)\"\n })\n ),\n font: Type11.Optional(ListMarkerFontSchema)\n },\n {\n description: \"Configuration for a single list level\",\n additionalProperties: false\n }\n);\nvar ListPropsSchema = Type11.Object(\n {\n items: Type11.Array(\n Type11.Union([\n Type11.String(),\n Type11.Object(\n {\n text: Type11.String(),\n level: Type11.Optional(\n Type11.Number({\n minimum: 0,\n maximum: 8,\n description: \"Nesting level for this item\"\n })\n ),\n id: Type11.Optional(\n Type11.String({\n description: \"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])\"\n })\n ),\n revision: Type11.Optional(RevisionSchema)\n },\n { additionalProperties: false }\n )\n ]),\n {\n description: \"List items (required)\",\n minItems: 1\n }\n ),\n reference: Type11.Optional(\n Type11.String({\n description: \"Unique reference ID for this numbering configuration (auto-generated if not provided)\"\n })\n ),\n levels: Type11.Optional(\n Type11.Array(ListLevelPropsSchema, {\n description: \"Configuration for each nesting level\",\n minItems: 1,\n maxItems: 9\n })\n ),\n // Simplified options for common use cases (when levels not specified)\n format: Type11.Optional(\n Type11.Union(\n [LevelFormatSchema, Type11.Literal(\"numbered\"), Type11.Literal(\"none\")],\n {\n description: \"Format for level 0 (simplified option when levels not specified)\"\n }\n )\n ),\n bullet: Type11.Optional(\n Type11.String({\n description: \"Custom bullet character (simplified option when levels not specified)\"\n })\n ),\n start: Type11.Optional(\n Type11.Number({\n minimum: 1,\n description: \"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins.\"\n })\n ),\n // Base run style for every item's text, same shape as the paragraph's.\n // Inline decorators in an item still layer on top of it. Distinct from a\n // level's `font`, which styles the marker glyph and nothing else.\n font: Type11.Optional(Type11.Partial(FontDefinitionSchema)),\n spacing: Type11.Optional(ListSpacingSchema),\n alignment: Type11.Optional(JustifiedAlignmentSchema),\n keepNext: Type11.Optional(\n Type11.Boolean({\n description: \"Keep every item with what follows, so the list stays with the text that introduces it\"\n })\n ),\n keepLines: Type11.Optional(\n Type11.Boolean({\n description: \"Keep all lines of each item together on the same page\"\n })\n ),\n indent: Type11.Optional(\n Type11.Union([Type11.Number({ minimum: 0 }), IndentSchema])\n ),\n // Anchored to the list as a whole: the range opens on the first rendered\n // item and closes on the last.\n comment: Type11.Optional(CommentSchema)\n },\n {\n description: \"List component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/component-defaults.ts\nvar PER_INSTANCE_PROPS = [\n \"revision\",\n \"comment\",\n \"footnotes\",\n \"endnotes\"\n];\nvar HeadingComponentDefaultsSchema = Type12.Partial(\n Type12.Omit(HeadingPropsSchema, PER_INSTANCE_PROPS)\n);\nvar ParagraphComponentDefaultsSchema = Type12.Partial(\n Type12.Omit(ParagraphPropsSchema, PER_INSTANCE_PROPS)\n);\nvar ImageComponentDefaultsSchema = Type12.Partial(ImagePropsSchema);\nvar StatisticComponentDefaultsSchema = Type12.Partial(StatisticPropsSchema);\nvar TableComponentDefaultsSchema = Type12.Partial(\n Type12.Omit(TablePropsSchema, [\"rows\"])\n);\nvar SectionComponentDefaultsSchema = Type12.Partial(SectionPropsSchema);\nvar ColumnsComponentDefaultsSchema = Type12.Partial(ColumnsPropsSchema);\nvar ListComponentDefaultsSchema = Type12.Partial(\n Type12.Omit(ListPropsSchema, PER_INSTANCE_PROPS)\n);\nvar ComponentDefaultsSchema = Type12.Object(\n {\n heading: Type12.Optional(HeadingComponentDefaultsSchema),\n paragraph: Type12.Optional(ParagraphComponentDefaultsSchema),\n image: Type12.Optional(ImageComponentDefaultsSchema),\n statistic: Type12.Optional(StatisticComponentDefaultsSchema),\n table: Type12.Optional(TableComponentDefaultsSchema),\n section: Type12.Optional(SectionComponentDefaultsSchema),\n columns: Type12.Optional(ColumnsComponentDefaultsSchema),\n list: Type12.Optional(ListComponentDefaultsSchema)\n },\n { additionalProperties: true }\n // TODO: add a way to add strict custom component defaults when the plugin/registry paradigm will be implemented\n);\n\nexport {\n RevisionSegmentSchema,\n RevisionSchema,\n RevisionMarkSchema,\n CommentReplySchema,\n CommentSchema,\n HeadingPropsSchema,\n NoteSchema,\n FootnotesSchema,\n EndnotesSchema,\n ParagraphPropsSchema,\n ImagePropsSchema,\n StatisticPropsSchema,\n createTablePropsSchema,\n TablePropsSchema,\n createSectionPropsSchema,\n SectionPropsSchema,\n ColumnsPropsSchema,\n LevelFormatSchema,\n ListMarkerFontSchema,\n ListLevelPropsSchema,\n ListPropsSchema,\n PER_INSTANCE_PROPS,\n HeadingComponentDefaultsSchema,\n ParagraphComponentDefaultsSchema,\n ImageComponentDefaultsSchema,\n StatisticComponentDefaultsSchema,\n TableComponentDefaultsSchema,\n SectionComponentDefaultsSchema,\n ColumnsComponentDefaultsSchema,\n ListComponentDefaultsSchema,\n ComponentDefaultsSchema\n};\n//# sourceMappingURL=chunk-W6KB2SMK.js.map","import {\n ComponentDefaultsSchema\n} from \"./chunk-W6KB2SMK.js\";\nimport {\n IndentSchema\n} from \"./chunk-FYJOHPU2.js\";\nimport {\n FontDefinitionSchema,\n HexColorSchema,\n TextFormattingPropertiesSchema\n} from \"./chunk-XRVPNHNS.js\";\n\n// src/schemas/theme.ts\nimport { Type } from \"@sinclair/typebox\";\nimport {\n FontRegistrySchema,\n DesignSystemProperties\n} from \"@json-to-office/shared\";\nimport { Value } from \"@sinclair/typebox/value\";\nvar BUILT_IN_DOCX_THEME_NAMES = [\n \"consulting\",\n \"devportal\",\n \"minimal\",\n \"vermilion\"\n];\nvar DocumentMarginsSchema = Type.Object(\n {\n top: Type.Number({ minimum: 0 }),\n bottom: Type.Number({ minimum: 0 }),\n left: Type.Number({ minimum: 0 }),\n right: Type.Number({ minimum: 0 }),\n header: Type.Number({ minimum: 0 }),\n footer: Type.Number({ minimum: 0 }),\n gutter: Type.Number({ minimum: 0 })\n },\n { additionalProperties: false, description: \"Document margin configuration\" }\n);\nvar PageDimensionsSchema = Type.Object(\n {\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 })\n },\n { additionalProperties: false, description: \"Page dimensions in twips\" }\n);\nvar PageSchema = Type.Object(\n {\n size: Type.Union(\n [\n Type.Literal(\"A4\"),\n Type.Literal(\"A3\"),\n Type.Literal(\"LETTER\"),\n Type.Literal(\"LEGAL\"),\n Type.Object(\n {\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 })\n },\n { additionalProperties: false }\n )\n ],\n { description: \"Standard page size or custom dimensions\" }\n ),\n margins: DocumentMarginsSchema\n },\n {\n description: \"Page configuration including dimensions and margins\",\n additionalProperties: false\n }\n);\nvar FontsSchema = Type.Object(\n {\n heading: FontDefinitionSchema,\n body: FontDefinitionSchema,\n mono: FontDefinitionSchema,\n light: FontDefinitionSchema\n },\n {\n additionalProperties: false,\n description: \"Font definitions for different text types\"\n }\n);\nvar BorderStyleSchema = Type.Union(\n [\n Type.Literal(\"single\"),\n Type.Literal(\"dashDotStroked\"),\n Type.Literal(\"dashed\"),\n Type.Literal(\"dashSmallGap\"),\n Type.Literal(\"dotDash\"),\n Type.Literal(\"dotDotDash\"),\n Type.Literal(\"dotted\"),\n Type.Literal(\"double\"),\n Type.Literal(\"doubleWave\"),\n Type.Literal(\"inset\"),\n Type.Literal(\"nil\"),\n Type.Literal(\"none\"),\n Type.Literal(\"outset\"),\n Type.Literal(\"thick\"),\n Type.Literal(\"thickThinLargeGap\"),\n Type.Literal(\"thickThinMediumGap\"),\n Type.Literal(\"thickThinSmallGap\"),\n Type.Literal(\"thinThickLargeGap\"),\n Type.Literal(\"thinThickMediumGap\"),\n Type.Literal(\"thinThickSmallGap\"),\n Type.Literal(\"thinThickThinLargeGap\"),\n Type.Literal(\"thinThickThinMediumGap\"),\n Type.Literal(\"thinThickThinSmallGap\"),\n Type.Literal(\"threeDEmboss\"),\n Type.Literal(\"threeDEngrave\"),\n Type.Literal(\"triple\"),\n Type.Literal(\"wave\")\n ],\n { description: \"Paragraph border style\" }\n);\nvar BorderDefinitionFields = {\n style: BorderStyleSchema,\n size: Type.Number({\n minimum: 0,\n description: \"Width in eighths of a point (docx sz)\"\n }),\n color: HexColorSchema,\n space: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Space between text and border in points\"\n })\n )\n};\nvar BorderDefinitionSchema = Type.Object(BorderDefinitionFields, {\n additionalProperties: false,\n description: \"Paragraph border side definition\"\n});\nvar BetweenBorderSchema = Type.Object(BorderDefinitionFields, {\n additionalProperties: false,\n description: \"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges\"\n});\nvar BordersSchema = Type.Object(\n {\n top: Type.Optional(BorderDefinitionSchema),\n bottom: Type.Optional(BorderDefinitionSchema),\n left: Type.Optional(BorderDefinitionSchema),\n right: Type.Optional(BorderDefinitionSchema),\n between: Type.Optional(BetweenBorderSchema)\n },\n {\n additionalProperties: false,\n description: \"Paragraph borders (per side, plus the between-paragraph rule)\"\n }\n);\nvar AlignmentSchema = Type.Optional(\n Type.Union([\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"justify\")\n ])\n);\nvar StylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal(\"heading\"),\n Type.Literal(\"body\"),\n Type.Literal(\"mono\"),\n Type.Literal(\"light\")\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Additional properties specific to styles\n priority: Type.Optional(Type.Number()),\n baseStyle: Type.Optional(Type.String()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema)\n },\n { additionalProperties: false }\n);\nvar TabStopLeaderSchema = Type.Union(\n [\n Type.Literal(\"dot\"),\n Type.Literal(\"hyphen\"),\n Type.Literal(\"middleDot\"),\n Type.Literal(\"none\"),\n Type.Literal(\"underscore\")\n ],\n {\n description: \"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore\"\n }\n);\nvar TabStopTypeSchema = Type.Union(\n [\n Type.Literal(\"left\"),\n Type.Literal(\"right\"),\n Type.Literal(\"center\"),\n Type.Literal(\"bar\"),\n Type.Literal(\"clear\"),\n Type.Literal(\"decimal\"),\n Type.Literal(\"end\"),\n Type.Literal(\"num\"),\n Type.Literal(\"start\")\n ],\n {\n description: \"Tab stop alignment type\"\n }\n);\nvar TabStopDefinitionSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Union([\n Type.Number({\n description: \"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin\"\n }),\n Type.Literal(\"max\", {\n description: \"Use maximum position (TabStopPosition.MAX = 9026 twips)\"\n })\n ]),\n leader: Type.Optional(TabStopLeaderSchema)\n },\n {\n description: \"Tab stop configuration with position, alignment, and optional leader\",\n additionalProperties: false\n }\n);\nvar TocStylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal(\"heading\"),\n Type.Literal(\"body\"),\n Type.Literal(\"mono\"),\n Type.Literal(\"light\")\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Tab stops for controlling TOC entry formatting (leader dots, alignment, etc.)\n tabStops: Type.Optional(\n Type.Array(TabStopDefinitionSchema, {\n description: \"Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.\",\n default: [{ type: \"right\", position: \"max\", leader: \"none\" }]\n })\n ),\n // Additional properties specific to styles (baseStyle intentionally excluded)\n priority: Type.Optional(Type.Number()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema)\n },\n { additionalProperties: false }\n);\nvar StyleDefinitionsSchema = Type.Object(\n {\n normal: Type.Optional(StylePropertiesSchema),\n heading1: Type.Optional(StylePropertiesSchema),\n heading2: Type.Optional(StylePropertiesSchema),\n heading3: Type.Optional(StylePropertiesSchema),\n heading4: Type.Optional(StylePropertiesSchema),\n heading5: Type.Optional(StylePropertiesSchema),\n heading6: Type.Optional(StylePropertiesSchema),\n title: Type.Optional(StylePropertiesSchema),\n subtitle: Type.Optional(StylePropertiesSchema),\n // TOC entry styles (used by Word to format TOC entries)\n // Note: TOC styles use TocStylePropertiesSchema which excludes baseStyle to prevent coupling with Headings\n TOC1: Type.Optional(TocStylePropertiesSchema),\n TOC2: Type.Optional(TocStylePropertiesSchema),\n TOC3: Type.Optional(TocStylePropertiesSchema),\n TOC4: Type.Optional(TocStylePropertiesSchema),\n TOC5: Type.Optional(TocStylePropertiesSchema),\n TOC6: Type.Optional(TocStylePropertiesSchema)\n },\n {\n additionalProperties: StylePropertiesSchema,\n description: \"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles.\"\n }\n);\nvar HeadingDefinitionSchema = Type.Object(\n {\n level: Type.Union([\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6)\n ]),\n ...StylePropertiesSchema.properties\n },\n { additionalProperties: false }\n);\nvar ThemeColorsSchema = Type.Object(\n {\n primary: HexColorSchema,\n secondary: HexColorSchema,\n accent: HexColorSchema,\n text: HexColorSchema,\n background: HexColorSchema,\n border: HexColorSchema,\n // Additional semantic color names\n textPrimary: HexColorSchema,\n textSecondary: HexColorSchema,\n textMuted: HexColorSchema,\n borderPrimary: HexColorSchema,\n borderSecondary: HexColorSchema,\n backgroundPrimary: HexColorSchema,\n backgroundSecondary: HexColorSchema,\n // Extra chart-series slots, named to match the PPTX theme so both\n // formats share one palette vocabulary. Optional: the bundled DOCX\n // themes leave them unset and charts skip the empty slots.\n accent4: Type.Optional(HexColorSchema),\n accent5: Type.Optional(HexColorSchema),\n accent6: Type.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n);\nvar ThemeOverridesSchema = Type.Object(\n {\n ...DesignSystemProperties,\n colors: Type.Optional(Type.Partial(ThemeColorsSchema)),\n fonts: Type.Optional(Type.Partial(FontsSchema)),\n styles: Type.Optional(StyleDefinitionsSchema)\n },\n {\n additionalProperties: false,\n description: \"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document.\"\n }\n);\nvar ThemeConfigSchema = Type.Object(\n {\n ...DesignSystemProperties,\n $schema: Type.Optional(Type.String()),\n name: Type.String(),\n displayName: Type.String(),\n description: Type.String({\n description: \"The visual voice: what the theme looks like, in one sentence.\"\n }),\n whenToUse: Type.Optional(\n Type.String({\n description: \"The documents the theme suits; discovery and the design guide quote it.\"\n })\n ),\n version: Type.String(),\n colors: ThemeColorsSchema,\n fonts: FontsSchema,\n fontRegistry: Type.Optional(FontRegistrySchema),\n page: PageSchema,\n styles: Type.Optional(StyleDefinitionsSchema),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\n // House-style \"known words\" allowlist (whole-word, case-insensitive) that\n // should never be flagged as misspelled. The document's `noProofWords` is\n // merged on top of this at render time.\n noProofWords: Type.Optional(\n Type.Array(Type.String({ minLength: 1 }), {\n description: \"Words that should never be flagged as misspelled (whole-word, case-insensitive).\"\n })\n )\n },\n {\n additionalProperties: false,\n description: \"Theme configuration\"\n }\n);\nfunction isValidThemeConfig(data) {\n return Value.Check(ThemeConfigSchema, data);\n}\nfunction createMinimalTheme(name = \"minimal-theme\") {\n return {\n name,\n displayName: name.split(/[-_\\s]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(\" \") || name,\n description: \"A minimal theme with basic styling\",\n version: \"1.0.0\",\n colors: {\n primary: \"#2563EB\",\n secondary: \"#64748B\",\n accent: \"#F8FAFC\",\n text: \"#334155\",\n background: \"#FFFFFF\",\n border: \"#E2E8F0\",\n textPrimary: \"#334155\",\n textSecondary: \"#64748B\",\n textMuted: \"#94A3B8\",\n borderPrimary: \"#CBD5E1\",\n borderSecondary: \"#E2E8F0\",\n backgroundPrimary: \"#FFFFFF\",\n backgroundSecondary: \"#F8FAFC\"\n },\n fonts: {\n heading: { family: \"Arial\", size: 14 },\n body: { family: \"Arial\", size: 11 },\n mono: { family: \"Courier New\", size: 10 },\n light: { family: \"Arial\", size: 10 }\n },\n page: {\n size: \"A4\",\n margins: {\n top: 1440,\n bottom: 1440,\n left: 1440,\n right: 1440,\n header: 720,\n footer: 720,\n gutter: 0\n }\n },\n styles: {\n normal: {\n font: \"body\",\n size: 11,\n color: \"#334155\",\n alignment: \"left\",\n lineSpacing: { type: \"multiple\", value: 1.15 },\n spacing: { after: 8 }\n }\n }\n };\n}\n\nexport {\n BUILT_IN_DOCX_THEME_NAMES,\n DocumentMarginsSchema,\n PageDimensionsSchema,\n PageSchema,\n FontsSchema,\n StyleDefinitionsSchema,\n HeadingDefinitionSchema,\n ThemeColorsSchema,\n ThemeOverridesSchema,\n ThemeConfigSchema,\n isValidThemeConfig,\n createMinimalTheme\n};\n//# sourceMappingURL=chunk-OVL4RTD7.js.map","import {\n BUILT_IN_DOCX_THEME_NAMES,\n ThemeOverridesSchema\n} from \"./chunk-OVL4RTD7.js\";\nimport {\n DOCX_RENDERER_IDS,\n VisualPropsSchema,\n docxFlowDefinitionName,\n docxPropsSchemaForRenderer\n} from \"./chunk-HDFGXHUB.js\";\nimport {\n ColumnsPropsSchema,\n ComponentDefaultsSchema,\n HeadingPropsSchema,\n ImagePropsSchema,\n ListPropsSchema,\n ParagraphPropsSchema,\n SectionPropsSchema,\n StatisticPropsSchema,\n TablePropsSchema,\n createSectionPropsSchema,\n createTablePropsSchema\n} from \"./chunk-W6KB2SMK.js\";\nimport {\n AlignmentSchema,\n FloatingPropertiesSchema,\n SpacingSchema\n} from \"./chunk-FYJOHPU2.js\";\nimport {\n HexColorSchema,\n NoProofWordsSchema\n} from \"./chunk-XRVPNHNS.js\";\n\n// src/schemas/component-registry.ts\nimport { BlockInvocationPropsSchema as BlockInvocationPropsSchema2 } from \"@json-to-office/shared\";\n\n// src/schemas/components/block.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { BlockInvocationPropsSchema } from \"@json-to-office/shared\";\nvar GroupPropsSchema = Type.Object(\n {},\n { additionalProperties: false }\n);\n\n// src/schemas/component-registry.ts\nimport { Type as Type8 } from \"@sinclair/typebox\";\n\n// src/schemas/components/report.ts\nimport { Type as Type2 } from \"@sinclair/typebox\";\nimport {\n FontRegistrySchema,\n BlockDefinitionsSchema\n} from \"@json-to-office/shared\";\nvar createReportPropsSchema = (_componentRef) => Type2.Object(\n {\n blocks: Type2.Optional(BlockDefinitionsSchema),\n theme: Type2.Optional(\n Type2.String({\n description: `Theme name to apply (default: \"minimal\"). Built-ins: ${BUILT_IN_DOCX_THEME_NAMES.join(\", \")} (consulting is the house style).`,\n examples: [...BUILT_IN_DOCX_THEME_NAMES],\n default: \"minimal\"\n })\n ),\n themeOverrides: Type2.Optional(ThemeOverridesSchema),\n qualityProfile: Type2.Optional(\n Type2.String({\n 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.\",\n examples: [\n \"client-report\",\n \"technical-report\",\n \"executive-report\",\n \"legal-appendix\",\n \"general\"\n ]\n })\n ),\n fontRegistry: Type2.Optional(FontRegistrySchema),\n componentDefaults: Type2.Optional(ComponentDefaultsSchema),\n language: Type2.Optional(\n Type2.String({\n pattern: \"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$\",\n 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.`,\n examples: [\"en-US\", \"fr-FR\", \"de-DE\", \"it-IT\", \"es-ES\"]\n })\n ),\n noProofWords: Type2.Optional(NoProofWordsSchema),\n trackRevisions: Type2.Optional(\n Type2.Boolean({\n 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\"\n })\n ),\n metadata: Type2.Optional(\n Type2.Object(\n {\n title: Type2.Optional(\n Type2.String({\n description: \"Document title\",\n examples: [\"Annual Report 2024\", \"Technical Documentation\"]\n })\n ),\n subtitle: Type2.Optional(\n Type2.String({\n description: \"Document subtitle\"\n })\n ),\n description: Type2.Optional(Type2.String()),\n author: Type2.Optional(Type2.String()),\n company: Type2.Optional(\n Type2.String({\n description: \"Company name, written to docProps/custom.xml (Word has no core-property slot for it)\"\n })\n ),\n date: Type2.Optional(\n Type2.String({\n description: \"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)\"\n })\n ),\n version: Type2.Optional(\n Type2.String({\n description: \"Document version, written to docProps/custom.xml\",\n examples: [\"1.0\", \"2024.3\"]\n })\n ),\n tags: Type2.Optional(Type2.Array(Type2.String()))\n },\n {\n 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.\",\n additionalProperties: false\n }\n )\n )\n },\n {\n description: \"Report component props\",\n additionalProperties: false\n }\n);\nvar ReportPropsSchema = createReportPropsSchema();\n\n// src/schemas/components/text-box.ts\nimport { Type as Type3 } from \"@sinclair/typebox\";\nvar TextBoxPropsSchema = Type3.Object(\n {\n width: Type3.Optional(\n Type3.Union(\n [\n Type3.Number({\n minimum: 1,\n description: \"Text box width in pixels\"\n }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Text box width as percentage (e.g., \"50%\") relative to content width'\n })\n ],\n {\n description: 'Text box width in pixels (number) or as percentage string (e.g., \"50%\")'\n }\n )\n ),\n height: Type3.Optional(\n Type3.Union(\n [\n Type3.Number({\n minimum: 1,\n description: \"Text box height in pixels\"\n }),\n Type3.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Text box height as percentage (e.g., \"50%\") relative to content height'\n })\n ],\n {\n description: 'Text box height in pixels (number) or as percentage string (e.g., \"50%\")'\n }\n )\n ),\n renderAs: Type3.Optional(\n Type3.Union([Type3.Literal(\"table\"), Type3.Literal(\"shape\")], {\n 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.\"\n })\n ),\n floating: Type3.Optional(FloatingPropertiesSchema),\n style: Type3.Optional(\n Type3.Object(\n {\n padding: Type3.Optional(\n Type3.Object(\n {\n top: Type3.Optional(Type3.Number({ minimum: 0 })),\n right: Type3.Optional(Type3.Number({ minimum: 0 })),\n bottom: Type3.Optional(Type3.Number({ minimum: 0 })),\n left: Type3.Optional(Type3.Number({ minimum: 0 }))\n },\n { additionalProperties: false }\n )\n ),\n border: Type3.Optional(\n Type3.Object(\n {\n top: Type3.Optional(\n // Reuse border schema semantics: style/width/color\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"solid\"),\n Type3.Literal(\"dashed\"),\n Type3.Literal(\"dotted\"),\n Type3.Literal(\"double\"),\n Type3.Literal(\"none\")\n ])\n ),\n width: Type3.Optional(Type3.Number({ minimum: 0 })),\n color: Type3.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n )\n ),\n right: Type3.Optional(\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"solid\"),\n Type3.Literal(\"dashed\"),\n Type3.Literal(\"dotted\"),\n Type3.Literal(\"double\"),\n Type3.Literal(\"none\")\n ])\n ),\n width: Type3.Optional(Type3.Number({ minimum: 0 })),\n color: Type3.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n )\n ),\n bottom: Type3.Optional(\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"solid\"),\n Type3.Literal(\"dashed\"),\n Type3.Literal(\"dotted\"),\n Type3.Literal(\"double\"),\n Type3.Literal(\"none\")\n ])\n ),\n width: Type3.Optional(Type3.Number({ minimum: 0 })),\n color: Type3.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n )\n ),\n left: Type3.Optional(\n Type3.Object(\n {\n style: Type3.Optional(\n Type3.Union([\n Type3.Literal(\"solid\"),\n Type3.Literal(\"dashed\"),\n Type3.Literal(\"dotted\"),\n Type3.Literal(\"double\"),\n Type3.Literal(\"none\")\n ])\n ),\n width: Type3.Optional(Type3.Number({ minimum: 0 })),\n color: Type3.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n )\n )\n },\n { additionalProperties: false }\n )\n ),\n shading: Type3.Optional(\n Type3.Object(\n {\n // Same domain as every other colour prop and as the border\n // colours above: resolveColor() accepts \"#RRGGBB\" or a theme\n // colour name, and throws on anything else at render time.\n fill: Type3.Optional(HexColorSchema)\n },\n { additionalProperties: false }\n )\n )\n },\n { additionalProperties: false }\n )\n )\n },\n {\n additionalProperties: false,\n /**\n * The same two shape limits `collectTextBoxShapeConflicts` enforces, said\n * in JSON Schema so an editor can say it too.\n *\n * The deep validator only runs when a document is generated, so until now\n * an author learned that a shape needs a height by pressing Run. These are\n * plain cross-field rules, and `if`/`then` expresses them — which is what\n * Monaco checks the buffer against, so the editor underlines the mistake\n * while it is being made. The deep validator stays as the backstop: it\n * carries the remediation text, and it is what the API enforces for\n * callers who never see an editor.\n */\n allOf: [\n {\n if: {\n properties: { renderAs: { const: \"shape\" } },\n required: [\"renderAs\"]\n },\n then: {\n required: [\"width\", \"height\"],\n properties: {\n style: {\n properties: {\n border: {\n properties: Object.fromEntries(\n [\"top\", \"right\", \"bottom\", \"left\"].map((side) => [\n side,\n { properties: { style: { enum: [\"solid\", \"none\"] } } }\n ])\n )\n }\n }\n }\n }\n }\n }\n ]\n }\n);\n\n// src/schemas/components/toc.ts\nimport { Type as Type4 } from \"@sinclair/typebox\";\nvar TocStyleSchema = Type4.Union(\n [Type4.Literal(\"numeric\"), Type4.Literal(\"bullet\"), Type4.Literal(\"none\")],\n {\n description: \"TOC numbering style \\u2014 accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation\"\n }\n);\nvar TocScopeSchema = Type4.Union(\n [Type4.Literal(\"document\"), Type4.Literal(\"section\")],\n { description: \"TOC scope: document-wide or section-only\" }\n);\nvar TocStyleMappingSchema = Type4.Object(\n {\n styleId: Type4.String({\n description: \"Custom style ID matching a key in theme.styles\"\n }),\n level: Type4.Number({\n minimum: 1,\n maximum: 6,\n description: \"TOC level (1-6) to assign to this style\"\n })\n },\n {\n description: \"Mapping of custom style to TOC level\",\n additionalProperties: false\n }\n);\nvar TocDepthRangeSchema = Type4.Object(\n {\n from: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description: \"Starting heading level (1-6). Defaults to 1 if not specified.\"\n })\n ),\n to: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description: \"Ending heading level (1-6). Defaults to 3 if not specified.\"\n })\n )\n },\n {\n description: 'Range of heading levels to include in TOC. Specify at least one of \"from\" or \"to\".',\n additionalProperties: false\n }\n);\nvar TocPropsSchema = Type4.Object(\n {\n pageBreak: Type4.Optional(\n Type4.Boolean({\n description: \"Insert page break before TOC block\"\n })\n ),\n depth: Type4.Optional(\n Type4.Object(\n {\n from: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description: \"Starting heading level (1-6). Defaults to 1 if not specified.\"\n })\n ),\n to: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description: \"Ending heading level (1-6). Defaults to 3 if not specified.\"\n })\n )\n },\n {\n description: 'Range of heading levels to include in TOC. Specify \"from\", \"to\", or both. Defaults: from=1, to=3',\n additionalProperties: false,\n default: { to: 3 }\n }\n )\n ),\n pageNumbersDepth: Type4.Optional(\n Type4.Object(\n {\n from: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description: \"Starting heading level (1-6). Defaults to 1 if not specified.\"\n })\n ),\n to: Type4.Optional(\n Type4.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description: \"Ending heading level (1-6). Defaults to 3 if not specified.\"\n })\n )\n },\n {\n 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.',\n additionalProperties: false\n }\n )\n ),\n numberingStyle: Type4.Optional(TocStyleSchema),\n title: Type4.Optional(\n Type4.String({\n description: \"TOC heading title\"\n })\n ),\n includePageNumbers: Type4.Optional(\n Type4.Boolean({\n default: true,\n description: \"Show page numbers next to entries\"\n })\n ),\n numberSeparator: Type4.Optional(\n Type4.Boolean({\n default: true,\n description: 'Use tab separator between entry and page number. True applies \"\\\\t\" (default), false applies \" \"'\n })\n ),\n scope: Type4.Optional(\n Type4.Union([TocScopeSchema, Type4.Literal(\"auto\")], {\n default: \"auto\",\n description: 'TOC scope: \"document\" for entire document, \"section\" for parent section only, \"auto\" for automatic detection (section if inside section, otherwise document)'\n })\n ),\n styles: Type4.Optional(\n Type4.Array(TocStyleMappingSchema, {\n description: \"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels.\"\n })\n )\n },\n {\n description: \"Table of Contents component props\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/divider.ts\nimport { Type as Type5 } from \"@sinclair/typebox\";\nvar DividerPropsSchema = Type5.Object(\n {\n thickness: Type5.Optional(\n Type5.Number({\n minimum: 0.25,\n maximum: 12,\n 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.\"\n })\n ),\n color: Type5.Optional(HexColorSchema),\n style: Type5.Optional(\n Type5.Union(\n [\n Type5.Literal(\"solid\"),\n Type5.Literal(\"dashed\"),\n Type5.Literal(\"dotted\"),\n Type5.Literal(\"double\")\n ],\n {\n description: 'Line style (default \"solid\"). `double` draws two lines and is measured per line, so it reads about twice as tall as its thickness.'\n }\n )\n ),\n width: Type5.Optional(\n Type5.Union(\n [\n Type5.Number({\n minimum: 1,\n description: \"Divider width in points\"\n }),\n Type5.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Divider width as a percentage of the text measure (e.g. \"40%\")'\n })\n ],\n {\n 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.\"\n }\n )\n ),\n alignment: Type5.Optional(\n Type5.Union(\n [Type5.Literal(\"left\"), Type5.Literal(\"center\"), Type5.Literal(\"right\")],\n {\n description: 'Which end of the measure a partial divider sits at (default \"left\"). Ignored at full width.'\n }\n )\n ),\n spacing: Type5.Optional(SpacingSchema)\n },\n {\n description: \"Horizontal divider \\u2014 a thin line across the measure, drawn as a Word paragraph border so it stays editable in Word.\",\n additionalProperties: false\n }\n);\n\n// src/schemas/components/highcharts.ts\nimport { Type as Type6 } from \"@sinclair/typebox\";\nvar HighchartsPropsSchema = Type6.Object({\n // Highcharts chart options - can be anything but must at least have chart.width and chart.height\n options: Type6.Intersect([\n Type6.Record(Type6.String(), Type6.Unknown()),\n Type6.Object({\n chart: Type6.Object({\n width: Type6.Number(),\n height: Type6.Number()\n })\n })\n ]),\n // Optional scale factor for export\n scale: Type6.Optional(Type6.Number()),\n // Optional resources forwarded verbatim to the export server (CSS/JS/files).\n // Notably enables @font-face rules so charts render in custom fonts.\n resources: Type6.Optional(\n Type6.Object({\n css: Type6.Optional(Type6.String()),\n js: Type6.Optional(Type6.String()),\n files: Type6.Optional(Type6.Array(Type6.String()))\n })\n ),\n // Optional Highcharts Export Server URL override\n serverUrl: Type6.Optional(\n Type6.String({\n description: \"Highcharts Export Server URL (default: http://localhost:7801)\"\n })\n ),\n // Optional width for rendering (overrides chart width)\n width: Type6.Optional(\n Type6.Union(\n [\n Type6.Number({\n minimum: 1,\n description: \"Image width in pixels\"\n }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Image width as percentage (e.g., \"90%\") relative to content width'\n })\n ],\n {\n description: 'Rendered image width in pixels (number) or as percentage string (e.g., \"90%\")'\n }\n )\n ),\n // Optional height for rendering (overrides chart height)\n height: Type6.Optional(\n Type6.Union(\n [\n Type6.Number({\n minimum: 1,\n description: \"Image height in pixels\"\n }),\n Type6.String({\n pattern: \"^\\\\d+(\\\\.\\\\d+)?%$\",\n description: 'Image height as percentage (e.g., \"90%\") relative to content height'\n })\n ],\n {\n description: 'Rendered image height in pixels (number) or as percentage string (e.g., \"90%\")'\n }\n )\n )\n});\n\n// src/schemas/components/chart.ts\nimport { Type as Type7 } from \"@sinclair/typebox\";\nvar ChartTypeSchema = Type7.Union(\n [\n Type7.Literal(\"area\"),\n Type7.Literal(\"bar\"),\n Type7.Literal(\"column\"),\n Type7.Literal(\"doughnut\"),\n Type7.Literal(\"line\"),\n Type7.Literal(\"pie\"),\n Type7.Literal(\"radar\"),\n Type7.Literal(\"scatter\")\n ],\n { description: \"Chart type\" }\n);\nvar ChartDataSeriesSchema = Type7.Object(\n {\n name: Type7.Optional(Type7.String({ description: \"Series name\" })),\n labels: Type7.Optional(\n Type7.Array(Type7.String(), {\n 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.\"\n })\n ),\n values: Type7.Optional(\n Type7.Array(Type7.Number(), {\n description: \"Data values, one per label. Needed on every series \\u2014 see `labels`.\"\n })\n )\n },\n { additionalProperties: false }\n);\nvar ChartPropsSchema = Type7.Object(\n {\n type: ChartTypeSchema,\n data: Type7.Array(ChartDataSeriesSchema, {\n description: \"Chart data series\",\n minItems: 1\n }),\n // Title\n title: Type7.Optional(Type7.String({ description: \"Chart title text\" })),\n showTitle: Type7.Optional(\n Type7.Boolean({\n description: \"Show the chart title. Defaults to true when `title` is set.\"\n })\n ),\n // Legend\n showLegend: Type7.Optional(\n Type7.Boolean({ description: \"Show chart legend\" })\n ),\n legendPos: Type7.Optional(\n Type7.Union(\n [\n Type7.Literal(\"b\"),\n Type7.Literal(\"l\"),\n Type7.Literal(\"r\"),\n Type7.Literal(\"t\"),\n Type7.Literal(\"tr\")\n ],\n { description: \"Legend position\" }\n )\n ),\n // Series colors\n chartColors: Type7.Optional(\n Type7.Array(Type7.String(), {\n description: \"Series colors (hex or semantic theme names). Defaults to the theme palette.\"\n })\n ),\n // Axis titles\n catAxisTitle: Type7.Optional(\n Type7.String({ description: \"Category axis title\" })\n ),\n valAxisTitle: Type7.Optional(\n Type7.String({ description: \"Value axis title\" })\n ),\n // Flow placement — the same vocabulary as `image` and `highcharts`.\n width: Type7.Optional(\n Type7.Number({\n minimum: 0,\n exclusiveMinimum: 0,\n description: \"Chart width in inches. Defaults to the content width.\"\n })\n ),\n height: Type7.Optional(\n Type7.Number({\n minimum: 0,\n exclusiveMinimum: 0,\n description: \"Chart height in inches. Defaults to 3.\"\n })\n ),\n alignment: Type7.Optional(AlignmentSchema),\n caption: Type7.Optional(\n Type7.String({\n description: \"Chart caption (supports rich text with **bold**, *italic*, ***both***)\"\n })\n ),\n alt: Type7.Optional(\n Type7.String({ description: \"Alternative text for accessibility\" })\n ),\n spacing: Type7.Optional(SpacingSchema),\n floating: Type7.Optional(FloatingPropertiesSchema),\n keepNext: Type7.Optional(\n Type7.Boolean({\n description: \"Keep paragraph with next paragraph on same page\"\n })\n ),\n keepLines: Type7.Optional(\n Type7.Boolean({\n description: \"Keep all lines of paragraph together on same page\"\n })\n )\n },\n {\n description: 'Native Word chart - editable, scalable, no export server needed. Requires renderer \"office-open\".',\n additionalProperties: false\n }\n);\n\n// src/schemas/component-registry.ts\nvar FLOW_CHILDREN = [\n \"block\",\n \"group\",\n \"heading\",\n \"paragraph\",\n \"image\",\n \"statistic\",\n \"table\",\n \"list\",\n \"toc\",\n \"divider\",\n \"highcharts\",\n \"chart\",\n \"visual\",\n \"columns\",\n \"text-box\"\n];\nvar STANDARD_COMPONENTS_REGISTRY = [\n // ========================================================================\n // Container Components (can contain children)\n // ========================================================================\n {\n name: \"docx\",\n propsSchema: ReportPropsSchema,\n hasChildren: true,\n allowedChildren: [\"section\"],\n category: \"container\",\n description: \"Main document container - defines the overall document structure. Required as the root component.\",\n special: {\n hasSchemaField: true\n // Only docx root has $schema field\n }\n },\n {\n name: \"section\",\n propsSchema: SectionPropsSchema,\n createPropsSchema: createSectionPropsSchema,\n embeddedComponents: [\n // The static schema types both regions as an array of Type.Any() (or\n // the 'linkToPrevious' literal), so the walk is their only structural\n // checker — report malformed entries too.\n { path: [\"header\"], arity: \"component-array\", reportStructure: true },\n { path: [\"footer\"], arity: \"component-array\", reportStructure: true }\n ],\n hasChildren: true,\n allowedChildren: FLOW_CHILDREN,\n category: \"container\",\n description: \"Section container - groups related content with optional title. Use for organizing document structure.\"\n },\n {\n name: \"columns\",\n propsSchema: ColumnsPropsSchema,\n hasChildren: true,\n // Everything in flow but another `columns`: at the top level a columns\n // becomes a section column layout, which has no second level.\n allowedChildren: FLOW_CHILDREN.filter((name) => name !== \"columns\"),\n category: \"layout\",\n description: \"Multi-column layout - arranges content in 2-4 columns. Great for side-by-side content.\"\n },\n {\n name: \"text-box\",\n propsSchema: TextBoxPropsSchema,\n hasChildren: true,\n // A one-cell table, so it holds what a section holds — a table for a\n // metadata band, a columns for a two-up sidebar, another text-box.\n allowedChildren: FLOW_CHILDREN,\n category: \"layout\",\n description: \"Floating text container - allows positioning text anywhere on the page with absolute or relative positioning. Holds any flow content, tables and columns included.\"\n },\n // ========================================================================\n // Content Components (leaf nodes, no children)\n // ========================================================================\n {\n name: \"heading\",\n propsSchema: HeadingPropsSchema,\n hasChildren: false,\n category: \"content\",\n 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.\"\n },\n {\n name: \"paragraph\",\n propsSchema: ParagraphPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Paragraph text - supports formatting like bold, italic, and color. Main content element.\"\n },\n {\n name: \"image\",\n propsSchema: ImagePropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Image element - displays images with optional caption. Supports various formats.\"\n },\n {\n name: \"statistic\",\n propsSchema: StatisticPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Statistic display - shows a number with description. Perfect for KPIs and metrics.\"\n },\n {\n name: \"block\",\n propsSchema: BlockInvocationPropsSchema2,\n hasChildren: false,\n category: \"content\",\n description: \"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine.\"\n },\n {\n name: \"group\",\n propsSchema: GroupPropsSchema,\n hasChildren: true,\n allowedChildren: FLOW_CHILDREN,\n category: \"container\",\n description: \"Transparent group of flow components; also the inspectable result of block expansion.\"\n },\n {\n name: \"table\",\n propsSchema: TablePropsSchema,\n createPropsSchema: createTablePropsSchema,\n embeddedComponents: [\n // Cell content is `string | component`. The table's own props schema\n // already validates the cell structure, so the walk only adds the\n // per-component prop errors the loose static content ref misses —\n // reporting structure here would double-report.\n {\n path: [\"columns\", \"*\", \"header\", \"content\"],\n arity: \"component\",\n reportStructure: false\n },\n {\n path: [\"columns\", \"*\", \"cells\", \"*\", \"content\"],\n arity: \"component\",\n reportStructure: false\n }\n ],\n hasChildren: false,\n category: \"content\",\n 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.\"\n },\n {\n name: \"list\",\n propsSchema: ListPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"List element - bulleted or numbered list items. Supports nested lists.\"\n },\n {\n name: \"toc\",\n propsSchema: TocPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles.\"\n },\n {\n name: \"divider\",\n propsSchema: DividerPropsSchema,\n hasChildren: false,\n category: \"content\",\n 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.\"\n },\n {\n name: \"highcharts\",\n propsSchema: HighchartsPropsSchema,\n hasChildren: false,\n category: \"content\",\n description: \"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options.\"\n },\n {\n name: \"chart\",\n propsSchema: ChartPropsSchema,\n hasChildren: false,\n // docx.js has no chart primitive at all, so this is a backend gap rather\n // than a slice boundary — the same reasoning that keeps `drawing-groups`\n // off the docxjs capability set.\n renderers: [\"office-open\"],\n category: \"content\",\n description: 'Native Word chart - editable, scalable, no export server needed. Requires renderer \"office-open\".'\n },\n {\n name: \"visual\",\n propsSchema: VisualPropsSchema,\n hasChildren: false,\n category: \"content\",\n 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\").'\n }\n];\nfunction getStandardComponent(name) {\n return STANDARD_COMPONENTS_REGISTRY.find((c) => c.name === name);\n}\nfunction getAllStandardComponentNames() {\n return STANDARD_COMPONENTS_REGISTRY.map((c) => c.name);\n}\nfunction getComponentsByCategory(category) {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => c.category === category);\n}\nfunction getContainerComponents() {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n}\nfunction getContentComponents() {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => !c.hasChildren);\n}\nfunction isStandardComponent(name) {\n return STANDARD_COMPONENTS_REGISTRY.some((c) => c.name === name);\n}\nfunction demandsProps(propsSchema) {\n const schema = propsSchema;\n return schema.type !== \"object\" || (schema.required?.length ?? 0) > 0;\n}\nfunction createComponentSchemaObject(component, childrenType, selfRef, profile) {\n const schema = {\n name: Type8.Literal(component.name),\n id: Type8.Optional(Type8.String()),\n enabled: Type8.Optional(\n Type8.Boolean({\n default: true,\n description: \"When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion.\"\n })\n )\n };\n if (component.special?.hasSchemaField) {\n schema.$schema = Type8.Optional(Type8.String({ format: \"uri\" }));\n schema.renderer = profile ? profile.requireDiscriminator ? Type8.Literal(profile.renderer, {\n description: \"Renderer backend for this document\"\n }) : Type8.Optional(\n Type8.Literal(profile.renderer, {\n description: 'Renderer backend. Omitted defaults to \"docxjs\".'\n })\n ) : Type8.Optional(\n Type8.Union(\n DOCX_RENDERER_IDS.map((renderer) => Type8.Literal(renderer)),\n {\n description: 'Renderer backend. Omitted defaults to \"docxjs\".'\n }\n )\n );\n }\n const basePropsSchema = component.createPropsSchema && selfRef ? component.createPropsSchema(selfRef) : component.propsSchema;\n const propsSchema = profile ? docxPropsSchemaForRenderer(\n component.name,\n basePropsSchema,\n profile.renderer\n ) : basePropsSchema;\n schema.props = demandsProps(propsSchema) ? propsSchema : Type8.Optional(propsSchema);\n if (component.hasChildren && childrenType) {\n schema.children = component.special?.hasSchemaField ? Type8.Array(childrenType) : Type8.Optional(Type8.Array(childrenType));\n }\n return Type8.Object(schema, {\n additionalProperties: false,\n description: component.description\n });\n}\nfunction createAllComponentSchemas(recursiveRef) {\n return STANDARD_COMPONENTS_REGISTRY.map(\n (component) => createComponentSchemaObject(component, recursiveRef)\n );\n}\nfunction sameNames(a, b) {\n const set = new Set(a);\n return a.length === set.size && b.length === set.size && b.every((n) => set.has(n));\n}\nfunction createAllComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile) {\n const drawnHere = (comp) => !profile || !comp.renderers || comp.renderers.includes(profile.renderer);\n const components = STANDARD_COMPONENTS_REGISTRY.filter(drawnHere);\n const inFlow = new Set(FLOW_CHILDREN);\n const byName = /* @__PURE__ */ new Map();\n for (const comp of components) {\n if (!comp.hasChildren) {\n byName.set(\n comp.name,\n createComponentSchemaObject(comp, void 0, selfRef, profile)\n );\n }\n }\n const resolveContainers = (containers, flowRef) => {\n const pending = [...containers];\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n if (!comp.allowedChildren) {\n byName.set(\n comp.name,\n createComponentSchemaObject(comp, selfRef, selfRef, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n if (sameNames(comp.allowedChildren, FLOW_CHILDREN)) {\n byName.set(\n comp.name,\n createComponentSchemaObject(comp, flowRef, selfRef, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n const deps = comp.allowedChildren.filter(\n (name) => components.some((c) => c.name === name && c.hasChildren)\n );\n if (!deps.every((name) => byName.has(name))) continue;\n const childSchemas = comp.allowedChildren.map((name) => byName.get(name)).filter((s) => s !== void 0);\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType = allChildSchemas.length === 1 ? allChildSchemas[0] : Type8.Union(allChildSchemas);\n byName.set(\n comp.name,\n createComponentSchemaObject(comp, childrenType, selfRef, profile)\n );\n pending.splice(i, 1);\n }\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(\", \")}`\n );\n }\n }\n };\n const flow = Type8.Recursive(\n (Flow) => {\n resolveContainers(\n components.filter((c) => c.hasChildren && inFlow.has(c.name)),\n Flow\n );\n const members = FLOW_CHILDREN.map((name) => byName.get(name)).filter(\n (s) => s !== void 0\n );\n return Type8.Union([...members, ...pluginSchemas], {\n discriminator: { propertyName: \"name\" },\n description: \"Flow content: what a section body holds, and so what a group, columns or text-box holds.\"\n });\n },\n { $id: docxFlowDefinitionName(profile?.renderer) }\n );\n resolveContainers(\n components.filter((c) => c.hasChildren && !inFlow.has(c.name)),\n flow\n );\n const schemas = components.map((comp) => byName.get(comp.name)).filter((s) => s !== void 0);\n const roots = components.filter((comp) => !inFlow.has(comp.name)).map((comp) => byName.get(comp.name));\n return { schemas, byName, flow, roots };\n}\n\nexport {\n GroupPropsSchema,\n BlockInvocationPropsSchema,\n createReportPropsSchema,\n ReportPropsSchema,\n TextBoxPropsSchema,\n TocStyleSchema,\n TocScopeSchema,\n TocStyleMappingSchema,\n TocDepthRangeSchema,\n TocPropsSchema,\n DividerPropsSchema,\n HighchartsPropsSchema,\n ChartPropsSchema,\n FLOW_CHILDREN,\n STANDARD_COMPONENTS_REGISTRY,\n getStandardComponent,\n getAllStandardComponentNames,\n getComponentsByCategory,\n getContainerComponents,\n getContentComponents,\n isStandardComponent,\n createComponentSchemaObject,\n createAllComponentSchemas,\n createAllComponentSchemasNarrowed\n};\n//# sourceMappingURL=chunk-E5DT5YTY.js.map","import {\n addDocxBlockAuthoringSchemas\n} from \"./chunk-N3KCALAB.js\";\nimport {\n getContainerComponents\n} from \"./chunk-E5DT5YTY.js\";\n\n// src/schemas/export.ts\nimport { restructureNameDiscriminatedUnions } from \"@json-to-office/shared\";\nfunction fixSchemaReferences(schema, rootDefinitionName = \"ComponentDefinition\") {\n const definitionNames = new Set(\n Object.keys(\n schema.definitions ?? {}\n )\n );\n const definitionRef = (name) => {\n const target = definitionNames.has(name) ? name : rootDefinitionName;\n return definitionNames.has(target) ? `#/definitions/${target}` : void 0;\n };\n const isBareDefinitionRef = (value) => typeof value === \"string\" && (/^T\\d+$/.test(value) || value === rootDefinitionName || definitionNames.has(value));\n function traverse(obj, path = \"\") {\n if (typeof obj !== \"object\" || obj === null) return;\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = path ? `${path}.${key}` : key;\n if (value && typeof value === \"object\") {\n const schemaValue = value;\n if (schemaValue.type === \"array\" && schemaValue.items && Object.keys(schemaValue.items).length === 0 && definitionNames.has(rootDefinitionName)) {\n schemaValue.items = {\n $ref: `#/definitions/${rootDefinitionName}`\n };\n }\n if (schemaValue.type === \"array\" && schemaValue.items && typeof schemaValue.items === \"object\" && \"$ref\" in schemaValue.items && isBareDefinitionRef(\n schemaValue.items.$ref\n )) {\n const ref = definitionRef(\n schemaValue.items.$ref\n );\n schemaValue.items = ref ? { $ref: ref } : {};\n }\n if (isBareDefinitionRef(schemaValue.$ref)) {\n const ref = definitionRef(schemaValue.$ref);\n if (ref) schemaValue.$ref = ref;\n else delete schemaValue.$ref;\n }\n if (key === \"$id\" && isBareDefinitionRef(value) && currentPath !== `definitions.${value}.$id`) {\n delete obj[key];\n continue;\n }\n traverse(value, currentPath);\n }\n }\n }\n traverse(schema);\n}\nfunction convertToJsonSchema(schema, options = {}) {\n const {\n $schema = \"http://json-schema.org/draft-07/schema#\",\n $id,\n title,\n description,\n definitions = {}\n } = options;\n const schemaJson = JSON.parse(JSON.stringify(schema));\n const extractedDefinitions = { ...definitions };\n function extractRecursiveSchemas(obj, path = \"\") {\n if (typeof obj !== \"object\" || obj === null) return;\n for (const [key, value] of Object.entries(obj)) {\n if (value && typeof value === \"object\") {\n const schemaValue = value;\n if (schemaValue.$id && typeof schemaValue.$id === \"string\") {\n const definitionName = schemaValue.$id;\n if (path !== `definitions.${definitionName}`) {\n const { $id: _, ...schemaWithoutId } = schemaValue;\n extractedDefinitions[definitionName] = schemaWithoutId;\n obj[key] = { $ref: `#/definitions/${definitionName}` };\n extractRecursiveSchemas(\n schemaWithoutId,\n `definitions.${definitionName}`\n );\n continue;\n }\n }\n extractRecursiveSchemas(\n value,\n path ? `${path}.${key}` : key\n );\n }\n }\n }\n extractRecursiveSchemas(schemaJson);\n const jsonSchema = {\n $schema\n };\n if ($id) jsonSchema.$id = $id;\n Object.assign(jsonSchema, schemaJson);\n if (title !== void 0) jsonSchema.title = title;\n if (description !== void 0) jsonSchema.description = description;\n if (Object.keys(extractedDefinitions).length > 0) {\n jsonSchema.definitions = extractedDefinitions;\n }\n fixSchemaReferences(jsonSchema);\n addDocxBlockAuthoringSchemas(jsonSchema);\n restructureNameDiscriminatedUnions(jsonSchema);\n return jsonSchema;\n}\nfunction createComponentSchema(name, config, componentDefinitionSchema, rootDefinitionName = \"ComponentDefinition\") {\n const componentStructure = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n $id: `${name}.schema.json`,\n title: config.title,\n description: config.description,\n type: \"object\",\n required: [\"name\", \"props\"],\n properties: {\n name: {\n type: \"string\",\n const: name,\n description: `Component name identifier (must be \"${name}\")`\n },\n id: {\n type: \"string\",\n description: \"Optional unique identifier for the component\"\n },\n props: JSON.parse(JSON.stringify(config.schema))\n }\n };\n const containerNames = getContainerComponents().map((c) => c.name);\n if (containerNames.includes(name)) {\n componentStructure.properties.children = {\n type: \"array\",\n description: \"Children within this container\",\n items: {\n $ref: `#/definitions/${rootDefinitionName}`\n }\n };\n if (componentDefinitionSchema) {\n componentStructure.definitions = {\n [rootDefinitionName]: JSON.parse(\n JSON.stringify(componentDefinitionSchema)\n )\n };\n }\n }\n if (config.enhanceForRichContent && name === \"table\") {\n const componentStructureWithDefs = componentStructure;\n if (!componentStructureWithDefs.definitions) {\n componentStructureWithDefs.definitions = {};\n }\n if (componentDefinitionSchema) {\n componentStructureWithDefs.definitions[rootDefinitionName] = JSON.parse(\n JSON.stringify(componentDefinitionSchema)\n );\n }\n const properties = componentStructure.properties;\n const propsProp = properties.props;\n if (propsProp?.properties && typeof propsProp.properties === \"object\" && propsProp.properties !== null) {\n const propsProps = propsProp.properties;\n const rowsProp = propsProps.rows;\n if (rowsProp?.items && typeof rowsProp.items === \"object\" && rowsProp.items !== null) {\n const rowsItems = rowsProp.items;\n const cellSchema = rowsItems.items;\n if (cellSchema?.anyOf && Array.isArray(cellSchema.anyOf)) {\n const componentRef = `#/definitions/${rootDefinitionName}`;\n const hasComponentRef = cellSchema.anyOf.some((item) => {\n const itemObj = item;\n return itemObj.$ref === componentRef;\n });\n if (!hasComponentRef) {\n cellSchema.anyOf.push({\n description: \"Rich content cell with component (e.g., image, paragraph)\",\n $ref: componentRef\n });\n }\n }\n }\n }\n }\n fixSchemaReferences(componentStructure, rootDefinitionName);\n componentStructure.additionalProperties = false;\n return componentStructure;\n}\nasync function exportSchemaToFile(schema, outputPath, options = {}) {\n const { prettyPrint = true } = options;\n const jsonSchema = prettyPrint ? JSON.stringify(schema, null, 2) : JSON.stringify(schema);\n const fs = await import(\"fs/promises\");\n await fs.writeFile(outputPath, jsonSchema, \"utf-8\");\n}\nvar COMPONENT_METADATA = {\n report: {\n title: \"Report Component\",\n description: \"Top-level report container component with document-wide settings\"\n },\n section: {\n title: \"Section Component\",\n description: \"Section container for organizing document content\"\n },\n columns: {\n title: \"Columns Component\",\n description: \"Multi-column layout container\"\n },\n heading: {\n title: \"Heading Component\",\n description: \"Heading text with configurable levels and styling\"\n },\n paragraph: {\n title: \"Paragraph Component\",\n description: \"Rich paragraph text content with formatting options\"\n },\n \"text-box\": {\n title: \"Text Box Component\",\n description: \"Inline or floating container that groups text and image components with shared positioning\"\n },\n image: {\n title: \"Image Component\",\n description: \"Image content with positioning and sizing options\"\n },\n statistic: {\n title: \"Statistic Component\",\n description: \"Statistical display with value and label\"\n },\n table: {\n title: \"Table Component\",\n description: \"Tabular data display with headers and rows\",\n enhanceForRichContent: true\n },\n list: {\n title: \"List Component\",\n description: \"Ordered or unordered list with nested items\"\n },\n highcharts: {\n title: \"Highcharts Component\",\n description: \"Charts powered by Highcharts (line, bar, pie, heatmap, etc.) with rich configuration\"\n },\n visual: {\n title: \"Visual Component\",\n description: 'Free-canvas graphic: a rasterized pptx slide, or a native Word drawing group with renderMode \"native\"'\n }\n};\nvar BASE_SCHEMA_METADATA = {\n alignment: {\n title: \"Alignment\",\n description: \"Text alignment options\"\n },\n \"base-component\": {\n title: \"Base Component Props\",\n description: \"Common props for all components\"\n },\n border: {\n title: \"Border\",\n description: \"Border styling configuration\"\n },\n spacing: {\n title: \"Spacing\",\n description: \"Spacing configuration for before and after elements\"\n },\n margins: {\n title: \"Margins\",\n description: \"Margin configuration for all sides\"\n },\n indent: {\n title: \"Indent\",\n description: \"Indentation configuration\"\n },\n \"line-spacing\": {\n title: \"Line Spacing\",\n description: \"Line height and spacing configuration\"\n },\n \"heading-level\": {\n title: \"Heading Level\",\n description: \"Heading level from 1 to 6\"\n },\n numbering: {\n title: \"Numbering\",\n description: \"Numbering configuration for ordered lists\"\n },\n \"justified-alignment\": {\n title: \"Justified Alignment\",\n description: \"Justified text alignment options\"\n }\n};\nvar THEME_SCHEMA_METADATA = {\n theme: {\n title: \"Theme Configuration\",\n description: \"JSON theme configuration for document styling and appearance\"\n }\n};\n\nexport {\n fixSchemaReferences,\n convertToJsonSchema,\n createComponentSchema,\n exportSchemaToFile,\n COMPONENT_METADATA,\n BASE_SCHEMA_METADATA,\n THEME_SCHEMA_METADATA\n};\n//# sourceMappingURL=chunk-SGESROO2.js.map","import {\n createAllComponentSchemasNarrowed,\n getStandardComponent\n} from \"./chunk-E5DT5YTY.js\";\nimport {\n DEFAULT_DOCX_RENDERER_ID,\n DOCX_RENDERER_IDS,\n docxComponentDefinitionName,\n docxPropsSchemaForRenderer\n} from \"./chunk-HDFGXHUB.js\";\n\n// src/schemas/generator.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { latestVersion } from \"@json-to-office/shared\";\nfunction generateUnifiedDocumentSchema(options = {}) {\n return Type.Union(\n DOCX_RENDERER_IDS.map(\n (renderer) => generateRendererDocumentSchema(\n options,\n renderer,\n renderer !== DEFAULT_DOCX_RENDERER_ID\n )\n ),\n {\n description: \"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs.\"\n }\n );\n}\nfunction generateRendererDocumentSchema(options, renderer, requireDiscriminator) {\n const {\n includeStandardComponents = true,\n customComponents = [],\n title = \"JSON Report Definition\",\n description = \"JSON report definition with TypeBox schemas\"\n } = options;\n let capturedRootChildSchemas = [];\n let capturedPluginSchemas = [];\n const definitionName = docxComponentDefinitionName(renderer);\n const ComponentDefinition = Type.Recursive(\n (This) => {\n const pluginSchemas = [];\n for (const customComponent of customComponents) {\n if (customComponent.versionedProps && customComponent.versionedProps.length > 0) {\n const versionEntries = customComponent.versionedProps;\n const latest = latestVersion(versionEntries.map((e) => e.version));\n for (const entry of versionEntries) {\n const versionLiteralDesc = entry.description || customComponent.description;\n const schema = {\n name: Type.Literal(customComponent.name),\n id: Type.Optional(Type.String()),\n version: versionLiteralDesc ? Type.Literal(entry.version, {\n description: versionLiteralDesc\n }) : Type.Literal(entry.version),\n props: entry.propsSchema\n };\n if (entry.hasChildren) {\n schema.children = Type.Optional(Type.Array(This));\n }\n const versionDesc = entry.description ? `${customComponent.name} v${entry.version} \\u2014 ${entry.description}` : customComponent.description ? `${customComponent.name} v${entry.version} \\u2014 ${customComponent.description}` : `${customComponent.name} v${entry.version}`;\n pluginSchemas.push(\n Type.Object(schema, {\n additionalProperties: false,\n description: versionDesc\n })\n );\n }\n const latestEntry = versionEntries.find((e) => e.version === latest);\n const fallbackSchema = {\n name: Type.Literal(customComponent.name),\n id: Type.Optional(Type.String()),\n props: latestEntry.propsSchema\n };\n if (latestEntry.hasChildren) {\n fallbackSchema.children = Type.Optional(Type.Array(This));\n }\n const fallbackDesc = latestEntry.description ? `${customComponent.name} (latest: v${latest}) \\u2014 ${latestEntry.description}` : customComponent.description ? `${customComponent.name} (latest: v${latest}) \\u2014 ${customComponent.description}` : `${customComponent.name} (latest: v${latest})`;\n pluginSchemas.push(\n Type.Object(fallbackSchema, {\n additionalProperties: false,\n description: fallbackDesc\n })\n );\n } else {\n const hasChildren = !!customComponent.hasChildren;\n const schema = {\n name: Type.Literal(customComponent.name),\n id: Type.Optional(Type.String()),\n props: customComponent.propsSchema\n };\n if (hasChildren) {\n schema.children = Type.Optional(Type.Array(This));\n }\n pluginSchemas.push(\n Type.Object(schema, {\n additionalProperties: false,\n ...customComponent.description ? { description: customComponent.description } : {}\n })\n );\n }\n }\n const { schemas: standardSchemas, byName } = includeStandardComponents ? createAllComponentSchemasNarrowed(This, pluginSchemas, {\n renderer,\n requireDiscriminator\n }) : { schemas: [], byName: /* @__PURE__ */ new Map() };\n const sectionComponent = getStandardComponent(\"section\");\n capturedRootChildSchemas = [\n \"section\",\n ...sectionComponent?.allowedChildren ?? []\n ].map((componentName) => byName.get(componentName)).filter((schema) => schema !== void 0);\n capturedPluginSchemas = pluginSchemas;\n const componentSchemas = [...standardSchemas, ...pluginSchemas];\n if (componentSchemas.length === 0) {\n return Type.Any();\n } else if (componentSchemas.length === 1) {\n return componentSchemas[0];\n } else {\n const componentDescription = customComponents.length > 0 ? \"Component definition with discriminated union including custom components\" : \"Component definition with discriminated union\";\n return Type.Union(componentSchemas, {\n discriminator: { propertyName: \"name\" },\n description: componentDescription\n });\n }\n },\n { $id: definitionName }\n );\n const reportComponent = getStandardComponent(\"docx\");\n if (!reportComponent) {\n throw new Error(\"Docx root component not found in registry\");\n }\n if (capturedRootChildSchemas.length === 0) {\n throw new Error(\n \"Root child schemas not found in narrowed standard schemas\"\n );\n }\n return Type.Object(\n {\n name: Type.Literal(\"docx\"),\n id: Type.Optional(Type.String()),\n $schema: Type.Optional(Type.String({ format: \"uri\" })),\n renderer: requireDiscriminator ? Type.Literal(renderer, {\n description: \"Renderer backend for this document\"\n }) : Type.Optional(\n Type.Literal(renderer, {\n description: 'Renderer backend. Omitted defaults to \"docxjs\".'\n })\n ),\n // Optional so the exported schema agrees with the runtime validator and\n // the generator, both of which treat a propless root as `props: {}`.\n // Schema-driven editors would otherwise flag a document that builds.\n props: Type.Optional(\n docxPropsSchemaForRenderer(\n reportComponent.name,\n reportComponent.propsSchema,\n renderer\n )\n ),\n // Required, matching the runtime validator: a root without `children`\n // is rejected (deep-validator.ts), so the exported schema says so too.\n children: Type.Array(\n Type.Union([...capturedRootChildSchemas, ...capturedPluginSchemas], {\n discriminator: { propertyName: \"name\" }\n })\n )\n },\n {\n additionalProperties: false,\n title,\n description,\n // Embed it so convertToJsonSchema extracts it to definitions and this\n // branch's bare `$ref: \"<definitionName>\"` values resolve.\n definitions: { [definitionName]: ComponentDefinition }\n }\n );\n}\n\nexport {\n generateUnifiedDocumentSchema\n};\n//# sourceMappingURL=chunk-7AXWLBH5.js.map","import {\n createAllComponentSchemas,\n createAllComponentSchemasNarrowed\n} from \"./chunk-E5DT5YTY.js\";\n\n// src/schemas/components.ts\nimport { Type } from \"@sinclair/typebox\";\nvar StandardComponentDefinitionSchema = Type.Union(\n // Use Type.Any() for non-recursive standard components\n // Convert readonly array to mutable array for Type.Union\n [...createAllComponentSchemas(Type.Any())],\n {\n discriminator: { propertyName: \"name\" },\n description: \"Standard component definition with discriminated union\"\n }\n);\nvar ComponentDefinitionSchema = Type.Recursive((This) => {\n const { roots, flow } = createAllComponentSchemasNarrowed(This);\n return Type.Union([...roots, flow], {\n discriminator: { propertyName: \"name\" },\n description: \"Component definition with discriminated union\"\n });\n});\n\nexport {\n StandardComponentDefinitionSchema,\n ComponentDefinitionSchema\n};\n//# sourceMappingURL=chunk-AVONZSC5.js.map","// src/schemas/custom-components.ts\nimport { Type } from \"@sinclair/typebox\";\nvar TextSpaceAfterPropsSchema = Type.Object({\n content: Type.String({\n description: \"Text content (required)\"\n }),\n spaceAfter: Type.Optional(\n Type.Number({\n minimum: 0,\n description: \"Spacing after text in points\"\n })\n ),\n fontSize: Type.Optional(Type.Number({ minimum: 1 })),\n fontFamily: Type.Optional(Type.String()),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(Type.Integer({ minimum: 100, maximum: 900 })),\n italic: Type.Optional(Type.Boolean()),\n underline: Type.Optional(Type.Boolean()),\n color: Type.Optional(\n Type.String({\n pattern: \"^#[0-9A-Fa-f]{6}$\"\n })\n ),\n alignment: Type.Optional(\n Type.Union([\n Type.Literal(\"left\"),\n Type.Literal(\"center\"),\n Type.Literal(\"right\"),\n Type.Literal(\"justify\")\n ])\n )\n});\nvar TextSpaceAfterComponentSchema = Type.Object({\n name: Type.Literal(\"text-space-after\"),\n id: Type.Optional(Type.String()),\n props: TextSpaceAfterPropsSchema\n});\nvar CustomComponentDefinitionSchema = TextSpaceAfterComponentSchema;\n\nexport {\n TextSpaceAfterPropsSchema,\n TextSpaceAfterComponentSchema,\n CustomComponentDefinitionSchema\n};\n//# sourceMappingURL=chunk-7GGTZ4TA.js.map","import {\n ComponentDefinitionSchema,\n StandardComponentDefinitionSchema\n} from \"./chunk-AVONZSC5.js\";\nimport {\n ReportPropsSchema,\n STANDARD_COMPONENTS_REGISTRY,\n createComponentSchemaObject\n} from \"./chunk-E5DT5YTY.js\";\nimport {\n collectDocxRendererErrors\n} from \"./chunk-HDFGXHUB.js\";\nimport {\n CustomComponentDefinitionSchema\n} from \"./chunk-7GGTZ4TA.js\";\n\n// src/validation/unified/error-transformer.ts\nimport {\n isObjectSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n createErrorConfig,\n formatErrorMessage,\n ERROR_EMOJIS\n} from \"@json-to-office/shared\";\nfunction generateEnhancedMessage(error, _config) {\n const typeStr = String(error.type || \"\");\n const path = error.path || \"root\";\n if (typeStr === \"62\" || typeStr === \"union\") {\n return generateUnionErrorMessage(error);\n }\n if (error.message?.includes(\"additionalProperties\")) {\n return generateAdditionalPropertiesMessage(error);\n }\n if (error.message?.includes(\"Required property\")) {\n return generateRequiredPropertyMessage(error);\n }\n if (typeStr === \"string\" || typeStr === \"number\" || typeStr === \"boolean\" || typeStr === \"array\" || typeStr === \"object\") {\n return generateTypeMismatchMessage(error);\n }\n if (typeStr === \"literal\") {\n return generateLiteralErrorMessage(error);\n }\n if (typeStr === \"pattern\" || typeStr === \"RegExp\") {\n return generatePatternErrorMessage(error);\n }\n return `At ${path}: ${error.message}`;\n}\nfunction generateUnionErrorMessage(error) {\n const path = error.path || \"root\";\n const value = error.value;\n if (path === \"root\" || path === \"/\" || path === \"/jsonDefinition\") {\n if (value && typeof value === \"object\") {\n if (\"name\" in value) {\n const name = value.name;\n if (name === \"docx\") {\n return \"Document structure appears valid but contains invalid component configurations. Check each component for errors.\";\n }\n return `Unknown document name '${name}'. Expected 'docx'.`;\n }\n const valueAny = value;\n if (\"children\" in value && Array.isArray(valueAny.children)) {\n return `Document is missing required 'name' field. Add \"name\": \"docx\" at the root level.`;\n }\n if (\"name\" in value || \"styles\" in value) {\n return \"This appears to be a theme configuration. Use --type theme or ensure proper document structure.\";\n }\n }\n return 'Invalid document structure. Expected a document with name=\"docx\" or a theme configuration.';\n }\n if (path.includes(\"/children/\")) {\n if (value && typeof value === \"object\" && \"name\" in value) {\n const componentType = value.name;\n return `Invalid component configuration for type '${componentType}'. Check that all required fields are present and correctly formatted.`;\n }\n return 'Invalid component structure. Each component must have a \"name\" field and valid configuration.';\n }\n return `Value at ${path} doesn't match any of the expected formats. Check the structure and required fields.`;\n}\nfunction generateAdditionalPropertiesMessage(error) {\n const path = error.path || \"root\";\n const value = error.value;\n if (typeof value === \"object\" && value !== null) {\n const schema = error.schema;\n if (schema && isObjectSchema(schema)) {\n const knownProps = getObjectSchemaPropertyNames(schema);\n const actualProps = Object.keys(value);\n const unknownProps = actualProps.filter((p) => !knownProps.includes(p));\n if (unknownProps.length > 0) {\n return `Unknown properties at ${path}: ${unknownProps.join(\", \")}. Allowed properties are: ${knownProps.join(\", \")}`;\n }\n }\n }\n return `Additional properties not allowed at ${path}. Check for typos or unsupported fields.`;\n}\nfunction generateRequiredPropertyMessage(error) {\n const path = error.path || \"root\";\n const match = error.message?.match(/Required property '([^']+)'/);\n if (match) {\n const propName = match[1];\n return `Missing required field '${propName}' at ${path}. This field is mandatory for this configuration.`;\n }\n return `Missing required property at ${path}. Check that all mandatory fields are present.`;\n}\nfunction generateTypeMismatchMessage(error) {\n const path = error.path || \"root\";\n const expectedType = String(error.type);\n const actualType = Array.isArray(error.value) ? \"array\" : typeof error.value;\n if (path.includes(\"alignment\")) {\n return `Invalid alignment value at ${path}. Expected one of: left, center, right, justify`;\n }\n if (path.includes(\"color\")) {\n return `Invalid color value at ${path}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`;\n }\n if (path.includes(\"fontSize\") || path.includes(\"size\")) {\n return `Invalid size value at ${path}. Expected a number (in points)`;\n }\n if (path.includes(\"margin\") || path.includes(\"padding\") || path.includes(\"spacing\")) {\n return `Invalid spacing value at ${path}. Expected a number or spacing object with top/bottom/left/right`;\n }\n return `Type mismatch at ${path}: Expected ${expectedType} but got ${actualType}`;\n}\nfunction generateLiteralErrorMessage(error) {\n const path = error.path || \"root\";\n const expected = error.schema ? JSON.stringify(getLiteralValue(error.schema)) : \"specific value\";\n const actual = JSON.stringify(error.value);\n return `Invalid value at ${path}: Expected exactly ${expected} but got ${actual}`;\n}\nfunction generatePatternErrorMessage(error) {\n const path = error.path || \"root\";\n if (path.includes(\"email\")) {\n return `Invalid email format at ${path}. Use format: user@example.com`;\n }\n if (path.includes(\"url\") || path.includes(\"link\")) {\n return `Invalid URL format at ${path}. Use format: https://example.com`;\n }\n if (path.includes(\"date\")) {\n return `Invalid date format at ${path}. Use ISO format: YYYY-MM-DD`;\n }\n if (path.includes(\"phone\")) {\n return `Invalid phone number format at ${path}`;\n }\n return `Value at ${path} doesn't match the required pattern`;\n}\nfunction transformValueError(error, jsonString, config) {\n const formatterConfig = createErrorConfig(config);\n const enhancedMessage = generateEnhancedMessage(error, formatterConfig);\n const baseError = {\n path: error.path || \"root\",\n message: formatErrorMessage(\n enhancedMessage || error.message,\n formatterConfig\n ),\n code: String(error.type || \"validation_error\"),\n value: error.value\n };\n if (formatterConfig.includeSuggestions) {\n const suggestion = getSuggestion(error, formatterConfig);\n if (suggestion) {\n baseError.suggestion = formatErrorMessage(suggestion, formatterConfig);\n }\n }\n if (jsonString && error.path) {\n const position = calculatePosition(jsonString, error.path);\n if (position) {\n baseError.line = position.line;\n baseError.column = position.column;\n }\n }\n return baseError;\n}\nfunction transformValueErrors(errors, options) {\n const maxErrors = options?.maxErrors ?? Number.MAX_SAFE_INTEGER;\n const result = [];\n const seenPaths = /* @__PURE__ */ new Set();\n for (const error of errors) {\n if (result.length >= maxErrors) break;\n const errorKey = `${error.path}:${error.type}`;\n if (!seenPaths.has(errorKey)) {\n seenPaths.add(errorKey);\n result.push(transformValueError(error, options?.jsonString, void 0));\n }\n }\n return result;\n}\nfunction calculatePosition(jsonString, path) {\n try {\n const pathParts = path.split(\"/\").filter(Boolean);\n if (pathParts.length === 0) {\n return { line: 1, column: 1 };\n }\n const lastPart = pathParts[pathParts.length - 1];\n const searchPattern = `\"${lastPart}\"`;\n const index = jsonString.indexOf(searchPattern);\n if (index === -1) {\n return { line: 1, column: 1 };\n }\n const beforeError = jsonString.substring(0, index);\n const lines = beforeError.split(\"\\n\");\n const line = lines.length;\n const column = lines[lines.length - 1].length + 1;\n return { line, column };\n } catch {\n return null;\n }\n}\nfunction getSuggestion(error, config) {\n const { type, path, value } = error;\n const typeStr = String(type);\n if (typeStr === \"62\" || typeStr === \"union\") {\n if (path === \"root\" || path === \"/\") {\n if (value && typeof value === \"object\") {\n if (!(\"name\" in value)) {\n const msg = 'Add a \"name\" field with value \"docx\" for documents';\n return config.includeEmojis ? `${ERROR_EMOJIS.FIX} ${msg}` : msg;\n }\n if (\"props\" in value && typeof value.props === \"object\") {\n const knownFields = getObjectSchemaPropertyNames(ReportPropsSchema);\n return `Review the props section for unsupported fields. Allowed fields: ${knownFields.join(\", \")}`;\n }\n }\n return 'Ensure the document has proper structure: { \"name\": \"docx\", \"props\": {...}, \"children\": [...] }';\n }\n if (path?.includes(\"/children/\")) {\n return 'Check that the component has a valid \"name\" and all required fields for that component type';\n }\n return \"Review the structure and ensure all required fields are present with correct types\";\n }\n if (error.message?.includes(\"additionalProperties\")) {\n return \"Remove any unknown or unsupported fields. Check documentation for allowed properties.\";\n }\n if (error.message?.includes(\"Required property\")) {\n return \"Add the missing required field to fix this error\";\n }\n if (typeStr === \"string\") {\n if (path?.includes(\"alignment\")) {\n return \"Use one of: left, center, right, justify\";\n }\n if (path?.includes(\"color\")) {\n return \"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)\";\n }\n return \"Provide a text string value\";\n }\n if (typeStr === \"number\") {\n if (path?.includes(\"fontSize\") || path?.includes(\"size\")) {\n return \"Use a number in points (e.g., 12, 14, 16)\";\n }\n if (path?.includes(\"margin\") || path?.includes(\"padding\")) {\n return \"Use a number for spacing in points\";\n }\n return \"Provide a numeric value\";\n }\n if (typeStr === \"boolean\") {\n return \"Use true or false (without quotes)\";\n }\n if (typeStr === \"array\") {\n if (path?.includes(\"children\")) {\n return 'Provide an array of component objects, each with a \"name\" field';\n }\n return \"Provide an array/list of values using square brackets []\";\n }\n if (typeStr === \"object\") {\n return \"Provide an object with key-value pairs using curly braces {}\";\n }\n if (typeStr === \"literal\") {\n const expected = error.schema ? JSON.stringify(getLiteralValue(error.schema)) : \"specific value\";\n return `Use exactly this value: ${expected}`;\n }\n if (typeStr === \"pattern\" || typeStr === \"RegExp\") {\n if (path?.includes(\"email\")) {\n return \"Use valid email format: user@example.com\";\n }\n if (path?.includes(\"url\")) {\n return \"Use valid URL format: https://example.com\";\n }\n if (path?.includes(\"date\")) {\n return \"Use ISO date format: YYYY-MM-DD\";\n }\n return \"Ensure the value matches the required format\";\n }\n if (path?.includes(\"name\") || path?.includes(\"type\")) {\n return \"Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual\";\n }\n return void 0;\n}\n\n// src/validation/unified/deep-validator.ts\nimport { Value } from \"@sinclair/typebox/value\";\nvar COMPONENT_SCHEMAS = Object.fromEntries([\n ...STANDARD_COMPONENTS_REGISTRY.map((c) => [c.name, c.propsSchema]),\n [\"custom\", CustomComponentDefinitionSchema]\n]);\nvar EMBEDDED_REGIONS = new Map(\n STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => (c.embeddedComponents?.length ?? 0) > 0\n ).map((c) => [c.name, c.embeddedComponents])\n);\nvar ROOT_COMPONENT_NAMES = new Set(\n STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => Boolean(c.special?.hasSchemaField)\n ).map((c) => c.name)\n);\nvar ALLOWED_SIBLING_KEYS = new Map(\n STANDARD_COMPONENTS_REGISTRY.map((c) => [\n c.name,\n /* @__PURE__ */ new Set([\n \"name\",\n \"id\",\n \"enabled\",\n \"props\",\n ...c.hasChildren ? [\"children\"] : [],\n ...c.special?.hasSchemaField ? [\"$schema\", \"renderer\"] : []\n ])\n ])\n);\nvar SIBLING_KEY_TYPES = {\n id: \"string\",\n enabled: \"boolean\",\n $schema: \"string\",\n renderer: \"string\"\n};\nfunction collectSiblingKeyErrors(node, path, opts, errors) {\n const allowed = typeof node.name === \"string\" ? ALLOWED_SIBLING_KEYS.get(node.name) : void 0;\n if (!allowed) return;\n for (const key of Object.keys(node)) {\n if (!allowed.has(key)) {\n if (opts.allowUnknownFields) continue;\n errors.push({\n path: `${path}/${key}`,\n message: `Unknown key \"${key}\" on component \"${node.name}\". Allowed keys: ${[\n ...allowed\n ].join(\", \")}.`,\n code: \"unknown_key\"\n });\n continue;\n }\n const expected = SIBLING_KEY_TYPES[key];\n if (expected && typeof node[key] !== expected) {\n errors.push({\n path: `${path}/${key}`,\n message: `Key \"${key}\" on component \"${node.name}\" must be a ${expected}.`,\n code: \"invalid_type\"\n });\n }\n }\n}\nvar IMAGE_SOURCE_FIELDS = [\"path\", \"base64\", \"svg\"];\nfunction presentImageSources(props) {\n if (!props || typeof props !== \"object\") return [];\n const p = props;\n return IMAGE_SOURCE_FIELDS.filter((f) => {\n const v = p[f];\n return typeof v === \"string\" && v.trim().length > 0;\n });\n}\nfunction collectImageSourceConflicts(data) {\n const errors = [];\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n if (node.name === \"image\") {\n const present = presentImageSources(node.props);\n if (present.length > 1) {\n errors.push({\n path: `${path}/props`,\n message: `Image component accepts only one source, but found ${present.map((f) => `\"${f}\"`).join(\", \")}. Use exactly one of \"path\", \"base64\", or \"svg\".`,\n code: \"mutually_exclusive\"\n });\n }\n }\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n visit(data, \"\");\n return errors;\n}\nvar INDENT_COMPONENT_NAMES = /* @__PURE__ */ new Set([\"paragraph\", \"heading\"]);\nfunction collectIndentConflicts(data) {\n const errors = [];\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n if (INDENT_COMPONENT_NAMES.has(node.name)) {\n const indent = node.props?.indent;\n if (indent && typeof indent === \"object\" && indent.hanging !== void 0 && indent.firstLine !== void 0) {\n errors.push({\n path: `${path}/props/indent`,\n message: 'Indent accepts either \"hanging\" or \"firstLine\", not both. Use exactly one of the two.',\n code: \"mutually_exclusive\"\n });\n }\n }\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n visit(data, \"\");\n return errors;\n}\nfunction collectNoteRevisionConflicts(data) {\n const errors = [];\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n const revisedNotes = [];\n if (node.name === \"paragraph\" && node.props?.revision) {\n for (const kind of [\"footnotes\", \"endnotes\"]) {\n revisedNotes.push({\n notes: node.props[kind],\n path: `${path}/props/${kind}`\n });\n }\n }\n if (node.revision && node.content?.name === \"paragraph\") {\n for (const kind of [\"footnotes\", \"endnotes\"]) {\n revisedNotes.push({\n notes: node.content.props?.[kind],\n path: `${path}/content/props/${kind}`\n });\n }\n }\n for (const { notes, path: notesPath } of revisedNotes) {\n if (Array.isArray(notes) && notes.length > 0) {\n const kind = notesPath.endsWith(\"endnotes\") ? \"endnotes\" : \"footnotes\";\n errors.push({\n path: notesPath,\n message: `\"revision\" and \"${kind}\" 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.`,\n code: \"mutually_exclusive\"\n });\n }\n }\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n visit(data, \"\");\n return errors;\n}\nvar UNDASHABLE_BORDER_STYLES = /* @__PURE__ */ new Set([\"dashed\", \"dotted\", \"double\"]);\nfunction collectTextBoxShapeConflicts(data) {\n const errors = [];\n const visit = (node, path) => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== \"object\") return;\n if (node.name === \"text-box\" && node.props?.renderAs === \"shape\") {\n const missing = [\"width\", \"height\"].filter(\n (axis) => node.props[axis] === void 0\n );\n if (missing.length > 0) {\n errors.push({\n path: `${path}/props/${missing[0]}`,\n message: `A text-box with renderAs \"shape\" requires ${missing.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.`,\n code: \"required\"\n });\n }\n const border = node.props.style?.border;\n if (border && typeof border === \"object\") {\n for (const side of [\"top\", \"right\", \"bottom\", \"left\"]) {\n const style = border[side]?.style;\n if (typeof style === \"string\" && UNDASHABLE_BORDER_STYLES.has(style)) {\n errors.push({\n path: `${path}/props/style/border/${side}/style`,\n message: `A text-box with renderAs \"shape\" cannot draw a \"${style}\" border: a shape outline carries no dash pattern. Use \"solid\", or use renderAs \"table\", which draws every border style.`,\n code: \"unsupported_value\"\n });\n }\n }\n }\n }\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n visit(data, \"\");\n return errors;\n}\nfunction deepValidateDocument(data, opts = {}) {\n const allErrors = [];\n if (!data || typeof data !== \"object\") {\n allErrors.push({\n path: \"root\",\n message: \"Document must be an object\",\n code: \"invalid_type\"\n });\n return allErrors;\n }\n if (!data.name) {\n allErrors.push({\n path: \"/name\",\n message: 'Missing required field \"name\"',\n code: \"required_property\"\n });\n } else if (!ROOT_COMPONENT_NAMES.has(data.name)) {\n const expected = [...ROOT_COMPONENT_NAMES].map((n) => `\"${n}\"`).join(\", \");\n allErrors.push({\n path: \"/name\",\n message: `Invalid name \"${data.name}\". Expected ${expected}`,\n code: \"invalid_value\"\n });\n }\n collectSiblingKeyErrors(data, \"\", opts, allErrors);\n if (ROOT_COMPONENT_NAMES.has(data.name) && \"props\" in data) {\n const propsErrors = validateComponentProps(\n data.name,\n data.props,\n \"/props\",\n opts\n );\n allErrors.push(...propsErrors);\n }\n if (!data.children) {\n allErrors.push({\n path: \"/children\",\n message: 'Missing required field \"children\"',\n code: \"required_property\"\n });\n } else if (!Array.isArray(data.children)) {\n allErrors.push({\n path: \"/children\",\n message: 'Field \"children\" must be an array',\n code: \"invalid_type\"\n });\n }\n walkComponentTree(data, \"\", opts, allErrors);\n return allErrors;\n}\nfunction walkComponentTree(node, path, opts, errors) {\n if (!node || typeof node !== \"object\") return;\n const validateEntry = (child, childPath, strictStructure) => {\n if (!child || typeof child !== \"object\") {\n if (strictStructure) {\n errors.push({\n path: childPath,\n message: \"Component must be an object\",\n code: \"invalid_type\"\n });\n }\n return;\n }\n if (typeof child.name !== \"string\" || child.name.length === 0) {\n if (strictStructure) {\n errors.push({\n path: `${childPath}/name`,\n message: 'Component missing required field \"name\"',\n code: \"required_property\"\n });\n }\n return;\n }\n if (opts.knownCustomNames?.has(child.name)) return;\n collectSiblingKeyErrors(child, childPath, opts, errors);\n if (\"props\" in child) {\n errors.push(\n ...validateComponentProps(\n child.name,\n child.props,\n `${childPath}/props`,\n opts\n )\n );\n } else if (child.name !== \"custom\") {\n errors.push(\n ...validateComponentProps(child.name, {}, `${childPath}/props`, opts)\n );\n }\n walkComponentTree(child, childPath, opts, errors);\n };\n const regions = typeof node.name === \"string\" ? EMBEDDED_REGIONS.get(node.name) : void 0;\n if (regions && node.props && typeof node.props === \"object\") {\n for (const region of regions) {\n resolveRegionValues(\n node.props,\n region.path,\n `${path}/props`,\n (value, valuePath) => {\n if (region.arity === \"component-array\") {\n if (Array.isArray(value)) {\n value.forEach(\n (child, i) => validateEntry(\n child,\n `${valuePath}/${i}`,\n region.reportStructure\n )\n );\n }\n } else if (value && typeof value === \"object\" && !Array.isArray(value)) {\n validateEntry(value, valuePath, region.reportStructure);\n }\n }\n );\n }\n }\n if (Array.isArray(node.children)) {\n node.children.forEach(\n (child, i) => validateEntry(child, `${path}/children/${i}`, true)\n );\n } else if (node.children != null && path !== \"\") {\n errors.push({\n path: `${path}/children`,\n message: 'Field \"children\" must be an array',\n code: \"invalid_type\"\n });\n }\n}\nfunction resolveRegionValues(value, segments, path, visit) {\n if (segments.length === 0) {\n visit(value, path);\n return;\n }\n if (!value || typeof value !== \"object\") return;\n const [head, ...rest] = segments;\n if (head === \"*\") {\n if (!Array.isArray(value)) return;\n value.forEach(\n (item, i) => resolveRegionValues(item, rest, `${path}/${i}`, visit)\n );\n return;\n }\n resolveRegionValues(value[head], rest, `${path}/${head}`, visit);\n}\nfunction validateComponentProps(componentName, props, basePath, opts = {}) {\n const errors = [];\n const schema = COMPONENT_SCHEMAS[componentName];\n if (!schema) {\n errors.push({\n path: basePath.replace(/\\/props$/, \"/name\"),\n message: `Unknown component \"${componentName}\"`,\n code: \"unknown_component\"\n });\n return errors;\n }\n const branch = selectPropsBranch(schema, props);\n const toCheck = opts.allowUnknownFields ? Value.Clean(branch, Value.Clone(props)) : props;\n if (!Value.Check(branch, toCheck)) {\n const valueErrors = [...Value.Errors(branch, toCheck)];\n const transformedErrors = transformValueErrors(valueErrors, {\n maxErrors: 100\n });\n transformedErrors.forEach((error) => {\n const fullPath = error.path === \"root\" ? basePath : `${basePath}${error.path.startsWith(\"/\") ? error.path : \"/\" + error.path}`;\n errors.push({\n ...error,\n path: fullPath\n });\n });\n }\n return errors;\n}\nfunction selectPropsBranch(schema, props) {\n const branches = schema.anyOf;\n if (!Array.isArray(branches) || branches.length === 0) return schema;\n const claimed = branches.filter((branch) => claimsProps(branch, props));\n if (claimed.length === 1) return claimed[0];\n const candidates = claimed.length > 1 ? claimed : branches;\n let best = candidates[0];\n let fewest = Number.POSITIVE_INFINITY;\n for (const candidate of candidates) {\n const count = [...Value.Errors(candidate, props)].length;\n if (count < fewest) {\n fewest = count;\n best = candidate;\n }\n }\n return best;\n}\nfunction claimsProps(branch, props) {\n const properties = branch.properties;\n if (!properties) return false;\n const required = new Set(\n branch.required ?? []\n );\n const value = props ?? {};\n for (const [key, propertySchema] of Object.entries(properties)) {\n const literal = propertySchema.const;\n if (literal === void 0) continue;\n const present = value[key] !== void 0;\n if (!present) {\n if (required.has(key)) return false;\n continue;\n }\n if (value[key] !== literal) return false;\n }\n return true;\n}\nfunction comprehensiveValidateDocument(data, existingErrors = [], opts = {}) {\n const deepErrors = deepValidateDocument(data, opts);\n const filteredExisting = existingErrors.filter(\n (e) => !isGenericUnionCatchAll(e)\n );\n return deduplicateErrors([...filteredExisting, ...deepErrors]);\n}\nfunction isGenericUnionCatchAll(error) {\n const atRoot = !error.path || error.path === \"root\" || error.path === \"/\";\n if (!atRoot) return false;\n const msg = error.message || \"\";\n return /invalid component configurations?/i.test(msg) || /invalid document structure/i.test(msg);\n}\nfunction deduplicateErrors(errors) {\n const seen = /* @__PURE__ */ new Set();\n const unique = [];\n for (const error of errors) {\n const key = `${error.path}:${error.message}`;\n if (!seen.has(key)) {\n seen.add(key);\n unique.push(error);\n }\n }\n return unique;\n}\n\n// src/validation/unified/base-validator.ts\nimport { Value as Value2 } from \"@sinclair/typebox/value\";\nimport {\n transformValueErrors as transformValueErrors2,\n createJsonParseError,\n formatErrorSummary\n} from \"@json-to-office/shared\";\nfunction validateAgainstSchema(schema, data, options) {\n try {\n if (!Value2.Check(schema, data)) {\n const errors = [...Value2.Errors(schema, data)];\n const transformedErrors = transformValueErrors2(errors, {\n jsonString: options?.jsonString,\n maxErrors: options?.maxErrors || 100\n // Default to 100 if not specified\n });\n return {\n valid: false,\n errors: transformedErrors\n };\n }\n let processedData = data;\n if (options?.clean) {\n processedData = Value2.Clean(schema, Value2.Clone(processedData));\n }\n if (options?.applyDefaults) {\n processedData = Value2.Default(schema, processedData);\n }\n return {\n valid: true,\n data: processedData\n };\n } catch (error) {\n return {\n valid: false,\n errors: [\n {\n path: \"root\",\n message: error instanceof Error ? error.message : \"Unknown validation error\",\n code: \"validation_exception\"\n }\n ]\n };\n }\n}\nfunction validateJson(schema, jsonInput, options) {\n if (typeof jsonInput === \"string\") {\n if (!jsonInput.trim()) {\n return {\n valid: false,\n errors: [\n {\n path: \"root\",\n message: \"Input must be a non-empty string\",\n code: \"empty_input\"\n }\n ],\n isJsonError: true\n };\n }\n let parsed;\n try {\n parsed = JSON.parse(jsonInput);\n } catch (error) {\n if (error instanceof Error) {\n return {\n valid: false,\n errors: [createJsonParseError(error, jsonInput)],\n isJsonError: true\n };\n }\n return {\n valid: false,\n errors: [\n {\n path: \"root\",\n message: \"Failed to parse JSON\",\n code: \"json_parse_error\"\n }\n ],\n isJsonError: true\n };\n }\n const result2 = validateAgainstSchema(schema, parsed, {\n ...options,\n jsonString: jsonInput,\n calculatePosition: true\n });\n return {\n ...result2,\n parsed,\n isJsonError: false\n };\n }\n const result = validateAgainstSchema(schema, jsonInput, options);\n return {\n ...result,\n parsed: jsonInput,\n isJsonError: false\n };\n}\nfunction validateBatch(schema, items, options) {\n const results = [];\n const allErrors = [];\n let hasErrors = false;\n for (let i = 0; i < items.length; i++) {\n const result = validateAgainstSchema(schema, items[i], options);\n if (result.valid && result.data) {\n results.push(result.data);\n } else {\n hasErrors = true;\n if (result.errors) {\n const prefixedErrors = result.errors.map((e) => ({\n ...e,\n path: `[${i}]${e.path ? \"/\" + e.path : \"\"}`\n }));\n allErrors.push(...prefixedErrors);\n }\n }\n if (options?.maxErrors && allErrors.length >= options.maxErrors) {\n break;\n }\n }\n if (hasErrors) {\n return {\n valid: false,\n errors: allErrors.slice(0, options?.maxErrors)\n };\n }\n return {\n valid: true,\n data: results\n };\n}\nfunction validateWithEnhancement(schema, data, enhancer, options) {\n const result = validateAgainstSchema(schema, data, options);\n if (!result.valid && result.errors) {\n result.errors = enhancer(result.errors);\n }\n return result;\n}\nfunction createValidator(schema, defaultOptions) {\n return (data, options) => {\n return validateAgainstSchema(schema, data, {\n ...defaultOptions,\n ...options\n });\n };\n}\nfunction createJsonValidator(schema, defaultOptions) {\n return (jsonInput, options) => {\n return validateJson(schema, jsonInput, {\n ...defaultOptions,\n ...options\n });\n };\n}\nfunction isValidationSuccess(result) {\n return result.valid === true && result.data !== void 0;\n}\nfunction getValidationSummary(result) {\n if (result.valid) {\n return \"Validation successful\";\n }\n if (!result.errors || result.errors.length === 0) {\n return \"Validation failed with unknown error\";\n }\n return formatErrorSummary(result.errors);\n}\n\n// src/validation/unified/document-validator.ts\nimport { Type } from \"@sinclair/typebox\";\nimport { Value as Value3 } from \"@sinclair/typebox/value\";\nimport {\n readBlockDefinitions,\n validateBlockInvocations,\n extractStandardComponentNames\n} from \"@json-to-office/shared\";\nvar JsonComponentDefinitionSchema = ComponentDefinitionSchema;\nvar SEMANTIC_COLLECTORS = [\n {\n // A multi-source image passes the structural check: each source is its own\n // optional field.\n why: \"image source mutual-exclusivity\",\n collect: collectImageSourceConflicts\n },\n {\n why: \"indent hanging/firstLine mutual-exclusivity\",\n collect: collectIndentConflicts\n },\n {\n // Tracked-change text renders literally, so a note marker inside it never\n // resolves and docx cannot express the pair anyway.\n why: \"notes on a revised paragraph\",\n collect: collectNoteRevisionConflicts\n },\n {\n // A shape has no autofit and its outline carries no dash pattern, so the\n // request could only ever come back as a table.\n why: \"a text box asking for a shape rendering a shape cannot give it\",\n collect: collectTextBoxShapeConflicts\n },\n {\n why: \"renderer profile compatibility\",\n collect: collectDocxRendererErrors\n }\n];\nfunction collectSemanticConflicts(document) {\n return SEMANTIC_COLLECTORS.flatMap(({ collect }) => collect(document));\n}\nfunction referencesCustomComponent(node, names) {\n if (Array.isArray(node)) {\n return node.some((item) => referencesCustomComponent(item, names));\n }\n if (!node || typeof node !== \"object\") return false;\n const record = node;\n if (typeof record.name === \"string\" && names.has(record.name)) return true;\n return Object.values(record).some(\n (value) => referencesCustomComponent(value, names)\n );\n}\nvar containmentRelaxedSchema;\nfunction getContainmentRelaxedSchema() {\n containmentRelaxedSchema ??= Type.Recursive(\n (This) => Type.Union(\n STANDARD_COMPONENTS_REGISTRY.map(\n (component) => createComponentSchemaObject(component, This, This)\n )\n )\n );\n return containmentRelaxedSchema;\n}\nfunction resolveEmptyWalk(document, stageOneErrors, options) {\n if (options?.allowUnknownFields === true || options?.knownCustomNames !== void 0 && options.knownCustomNames.size > 0 && referencesCustomComponent(document, options.knownCustomNames) || Value3.Check(getContainmentRelaxedSchema(), document)) {\n return { valid: true, errors: [] };\n }\n const errors = stageOneErrors.length > 0 ? stageOneErrors : [\n {\n path: \"root\",\n message: \"Document does not match the 'docx' document schema.\",\n code: \"invalid_document\"\n }\n ];\n return {\n valid: false,\n errors: [\n ...errors,\n {\n path: \"root\",\n 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.',\n code: \"unlocalized_schema_error\"\n }\n ]\n };\n}\nfunction deepValidateRejected(document, stageOneErrors, options) {\n const errors = comprehensiveValidateDocument(document, stageOneErrors, {\n allowUnknownFields: options?.allowUnknownFields,\n knownCustomNames: options?.knownCustomNames\n });\n if (errors.length === 0) {\n return resolveEmptyWalk(document, stageOneErrors, options);\n }\n return { valid: false, errors };\n}\nfunction validateDocument(data, options) {\n const result = validateAgainstSchema(\n ComponentDefinitionSchema,\n data,\n options\n );\n let finalErrors = result.errors || [];\n let finalValid = result.valid;\n if (!result.valid && data) {\n ({ valid: finalValid, errors: finalErrors } = deepValidateRejected(\n data,\n result.errors || [],\n options\n ));\n }\n const semanticConflicts = [\n ...collectSemanticConflicts(data),\n ...validateBlockInvocations(data, readBlockDefinitions(data), \"docx\", [\n ...options?.knownCustomNames ?? []\n ])\n ];\n if (semanticConflicts.length > 0) {\n finalErrors = [...finalErrors, ...semanticConflicts];\n finalValid = false;\n }\n const resolvedData = result.data ?? (finalValid ? data : void 0);\n const documentResult = {\n ...result,\n valid: finalValid,\n documentType: \"docx\",\n errors: finalErrors,\n data: resolvedData\n };\n if (finalValid) {\n const doc = resolvedData;\n if (doc && doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n return documentResult;\n}\nfunction validateJsonDocument(jsonInput, options) {\n const result = validateJson(\n JsonComponentDefinitionSchema,\n jsonInput,\n options\n );\n let finalErrors = result.errors || [];\n let finalValid = result.valid;\n if (!result.valid && result.parsed) {\n ({ valid: finalValid, errors: finalErrors } = deepValidateRejected(\n result.parsed,\n result.errors || [],\n options\n ));\n }\n const semanticConflicts = [\n ...collectSemanticConflicts(result.parsed),\n ...validateBlockInvocations(\n result.parsed,\n readBlockDefinitions(result.parsed),\n \"docx\",\n [...options?.knownCustomNames ?? []]\n )\n ];\n if (semanticConflicts.length > 0) {\n finalErrors = [...finalErrors, ...semanticConflicts];\n finalValid = false;\n }\n const resolvedData = result.data ?? (finalValid ? result.parsed : void 0);\n const documentResult = {\n ...result,\n valid: finalValid,\n documentType: \"docx\",\n errors: finalErrors,\n data: resolvedData\n };\n if (finalValid) {\n const doc = resolvedData;\n if (doc && doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n return documentResult;\n}\nfunction isValidDocument(result) {\n return result.valid === true && result.data !== void 0;\n}\nfunction getStandardComponentNames() {\n return extractStandardComponentNames(StandardComponentDefinitionSchema);\n}\nfunction isStandardComponentName(name) {\n const standardNames = getStandardComponentNames();\n return standardNames.includes(name);\n}\nfunction createDocumentValidator(defaultOptions) {\n return {\n validate: (data, options) => validateDocument(data, { ...defaultOptions, ...options }),\n validateJson: (jsonInput, options) => validateJsonDocument(jsonInput, { ...defaultOptions, ...options })\n };\n}\nvar documentValidator = createDocumentValidator({\n clean: true,\n applyDefaults: true,\n maxErrors: 100\n // Collect up to 100 errors to show all validation issues\n});\nvar strictDocumentValidator = createDocumentValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 100\n // Increased from 10 to show more errors\n});\nvar validateJsonComponent = validateJsonDocument;\nvar validateDocumentWithSchema = validateDocument;\n\nexport {\n transformValueError,\n transformValueErrors,\n collectIndentConflicts,\n collectNoteRevisionConflicts,\n collectTextBoxShapeConflicts,\n deepValidateDocument,\n comprehensiveValidateDocument,\n validateAgainstSchema,\n validateJson,\n validateBatch,\n validateWithEnhancement,\n createValidator,\n createJsonValidator,\n isValidationSuccess,\n getValidationSummary,\n validateDocument,\n validateJsonDocument,\n isValidDocument,\n createDocumentValidator,\n documentValidator,\n strictDocumentValidator,\n validateJsonComponent,\n validateDocumentWithSchema\n};\n//# sourceMappingURL=chunk-AT4X3CGA.js.map","import {\n documentValidator,\n strictDocumentValidator,\n validateAgainstSchema,\n validateJson\n} from \"./chunk-AT4X3CGA.js\";\nimport {\n ComponentDefinitionSchema\n} from \"./chunk-AVONZSC5.js\";\nimport {\n ReportPropsSchema\n} from \"./chunk-E5DT5YTY.js\";\nimport {\n ThemeConfigSchema\n} from \"./chunk-OVL4RTD7.js\";\nimport {\n ColumnsPropsSchema,\n HeadingPropsSchema,\n ImagePropsSchema,\n ListPropsSchema,\n ParagraphPropsSchema,\n SectionPropsSchema,\n StatisticPropsSchema,\n TablePropsSchema\n} from \"./chunk-W6KB2SMK.js\";\nimport {\n CustomComponentDefinitionSchema\n} from \"./chunk-7GGTZ4TA.js\";\n\n// src/validation/unified/index.ts\nimport {\n transformValueError,\n transformValueErrors,\n calculatePosition,\n formatErrorSummary,\n groupErrorsByPath,\n createJsonParseError\n} from \"@json-to-office/shared\";\nimport {\n isUnionSchema,\n isObjectSchema,\n isLiteralSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n extractStandardComponentNames,\n clearComponentNamesCache,\n getSchemaMetadata\n} from \"@json-to-office/shared\";\nimport {\n DEFAULT_ERROR_CONFIG as DEFAULT_ERROR_CONFIG2,\n ERROR_EMOJIS,\n createErrorConfig,\n formatErrorMessage\n} from \"@json-to-office/shared\";\n\n// src/validation/unified/error-formatter-config.ts\nfunction getDefaultConfig() {\n return {\n includeEmojis: !isCI(),\n verbosity: \"normal\",\n includeSuggestions: true,\n includePath: true,\n maxMessageLength: 0,\n includeDocLinks: false,\n colorSupport: hasColorSupport()\n };\n}\nvar DEFAULT_ERROR_CONFIG = getDefaultConfig();\nvar ERROR_TEMPLATES = {\n UNION_NO_MATCH: \"Value doesn't match any of the expected formats\",\n TYPE_MISMATCH: \"Expected {expected} but got {actual}\",\n MISSING_REQUIRED: \"Missing required field '{field}'\",\n UNKNOWN_PROPERTY: \"Unknown property '{property}'\",\n INVALID_FORMAT: \"Invalid {type} format\",\n PATTERN_MISMATCH: \"Value doesn't match the required pattern\"\n};\nfunction isCI() {\n if (typeof process === \"undefined\" || !process.env) {\n return false;\n }\n return !!(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);\n}\nfunction hasColorSupport() {\n if (typeof process === \"undefined\") {\n return false;\n }\n if (process.env?.NO_COLOR) {\n return false;\n }\n if (process.env?.FORCE_COLOR) {\n return true;\n }\n if (process.stdout?.isTTY) {\n return true;\n }\n return !isCI();\n}\n\n// src/validation/unified/theme-validator.ts\nfunction validateTheme(data, options) {\n if (typeof data === \"string\") {\n return {\n valid: true,\n themeName: data\n };\n }\n const result = validateAgainstSchema(ThemeConfigSchema, data, options);\n const themeResult = {\n ...result\n };\n if (result.valid && result.data) {\n const theme = result.data;\n if (theme.name) {\n themeResult.themeName = theme.name;\n }\n }\n return themeResult;\n}\nfunction validateThemeJson(jsonInput, options) {\n const result = validateJson(ThemeConfigSchema, jsonInput, options);\n const themeResult = {\n ...result\n };\n if (result.valid && result.data) {\n const theme = result.data;\n if (typeof theme === \"object\" && !theme.$schema) {\n theme.$schema = \"./json-schemas/theme.schema.json\";\n }\n if (theme.name) {\n themeResult.themeName = theme.name;\n }\n }\n return themeResult;\n}\nfunction validateThemeWithEnhancement(data, options) {\n const result = validateTheme(data, options);\n if (!result.valid && result.errors) {\n result.errors = result.errors.map((error) => {\n if (error.path.includes(\"colors\") && !error.suggestion) {\n error.suggestion = \"Colors must be valid hex, rgb, or named colors\";\n }\n if (error.path.includes(\"fonts\") && !error.suggestion) {\n error.suggestion = \"Fonts must include size and family properties\";\n }\n if (error.path.includes(\"headings\") && !error.suggestion) {\n error.suggestion = \"Headings must be an array of 6 style definitions\";\n }\n return error;\n });\n }\n return result;\n}\nfunction isValidTheme(result) {\n return result.valid === true && result.data !== void 0;\n}\nfunction createThemeValidator(defaultOptions) {\n return {\n validate: (data, options) => validateTheme(data, { ...defaultOptions, ...options }),\n validateJson: (jsonInput, options) => validateThemeJson(jsonInput, { ...defaultOptions, ...options }),\n validateWithEnhancement: (data, options) => validateThemeWithEnhancement(data, { ...defaultOptions, ...options })\n };\n}\nvar themeValidator = createThemeValidator({\n clean: true,\n applyDefaults: true\n});\nvar strictThemeValidator = createThemeValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 10\n});\nfunction getThemeName(data) {\n if (typeof data === \"string\") {\n return data;\n }\n if (typeof data === \"object\" && data !== null && \"name\" in data) {\n const theme = data;\n if (typeof theme.name === \"string\") {\n return theme.name;\n }\n }\n return void 0;\n}\nfunction isThemeConfig(data) {\n if (!data || typeof data !== \"object\") {\n return false;\n }\n const theme = data;\n return !!(theme.colors && theme.fonts);\n}\n\n// src/validation/unified/component-validator.ts\nimport { Value } from \"@sinclair/typebox/value\";\nimport { validateCustomComponentProps as sharedValidateCustomComponentProps } from \"@json-to-office/shared/plugin\";\nvar COMPONENT_SCHEMA_MAP = {\n report: ReportPropsSchema,\n section: SectionPropsSchema,\n heading: HeadingPropsSchema,\n paragraph: ParagraphPropsSchema,\n columns: ColumnsPropsSchema,\n image: ImagePropsSchema,\n statistic: StatisticPropsSchema,\n table: TablePropsSchema,\n list: ListPropsSchema,\n custom: CustomComponentDefinitionSchema\n};\nfunction validateComponent(name, props, options) {\n const schema = COMPONENT_SCHEMA_MAP[name];\n if (!schema) {\n const customResult = validateAgainstSchema(\n CustomComponentDefinitionSchema,\n props,\n options\n );\n return {\n ...customResult,\n success: customResult.valid,\n // Add success for backward compatibility\n componentName: name,\n isCustomComponent: true\n };\n }\n const result = validateAgainstSchema(schema, props, options);\n return {\n ...result,\n success: result.valid,\n // Add success for backward compatibility\n componentName: name,\n isCustomComponent: name === \"custom\"\n };\n}\nfunction validateComponentDefinition(component, options) {\n const result = validateAgainstSchema(\n ComponentDefinitionSchema,\n component,\n options\n );\n const componentResult = {\n ...result\n };\n if (result.valid && result.data) {\n const comp = result.data;\n componentResult.componentName = comp.name;\n componentResult.isCustomComponent = !isStandardComponentName(comp.name);\n }\n return componentResult;\n}\nfunction validateCustomComponentProps(componentSchema, config, options) {\n return sharedValidateCustomComponentProps(\n componentSchema,\n config,\n options\n );\n}\nfunction validateComponents(components, options) {\n return components.map(({ name, props }) => {\n if (isStandardComponentName(name)) {\n return validateComponent(name, props, options);\n }\n return validateComponent(\"custom\", props, options);\n });\n}\nfunction isStandardComponentName(name) {\n return name in COMPONENT_SCHEMA_MAP;\n}\nfunction isReportProps(config) {\n return Value.Check(ReportPropsSchema, config);\n}\nfunction isSectionProps(config) {\n return Value.Check(SectionPropsSchema, config);\n}\nfunction isHeadingProps(config) {\n return Value.Check(HeadingPropsSchema, config);\n}\nfunction isParagraphProps(config) {\n return Value.Check(ParagraphPropsSchema, config);\n}\nfunction isColumnsProps(config) {\n return Value.Check(ColumnsPropsSchema, config);\n}\nfunction isImageProps(config) {\n return Value.Check(ImagePropsSchema, config);\n}\nfunction isStatisticProps(config) {\n return Value.Check(StatisticPropsSchema, config);\n}\nfunction isTableProps(config) {\n return Value.Check(TablePropsSchema, config);\n}\nfunction isListProps(config) {\n return Value.Check(ListPropsSchema, config);\n}\nfunction isCustomComponentProps(config) {\n return Value.Check(CustomComponentDefinitionSchema, config);\n}\nfunction createComponentValidator(defaultOptions) {\n return {\n validate: (name, props, options) => {\n if (isStandardComponentName(name)) {\n return validateComponent(name, props, {\n ...defaultOptions,\n ...options\n });\n }\n return validateComponent(\"custom\", props, {\n ...defaultOptions,\n ...options\n });\n },\n validateDefinition: (component, options) => validateComponentDefinition(component, { ...defaultOptions, ...options }),\n validateCustom: (schema, config, options) => validateCustomComponentProps(schema, config, {\n ...defaultOptions,\n ...options\n })\n };\n}\nvar componentValidator = createComponentValidator({\n clean: true,\n applyDefaults: true\n});\nvar strictComponentValidator = createComponentValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 10\n});\n\n// src/validation/unified/index.ts\nvar validate = {\n // Document validation\n document: (data) => documentValidator.validate(data),\n jsonDocument: (jsonInput) => documentValidator.validateJson(jsonInput),\n // Theme validation\n theme: (data) => themeValidator.validate(data),\n jsonTheme: (jsonInput) => themeValidator.validateJson(jsonInput),\n // Component validation\n component: (name, props) => componentValidator.validate(name, props),\n componentDefinition: (component) => componentValidator.validateDefinition(component),\n // Batch operations\n components: (components) => components.map((c) => componentValidator.validate(c.name, c.props)),\n // Type checking (non-throwing)\n isDocument: (data) => {\n const result = documentValidator.validate(data);\n return result.valid;\n },\n isTheme: (data) => {\n const result = themeValidator.validate(data);\n return result.valid;\n },\n isComponent: (name, props) => {\n const result = componentValidator.validate(name, props);\n return result.valid;\n }\n};\nvar validateStrict = {\n document: (data) => strictDocumentValidator.validate(data),\n jsonDocument: (jsonInput) => strictDocumentValidator.validateJson(jsonInput),\n theme: (data) => strictThemeValidator.validate(data),\n jsonTheme: (jsonInput) => strictThemeValidator.validateJson(jsonInput),\n component: (name, props) => strictComponentValidator.validate(name, props),\n componentDefinition: (component) => strictComponentValidator.validateDefinition(component)\n};\n\nexport {\n validateTheme,\n validateThemeJson,\n validateThemeWithEnhancement,\n isValidTheme,\n createThemeValidator,\n themeValidator,\n strictThemeValidator,\n getThemeName,\n isThemeConfig,\n validateComponent,\n validateComponentDefinition,\n validateCustomComponentProps,\n validateComponents,\n isStandardComponentName,\n isReportProps,\n isSectionProps,\n isHeadingProps,\n isParagraphProps,\n isColumnsProps,\n isImageProps,\n isStatisticProps,\n isTableProps,\n isListProps,\n isCustomComponentProps,\n createComponentValidator,\n componentValidator,\n strictComponentValidator,\n ERROR_TEMPLATES,\n validate,\n validateStrict,\n transformValueError,\n transformValueErrors,\n calculatePosition,\n formatErrorSummary,\n groupErrorsByPath,\n createJsonParseError,\n isUnionSchema,\n isObjectSchema,\n isLiteralSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n extractStandardComponentNames,\n clearComponentNamesCache,\n getSchemaMetadata,\n DEFAULT_ERROR_CONFIG2 as DEFAULT_ERROR_CONFIG,\n ERROR_EMOJIS,\n createErrorConfig,\n formatErrorMessage\n};\n//# sourceMappingURL=chunk-BDAYHIDQ.js.map","import {\n ComponentDefinitionSchema\n} from \"./chunk-AVONZSC5.js\";\n\n// src/schemas/api.ts\nimport { Type } from \"@sinclair/typebox\";\nvar GenerateDocumentRequestSchema = Type.Object(\n {\n definition: ComponentDefinitionSchema,\n format: Type.Optional(\n Type.Union([\n Type.Literal(\"docx\"),\n Type.Literal(\"pdf\"),\n Type.Literal(\"html\")\n ])\n ),\n options: Type.Optional(\n Type.Object(\n {\n includeMetadata: Type.Optional(Type.Boolean()),\n /**\n * @deprecated No effect. Comments are authored on the components\n * that carry them (see the `comment` prop), so there is nothing for\n * a request-level toggle to switch. Kept so the exported\n * `GenerateDocumentRequest` type still accepts callers that send it.\n */\n includeComments: Type.Optional(\n Type.Boolean({\n deprecated: true,\n description: \"Deprecated and ignored. Comments are authored per component via the `comment` prop.\"\n })\n ),\n trackChanges: Type.Optional(Type.Boolean())\n },\n { additionalProperties: true }\n )\n )\n },\n {\n additionalProperties: false,\n description: \"Document generation request\"\n }\n);\nvar ValidateDocumentRequestSchema = Type.Object(\n {\n definition: Type.Unknown(),\n strict: Type.Optional(Type.Boolean())\n },\n {\n additionalProperties: false,\n description: \"Document validation request\"\n }\n);\nvar GenerateDocumentResponseSchema = Type.Object(\n {\n success: Type.Boolean(),\n documentId: Type.Optional(Type.String()),\n downloadUrl: Type.Optional(Type.String()),\n error: Type.Optional(Type.String()),\n metadata: Type.Optional(\n Type.Object(\n {\n pageCount: Type.Optional(Type.Number()),\n wordCount: Type.Optional(Type.Number()),\n generatedAt: Type.Optional(Type.String({ format: \"date-time\" }))\n },\n { additionalProperties: true }\n )\n )\n },\n {\n additionalProperties: false,\n description: \"Document generation response\"\n }\n);\nvar ValidateDocumentResponseSchema = Type.Object(\n {\n valid: Type.Boolean(),\n errors: Type.Array(\n Type.Object({\n path: Type.String(),\n message: Type.String(),\n code: Type.Optional(Type.String())\n })\n ),\n warnings: Type.Optional(\n Type.Array(\n Type.Object({\n path: Type.String(),\n message: Type.String(),\n code: Type.Optional(Type.String())\n })\n )\n )\n },\n {\n additionalProperties: false,\n description: \"Document validation response\"\n }\n);\n\nexport {\n GenerateDocumentRequestSchema,\n ValidateDocumentRequestSchema,\n GenerateDocumentResponseSchema,\n ValidateDocumentResponseSchema\n};\n//# sourceMappingURL=chunk-WLSSJVKC.js.map","import {\n BASE_SCHEMA_METADATA,\n COMPONENT_METADATA,\n THEME_SCHEMA_METADATA,\n convertToJsonSchema,\n createComponentSchema,\n exportSchemaToFile,\n fixSchemaReferences\n} from \"./chunk-SGESROO2.js\";\nimport {\n generateUnifiedDocumentSchema\n} from \"./chunk-7AXWLBH5.js\";\nimport {\n ERROR_TEMPLATES,\n componentValidator,\n createComponentValidator,\n createThemeValidator,\n getThemeName,\n isColumnsProps,\n isCustomComponentProps,\n isHeadingProps,\n isImageProps,\n isListProps,\n isParagraphProps,\n isReportProps,\n isSectionProps,\n isStandardComponentName,\n isStatisticProps,\n isTableProps,\n isThemeConfig,\n isValidTheme,\n strictComponentValidator,\n strictThemeValidator,\n themeValidator,\n validate,\n validateComponent,\n validateComponentDefinition,\n validateCustomComponentProps,\n validateStrict,\n validateTheme,\n validateThemeJson,\n validateThemeWithEnhancement\n} from \"./chunk-BDAYHIDQ.js\";\nimport {\n GenerateDocumentRequestSchema,\n GenerateDocumentResponseSchema,\n ValidateDocumentRequestSchema,\n ValidateDocumentResponseSchema\n} from \"./chunk-WLSSJVKC.js\";\nimport {\n docxDocumentBlockTargets\n} from \"./chunk-N3KCALAB.js\";\nimport {\n JSON_SCHEMA_URLS,\n JsonComponentDefinitionSchema\n} from \"./chunk-H3HNLNN7.js\";\nimport {\n collectIndentConflicts,\n collectNoteRevisionConflicts,\n collectTextBoxShapeConflicts,\n comprehensiveValidateDocument,\n createDocumentValidator,\n createJsonValidator,\n createValidator,\n deepValidateDocument,\n documentValidator,\n getValidationSummary,\n isValidDocument,\n isValidationSuccess,\n strictDocumentValidator,\n transformValueError,\n transformValueErrors,\n validateAgainstSchema,\n validateBatch,\n validateDocument,\n validateDocumentWithSchema,\n validateJson,\n validateJsonComponent,\n validateJsonDocument,\n validateWithEnhancement\n} from \"./chunk-AT4X3CGA.js\";\nimport {\n ComponentDefinitionSchema,\n StandardComponentDefinitionSchema\n} from \"./chunk-AVONZSC5.js\";\nimport {\n BlockInvocationPropsSchema,\n ChartPropsSchema,\n DividerPropsSchema,\n FLOW_CHILDREN,\n GroupPropsSchema,\n HighchartsPropsSchema,\n ReportPropsSchema,\n STANDARD_COMPONENTS_REGISTRY,\n TextBoxPropsSchema,\n TocPropsSchema,\n getAllStandardComponentNames,\n getStandardComponent\n} from \"./chunk-E5DT5YTY.js\";\nimport {\n BUILT_IN_DOCX_THEME_NAMES,\n ThemeConfigSchema,\n ThemeOverridesSchema,\n createMinimalTheme,\n isValidThemeConfig\n} from \"./chunk-OVL4RTD7.js\";\nimport {\n DEFAULT_DOCX_RENDERER_ID,\n DOCX_RENDERER_IDS,\n NATIVE_RENDER_MODE,\n NATIVE_VISUAL_ELEMENT_NAMES,\n NativeVisualCanvasSchema,\n NativeVisualElementSchema,\n NativeVisualImagePropsSchema,\n NativeVisualShapePropsSchema,\n NativeVisualTextPropsSchema,\n VisualCanvasBackgroundSchema,\n VisualCanvasSchema,\n VisualNativePropsSchema,\n VisualPropsSchema,\n VisualRasterPropsSchema,\n collectDocxRendererErrors,\n docxComponentDefinitionName,\n docxFlowDefinitionName,\n isNativeVisualProps\n} from \"./chunk-HDFGXHUB.js\";\nimport {\n ColumnsPropsSchema,\n CommentReplySchema,\n CommentSchema,\n EndnotesSchema,\n FootnotesSchema,\n HeadingPropsSchema,\n ImagePropsSchema,\n ListMarkerFontSchema,\n ListPropsSchema,\n NoteSchema,\n ParagraphPropsSchema,\n RevisionMarkSchema,\n RevisionSchema,\n RevisionSegmentSchema,\n SectionPropsSchema,\n StatisticPropsSchema,\n TablePropsSchema\n} from \"./chunk-W6KB2SMK.js\";\nimport {\n AlignmentSchema,\n BaseComponentPropsSchema,\n BorderSchema,\n HeadingLevelSchema,\n IndentSchema,\n JustifiedAlignmentSchema,\n LineSpacingSchema,\n MarginsSchema,\n NumberingSchema,\n ParagraphIndentSchema,\n SpacingSchema,\n TabStopLeaderSchema,\n TabStopSchema,\n TabStopTypeSchema,\n TabStopsSchema\n} from \"./chunk-FYJOHPU2.js\";\nimport \"./chunk-XRVPNHNS.js\";\nimport {\n CustomComponentDefinitionSchema,\n TextSpaceAfterComponentSchema,\n TextSpaceAfterPropsSchema\n} from \"./chunk-7GGTZ4TA.js\";\n\n// src/diff/word-diff.ts\nvar MAX_LCS_CELLS = 1e6;\nfunction tokenizeWords(text) {\n if (!text) return [];\n return text.split(/(\\s+)/).filter((t) => t.length > 0);\n}\nfunction mergeSegments(segments) {\n const merged = [];\n for (const seg of segments) {\n if (!seg.text) continue;\n const last = merged[merged.length - 1];\n if (last && last.type === seg.type) {\n last.text += seg.text;\n } else {\n merged.push({ ...seg });\n }\n }\n return merged;\n}\nfunction normalizeSegments(segments) {\n const folded = [];\n for (let k2 = 0; k2 < segments.length; k2++) {\n const seg = segments[k2];\n if (seg.type === \"equal\" && /^\\s+$/.test(seg.text)) {\n const prev = folded[folded.length - 1];\n const next = segments[k2 + 1];\n if (prev && prev.type !== \"equal\" && next && next.type !== \"equal\") {\n folded.push(\n { type: \"delete\", text: seg.text },\n { type: \"insert\", text: seg.text }\n );\n continue;\n }\n }\n folded.push({ ...seg });\n }\n const out = [];\n let k = 0;\n while (k < folded.length) {\n if (folded[k].type === \"equal\") {\n out.push(folded[k]);\n k++;\n continue;\n }\n let deleted = \"\";\n let inserted = \"\";\n while (k < folded.length && folded[k].type !== \"equal\") {\n if (folded[k].type === \"delete\") deleted += folded[k].text;\n else inserted += folded[k].text;\n k++;\n }\n if (deleted) out.push({ type: \"delete\", text: deleted });\n if (inserted) out.push({ type: \"insert\", text: inserted });\n }\n return mergeSegments(out);\n}\nfunction diffWords(oldText, newText) {\n if (oldText === newText) {\n return oldText ? [{ type: \"equal\", text: oldText }] : [];\n }\n const oldTokens = tokenizeWords(oldText);\n const newTokens = tokenizeWords(newText);\n if (oldTokens.length === 0) {\n return mergeSegments([{ type: \"insert\", text: newText }]);\n }\n if (newTokens.length === 0) {\n return mergeSegments([{ type: \"delete\", text: oldText }]);\n }\n if (oldTokens.length * newTokens.length > MAX_LCS_CELLS) {\n return mergeSegments([\n { type: \"delete\", text: oldText },\n { type: \"insert\", text: newText }\n ]);\n }\n const n = oldTokens.length;\n const m = newTokens.length;\n const lcs = Array.from(\n { length: n + 1 },\n () => new Int32Array(m + 1)\n );\n for (let i2 = n - 1; i2 >= 0; i2--) {\n for (let j2 = m - 1; j2 >= 0; j2--) {\n lcs[i2][j2] = oldTokens[i2] === newTokens[j2] ? lcs[i2 + 1][j2 + 1] + 1 : Math.max(lcs[i2 + 1][j2], lcs[i2][j2 + 1]);\n }\n }\n const segments = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldTokens[i] === newTokens[j]) {\n segments.push({ type: \"equal\", text: oldTokens[i] });\n i++;\n j++;\n } else if (lcs[i + 1][j] >= lcs[i][j + 1]) {\n segments.push({ type: \"delete\", text: oldTokens[i] });\n i++;\n } else {\n segments.push({ type: \"insert\", text: newTokens[j] });\n j++;\n }\n }\n while (i < n) {\n segments.push({ type: \"delete\", text: oldTokens[i] });\n i++;\n }\n while (j < m) {\n segments.push({ type: \"insert\", text: newTokens[j] });\n j++;\n }\n return normalizeSegments(segments);\n}\nfunction stripMarkdown(text) {\n return text.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, \"$1\").replace(\n /(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,\n (_match, _d1, bi, _d2, b, _d3, i) => bi ?? b ?? i ?? \"\"\n );\n}\n\n// src/diff/document-diff.ts\nvar TEXT_COMPONENTS = /* @__PURE__ */ new Set([\"paragraph\", \"heading\"]);\nfunction deepEqual(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n}\nfunction makeRevision(ctx, segments) {\n return {\n ...ctx.author && { author: ctx.author },\n ...ctx.date && { date: ctx.date },\n segments\n };\n}\nfunction rawText(node) {\n const text = node.props?.text;\n return typeof text === \"string\" ? text.normalize(\"NFC\") : \"\";\n}\nfunction plainText(node) {\n return stripMarkdown(rawText(node));\n}\nvar PLACEHOLDER_PATTERN = /\\{[^}]+\\}/;\nfunction isEnabled(node) {\n return node.enabled !== false;\n}\nfunction notePlaceholdersInChanges(segments, path, component, ctx) {\n if (segments.some((s) => s.type !== \"equal\" && PLACEHOLDER_PATTERN.test(s.text))) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component,\n detail: \"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline\"\n });\n }\n}\nfunction propsWithout(props, ...keys) {\n const copy = { ...props || {} };\n for (const key of keys) delete copy[key];\n return copy;\n}\nvar MAX_ALIGN_CELLS = 4e6;\nfunction alignByLcs(oldItems, newItems, key) {\n const oldKeys = oldItems.map(key);\n const newKeys = newItems.map(key);\n let start = 0;\n while (start < oldItems.length && start < newItems.length && oldKeys[start] === newKeys[start]) {\n start++;\n }\n let oldEnd = oldItems.length;\n let newEnd = newItems.length;\n while (oldEnd > start && newEnd > start && oldKeys[oldEnd - 1] === newKeys[newEnd - 1]) {\n oldEnd--;\n newEnd--;\n }\n const prefix = [];\n for (let k = 0; k < start; k++) {\n prefix.push({ op: \"equal\", oldItem: oldItems[k], newItem: newItems[k] });\n }\n const suffix = [];\n for (let k = 0; k < oldItems.length - oldEnd; k++) {\n suffix.push({\n op: \"equal\",\n oldItem: oldItems[oldEnd + k],\n newItem: newItems[newEnd + k]\n });\n }\n const n = oldEnd - start;\n const m = newEnd - start;\n const middle = [];\n if (n * m > MAX_ALIGN_CELLS) {\n for (let k = 0; k < n; k++) {\n middle.push({ op: \"delete\", oldItem: oldItems[start + k] });\n }\n for (let k = 0; k < m; k++) {\n middle.push({ op: \"insert\", newItem: newItems[start + k] });\n }\n return [...prefix, ...middle, ...suffix];\n }\n const lcs = Array.from(\n { length: n + 1 },\n () => new Int32Array(m + 1)\n );\n for (let i2 = n - 1; i2 >= 0; i2--) {\n for (let j2 = m - 1; j2 >= 0; j2--) {\n lcs[i2][j2] = oldKeys[start + i2] === newKeys[start + j2] ? lcs[i2 + 1][j2 + 1] + 1 : Math.max(lcs[i2 + 1][j2], lcs[i2][j2 + 1]);\n }\n }\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldKeys[start + i] === newKeys[start + j]) {\n middle.push({\n op: \"equal\",\n oldItem: oldItems[start + i],\n newItem: newItems[start + j]\n });\n i++;\n j++;\n } else if (lcs[i + 1][j] >= lcs[i][j + 1]) {\n middle.push({ op: \"delete\", oldItem: oldItems[start + i] });\n i++;\n } else {\n middle.push({ op: \"insert\", newItem: newItems[start + j] });\n j++;\n }\n }\n while (i < n) middle.push({ op: \"delete\", oldItem: oldItems[start + i++] });\n while (j < m) middle.push({ op: \"insert\", newItem: newItems[start + j++] });\n return [...prefix, ...middle, ...suffix];\n}\nfunction pairGap(deleted, inserted, pairable) {\n const usedOld = new Array(deleted.length).fill(false);\n const pairing = new Array(inserted.length).fill(-1);\n let searchFrom = 0;\n for (let j = 0; j < inserted.length; j++) {\n for (let i = searchFrom; i < deleted.length; i++) {\n if (!usedOld[i] && pairable(deleted[i], inserted[j])) {\n usedOld[i] = true;\n pairing[j] = i;\n searchFrom = i + 1;\n break;\n }\n }\n }\n const plan = [];\n const pairs = [];\n let emittedOld = 0;\n for (let j = 0; j < inserted.length; j++) {\n const i = pairing[j];\n if (i >= 0) {\n while (emittedOld < i) {\n if (!usedOld[emittedOld]) {\n plan.push({ kind: \"deleted\", oldItem: deleted[emittedOld] });\n }\n emittedOld++;\n }\n emittedOld = i + 1;\n plan.push({ kind: \"paired\", oldItem: deleted[i], newItem: inserted[j] });\n pairs.push({ oldItem: deleted[i], newItem: inserted[j] });\n } else {\n plan.push({ kind: \"inserted\", newItem: inserted[j] });\n }\n }\n for (let i = emittedOld; i < deleted.length; i++) {\n if (!usedOld[i]) plan.push({ kind: \"deleted\", oldItem: deleted[i] });\n }\n return { pairs, plan };\n}\nfunction diffTextComponent(oldNode, newNode, path, ctx) {\n const oldText = plainText(oldNode);\n const newText = plainText(newNode);\n const propsChanged = !deepEqual(\n propsWithout(oldNode.props, \"text\", \"revision\", \"comment\"),\n propsWithout(newNode.props, \"text\", \"revision\", \"comment\")\n );\n if (propsChanged) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: newNode.name,\n detail: \"formatting/props changed (not expressible as a tracked change); new version rendered\"\n });\n }\n if (oldText === newText) {\n if (rawText(oldNode) !== rawText(newNode)) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: newNode.name,\n detail: \"inline formatting or link target changed (markdown-only); new version rendered without a tracked change\"\n });\n } else if (!propsChanged) {\n ctx.summary.unchangedBlocks++;\n }\n return newNode;\n }\n ctx.summary.tracked.modified++;\n const segments = diffWords(oldText, newText);\n notePlaceholdersInChanges(segments, path, newNode.name, ctx);\n if (rawText(oldNode) !== oldText || rawText(newNode) !== newText) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: newNode.name,\n detail: \"inline formatting or links flattened to plain text in the redline (revision segments render literally)\"\n });\n }\n return {\n ...newNode,\n props: {\n ...revisedTextProps(newNode, path, ctx),\n text: newText,\n revision: makeRevision(ctx, segments)\n }\n };\n}\nfunction revisedTextProps(node, path, ctx) {\n const props = { ...node.props ?? {} };\n const dropped = [\"footnotes\", \"endnotes\"].filter((kind) => {\n const notes = props[kind];\n return Array.isArray(notes) && notes.length > 0;\n });\n if (dropped.length === 0) return props;\n for (const kind of dropped) delete props[kind];\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: node.name,\n detail: `${dropped.join(\" and \")} dropped from a tracked-change paragraph (note markers do not resolve inside revision text); the note bodies are not in the redline`\n });\n return props;\n}\nfunction insertedTextComponent(node, path, ctx) {\n ctx.summary.tracked.inserted++;\n const text = plainText(node);\n const segments = [{ type: \"insert\", text }];\n notePlaceholdersInChanges(segments, path, node.name, ctx);\n return {\n ...node,\n props: {\n ...revisedTextProps(node, path, ctx),\n text,\n revision: makeRevision(ctx, segments)\n }\n };\n}\nfunction deletedTextComponent(node, path, ctx) {\n ctx.summary.tracked.deleted++;\n const text = plainText(node);\n const segments = [{ type: \"delete\", text }];\n notePlaceholdersInChanges(segments, path, node.name, ctx);\n return {\n ...node,\n props: {\n ...revisedTextProps(node, path, ctx),\n text: \"\",\n revision: makeRevision(ctx, segments)\n }\n };\n}\nfunction normalizeListItems(node) {\n const items = node.props?.items || [];\n return items.map((item) => {\n const raw = typeof item === \"string\" ? item : item.text;\n const level = typeof item === \"string\" ? 0 : item.level || 0;\n return { raw, text: stripMarkdown(raw.normalize(\"NFC\")), level };\n });\n}\nfunction diffListComponent(oldNode, newNode, path, ctx) {\n const propsChanged = !deepEqual(\n propsWithout(oldNode.props, \"items\"),\n propsWithout(newNode.props, \"items\")\n );\n if (propsChanged) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"list\",\n detail: \"list configuration changed (format/levels/spacing); new version rendered\"\n });\n }\n const oldItems = normalizeListItems(oldNode);\n const newItems = normalizeListItems(newNode);\n const stripped = (items) => items.map((i) => ({ text: i.text, level: i.level }));\n if (deepEqual(stripped(oldItems), stripped(newItems))) {\n if (!deepEqual(\n oldItems.map((i) => i.raw),\n newItems.map((i) => i.raw)\n )) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"list\",\n detail: \"inline formatting or link target changed in list items (markdown-only); new version rendered without a tracked change\"\n });\n } else if (!propsChanged) {\n ctx.summary.unchangedBlocks++;\n }\n return newNode;\n }\n const ops = alignByLcs(\n oldItems,\n newItems,\n (item) => `${item.level}:${item.text}`\n );\n const outItems = [];\n let changed = false;\n let k = 0;\n while (k < ops.length) {\n const op = ops[k];\n if (op.op === \"equal\") {\n outItems.push({ text: op.newItem.raw, level: op.newItem.level });\n k++;\n continue;\n }\n const deleted = [];\n const inserted = [];\n while (k < ops.length && ops[k].op !== \"equal\") {\n const gapOp = ops[k];\n if (gapOp.op === \"delete\") deleted.push(gapOp.oldItem);\n else if (gapOp.op === \"insert\") inserted.push(gapOp.newItem);\n k++;\n }\n const { plan } = pairGap(\n deleted,\n inserted,\n (oldItem, newItem) => oldItem.level === newItem.level\n );\n for (const step of plan) {\n changed = true;\n if (step.kind === \"paired\") {\n const segments = diffWords(step.oldItem.text, step.newItem.text);\n notePlaceholdersInChanges(segments, path, \"list\", ctx);\n outItems.push({\n text: step.newItem.text,\n level: step.newItem.level,\n revision: makeRevision(ctx, segments)\n });\n } else if (step.kind === \"inserted\") {\n outItems.push({\n text: step.newItem.text,\n level: step.newItem.level,\n revision: makeRevision(ctx, [\n { type: \"insert\", text: step.newItem.text }\n ])\n });\n } else {\n outItems.push({\n text: \"\",\n level: step.oldItem.level,\n revision: makeRevision(ctx, [\n { type: \"delete\", text: step.oldItem.text }\n ])\n });\n }\n }\n }\n if (changed) ctx.summary.tracked.modified++;\n return {\n ...newNode,\n props: { ...newNode.props, items: outItems }\n };\n}\nfunction listWithAllItems(node, type, ctx) {\n if (type === \"insert\") ctx.summary.tracked.inserted++;\n else ctx.summary.tracked.deleted++;\n const items = normalizeListItems(node).map((item) => ({\n text: type === \"insert\" ? item.text : \"\",\n level: item.level,\n revision: makeRevision(ctx, [{ type, text: item.text }])\n }));\n return { ...node, props: { ...node.props, items } };\n}\nfunction cellText(cell) {\n if (!cell) return \"\";\n const content = cell.content;\n if (typeof content === \"string\")\n return stripMarkdown(content.normalize(\"NFC\"));\n if (content && typeof content === \"object\") {\n const props = content.props;\n const text = props?.text;\n if (typeof text === \"string\") return stripMarkdown(text.normalize(\"NFC\"));\n }\n return \"\";\n}\nfunction cellRawText(cell) {\n if (!cell) return \"\";\n const content = cell.content;\n if (typeof content === \"string\") return content.normalize(\"NFC\");\n if (content && typeof content === \"object\") {\n const text = content.props?.text;\n if (typeof text === \"string\") return text.normalize(\"NFC\");\n }\n return \"\";\n}\nfunction isTextCell(cell) {\n if (!cell) return true;\n const content = cell.content;\n if (content === void 0 || typeof content === \"string\") return true;\n return typeof content === \"object\" && content.name === \"paragraph\";\n}\nfunction toRowView(node) {\n const columns = node.props?.columns ?? [];\n const rowCount = columns.reduce(\n (max, column) => Math.max(max, column.cells?.length ?? 0),\n 0\n );\n const authoredRows = node.props?.rows ?? [];\n return Array.from({ length: rowCount }, (_, rowIndex) => {\n const cells = columns.map((column) => column.cells?.[rowIndex]);\n return {\n cells,\n key: cells.map(cellText).join(\"\\0\"),\n rawKey: cells.map(cellRawText).join(\"\\0\"),\n rowProps: authoredRows[rowIndex]\n };\n });\n}\nfunction withRows(node, rows, rowProps) {\n const columns = node.props?.columns ?? [];\n const merged = rows.map((row, index) => ({\n ...row.rowProps ?? {},\n ...rowProps[index]\n }));\n return {\n ...node,\n props: {\n ...node.props,\n columns: columns.map((column, colIndex) => ({\n ...column,\n cells: rows.map((row) => row.cells[colIndex] ?? { content: \"\" })\n })),\n ...merged.some((props) => Object.keys(props).length > 0) && {\n rows: merged\n }\n }\n };\n}\nfunction isColumnTable(node) {\n return Array.isArray(node.props?.columns) && !node.props?.headers;\n}\nfunction revisedCell(cell, oldCell, oldText, newText, path, ctx) {\n const segments = diffWords(oldText, newText);\n notePlaceholdersInChanges(segments, path, \"table\", ctx);\n if (cellRawText(oldCell) !== oldText || cellRawText(cell) !== newText) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"table\",\n detail: \"inline formatting or links flattened to plain text in a table cell (revision segments render literally)\"\n });\n }\n const base = cell ?? { content: \"\" };\n return {\n ...base,\n // The revision carries the text, so `content` keeps the new version for\n // readers that ignore tracked changes. A component cell keeps being a\n // component — replacing it with a bare string would silently discard the\n // paragraph's font, alignment and the rest.\n content: revisedCellContent(base.content, newText, path, ctx),\n revision: makeRevision(ctx, segments)\n };\n}\nfunction revisedCellContent(content, newText, path, ctx) {\n if (!content || typeof content !== \"object\") return newText;\n const component = content;\n return {\n ...component,\n props: {\n ...revisedTextProps(component, path, ctx),\n text: newText\n }\n };\n}\nfunction diffTableComponent(oldNode, newNode, path, ctx) {\n const oldRows = toRowView(oldNode);\n const newRows = toRowView(newNode);\n const oldColumns = oldNode.props?.columns ?? [];\n const newColumns = newNode.props?.columns ?? [];\n if (oldColumns.length !== newColumns.length) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"table\",\n detail: \"table column count changed (columns are not expressible as a tracked change); new version rendered\"\n });\n return newNode;\n }\n const propsChanged = !deepEqual(\n propsWithout(oldNode.props, \"columns\", \"rows\"),\n propsWithout(newNode.props, \"columns\", \"rows\")\n );\n if (propsChanged) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"table\",\n detail: \"table configuration changed (borders/widths/defaults); new version rendered\"\n });\n }\n const headersChanged = !deepEqual(\n oldColumns.map((column) => column.header),\n newColumns.map((column) => column.header)\n );\n if (headersChanged) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"table\",\n detail: \"table header row changed (headers are not row content); new version rendered\"\n });\n }\n if (deepEqual(\n oldRows.map((row) => row.key),\n newRows.map((row) => row.key)\n )) {\n if (!deepEqual(\n oldRows.map((row) => row.rawKey),\n newRows.map((row) => row.rawKey)\n )) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: \"table\",\n detail: \"inline formatting or link target changed in table cells (markdown-only); new version rendered without a tracked change\"\n });\n } else if (!propsChanged && !headersChanged && deepEqual(oldRows, newRows)) {\n ctx.summary.unchangedBlocks++;\n }\n return newNode;\n }\n const ops = alignByLcs(oldRows, newRows, (row) => row.key);\n const outRows = [];\n const outProps = [];\n let changed = false;\n const push = (row, props) => {\n outRows.push(row);\n outProps.push(props);\n };\n let k = 0;\n while (k < ops.length) {\n const op = ops[k];\n if (op.op === \"equal\") {\n push(op.newItem, {});\n k++;\n continue;\n }\n const deleted = [];\n const inserted = [];\n while (k < ops.length && ops[k].op !== \"equal\") {\n const gapOp = ops[k];\n if (gapOp.op === \"delete\") deleted.push(gapOp.oldItem);\n else if (gapOp.op === \"insert\") inserted.push(gapOp.newItem);\n k++;\n }\n const { plan } = pairGap(\n deleted,\n inserted,\n (oldRow, newRow) => oldRow.cells.length === newRow.cells.length && oldRow.cells.every(isTextCell) && newRow.cells.every(isTextCell)\n );\n for (const step of plan) {\n changed = true;\n if (step.kind === \"paired\") {\n const cells = step.newItem.cells.map((cell, index) => {\n const oldText = cellText(step.oldItem.cells[index]);\n const newText = cellText(cell);\n return oldText === newText ? cell ?? { content: \"\" } : revisedCell(\n cell,\n step.oldItem.cells[index],\n oldText,\n newText,\n path,\n ctx\n );\n });\n push({ ...step.newItem, cells }, {});\n } else if (step.kind === \"inserted\") {\n ctx.summary.tracked.inserted++;\n push(step.newItem, { revision: rowRevision(ctx, \"insert\") });\n } else {\n ctx.summary.tracked.deleted++;\n push(step.oldItem, { revision: rowRevision(ctx, \"delete\") });\n }\n }\n }\n if (changed) ctx.summary.tracked.modified++;\n return withRows(newNode, outRows, outProps);\n}\nfunction tableWithAllRows(node, type, ctx) {\n if (type === \"insert\") ctx.summary.tracked.inserted++;\n else ctx.summary.tracked.deleted++;\n const rows = toRowView(node);\n return withRows(\n node,\n rows,\n rows.map(() => ({ revision: rowRevision(ctx, type) }))\n );\n}\nfunction rowRevision(ctx, type) {\n return {\n type,\n ...ctx.author && { author: ctx.author },\n ...ctx.date && { date: ctx.date }\n };\n}\nfunction isContainer(node) {\n return Array.isArray(node.children);\n}\nfunction nodesPairable(oldNode, newNode) {\n return oldNode.name === newNode.name;\n}\nfunction diffPairedNode(oldNode, newNode, path, ctx) {\n const oldEnabled = isEnabled(oldNode);\n const newEnabled = isEnabled(newNode);\n if (!oldEnabled && !newEnabled) {\n ctx.summary.unchangedBlocks++;\n return newNode;\n }\n if (!oldEnabled && newEnabled) {\n return emitInserted(newNode, path, ctx);\n }\n if (oldEnabled && !newEnabled) {\n const deletedNode = emitDeleted(oldNode, path, ctx);\n return deletedNode ?? newNode;\n }\n if (TEXT_COMPONENTS.has(newNode.name)) {\n return diffTextComponent(oldNode, newNode, path, ctx);\n }\n if (newNode.name === \"list\") {\n return diffListComponent(oldNode, newNode, path, ctx);\n }\n if (newNode.name === \"table\" && isColumnTable(oldNode) && isColumnTable(newNode)) {\n return diffTableComponent(oldNode, newNode, path, ctx);\n }\n if (isContainer(newNode) || isContainer(oldNode)) {\n const propsChanged = !deepEqual(oldNode.props, newNode.props);\n if (propsChanged) {\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: newNode.name,\n detail: \"container props changed; new version rendered\"\n });\n }\n return {\n ...newNode,\n children: diffChildren(\n oldNode.children || [],\n newNode.children || [],\n `${path}/children`,\n ctx\n )\n };\n }\n ctx.summary.untracked.push({\n path,\n kind: \"modified\",\n component: newNode.name,\n detail: `\"${newNode.name}\" changed (no native tracked-change support); new version rendered`\n });\n return newNode;\n}\nfunction emitInserted(node, path, ctx) {\n if (!isEnabled(node)) {\n return node;\n }\n if (TEXT_COMPONENTS.has(node.name)) {\n return insertedTextComponent(node, path, ctx);\n }\n if (node.name === \"list\") {\n return listWithAllItems(node, \"insert\", ctx);\n }\n if (node.name === \"table\" && isColumnTable(node)) {\n return tableWithAllRows(node, \"insert\", ctx);\n }\n if (isContainer(node)) {\n if (typeof node.props?.title === \"string\") {\n ctx.summary.untracked.push({\n path,\n kind: \"inserted\",\n component: node.name,\n detail: `\"${node.name}\" title rendered without insertion mark (titles are props, not text blocks)`\n });\n }\n return {\n ...node,\n children: diffChildren([], node.children || [], `${path}/children`, ctx)\n };\n }\n ctx.summary.untracked.push({\n path,\n kind: \"inserted\",\n component: node.name,\n detail: `\"${node.name}\" added (rendered, but not marked as a tracked insertion)`\n });\n return node;\n}\nfunction emitDeleted(node, path, ctx) {\n if (!isEnabled(node)) {\n return null;\n }\n if (TEXT_COMPONENTS.has(node.name)) {\n return deletedTextComponent(node, path, ctx);\n }\n if (node.name === \"list\") {\n return listWithAllItems(node, \"delete\", ctx);\n }\n if (node.name === \"table\" && isColumnTable(node)) {\n return tableWithAllRows(node, \"delete\", ctx);\n }\n if (isContainer(node)) {\n if (typeof node.props?.title === \"string\") {\n ctx.summary.untracked.push({\n path,\n kind: \"deleted\",\n component: node.name,\n detail: `\"${node.name}\" title still rendered without deletion mark (titles are props, not text blocks)`\n });\n }\n const children = diffChildren(\n node.children || [],\n [],\n `${path}/children`,\n ctx\n );\n return { ...node, children };\n }\n ctx.summary.untracked.push({\n path,\n kind: \"deleted\",\n component: node.name,\n detail: `\"${node.name}\" removed (dropped from the redline; Word cannot mark it as a tracked deletion)`\n });\n return null;\n}\nfunction diffChildren(oldChildren, newChildren, path, ctx) {\n const ops = alignByLcs(\n oldChildren,\n newChildren,\n (node) => JSON.stringify(node)\n );\n const out = [];\n let k = 0;\n let newIndex = 0;\n while (k < ops.length) {\n const op = ops[k];\n if (op.op === \"equal\") {\n ctx.summary.unchangedBlocks++;\n out.push(op.newItem);\n k++;\n newIndex++;\n continue;\n }\n const deleted = [];\n const inserted = [];\n while (k < ops.length && ops[k].op !== \"equal\") {\n const gapOp = ops[k];\n if (gapOp.op === \"delete\") deleted.push(gapOp.oldItem);\n else if (gapOp.op === \"insert\") inserted.push(gapOp.newItem);\n k++;\n }\n const { plan } = pairGap(deleted, inserted, nodesPairable);\n for (const step of plan) {\n if (step.kind === \"paired\") {\n out.push(\n diffPairedNode(step.oldItem, step.newItem, `${path}/${newIndex}`, ctx)\n );\n newIndex++;\n } else if (step.kind === \"inserted\") {\n out.push(emitInserted(step.newItem, `${path}/${newIndex}`, ctx));\n newIndex++;\n } else {\n const deletedNode = emitDeleted(\n step.oldItem,\n `${path}/${newIndex}`,\n ctx\n );\n if (deletedNode) out.push(deletedNode);\n }\n }\n }\n return out;\n}\nfunction diffDocuments(oldDoc, newDoc, options = {}) {\n if (!oldDoc || oldDoc.name !== \"docx\") {\n throw new Error('Old document: top-level component must be \"docx\"');\n }\n if (!newDoc || newDoc.name !== \"docx\") {\n throw new Error('New document: top-level component must be \"docx\"');\n }\n const summary = {\n tracked: { modified: 0, inserted: 0, deleted: 0 },\n untracked: [],\n unchangedBlocks: 0,\n notes: []\n };\n const ctx = {\n author: options.author,\n date: options.date,\n summary\n };\n const rootPropsChanged = !deepEqual(\n propsWithout(oldDoc.props, \"trackRevisions\"),\n propsWithout(newDoc.props, \"trackRevisions\")\n );\n if (rootPropsChanged) {\n summary.untracked.push({\n path: \"/props\",\n kind: \"modified\",\n component: \"docx\",\n detail: \"document props changed (theme/metadata/defaults); new version used\"\n });\n }\n const children = diffChildren(\n oldDoc.children || [],\n newDoc.children || [],\n \"/children\",\n ctx\n );\n if (summary.tracked.deleted > 0) {\n summary.notes.push(\n `${summary.tracked.deleted} fully deleted block(s): accepting all changes leaves an empty paragraph behind (OOXML paragraph-mark deletion is not supported by the renderer)`\n );\n }\n const document = {\n ...newDoc,\n props: { ...newDoc.props, trackRevisions: true },\n children\n };\n return { document, summary };\n}\n\n// src/index.ts\nimport {\n fixSchemaReferences as fixSchemaReferences2,\n createComponentSchema as createComponentSchema2,\n createComponentSchemaObject,\n exportSchemaToFile as exportSchemaToFile2\n} from \"@json-to-office/shared\";\nimport {\n transformValueError as transformValueError2,\n transformValueErrors as transformValueErrors2,\n formatErrorSummary,\n groupErrorsByPath,\n createJsonParseError,\n calculatePosition\n} from \"@json-to-office/shared\";\nimport {\n DEFAULT_ERROR_CONFIG,\n createErrorConfig,\n ERROR_EMOJIS,\n formatErrorMessage\n} from \"@json-to-office/shared\";\nimport {\n isUnionSchema,\n isObjectSchema,\n isLiteralSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n extractStandardComponentNames,\n clearComponentNamesCache,\n getSchemaMetadata\n} from \"@json-to-office/shared\";\nimport {\n isValidSemver,\n parseSemver,\n compareSemver,\n latestVersion\n} from \"@json-to-office/shared\";\n\n// src/validation/parsers/json.ts\nimport { Value } from \"@sinclair/typebox/value\";\nimport { FormatRegistry } from \"@sinclair/typebox\";\nFormatRegistry.Set(\"uri\", (value) => {\n try {\n new URL(value);\n return true;\n } catch {\n if (value.includes(\".json\") || value.includes(\"/\") || value.includes(\"\\\\\")) {\n return true;\n }\n return /^https?:\\/\\/.+/.test(value);\n }\n});\nFormatRegistry.Set(\"date-time\", (value) => {\n const dateTimeRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/;\n return dateTimeRegex.test(value) && !isNaN(Date.parse(value));\n});\nvar JsonDocumentParser = class {\n schema = ComponentDefinitionSchema;\n constructor() {\n }\n /**\n * Parse JSON input (string or object) and validate against schema\n * Only supports unified ComponentDefinition structure where document IS a report component\n */\n parse(jsonInput) {\n let parsedObject;\n if (typeof jsonInput === \"string\") {\n try {\n parsedObject = JSON.parse(jsonInput);\n } catch (error) {\n throw new JsonParsingError(\n \"Invalid JSON syntax\",\n this.extractJSONSyntaxError(error, jsonInput)\n );\n }\n } else {\n parsedObject = jsonInput;\n }\n if (typeof parsedObject !== \"object\" || parsedObject === null || !(\"name\" in parsedObject) || parsedObject.name !== \"docx\") {\n throw new JsonValidationError(\n 'Invalid document structure: Document must be a docx component with name=\"docx\"',\n [\n {\n path: \"name\",\n message: 'Document must be a docx component with name=\"docx\"',\n code: \"INVALID_STRUCTURE\"\n }\n ]\n );\n }\n if (!Value.Check(this.schema, parsedObject)) {\n const errors = [...Value.Errors(this.schema, parsedObject)];\n throw new JsonValidationError(\n \"JSON validation failed\",\n this.formatTypeBoxErrors(\n errors,\n typeof jsonInput === \"string\" ? jsonInput : JSON.stringify(jsonInput, null, 2)\n )\n );\n }\n return parsedObject;\n }\n /**\n * Validate JSON without throwing errors - returns ValidationResult\n */\n validate(jsonInput) {\n try {\n this.parse(jsonInput);\n return {\n valid: true,\n errors: [],\n warnings: []\n };\n } catch (error) {\n if (error instanceof JsonParsingError || error instanceof JsonValidationError) {\n return {\n valid: false,\n errors: error.validationErrors,\n warnings: []\n };\n }\n return {\n valid: false,\n errors: [\n {\n path: \"\",\n message: error instanceof Error ? error.message : \"Unknown validation error\",\n code: \"UNEXPECTED_ERROR\"\n }\n ],\n warnings: []\n };\n }\n }\n /**\n * Parse JSON file content with line number tracking\n */\n parseWithLineNumbers(jsonString) {\n const lines = jsonString.split(\"\\n\");\n try {\n return this.parse(jsonString);\n } catch (error) {\n if (error instanceof JsonParsingError || error instanceof JsonValidationError) {\n const enhancedErrors = error.validationErrors.map((err) => ({\n ...err,\n ...this.findLineNumber(err.path, jsonString, lines)\n }));\n if (error instanceof JsonParsingError) {\n throw new JsonParsingError(error.message, enhancedErrors);\n } else {\n throw new JsonValidationError(error.message, enhancedErrors);\n }\n }\n throw error;\n }\n }\n /**\n * Extract JSON syntax error information\n */\n extractJSONSyntaxError(error, jsonString) {\n const message = error.message;\n const positionMatch = message.match(/position\\s+(\\d+)/i) || message.match(/at\\s+(\\d+)/i) || message.match(/character\\s+(\\d+)/i);\n let line = 0;\n let column = 0;\n if (positionMatch) {\n const position = parseInt(positionMatch[1], 10);\n const lines = jsonString.substring(0, position).split(\"\\n\");\n line = lines.length;\n column = lines[lines.length - 1].length + 1;\n }\n return [\n {\n path: \"\",\n message: `JSON syntax error: ${message}`,\n code: \"JSON_SYNTAX_ERROR\",\n line: line || void 0,\n column: column || void 0,\n suggestions: [\n \"Check for missing commas, brackets, or quotes\",\n \"Validate JSON syntax using a JSON validator\",\n \"Ensure all strings are properly quoted\"\n ]\n }\n ];\n }\n /**\n * Format TypeBox validation errors into ValidationError format\n */\n formatTypeBoxErrors(errors, originalJson) {\n return errors.map((error) => {\n const path = error.path || \"\";\n const lineInfo = this.findLineNumber(path, originalJson);\n return {\n path,\n message: this.formatTypeBoxErrorMessage(error),\n code: this.getErrorCode(error),\n line: lineInfo.line,\n column: lineInfo.column,\n suggestions: this.generateSuggestions(error)\n };\n });\n }\n /**\n * Format individual TypeBox error message\n */\n formatTypeBoxErrorMessage(error) {\n const path = error.path ? `at \"${error.path}\"` : \"\";\n const message = error.message;\n if (message.includes(\"Expected\")) {\n return `${message} ${path}`;\n } else if (message.includes(\"Required property\")) {\n return `${message} ${path}`;\n } else if (message.includes(\"Unexpected property\")) {\n return `${message} ${path}`;\n } else if (message.includes(\"minimum\")) {\n return `Value is too small ${path}. ${message}`;\n } else if (message.includes(\"maximum\")) {\n return `Value is too big ${path}. ${message}`;\n } else {\n return `${message} ${path}`;\n }\n }\n /**\n * Get error code from TypeBox error\n */\n getErrorCode(error) {\n const baseCode = String(error.type || \"VALIDATION_ERROR\").toUpperCase();\n const path = error.path ? error.path.replace(/\\//g, \"_\").toUpperCase() : \"\";\n return path ? `${baseCode}_${path}` : baseCode;\n }\n /**\n * Generate helpful suggestions based on error type\n */\n generateSuggestions(error) {\n const suggestions = [];\n const message = error.message;\n if (message.includes(\"Expected string\")) {\n suggestions.push(\"Ensure the value is wrapped in quotes\");\n } else if (message.includes(\"Expected number\")) {\n suggestions.push(\"Remove quotes around numeric values\");\n } else if (message.includes(\"Expected array\")) {\n suggestions.push(\"Use square brackets [] for arrays\");\n } else if (message.includes(\"Expected object\")) {\n suggestions.push(\"Use curly braces {} for objects\");\n } else if (message.includes(\"Expected literal\")) {\n const match = message.match(/Expected literal (.+)/);\n if (match) {\n suggestions.push(`Use the exact value: ${match[1]}`);\n }\n } else if (message.includes(\"Unexpected property\")) {\n suggestions.push(\"Remove unknown properties or check spelling\");\n suggestions.push(\n \"Refer to the JSON schema documentation for valid properties\"\n );\n } else if (message.includes(\"Expected union\")) {\n suggestions.push(\n \"Check that the value matches one of the allowed formats\"\n );\n const path = error.path ?? \"\";\n if (/\\/children\\/\\d+$/.test(path) || path.endsWith(\"/name\")) {\n suggestions.push(\"Verify the component name is spelled correctly\");\n }\n } else if (message.includes(\"minimum\")) {\n const match = message.match(/minimum.*?(\\d+)/);\n if (match) {\n if (message.includes(\"Array\")) {\n suggestions.push(`Array must have at least ${match[1]} items`);\n } else {\n suggestions.push(`Value must be at least ${match[1]}`);\n }\n }\n } else if (message.includes(\"format\") && message.includes(\"uri\")) {\n suggestions.push(\n \"Ensure the URL is valid and starts with http:// or https://\"\n );\n }\n if (suggestions.length === 0) {\n suggestions.push(\"Check the JSON schema documentation for valid values\");\n suggestions.push(\"Verify the property name and value format\");\n }\n return suggestions;\n }\n /**\n * Find line and column number for a given JSON path\n */\n findLineNumber(path, jsonString, lines) {\n if (!path) {\n return {};\n }\n const jsonLines = lines || jsonString.split(\"\\n\");\n const pathParts = path.split(\".\");\n for (let i = 0; i < jsonLines.length; i++) {\n const line = jsonLines[i];\n const lastPathPart = pathParts[pathParts.length - 1];\n if (line.includes(`\"${lastPathPart}\"`)) {\n const column = line.indexOf(`\"${lastPathPart}\"`) + 1;\n return {\n line: i + 1,\n column\n };\n }\n }\n return {};\n }\n};\nvar JsonParsingError = class extends Error {\n validationErrors;\n constructor(message, errors) {\n super(message);\n this.name = \"JsonParsingError\";\n this.validationErrors = errors;\n }\n};\nvar JsonValidationError = class extends Error {\n validationErrors;\n constructor(message, errors) {\n super(message);\n this.name = \"JsonValidationError\";\n this.validationErrors = errors;\n }\n};\nfunction parseJsonComponent(jsonInput) {\n const parser = new JsonDocumentParser();\n return parser.parse(jsonInput);\n}\nfunction parseJsonWithLineNumbers(jsonString) {\n const parser = new JsonDocumentParser();\n return parser.parseWithLineNumbers(jsonString);\n}\n\n// src/validation/validators/theme.ts\nfunction formatValidationErrors(errors) {\n if (!Array.isArray(errors)) return [];\n return errors.map((error) => {\n if (typeof error === \"string\") return error;\n const path = error.path ? `${error.path}: ` : \"\";\n const message = error.message || \"Validation error\";\n return `${path}${message}`;\n });\n}\n\n// src/validation/validators/component.ts\nfunction safeValidateComponentProps(name, props) {\n const componentName = isStandardComponentName(name) ? name : \"custom\";\n const result = validateComponent(componentName, props);\n if (result.valid) {\n return { success: true, data: result.data };\n }\n return { success: false, error: result.errors || [] };\n}\nfunction safeValidateComponentDefinition(component) {\n const result = validateComponentDefinition(component);\n if (result.valid) {\n return { success: true, data: result.data };\n }\n return { success: false, error: result.errors || [] };\n}\nfunction getValidationErrors(props, name) {\n const componentName = name && isStandardComponentName(name) ? name : \"custom\";\n const result = validateComponent(componentName, props);\n if (result.valid) return [];\n return (result.errors || []).map(\n (e) => e.path ? `${e.path}: ${e.message}` : e.message\n );\n}\n\n// src/validation/core/validator.ts\nimport { Value as Value2 } from \"@sinclair/typebox/value\";\n\n// src/validation/core/errors.ts\nfunction formatSingleIssue(issue) {\n const path = issue.path || \"root\";\n let message = issue.message;\n let suggestion;\n let expected;\n let received;\n let options;\n if (message.includes(\"Expected\")) {\n const match = message.match(/Expected (.+) but received (.+)/);\n if (match) {\n expected = match[1];\n received = match[2];\n suggestion = getSuggestionForType(expected, received);\n }\n }\n if (message.includes(\"Required property\")) {\n const match = message.match(/Required property '(.+)'/);\n if (match) {\n message = `Missing required field: ${match[1]}`;\n suggestion = `Add the required field: ${match[1]}`;\n }\n }\n if (message.includes(\"Unexpected property\")) {\n const match = message.match(/Unexpected property '(.+)'/);\n if (match) {\n message = `Unknown property: ${match[1]}`;\n suggestion = `Remove the unknown property: ${match[1]}`;\n }\n }\n if (message.includes(\"Expected union\")) {\n message = \"Value does not match any of the expected types\";\n suggestion = \"Check the documentation for valid format options\";\n }\n if (message.includes(\"Expected literal\")) {\n const match = message.match(/Expected literal (.+)/);\n if (match) {\n expected = match[1];\n message = `Expected value: ${expected}`;\n suggestion = `Use the exact value: ${expected}`;\n }\n }\n if (message.includes(\"String length\")) {\n const minMatch = message.match(/minimum length of (\\d+)/);\n const maxMatch = message.match(/maximum length of (\\d+)/);\n if (minMatch) {\n message = `String must be at least ${minMatch[1]} characters long`;\n suggestion = `Add more characters to meet the minimum length of ${minMatch[1]}`;\n } else if (maxMatch) {\n message = `String must be at most ${maxMatch[1]} characters long`;\n suggestion = `Reduce to ${maxMatch[1]} characters or less`;\n }\n }\n if (message.includes(\"Expected number\")) {\n const minMatch = message.match(/minimum value of ([\\d.]+)/);\n const maxMatch = message.match(/maximum value of ([\\d.]+)/);\n if (minMatch) {\n message = `Number must be greater than or equal to ${minMatch[1]}`;\n suggestion = `Use a value of ${minMatch[1]} or higher`;\n } else if (maxMatch) {\n message = `Number must be less than or equal to ${maxMatch[1]}`;\n suggestion = `Use a value of ${maxMatch[1]} or lower`;\n }\n }\n if (message.includes(\"Array length\")) {\n const minMatch = message.match(/minimum length of (\\d+)/);\n const maxMatch = message.match(/maximum length of (\\d+)/);\n if (minMatch) {\n message = `Array must have at least ${minMatch[1]} items`;\n suggestion = `Add more items to meet the minimum of ${minMatch[1]}`;\n } else if (maxMatch) {\n message = `Array must have at most ${maxMatch[1]} items`;\n suggestion = `Remove items to meet the maximum of ${maxMatch[1]}`;\n }\n }\n if (message.includes(\"format\")) {\n if (message.includes(\"email\")) {\n message = \"Invalid email address format\";\n suggestion = \"Use a valid email format like user@example.com\";\n } else if (message.includes(\"uri\") || message.includes(\"url\")) {\n message = \"Invalid URL format\";\n suggestion = \"Use a valid URL format like https://example.com\";\n } else if (message.includes(\"date-time\")) {\n message = \"Invalid date-time format\";\n suggestion = \"Use ISO 8601 format like 2024-01-01T00:00:00Z\";\n }\n }\n if (message.includes(\"pattern\")) {\n message = \"String does not match the required pattern\";\n suggestion = \"Check the format requirements for this field\";\n }\n return {\n path,\n message,\n code: String(issue.type || \"validation_error\"),\n suggestion,\n expected,\n received,\n options\n };\n}\nfunction getSuggestionForType(expected, received) {\n if (expected === \"number\" && received === \"string\") {\n return \"Remove quotes or convert the string to a number\";\n }\n if (expected === \"string\" && received === \"number\") {\n return \"Add quotes or convert the number to a string\";\n }\n if (expected === \"boolean\") {\n return \"Use true or false (without quotes)\";\n }\n if (expected === \"array\" && received === \"object\") {\n return \"Use square brackets [] for arrays instead of curly braces {}\";\n }\n if (expected === \"object\" && received === \"array\") {\n return \"Use curly braces {} for objects instead of square brackets []\";\n }\n if (received === \"null\" || received === \"undefined\") {\n return `Provide a valid ${expected} value or mark the field as optional`;\n }\n return void 0;\n}\nfunction formatTypeBoxError(errors) {\n return errors.map(formatSingleIssue);\n}\nfunction formatTypeBoxErrorStrings(errors) {\n return formatTypeBoxError(errors).map((err) => {\n let msg = `${err.path}: ${err.message}`;\n if (err.suggestion) {\n msg += ` (Suggestion: ${err.suggestion})`;\n }\n return msg;\n });\n}\nfunction getErrorSummary(errors) {\n const summary = /* @__PURE__ */ new Map();\n for (const formattedError of formatTypeBoxError(errors)) {\n const existing = summary.get(formattedError.path) || [];\n existing.push(formattedError);\n summary.set(formattedError.path, existing);\n }\n return summary;\n}\nfunction formatErrorReport(errors) {\n const formattedErrors = formatTypeBoxError(errors);\n const summary = getErrorSummary(errors);\n let report = `Validation failed with ${formattedErrors.length} error${formattedErrors.length > 1 ? \"s\" : \"\"}:\n\n`;\n for (const [path, pathErrors] of summary) {\n report += `\\u{1F4CD} ${path}:\n`;\n for (const err of pathErrors) {\n report += ` \\u274C ${err.message}\n`;\n if (err.suggestion) {\n report += ` \\u{1F4A1} ${err.suggestion}\n`;\n }\n if (err.expected && err.received) {\n report += ` \\u{1F4CB} Expected: ${err.expected}, Received: ${err.received}\n`;\n }\n if (err.options) {\n report += ` \\u{1F4CB} Valid options: ${err.options.join(\", \")}\n`;\n }\n }\n report += \"\\n\";\n }\n return report;\n}\nfunction hasCriticalErrors(errors) {\n return errors.some((issue) => {\n if (issue.message.includes(\"Required property\")) {\n return true;\n }\n if (issue.path.includes(\"name\") && issue.message.includes(\"Expected literal\")) {\n return true;\n }\n if (issue.message.includes(\"Expected union\") || issue.message.includes(\"Never\")) {\n return true;\n }\n return false;\n });\n}\nfunction getValidationContext(path) {\n if (!path || path === \"root\") return \"document root\";\n const pathParts = path.split(\".\");\n if (pathParts.includes(\"children\")) {\n const childIndex = pathParts.indexOf(\"children\");\n if (pathParts.length > childIndex + 1) {\n const index = pathParts[childIndex + 1];\n return `component at index ${index}`;\n }\n }\n if (pathParts.includes(\"props\")) {\n return \"props section\";\n }\n if (pathParts.includes(\"theme\")) {\n return \"theme configuration\";\n }\n return pathParts.join(\" > \");\n}\nvar formatValidationError = formatTypeBoxError;\nvar formatValidationErrorStrings = formatTypeBoxErrorStrings;\n\n// src/validation/core/validator.ts\nvar COMPONENT_SCHEMA_MAP = {\n report: ReportPropsSchema,\n section: SectionPropsSchema,\n heading: HeadingPropsSchema,\n paragraph: ParagraphPropsSchema,\n columns: ColumnsPropsSchema,\n image: ImagePropsSchema,\n statistic: StatisticPropsSchema,\n table: TablePropsSchema,\n list: ListPropsSchema\n};\nfunction validateComponent2(name, props, options) {\n const schema = COMPONENT_SCHEMA_MAP[name];\n if (!schema) {\n if (Value2.Check(CustomComponentDefinitionSchema, props)) {\n return {\n success: true,\n data: props\n };\n }\n const errors2 = [...Value2.Errors(CustomComponentDefinitionSchema, props)];\n const formattedErrors2 = formatTypeBoxError(errors2);\n return {\n success: false,\n errors: formattedErrors2,\n errorStrings: formatTypeBoxErrorStrings(errors2),\n report: options?.includeReport ? formatErrorReport(errors2) : void 0,\n hasCriticalErrors: options?.checkCritical ? hasCriticalErrors(errors2) : void 0\n };\n }\n if (Value2.Check(schema, props)) {\n return {\n success: true,\n data: props\n };\n }\n const errors = [...Value2.Errors(schema, props)];\n const formattedErrors = formatTypeBoxError(errors);\n return {\n success: false,\n errors: formattedErrors,\n errorStrings: formatTypeBoxErrorStrings(errors),\n report: options?.includeReport ? formatErrorReport(errors) : void 0,\n hasCriticalErrors: options?.checkCritical ? hasCriticalErrors(errors) : void 0\n };\n}\nfunction validateComponentDefinition2(component, options) {\n const maxDepth = options?.maxDepth ?? 10;\n const currentDepth = options?.currentDepth ?? 0;\n if (currentDepth > maxDepth) {\n return {\n success: false,\n errors: [\n {\n path: \"children\",\n message: `Maximum nesting depth (${maxDepth}) exceeded`,\n code: \"custom\",\n suggestion: \"Reduce the nesting level of components\"\n }\n ],\n errorStrings: [`Maximum nesting depth (${maxDepth}) exceeded`],\n hasCriticalErrors: true\n };\n }\n if (Value2.Check(ComponentDefinitionSchema, component)) {\n const data = component;\n const warnings = [];\n if (data.children && Array.isArray(data.children)) {\n for (let i = 0; i < data.children.length; i++) {\n const nestedResult = validateComponentDefinition2(data.children[i], {\n ...options,\n currentDepth: currentDepth + 1\n });\n if (!nestedResult.success) {\n const nestedErrors = nestedResult.errors?.map((err) => ({\n ...err,\n path: `children[${i}].${err.path}`\n }));\n return {\n success: false,\n errors: nestedErrors,\n errorStrings: nestedErrors?.map(\n (err) => `${err.path}: ${err.message}`\n ),\n report: options?.includeReport ? `Validation failed in nested component at index ${i}:\n${nestedResult.report}` : void 0,\n hasCriticalErrors: nestedResult.hasCriticalErrors\n };\n }\n if (nestedResult.warnings) {\n warnings.push(\n ...nestedResult.warnings.map((w) => `children[${i}]: ${w}`)\n );\n }\n }\n }\n return {\n success: true,\n data: component,\n warnings: warnings.length > 0 ? warnings : void 0\n };\n }\n const errors = [...Value2.Errors(ComponentDefinitionSchema, component)];\n const formattedErrors = formatTypeBoxError(errors);\n return {\n success: false,\n errors: formattedErrors,\n errorStrings: formatTypeBoxErrorStrings(errors),\n report: options?.includeReport ? formatErrorReport(errors) : void 0,\n hasCriticalErrors: options?.checkCritical ? hasCriticalErrors(errors) : void 0\n };\n}\nfunction validateComponents2(components, options) {\n const results = [];\n let criticalCount = 0;\n for (const { name, props } of components) {\n const result = name in COMPONENT_SCHEMA_MAP ? validateComponent2(name, props, options) : validateComponentDefinition2(props, options);\n results.push(result);\n if (result.hasCriticalErrors) {\n criticalCount++;\n }\n if (!result.success && options?.stopOnFirst) {\n break;\n }\n }\n const valid = results.filter((r) => r.success).length;\n const invalid = results.length - valid;\n return {\n success: invalid === 0,\n results,\n summary: {\n total: results.length,\n valid,\n invalid,\n criticalErrors: criticalCount\n }\n };\n}\nfunction transformAndValidate(name, data, transformer) {\n try {\n const transformed = transformer ? transformer(data) : data;\n return validateComponent2(name, transformed, {\n includeReport: true,\n checkCritical: true\n });\n } catch (error) {\n return {\n success: false,\n errors: [\n {\n path: \"root\",\n message: `Transformation failed: ${error instanceof Error ? error.message : String(error)}`,\n code: \"custom\"\n }\n ],\n errorStrings: [\n `Transformation failed: ${error instanceof Error ? error.message : String(error)}`\n ],\n hasCriticalErrors: true\n };\n }\n}\nfunction createValidatedComponent(name, partialConfig) {\n const schema = COMPONENT_SCHEMA_MAP[name];\n if (!schema) {\n return {\n success: false,\n errors: [\n {\n path: \"name\",\n message: `Unknown component name: ${name}`,\n code: \"custom\",\n suggestion: `Use one of: ${Object.keys(COMPONENT_SCHEMA_MAP).join(\", \")}`\n }\n ],\n errorStrings: [`Unknown component name: ${name}`],\n hasCriticalErrors: true\n };\n }\n if (Value2.Check(schema, partialConfig)) {\n return {\n success: true,\n data: partialConfig\n };\n }\n const errors = [...Value2.Errors(schema, partialConfig)];\n const formattedErrors = formatTypeBoxError(errors);\n return {\n success: false,\n errors: formattedErrors,\n errorStrings: formatTypeBoxErrorStrings(errors),\n report: formatErrorReport(errors),\n hasCriticalErrors: hasCriticalErrors(errors)\n };\n}\nfunction isValidComponent(name, props) {\n const result = validateComponent2(name, props);\n return result.success;\n}\n\n// src/types/components.ts\nvar STANDARD_COMPONENTS = [\n \"chart\",\n \"columns\",\n \"divider\",\n \"heading\",\n \"highcharts\",\n \"image\",\n \"list\",\n \"paragraph\",\n \"docx\",\n \"section\",\n \"statistic\",\n \"table\",\n \"text-box\",\n \"toc\",\n \"visual\",\n \"block\",\n \"group\"\n];\nvar STANDARD_COMPONENTS_SET = new Set(STANDARD_COMPONENTS);\nfunction isReportComponent(component) {\n return component.name === \"docx\";\n}\nfunction isSectionComponent(component) {\n return component.name === \"section\";\n}\nfunction isColumnsComponent(component) {\n return component.name === \"columns\";\n}\nfunction isHeadingComponent(component) {\n return component.name === \"heading\";\n}\nfunction isParagraphComponent(component) {\n return component.name === \"paragraph\";\n}\nfunction isImageComponent(component) {\n return component.name === \"image\";\n}\nfunction isTextBoxComponent(component) {\n return component.name === \"text-box\";\n}\nfunction isStatisticComponent(component) {\n return component.name === \"statistic\";\n}\nfunction isTableComponent(component) {\n return component.name === \"table\";\n}\nfunction isListComponent(component) {\n return component.name === \"list\";\n}\nfunction isTocComponent(component) {\n return component.name === \"toc\";\n}\nfunction isHighchartsComponent(component) {\n return component.name === \"highcharts\";\n}\nfunction isVisualComponent(component) {\n return component.name === \"visual\";\n}\nfunction isTextSpaceAfterComponent(component) {\n return component.name === \"text-space-after\";\n}\n\n// src/index.ts\nvar SHARED_DOCX_VERSION = \"1.0.0\";\nexport {\n AlignmentSchema,\n BASE_SCHEMA_METADATA,\n BUILT_IN_DOCX_THEME_NAMES,\n BaseComponentPropsSchema,\n BlockInvocationPropsSchema,\n BorderSchema,\n COMPONENT_METADATA,\n ChartPropsSchema,\n ColumnsPropsSchema,\n CommentReplySchema,\n CommentSchema,\n ComponentDefinitionSchema,\n CustomComponentDefinitionSchema,\n DEFAULT_DOCX_RENDERER_ID,\n DEFAULT_ERROR_CONFIG,\n DOCX_RENDERER_IDS,\n DividerPropsSchema,\n ERROR_EMOJIS,\n ERROR_TEMPLATES,\n EndnotesSchema,\n FLOW_CHILDREN,\n FootnotesSchema,\n GenerateDocumentRequestSchema,\n GenerateDocumentResponseSchema,\n GroupPropsSchema,\n HeadingLevelSchema,\n HeadingPropsSchema,\n HighchartsPropsSchema,\n ImagePropsSchema,\n IndentSchema,\n JSON_SCHEMA_URLS,\n JsonComponentDefinitionSchema,\n JsonDocumentParser,\n JsonParsingError,\n JsonValidationError,\n JustifiedAlignmentSchema,\n LineSpacingSchema,\n ListMarkerFontSchema,\n ListPropsSchema,\n MarginsSchema,\n NATIVE_RENDER_MODE,\n NATIVE_VISUAL_ELEMENT_NAMES,\n NativeVisualCanvasSchema,\n NativeVisualElementSchema,\n NativeVisualImagePropsSchema,\n NativeVisualShapePropsSchema,\n NativeVisualTextPropsSchema,\n NoteSchema,\n NumberingSchema,\n ParagraphIndentSchema,\n ParagraphPropsSchema,\n ReportPropsSchema,\n RevisionMarkSchema,\n RevisionSchema,\n RevisionSegmentSchema,\n SHARED_DOCX_VERSION,\n STANDARD_COMPONENTS,\n STANDARD_COMPONENTS_REGISTRY,\n STANDARD_COMPONENTS_SET,\n SectionPropsSchema,\n SpacingSchema,\n StandardComponentDefinitionSchema,\n StatisticPropsSchema,\n THEME_SCHEMA_METADATA,\n TabStopLeaderSchema,\n TabStopSchema,\n TabStopTypeSchema,\n TabStopsSchema,\n TablePropsSchema,\n TextBoxPropsSchema,\n TextSpaceAfterComponentSchema,\n TextSpaceAfterPropsSchema,\n ThemeConfigSchema,\n ThemeOverridesSchema,\n TocPropsSchema,\n ValidateDocumentRequestSchema,\n ValidateDocumentResponseSchema,\n VisualCanvasBackgroundSchema,\n VisualCanvasSchema,\n VisualNativePropsSchema,\n VisualPropsSchema,\n VisualRasterPropsSchema,\n calculatePosition,\n clearComponentNamesCache,\n collectDocxRendererErrors,\n collectIndentConflicts,\n collectNoteRevisionConflicts,\n collectTextBoxShapeConflicts,\n compareSemver,\n componentValidator,\n comprehensiveValidateDocument,\n convertToJsonSchema as convertDocxToJsonSchema,\n convertToJsonSchema,\n createComponentSchema2 as createComponentSchema,\n createComponentValidator,\n createDocumentValidator,\n createComponentSchema as createDocxComponentSchema,\n createErrorConfig,\n createJsonParseError,\n createJsonValidator,\n createMinimalTheme,\n createThemeValidator,\n createValidatedComponent,\n createValidator,\n deepValidateDocument,\n diffDocuments,\n diffWords,\n documentValidator,\n docxComponentDefinitionName,\n docxDocumentBlockTargets,\n docxFlowDefinitionName,\n exportSchemaToFile as exportDocxSchemaToFile,\n exportSchemaToFile2 as exportSchemaToFile,\n extractStandardComponentNames,\n fixSchemaReferences as fixDocxSchemaReferences,\n fixSchemaReferences2 as fixSchemaReferences,\n formatErrorMessage,\n formatErrorReport,\n formatErrorSummary,\n formatValidationError,\n formatValidationErrorStrings,\n formatValidationErrors,\n generateUnifiedDocumentSchema,\n getAllStandardComponentNames,\n getErrorSummary,\n getLiteralValue,\n getObjectSchemaPropertyNames,\n getSchemaMetadata,\n getStandardComponent,\n getThemeName,\n getValidationContext,\n getValidationErrors,\n getValidationSummary,\n groupErrorsByPath,\n hasCriticalErrors,\n isColumnsComponent,\n isColumnsProps,\n isCustomComponentProps,\n isHeadingComponent,\n isHeadingProps,\n isHighchartsComponent,\n isImageComponent,\n isImageProps,\n isListComponent,\n isListProps,\n isLiteralSchema,\n isNativeVisualProps,\n isObjectSchema,\n isParagraphComponent,\n isParagraphProps,\n isReportComponent,\n isReportProps,\n isSectionComponent,\n isSectionProps,\n isStandardComponentName,\n isStatisticComponent,\n isStatisticProps,\n isTableComponent,\n isTableProps,\n isTextBoxComponent,\n isTextSpaceAfterComponent,\n isThemeConfig,\n isTocComponent,\n isUnionSchema,\n isValidComponent,\n isValidDocument,\n isValidSemver,\n isValidTheme,\n isValidThemeConfig,\n isValidTheme as isValidThemeJson,\n isValidationSuccess,\n isVisualComponent,\n latestVersion,\n parseJsonComponent,\n parseJsonWithLineNumbers,\n parseSemver,\n safeValidateComponentDefinition,\n safeValidateComponentProps,\n createComponentSchemaObject as sharedCreateComponentSchemaObject,\n strictComponentValidator,\n strictDocumentValidator,\n strictThemeValidator,\n stripMarkdown,\n themeValidator,\n transformAndValidate,\n transformValueError as transformDocxValueError,\n transformValueErrors as transformDocxValueErrors,\n transformValueError2 as transformValueError,\n transformValueErrors2 as transformValueErrors,\n validate,\n validateAgainstSchema,\n validateBatch,\n validateComponent2 as validateComponent,\n validateComponentDefinition2 as validateComponentDefinition,\n validateComponent as validateComponentProps,\n validateComponents2 as validateComponents,\n validateCustomComponentProps,\n validateDocument,\n validateDocumentWithSchema,\n validateJson,\n validateJsonDocument as validateJsonComponent,\n validateJsonComponent as validateJsonComponentDoc,\n validateJsonDocument,\n validateStrict,\n validateTheme,\n validateThemeJson,\n validateThemeWithEnhancement,\n validateWithEnhancement\n};\n//# sourceMappingURL=index.js.map","import { Type, Static } from '@sinclair/typebox';\nimport { Value } from '@sinclair/typebox/value';\n\nexport type FormatName = 'docx' | 'pptx';\n\nconst EnvSchema = Type.Object({\n basePath: Type.String({ default: '' }),\n});\n\ntype Env = Static<typeof EnvSchema>;\n\nfunction validateAndTransformEnv(rawEnv: unknown): Env {\n const withDefaults = Value.Default(EnvSchema, rawEnv) as any;\n\n if (withDefaults.basePath && withDefaults.basePath !== '') {\n if (\n !withDefaults.basePath.startsWith('/') ||\n withDefaults.basePath.endsWith('/')\n ) {\n throw new Error('basePath must start with / and not end with /');\n }\n }\n\n if (!Value.Check(EnvSchema, withDefaults)) {\n const errors = [...Value.Errors(EnvSchema, withDefaults)];\n throw new Error(\n `Environment validation failed: ${errors.map((e) => e.message).join(', ')}`\n );\n }\n\n return withDefaults as Env;\n}\n\nexport const env = validateAndTransformEnv({\n basePath: import.meta.env.VITE_BASE_PATH || '',\n});\n\n// Format injected by server via window.__JTO_FORMAT__\ndeclare global {\n interface Window {\n __JTO_FORMAT__?: FormatName;\n }\n}\n\n/**\n * The declared type is a promise the runtime cannot keep: `__JTO_FORMAT__`\n * arrives from an injected script tag, so anything at all can be sitting there.\n * An unrecognized value used to flow straight into `QUALITY_RULES[FORMAT]` and\n * friends, where the lookup returns undefined and the next `.map` throws — a\n * blank playground rather than a wrong label. Narrow it once, here, so every\n * consumer downstream really does hold a `FormatName`.\n */\nconst FORMATS: readonly FormatName[] = ['docx', 'pptx'];\n\nfunction injectedFormat(): FormatName {\n if (typeof window === 'undefined') return 'docx';\n const injected = window.__JTO_FORMAT__;\n return FORMATS.includes(injected as FormatName)\n ? (injected as FormatName)\n : 'docx';\n}\n\nexport const FORMAT: FormatName = injectedFormat();\n\nexport const FORMAT_LABEL = FORMAT === 'docx' ? 'Document' : 'Presentation';\nexport const FORMAT_EXT = FORMAT === 'docx' ? '.docx' : '.pptx';\n","/**\n * JSON Schema Generator for Monaco Editor\n *\n * Uses TypeBox's native JSON Schema generation for rich autocomplete.\n * Format-aware: generates docx or pptx schemas based on FORMAT.\n */\nimport {\n generateUnifiedDocumentSchema as generatePptxSchema,\n convertToJsonSchema as convertPptxToJsonSchema,\n PptxComponentDefinitionSchema,\n PresentationPropsSchema,\n SlidePropsSchema,\n TextPropsSchema,\n PptxImagePropsSchema,\n ShapePropsSchema,\n PptxTablePropsSchema,\n ThemeConfigSchema as PptxThemeConfigSchema,\n} from '@json-to-office/shared-pptx';\n\nimport {\n generateUnifiedDocumentSchema as generateDocxSchema,\n convertToJsonSchema as convertDocxToJsonSchema,\n ComponentDefinitionSchema as DocxComponentDefinitionSchema,\n ReportPropsSchema,\n SectionPropsSchema,\n HeadingPropsSchema,\n ParagraphPropsSchema,\n ImagePropsSchema,\n TablePropsSchema as DocxTablePropsSchema,\n ThemeConfigSchema as DocxThemeConfigSchema,\n} from '@json-to-office/shared-docx';\n\nimport { FORMAT } from './env';\n\nexport interface MonacoSchemaConfig {\n uri: string;\n fileMatch: string[];\n schema: any;\n}\n\n// ---------------------------------------------------------------------------\n// Document schema\n// ---------------------------------------------------------------------------\n\nfunction generateDocxDocumentSchema(): any {\n const unified = generateDocxSchema({ customComponents: [] });\n const schema = convertDocxToJsonSchema(unified, {\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'https://json-to-office.dev/schema/document/v1.0.0',\n title: 'JSON to DOCX Document Definition',\n description: 'Schema for JSON to DOCX JSON document definitions',\n });\n\n const enhancedSchema: any = {\n ...schema,\n default: {\n name: 'docx',\n props: { title: 'New Document' },\n children: [],\n },\n properties: {\n ...(schema as any).properties,\n children: {\n ...((schema as any).properties?.children || {}),\n description:\n 'Array of document components. Type \"name\" to see available component types.',\n markdownDescription:\n 'Array of document components. Available types:\\n- `docx` - Main container\\n- `section` - Section container\\n- `heading` - Heading element\\n- `paragraph` - Paragraph element\\n- `image` - Image element\\n- `table` - Data table\\n- `list` - List element\\n- `columns` - Column layout\\n- `statistic` - Statistic element\\n- `highcharts` - Highcharts chart\\n- `toc` - Table of contents',\n },\n },\n definitions: {\n ...((schema as any).definitions || {}),\n },\n };\n\n enhanceSchemaDescriptions(enhancedSchema);\n return enhancedSchema;\n}\n\nfunction generatePptxDocumentSchema(): any {\n const unified = generatePptxSchema({ customComponents: [] });\n const schema = convertPptxToJsonSchema(unified, {\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'https://json-to-office.dev/schema/presentation/v1.0.0',\n title: 'JSON to PPTX Presentation Definition',\n description: 'Schema for JSON to PPTX JSON presentation definitions',\n });\n\n const enhancedSchema: any = {\n ...schema,\n default: {\n name: 'pptx',\n props: { title: 'New Presentation' },\n children: [],\n },\n properties: {\n ...(schema as any).properties,\n children: {\n ...((schema as any).properties?.children || {}),\n description:\n 'Array of slide components. Type \"name\" to see available component types.',\n markdownDescription:\n 'Array of presentation components. Available types:\\n- `pptx` - Main container\\n- `slide` - Slide container\\n- `text` - Text element\\n- `image` - Image element\\n- `shape` - Shape element\\n- `table` - Data table\\n- `highcharts` - Highcharts chart',\n },\n },\n definitions: {\n ...((schema as any).definitions || {}),\n },\n };\n\n enhanceSchemaDescriptions(enhancedSchema);\n return enhancedSchema;\n}\n\n/**\n * Generates JSON Schema for document/presentation definitions (format-aware)\n */\nexport function generateReportDefinitionSchema(): any {\n return FORMAT === 'docx'\n ? generateDocxDocumentSchema()\n : generatePptxDocumentSchema();\n}\n\n// ---------------------------------------------------------------------------\n// Theme schema\n// ---------------------------------------------------------------------------\n\n/**\n * Generates JSON Schema for theme definitions (format-aware)\n */\nexport function generateThemeConfigSchema(): any {\n const source =\n FORMAT === 'docx' ? DocxThemeConfigSchema : PptxThemeConfigSchema;\n const schema = JSON.parse(JSON.stringify(source));\n cleanupTypeBoxIds(schema, false);\n\n const label = FORMAT === 'docx' ? 'DOCX' : 'PPTX';\n return {\n ...schema,\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'https://json-to-office.dev/schemas/theme/v1.0.0',\n title: `JSON to ${label} Theme`,\n description: `Theme definition for JSON to ${label} ${FORMAT === 'docx' ? 'documents' : 'presentations'}`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Component definition schema\n// ---------------------------------------------------------------------------\n\n/**\n * Generates JSON Schema for component definitions with enhanced descriptions\n */\nexport function generateComponentDefinitionSchema(): any {\n const source =\n FORMAT === 'docx'\n ? DocxComponentDefinitionSchema\n : PptxComponentDefinitionSchema;\n const schema = JSON.parse(JSON.stringify(source));\n enhanceSchemaDescriptions(schema);\n\n const label = FORMAT === 'docx' ? 'DOCX' : 'PPTX';\n return {\n ...schema,\n $schema: 'http://json-schema.org/draft-07/schema#',\n title: 'Component Definition',\n description: `Individual component configuration for JSON to ${label}`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Component schemas per type\n// ---------------------------------------------------------------------------\n\nfunction generateDocxComponentSchemas(): Record<string, any> {\n const componentSchemas: Record<\n string,\n { schema: any; name: string; description: string }\n > = {\n docx: {\n schema: ReportPropsSchema,\n name: 'ReportProps',\n description: 'Main document container configuration',\n },\n section: {\n schema: SectionPropsSchema,\n name: 'SectionProps',\n description: 'Section container for organizing content',\n },\n heading: {\n schema: HeadingPropsSchema,\n name: 'HeadingProps',\n description: 'Heading element with level and formatting',\n },\n paragraph: {\n schema: ParagraphPropsSchema,\n name: 'ParagraphProps',\n description: 'Paragraph element with text and formatting',\n },\n image: {\n schema: ImagePropsSchema,\n name: 'ImageProps',\n description: 'Image element with sizing and positioning',\n },\n table: {\n schema: DocxTablePropsSchema,\n name: 'TableProps',\n description: 'Tabular data display with rows and columns',\n },\n };\n\n return buildComponentResult(componentSchemas);\n}\n\nfunction generatePptxComponentSchemas(): Record<string, any> {\n const componentSchemas: Record<\n string,\n { schema: any; name: string; description: string }\n > = {\n pptx: {\n schema: PresentationPropsSchema,\n name: 'PresentationProps',\n description: 'Main presentation container configuration',\n },\n slide: {\n schema: SlidePropsSchema,\n name: 'SlideProps',\n description: 'Slide container for organizing content',\n },\n text: {\n schema: TextPropsSchema,\n name: 'TextProps',\n description: 'Text element with formatting and positioning',\n },\n image: {\n schema: PptxImagePropsSchema,\n name: 'ImageProps',\n description: 'Image element with sizing and positioning',\n },\n shape: {\n schema: ShapePropsSchema,\n name: 'ShapeProps',\n description: 'Geometric shape with optional text and styling',\n },\n table: {\n schema: PptxTablePropsSchema,\n name: 'TableProps',\n description: 'Tabular data display with rows and columns',\n },\n };\n\n return buildComponentResult(componentSchemas);\n}\n\nfunction buildComponentResult(\n componentSchemas: Record<\n string,\n { schema: any; name: string; description: string }\n >\n): Record<string, any> {\n const result: Record<string, any> = {};\n for (const [type, config] of Object.entries(componentSchemas)) {\n const schema = JSON.parse(JSON.stringify(config.schema));\n result[type] = {\n ...schema,\n title: config.name,\n description: config.description,\n };\n }\n return result;\n}\n\n/**\n * Generates schemas for all component types (format-aware)\n */\nexport function generateComponentSchemas(): Record<string, any> {\n return FORMAT === 'docx'\n ? generateDocxComponentSchemas()\n : generatePptxComponentSchemas();\n}\n\n// ---------------------------------------------------------------------------\n// Monaco schema configs\n// ---------------------------------------------------------------------------\n\n/**\n * Creates Monaco editor schema configuration for document/presentation definitions\n */\nexport function createReportSchemaConfig(\n filePatterns: string[] = FORMAT === 'docx' ? ['*.docx.json'] : ['*.pptx.json']\n): MonacoSchemaConfig {\n return {\n uri: 'https://json-to-office.dev/schema/report/v1.0.0',\n fileMatch: filePatterns,\n schema: generateReportDefinitionSchema(),\n };\n}\n\n/**\n * Creates Monaco editor schema configuration for theme definitions\n */\nexport function createThemeSchemaConfig(\n filePatterns: string[] = [`*.${FORMAT}.theme.json`]\n): MonacoSchemaConfig {\n return {\n uri: 'https://json-to-office.dev/schemas/theme/v1.0.0',\n fileMatch: filePatterns,\n schema: generateThemeConfigSchema(),\n };\n}\n\n/**\n * Generates a complete schema configuration for Monaco editor\n */\nexport function generateMonacoSchemaConfigs(): MonacoSchemaConfig[] {\n return [createReportSchemaConfig(), createThemeSchemaConfig()];\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction enhanceSchemaDescriptions(schema: any): void {\n if (typeof schema !== 'object' || schema === null) return;\n\n // A component branch — wherever it sits: flat `anyOf` union or the\n // restructured if/then dispatch (`allOf[].then`).\n if (typeof schema.properties?.name?.const === 'string') {\n const componentType = schema.properties.name.const;\n // Registry descriptions (attached at generation) win; fill gaps only.\n if (!schema.description) {\n schema.description = getComponentDescription(componentType);\n }\n\n if (schema.properties?.props) {\n enhancePropsDescriptions(componentType, schema.properties.props);\n }\n }\n\n Object.values(schema).forEach((value) => {\n if (typeof value === 'object' && value !== null) {\n enhanceSchemaDescriptions(value);\n }\n });\n}\n\nfunction getComponentDescription(type: string): string {\n const descriptions: Record<string, string> = {\n // docx\n docx: 'Main document container - defines the overall document structure.',\n section: 'Section container - groups content within a document section.',\n heading: 'Heading element - displays headings with level and formatting.',\n paragraph: 'Paragraph element - displays text with formatting.',\n columns: 'Column layout - arranges content in multiple columns.',\n list: 'List element - displays ordered or unordered lists.',\n statistic: 'Statistic element - displays key metrics.',\n highcharts: 'Highcharts chart - renders a chart from Highcharts options.',\n toc: 'Table of contents - generates a document TOC.',\n 'text-box': 'Text box element - a positioned box with text content.',\n // pptx\n pptx: 'Main presentation container - defines the overall presentation structure.',\n slide: 'Slide container - groups content elements within a single slide.',\n text: 'Text element - displays text with formatting and positioning.',\n shape: 'Shape element - geometric shapes with optional text and styling.',\n // shared\n image: 'Image element - displays images with sizing and positioning.',\n table: 'Table element - displays tabular data with headers and rows.',\n custom:\n 'Custom component - user-defined component type for specialized content.',\n };\n\n return descriptions[type] || `${type} component`;\n}\n\nfunction enhancePropsDescriptions(\n componentType: string,\n propsSchema: any\n): void {\n if (!propsSchema.properties) return;\n\n const propertyDescriptions: Record<string, Record<string, string>> = {\n // pptx\n text: {\n text: 'The text content to display',\n fontSize: 'Font size in points',\n bold: 'Whether to bold the text',\n color: 'Text color as hex string',\n align: 'Text alignment',\n },\n shape: {\n type: 'Shape type (rect, ellipse, etc.)',\n text: 'Text content inside the shape',\n fill: 'Fill color',\n },\n // docx\n heading: {\n text: 'The heading text',\n level: 'Heading level (1-6)',\n },\n paragraph: {\n text: 'The paragraph text content',\n },\n // shared\n image: {\n path: 'Path or URL to the image',\n w: 'Image width in inches',\n h: 'Image height in inches',\n },\n table: {\n rows: 'Array of rows, each containing cell values',\n colW: 'Column widths',\n },\n };\n\n const descriptions = propertyDescriptions[componentType];\n if (descriptions) {\n Object.entries(descriptions).forEach(([prop, desc]) => {\n if (propsSchema.properties[prop]) {\n propsSchema.properties[prop].description = desc;\n }\n });\n }\n}\n\nfunction cleanupTypeBoxIds(schema: any, hasDefinitions = true): void {\n if (typeof schema !== 'object' || schema === null) return;\n\n if (schema.$id && /^T\\d+$/.test(schema.$id)) {\n delete schema.$id;\n }\n\n if (schema.$ref && /^T\\d+$/.test(schema.$ref)) {\n if (hasDefinitions) {\n schema.$ref = '#/definitions/ComponentDefinition';\n } else {\n // Theme schemas have no $ref — this is a safety guard\n delete schema.$ref;\n }\n }\n\n if (Array.isArray(schema)) {\n schema.forEach((item) => cleanupTypeBoxIds(item, hasDefinitions));\n return;\n }\n\n Object.keys(schema).forEach((key) => {\n if (typeof schema[key] === 'object' && schema[key] !== null) {\n cleanupTypeBoxIds(schema[key], hasDefinitions);\n }\n });\n}\n","import { FORMAT } from '../lib/env';\n\nexport const API_BASE_URL = import.meta.env.VITE_API_URL || '/api';\n\n// Format-specific API prefix\nconst FORMAT_API = `${API_BASE_URL}/${FORMAT}`;\n\nexport const API_ENDPOINTS = {\n discovery: {\n all: `${API_BASE_URL}/discovery/all`,\n plugins: `${API_BASE_URL}/discovery/plugins`,\n documents: `${API_BASE_URL}/discovery/documents`,\n themes: `${API_BASE_URL}/discovery/themes`,\n schemas: {\n document: `${API_BASE_URL}/discovery/schemas/document`,\n theme: `${API_BASE_URL}/discovery/schemas/theme`,\n },\n },\n generate: `${FORMAT_API}/generate`,\n validate: `${FORMAT_API}/validate`,\n diff: `${FORMAT_API}/diff`,\n fonts: {\n catalog: `${API_BASE_URL}/fonts/catalog`,\n materialize: `${API_BASE_URL}/fonts/materialize`,\n },\n preview: {\n libreoffice: `${FORMAT_API}/preview/libreoffice`,\n libreofficeFromJson: `${FORMAT_API}/preview/libreoffice-from-json`,\n },\n renderers: `${FORMAT_API}/renderers`,\n cacheStats: `${FORMAT_API}/cache-stats`,\n};\n","/**\n * Client-side service for fetching and caching JSON schemas\n */\n\nimport { API_BASE_URL } from '../config/api';\nimport type { BrowserComponentSchemaInfo } from '../store/browser-plugins-store';\n\ninterface SchemaResponse {\n success: boolean;\n data?: any;\n error?: string;\n}\n\nclass SchemaService {\n private documentSchemaCache: any | null = null;\n private themeSchemaCache: any | null = null;\n private pluginSchemaCache: Map<string, any> = new Map();\n private cacheTimestamp: { [key: string]: number } = {};\n private readonly CACHE_DURATION = 5 * 60 * 1000; // 5 minutes\n private readonly MAX_PLUGIN_CACHE = 10;\n // Requests that have been sent but have not answered yet, by cache key.\n // Several parts of the page ask for the same schema within the same tick on\n // load, and the document schema is megabytes of JSON, so asking once and\n // handing the same promise to every caller is worth more than the cache\n // behind it — which cannot help until the first answer lands.\n private inFlight: Map<string, { promise: Promise<any>; epoch: number }> =\n new Map();\n // Bumped by every invalidation. A request carries the epoch it was sent in,\n // which is what separates the two reasons the same key gets asked for twice:\n // several callers wanting the same answer at the same moment (share it) and\n // a caller wanting a *newer* answer than the one already on the wire (do\n // not). Without it, an invalidation and the sharing above disagree — the\n // shared request was sent before the invalidation and answers for the\n // server state it was sent against.\n private cacheEpoch = 0;\n\n /**\n * Fetch the JSON schema for document validation\n * @param pluginNames Optional array of plugin names to include in the schema\n * @param browserComponents Components compiled in the browser, by metadata;\n * when present the request is a POST carrying their props schemas.\n * @param options `bypassCache` asks for an answer that is not a stored one.\n * It is not an invalidation: a request already on the wire for this exact\n * key is still the answer being asked for, and is shared rather than sent\n * twice. Use `clearPluginSchemaCache` when what changed is on the server.\n */\n async fetchDocumentSchema(\n pluginNames?: string[],\n browserComponents?: BrowserComponentSchemaInfo[],\n options?: { bypassCache?: boolean }\n ): Promise<any> {\n // Create cache key based on plugins. An explicit selection (even [])\n // is cached apart from the \"unspecified\" default, which the server\n // resolves to every registered plugin. Browser components are part of\n // the key too: their schemas change on every edit of the plugin file.\n const browserKey =\n browserComponents && browserComponents.length > 0\n ? `+browser:${JSON.stringify(browserComponents)}`\n : '';\n const cacheKey = pluginNames\n ? `document-${[...pluginNames].sort().join(',')}${browserKey}`\n : `document${browserKey}`;\n\n // Check cache first\n if (!options?.bypassCache) {\n if (pluginNames || browserKey) {\n const cached = this.pluginSchemaCache.get(cacheKey);\n if (cached && this.isCacheValid(cacheKey)) {\n return cached;\n }\n } else if (this.documentSchemaCache && this.isCacheValid('document')) {\n return this.documentSchemaCache;\n }\n }\n\n // Only a request sent since the last invalidation answers the question\n // this caller is asking; an older one is describing a server state that\n // has been declared stale.\n const epoch = this.cacheEpoch;\n const pending = this.inFlight.get(cacheKey);\n if (pending && pending.epoch >= epoch) return pending.promise;\n\n const promise = this.requestDocumentSchema(\n cacheKey,\n pluginNames,\n browserComponents,\n browserKey,\n epoch\n ).finally(() => {\n // Only if it is still the entry for this key: an invalidation may have\n // replaced it with a newer request already.\n if (this.inFlight.get(cacheKey)?.promise === promise) {\n this.inFlight.delete(cacheKey);\n }\n });\n this.inFlight.set(cacheKey, { promise, epoch });\n return promise;\n }\n\n /**\n * Send one document-schema request and store what comes back.\n *\n * Split out of `fetchDocumentSchema` so the decisions that must happen\n * synchronously — cache lookup, sharing, registering this request as the one\n * in flight — are all made before the first `await`. Two callers in the same\n * tick would otherwise both find nothing in flight and both send.\n *\n * @param epoch the invalidation count when the request was sent; the result\n * is returned to the caller either way, but only reaches the cache if no\n * invalidation has happened since.\n */\n private async requestDocumentSchema(\n cacheKey: string,\n pluginNames: string[] | undefined,\n browserComponents: BrowserComponentSchemaInfo[] | undefined,\n browserKey: string,\n epoch: number\n ): Promise<any> {\n try {\n let response: Response;\n if (browserKey) {\n // Browser plugins ride in the body; the server composes their schemas\n // next to the disk plugins and never sees their code.\n response = await fetch(`${API_BASE_URL}/discovery/schemas/document`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n ...(pluginNames ? { plugins: pluginNames } : {}),\n customComponents: browserComponents,\n }),\n });\n } else {\n // Build URL with plugin query params. An explicit selection is always\n // sent — `plugins=` (empty) tells the server \"no plugins\", instead of\n // silently falling back to the all-plugins default.\n let url = `${API_BASE_URL}/discovery/schemas/document`;\n if (pluginNames) {\n // eslint-disable-next-line no-undef\n const params = new URLSearchParams();\n params.append('plugins', pluginNames.join(','));\n url = `${url}?${params.toString()}`;\n }\n response = await fetch(url);\n }\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch document schema: ${response.statusText}`\n );\n }\n\n const result: SchemaResponse = await response.json();\n\n if (!result.success || !result.data) {\n throw new Error(result.error || 'Failed to fetch document schema');\n }\n\n // Cache the schema, unless it was declared stale while it was on the\n // wire. Its caller still gets it — that is the answer to the question\n // they asked — but storing it would serve the stale schema to everyone\n // who asks next, which is what the invalidation was for.\n if (epoch === this.cacheEpoch) {\n if (pluginNames || browserKey) {\n if (this.pluginSchemaCache.size >= this.MAX_PLUGIN_CACHE) {\n const firstKey = this.pluginSchemaCache.keys().next().value;\n if (firstKey) this.pluginSchemaCache.delete(firstKey);\n }\n this.pluginSchemaCache.set(cacheKey, result.data);\n } else {\n this.documentSchemaCache = result.data;\n }\n this.cacheTimestamp[cacheKey] = Date.now();\n }\n\n return result.data;\n } catch (error) {\n console.error('Error fetching document schema:', error);\n throw error;\n }\n }\n\n /**\n * Fetch the JSON schema for theme validation\n */\n async fetchThemeSchema(): Promise<any> {\n // Check cache first\n if (this.themeSchemaCache && this.isCacheValid('theme')) {\n return this.themeSchemaCache;\n }\n\n try {\n const response = await fetch(`${API_BASE_URL}/discovery/schemas/theme`);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch theme schema: ${response.statusText}`);\n }\n\n const result: SchemaResponse = await response.json();\n\n if (!result.success || !result.data) {\n throw new Error(result.error || 'Failed to fetch theme schema');\n }\n\n // Cache the schema\n this.themeSchemaCache = result.data;\n this.cacheTimestamp.theme = Date.now();\n\n return result.data;\n } catch (error) {\n console.error('Error fetching theme schema:', error);\n throw error;\n }\n }\n\n /**\n * Get the appropriate schema based on the active tab type\n */\n async getSchemaForActiveTab(tabType: 'document' | 'theme'): Promise<any> {\n if (tabType === 'theme') {\n return this.fetchThemeSchema();\n }\n return this.fetchDocumentSchema();\n }\n\n /**\n * Clear all cached schemas\n */\n clearCache(): void {\n this.documentSchemaCache = null;\n this.themeSchemaCache = null;\n this.pluginSchemaCache.clear();\n this.cacheTimestamp = {};\n this.cacheEpoch++;\n }\n\n /**\n * Declare the stored document schemas stale — the answer the server would\n * give has changed for reasons the cache key cannot see, such as a plugin\n * rebuilt on disk under an unchanged name.\n *\n * Requests already on the wire are covered too: they were sent against the\n * state just declared stale, so they are no longer shared with callers that\n * ask after this point, and their answers no longer reach the cache.\n */\n clearPluginSchemaCache(): void {\n this.pluginSchemaCache.clear();\n // Clear cache timestamps for plugin schemas\n Object.keys(this.cacheTimestamp).forEach((key) => {\n if (key.startsWith('document-')) {\n delete this.cacheTimestamp[key];\n }\n });\n this.cacheEpoch++;\n }\n\n /**\n * Check if cache is still valid\n */\n private isCacheValid(type: string): boolean {\n const timestamp = this.cacheTimestamp[type];\n if (!timestamp) return false;\n\n return Date.now() - timestamp < this.CACHE_DURATION;\n }\n\n /**\n * Format schema for display (pretty print)\n */\n formatSchemaForDisplay(schema: any): string {\n return JSON.stringify(schema, null, 2);\n }\n\n /**\n * Get schema metadata\n */\n getSchemaMetadata(schema: any): {\n title?: string;\n description?: string;\n version?: string;\n $schema?: string;\n } {\n return {\n title: schema.title,\n description: schema.description,\n version: schema.version || schema.$id,\n $schema: schema.$schema,\n };\n }\n}\n\n// Export singleton instance\nexport const schemaService = new SchemaService();\n\n// Export types\nexport type SchemaType = 'document' | 'theme';\n","/**\n * Lightweight JSON scanner that locates string-valued properties whose names\n * indicate a font reference. Used by the Monaco CodeLens provider to attach\n * a \"Pick font…\" action to those lines without standing up a full JSON\n * parser (Monaco bundles one internally but doesn't re-export it).\n *\n * Why not just regex? We need to distinguish `{\"font\": {\"family\": \"Inter\"}}`\n * from `{\"family\": \"...\"}` inside some unrelated structure, and we need\n * offsets of the string value (not just the key) to place the lens correctly.\n * A small token-and-stack scanner handles both.\n */\nexport interface FontLens {\n /** JSON path to the string value, e.g. ['props', 'font', 'family']. */\n path: (string | number)[];\n /** Current string value (unescaped). */\n value: string;\n /** Offset of the opening quote of the value. */\n valueStart: number;\n /** Offset just past the closing quote of the value. */\n valueEnd: number;\n}\n\n/**\n * Property names we attach a lens to. Matches any level of nesting — a\n * `family` property at any depth becomes a lens, as do all the PPTX chart-\n * specific *FontFace fields. `heading` and `body` are only lensed when\n * nested under a `fonts` object to avoid false positives.\n */\nconst ANYWHERE_KEYS = new Set([\n 'family',\n 'fontFace',\n 'titleFontFace',\n 'legendFontFace',\n 'dataLabelFontFace',\n 'catAxisLabelFontFace',\n 'valAxisLabelFontFace',\n]);\n\nconst UNDER_FONTS_KEYS = new Set(['heading', 'body']);\n\ninterface Frame {\n /** Current container type. */\n kind: 'object' | 'array';\n /** Object key the current value was assigned to (for objects). */\n key?: string;\n /** Array index of the next element (for arrays). */\n index?: number;\n /** Name under which this container was assigned in the parent. */\n parentKey?: string | number;\n}\n\nexport function scanFontLenses(text: string): FontLens[] {\n const out: FontLens[] = [];\n // Start in a sentinel frame so we always have a container to walk from.\n const stack: Frame[] = [{ kind: 'object' }];\n let pos = 0;\n\n // Path tracking: we append parentKey when entering a container and pop\n // when leaving. Values themselves use stack[-1].key (object) or index\n // (array) to compute their own path.\n const pathStack: (string | number)[] = [];\n\n const isWS = (c: string) =>\n c === ' ' || c === '\\t' || c === '\\n' || c === '\\r';\n\n const skipWS = () => {\n while (pos < text.length && isWS(text[pos])) pos++;\n };\n\n /**\n * Read a JSON string starting at the opening quote. Returns the unescaped\n * value and end-offset (position just past the closing quote). Throws are\n * swallowed by the caller — this scanner is best-effort.\n */\n const readString = (): { value: string; start: number; end: number } => {\n const start = pos;\n pos++; // consume opening \"\n let value = '';\n while (pos < text.length) {\n const c = text[pos];\n if (c === '\\\\') {\n const next = text[pos + 1];\n // Minimal unescape — we only need enough to compare string values.\n if (next === '\"') value += '\"';\n else if (next === '\\\\') value += '\\\\';\n else if (next === '/') value += '/';\n else if (next === 'n') value += '\\n';\n else if (next === 'r') value += '\\r';\n else if (next === 't') value += '\\t';\n else if (next === 'u') {\n const hex = text.slice(pos + 2, pos + 6);\n // Guard invalid hex: parseInt returns NaN, and String.fromCharCode(NaN)\n // produces the NUL char, silently corrupting the scanned string.\n if (/^[0-9a-fA-F]{4}$/.test(hex)) {\n value += String.fromCharCode(parseInt(hex, 16));\n pos += 6;\n } else {\n // Malformed escape (e.g. `\\uZZ\"` at end of string). Advance past\n // `\\u` only — never consume more than is actually there, or we'd\n // skip past the closing quote and treat trailing JSON as string\n // content. Emit `\\u` literally so values compare intelligibly.\n value += '\\\\u';\n pos += 2;\n }\n continue;\n } else {\n value += next ?? '';\n }\n pos += 2;\n continue;\n }\n if (c === '\"') {\n pos++;\n return { value, start, end: pos };\n }\n value += c;\n pos++;\n }\n // Unterminated string — return what we have.\n return { value, start, end: pos };\n };\n\n /** Skip past a literal (true/false/null) or a number. */\n const skipPrimitive = () => {\n while (pos < text.length) {\n const c = text[pos];\n if (c === ',' || c === '}' || c === ']' || isWS(c)) return;\n pos++;\n }\n };\n\n /** Currently inside an object that lives at path `pathStack` + current key. */\n const currentPath = (): (string | number)[] => {\n const top = stack[stack.length - 1];\n if (!top) return pathStack.slice();\n if (top.kind === 'object') {\n if (top.key === undefined) return pathStack.slice();\n return [...pathStack, top.key];\n }\n if (top.kind === 'array') {\n return [...pathStack, top.index ?? 0];\n }\n return pathStack.slice();\n };\n\n const isLensTarget = (): boolean => {\n const top = stack[stack.length - 1];\n if (!top || top.kind !== 'object') return false;\n const key = top.key;\n if (!key) return false;\n // A fontRegistry entry declares a family rather than referencing one, so\n // \"pick a different font\" is the wrong offer: rewriting it renames the\n // registration and orphans every reference to it. Mirrors the same\n // exclusion in the shared collector.\n if (pathStack.includes('fontRegistry')) return false;\n if (ANYWHERE_KEYS.has(key)) return true;\n if (UNDER_FONTS_KEYS.has(key)) {\n // Require immediate parent object to be named 'fonts'.\n return pathStack[pathStack.length - 1] === 'fonts';\n }\n return false;\n };\n\n const parseValue = () => {\n skipWS();\n if (pos >= text.length) return;\n const c = text[pos];\n if (c === '\"') {\n const { value, start, end } = readString();\n if (isLensTarget()) {\n out.push({\n path: currentPath(),\n value,\n valueStart: start,\n valueEnd: end,\n });\n }\n return;\n }\n if (c === '{') {\n const top = stack[stack.length - 1];\n const parentKey =\n top?.kind === 'object'\n ? top.key\n : top?.kind === 'array'\n ? top.index\n : undefined;\n if (parentKey !== undefined) pathStack.push(parentKey);\n pos++;\n stack.push({ kind: 'object', parentKey });\n parseObjectBody();\n stack.pop();\n if (parentKey !== undefined) pathStack.pop();\n return;\n }\n if (c === '[') {\n const top = stack[stack.length - 1];\n const parentKey =\n top?.kind === 'object'\n ? top.key\n : top?.kind === 'array'\n ? top.index\n : undefined;\n if (parentKey !== undefined) pathStack.push(parentKey);\n pos++;\n stack.push({ kind: 'array', index: 0, parentKey });\n parseArrayBody();\n stack.pop();\n if (parentKey !== undefined) pathStack.pop();\n return;\n }\n // number / true / false / null\n skipPrimitive();\n };\n\n const parseObjectBody = () => {\n skipWS();\n if (text[pos] === '}') {\n pos++;\n return;\n }\n while (pos < text.length) {\n skipWS();\n if (text[pos] !== '\"') {\n // Malformed — bail on this object.\n while (pos < text.length && text[pos] !== '}') pos++;\n if (text[pos] === '}') pos++;\n return;\n }\n const { value: key } = readString();\n skipWS();\n if (text[pos] !== ':') return;\n pos++;\n const frame = stack[stack.length - 1];\n if (frame) frame.key = key;\n parseValue();\n if (frame) frame.key = undefined;\n skipWS();\n if (text[pos] === ',') {\n pos++;\n continue;\n }\n if (text[pos] === '}') {\n pos++;\n return;\n }\n return;\n }\n };\n\n const parseArrayBody = () => {\n skipWS();\n if (text[pos] === ']') {\n pos++;\n return;\n }\n while (pos < text.length) {\n parseValue();\n skipWS();\n if (text[pos] === ',') {\n pos++;\n const frame = stack[stack.length - 1];\n if (frame && frame.kind === 'array')\n frame.index = (frame.index ?? 0) + 1;\n continue;\n }\n if (text[pos] === ']') {\n pos++;\n return;\n }\n return;\n }\n };\n\n skipWS();\n parseValue();\n return out;\n}\n","/**\n * Lightweight global store tracking the FontPickerDialog's open state and,\n * when opened via Monaco CodeLens, the target JSON path the picker should\n * write to. `contextual === undefined` means theme-mode (the existing entry\n * point from the preview header menu — writes go to theme.fonts.heading/body).\n */\nimport { create } from 'zustand';\n\nexport interface FontPickerContext {\n /** JSON path within the active document to write the chosen family to. */\n jsonPath: (string | number)[];\n /** Value at that path when the picker opened, for pre-selection UX. */\n currentValue?: string;\n}\n\ninterface FontPickerState {\n open: boolean;\n contextual?: FontPickerContext;\n}\n\ninterface FontPickerActions {\n openFor: (contextual?: FontPickerContext) => void;\n close: () => void;\n}\n\nexport type FontPickerStore = FontPickerState & FontPickerActions;\n\nexport const useFontPickerStore = create<FontPickerStore>((set) => ({\n open: false,\n contextual: undefined,\n openFor: (contextual) => set({ open: true, contextual }),\n close: () => set({ open: false, contextual: undefined }),\n}));\n","/**\n * Registers a Monaco CodeLens provider for the JSON language that emits a\n * \"Pick font…\" lens above any string value whose property key names a font.\n * Clicking the lens opens the FontPickerDialog in contextual mode, where the\n * target path is pre-filled so the user only has to pick a family.\n *\n * Registration happens once at app boot from monaco-config.ts. The command\n * handler (jto.pickFont) dispatches to the global font-picker-store so the\n * dialog's open state stays in a single place.\n */\nimport type { Monaco } from '@monaco-editor/react';\nimport { scanFontLenses } from './font-lens-scan';\nimport { useFontPickerStore } from '../store/font-picker-store';\n\nconst CODELENS_COMMAND_ID = 'jto.pickFont';\n\nlet providerDisposable: { dispose(): void } | null = null;\nlet commandDisposable: { dispose(): void } | null = null;\n\nexport function registerFontCodeLens(monaco: Monaco): void {\n if (providerDisposable) providerDisposable.dispose();\n if (commandDisposable) commandDisposable.dispose();\n\n commandDisposable = monaco.editor.registerCommand(\n CODELENS_COMMAND_ID,\n (_accessor, path: (string | number)[], currentValue: string) => {\n useFontPickerStore.getState().openFor({ jsonPath: path, currentValue });\n }\n );\n\n providerDisposable = monaco.languages.registerCodeLensProvider('json', {\n provideCodeLenses(model) {\n const text = model.getValue();\n const lenses = scanFontLenses(text);\n return {\n lenses: lenses.map((lens) => {\n const startPos = model.getPositionAt(lens.valueStart);\n const endPos = model.getPositionAt(lens.valueEnd);\n return {\n range: {\n startLineNumber: startPos.lineNumber,\n startColumn: startPos.column,\n endLineNumber: endPos.lineNumber,\n endColumn: endPos.column,\n },\n id: `jto-pick-font-${lens.valueStart}`,\n command: {\n id: CODELENS_COMMAND_ID,\n title: lens.value\n ? `Pick font… (current: ${lens.value})`\n : 'Pick font…',\n arguments: [lens.path, lens.value],\n },\n };\n }),\n dispose: () => {},\n };\n },\n resolveCodeLens(_model, codeLens) {\n return codeLens;\n },\n });\n}\n","/**\n * Monaco themes for the playground editor.\n *\n * The editor pane is the largest surface in the app, and stock `vs` / `vs-dark`\n * paint it pure white / #1E1E1E — neither of which is a plane in the Wiseair\n * system, so the editor read as a foreign panel bolted onto the shell. Dark in\n * particular follows the ramp (canvas #1D2130 → card #282c3e → fill #3b4054 →\n * border #494e65) rather than collapsing onto one near-black. These\n * themes inherit the stock JSON token colors (already tuned for legibility on\n * a near-white / near-black bed, and already following the same blue-keys /\n * red-strings / green-numbers convention the schema viewer uses) and repaint\n * only the chrome — background, gutter, current-line, selection, and the\n * floating widgets — from the design tokens.\n *\n * Values are the hex equivalents of the HSL triplets in `index.css`; Monaco\n * takes hex only and needs both themes defined up front, while only the active\n * theme's variables are readable from the document at any moment.\n */\n\nimport type { Monaco } from '@monaco-editor/react';\n\nexport const MONACO_THEME_LIGHT = 'jto-light';\nexport const MONACO_THEME_DARK = 'jto-dark';\n\n/** Hex mirror of the light `:root` tokens the editor chrome draws from. */\nconst LIGHT = {\n surface: '#ffffff', // --surface-editor (= --card)\n popover: '#ffffff', // --popover\n foreground: '#1a1f2e', // --foreground\n muted: '#546f9c', // --muted-foreground\n border: '#e2e6ed', // --border\n fill: '#f8f9fc', // --accent / --muted / --header-bg (subtle fill)\n lineHighlight: '#edeff3', // --sidebar-accent (hover / active surface)\n selection: '#4f7ef833', // --data-blue wash\n inserted: '#16a34a26', // --success wash\n removed: '#ef444426', // --destructive wash\n};\n\n/** Hex mirror of the `.dark` tokens — the surface ramp, not one flat black. */\nconst DARK = {\n surface: '#282c3e', // --surface-editor (= --card)\n popover: '#32374e', // --popover\n foreground: '#fafafa', // --foreground\n muted: '#a4b2cc', // --muted-foreground\n border: '#494e65', // --border\n fill: '#3b4054', // --accent / --muted / --header-bg (subtle fill)\n lineHighlight: '#3b405499', // --accent, softened into a current-line band\n selection: '#85a6fa33', // --primary wash\n inserted: '#34d39926', // --success wash\n removed: '#fca5a526', // --destructive wash\n};\n\ntype Palette = typeof LIGHT;\n\n/**\n * Chrome-only color overrides. `inherit: true` keeps every syntax rule from\n * the base theme, so JSON highlighting is untouched.\n */\nfunction chrome(p: Palette): Record<string, string> {\n return {\n 'editor.background': p.surface,\n 'editor.foreground': p.foreground,\n 'editor.lineHighlightBackground': p.lineHighlight,\n 'editor.lineHighlightBorder': '#00000000',\n 'editor.selectionBackground': p.selection,\n 'editor.inactiveSelectionBackground': p.fill,\n 'editorCursor.foreground': p.foreground,\n\n 'editorGutter.background': p.surface,\n 'editorLineNumber.foreground': `${p.muted}99`,\n 'editorLineNumber.activeForeground': p.foreground,\n 'editorIndentGuide.background1': p.border,\n 'editorIndentGuide.activeBackground1': p.muted,\n 'editorWhitespace.foreground': p.border,\n\n // Floating surfaces sit on --popover, one step above the card, exactly as\n // menus and dialogs do elsewhere in the app.\n 'editorWidget.background': p.popover,\n 'editorWidget.border': p.border,\n 'editorSuggestWidget.background': p.popover,\n 'editorSuggestWidget.border': p.border,\n 'editorSuggestWidget.selectedBackground': p.fill,\n 'editorSuggestWidget.foreground': p.foreground,\n 'editorHoverWidget.background': p.popover,\n 'editorHoverWidget.border': p.border,\n 'input.background': p.surface,\n 'input.border': p.border,\n 'dropdown.background': p.popover,\n 'dropdown.border': p.border,\n 'list.hoverBackground': p.fill,\n 'list.activeSelectionBackground': p.fill,\n 'list.activeSelectionForeground': p.foreground,\n\n 'scrollbar.shadow': '#00000000',\n 'scrollbarSlider.background': `${p.muted}33`,\n 'scrollbarSlider.hoverBackground': `${p.muted}55`,\n 'scrollbarSlider.activeBackground': `${p.muted}77`,\n\n // The diff editor is the compare view; keep its beds on the semantic pair.\n 'diffEditor.insertedTextBackground': p.inserted,\n 'diffEditor.removedTextBackground': p.removed,\n 'diffEditor.border': p.border,\n\n 'editorGroupHeader.tabsBackground': p.fill,\n 'editorOverviewRuler.border': '#00000000',\n };\n}\n\nlet registered = false;\n\n/**\n * Register both themes on a Monaco instance. Idempotent — safe to call from\n * every mount path (global config, plugin reconfiguration, lazy editors).\n */\nexport function registerMonacoThemes(monaco: Monaco): void {\n if (registered) return;\n monaco.editor.defineTheme(MONACO_THEME_LIGHT, {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: chrome(LIGHT),\n });\n monaco.editor.defineTheme(MONACO_THEME_DARK, {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: chrome(DARK),\n });\n registered = true;\n}\n\n/** Theme name for a resolved `light` / `dark` preference. */\nexport function monacoThemeFor(resolvedTheme: string): string {\n return resolvedTheme === 'dark' ? MONACO_THEME_DARK : MONACO_THEME_LIGHT;\n}\n","/**\n * The shipped quality rules, as the playground knows them.\n *\n * The engine owns the real registry, but it lives behind the server and the\n * client never receives it — findings carry a `ruleId` and nothing else. A\n * policy editor that cannot name the rules is a text box for guessing, so the\n * ids, their defaults and their tunable parameters are mirrored here and fed to\n * the editor's schema for validation and completion.\n *\n * Keep in step with `core-docx/src/quality/rules.ts` and\n * `core-pptx/src/quality/rules.ts` — each list below is in its rule pack's own\n * order, so the two read side by side.\n *\n * A *wrong* entry costs a wrong hint and nothing more: the server validates\n * the policy it is actually sent. A *missing* one costs more than that, which\n * is what this file used to get wrong about itself. `parseQualityPolicy`\n * refuses any rule id it cannot find here, so nine rules shipping without an\n * entry did not merely go uncompleted — a policy naming one was rejected in\n * the editor and never reached the server at all.\n *\n * `__tests__/quality-rules.test.ts` now compares this table against the packs\n * and fails when they disagree, because asking in a comment was not enough.\n */\n\nimport { FORMAT, type FormatName } from './env';\nimport type { QualitySeverity } from './quality-findings';\n\nexport type QualityRuleParameter =\n | {\n name: string;\n type: 'number';\n default: number;\n description: string;\n }\n | {\n name: string;\n /** A list of names, e.g. the slot roles a profile requires. */\n type: 'string-list';\n default: readonly string[];\n description: string;\n };\n\nexport interface QualityRuleInfo {\n id: string;\n label: string;\n category: string;\n defaultSeverity: QualitySeverity;\n description: string;\n parameters: readonly QualityRuleParameter[];\n}\n\nexport const QUALITY_RULES: Record<FormatName, readonly QualityRuleInfo[]> = {\n docx: [\n {\n id: 'docx/table-width',\n label: 'Table width',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'Explicit column widths that sum past the usable width of their section.',\n parameters: [\n {\n name: 'toleranceTwips',\n type: 'number',\n default: 10,\n description: 'Slack before an overflow counts, in twips (20 = 1pt).',\n },\n ],\n },\n {\n id: 'docx/heading-hierarchy',\n label: 'Heading hierarchy',\n category: 'hierarchy',\n defaultSeverity: 'info',\n description: 'A heading that skips a level and breaks the outline.',\n parameters: [],\n },\n {\n id: 'docx/text-fit',\n label: 'Text fit',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'A word too wide for its floating frame, or a frame whose wrapped text runs off the sheet.',\n parameters: [\n {\n name: 'widthTolerance',\n type: 'number',\n default: 1.08,\n description:\n 'How far past the frame the estimate must reach before it counts — 1.08 is the measured error of the width model.',\n },\n ],\n },\n {\n id: 'docx/frame-collision',\n label: 'Frame collision',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'Two page-anchored frames whose estimated text lands on the same region of a page.',\n parameters: [\n {\n name: 'minOverlapWidthTwips',\n type: 'number',\n default: 240,\n description:\n 'Shared width before an overlap counts, in twips (240 = 12pt).',\n },\n {\n name: 'minOverlapLines',\n type: 'number',\n default: 1,\n description:\n 'Shared height, in lines of text. Below one line the overlap costs no words.',\n },\n ],\n },\n {\n id: 'docx/svg-text-bounds',\n label: 'SVG text bounds',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'A text baseline outside an inline SVG’s viewBox, so the words are never painted.',\n parameters: [],\n },\n {\n id: 'docx/line-box',\n label: 'Line box',\n category: 'legibility',\n defaultSeverity: 'warning',\n description:\n 'An `exactly` line box shorter than the capitals it has to hold.',\n parameters: [\n {\n name: 'minimumLineBoxRatio',\n type: 'number',\n default: 0.7,\n description:\n 'Smallest line box as a fraction of font size. 0.7 em is cap height on the faces the stock templates use.',\n },\n ],\n },\n {\n id: 'docx/placeholder-text',\n label: 'Placeholder text',\n category: 'integrity',\n defaultSeverity: 'warning',\n description: 'An unfilled scaffold slot, or leftover filler copy.',\n parameters: [],\n },\n {\n id: 'docx/slot-budget',\n label: 'Slot budget',\n category: 'composition',\n defaultSeverity: 'warning',\n description:\n 'A block slot holding more words than its budget allows — a takeaway past the word count the block sets.',\n parameters: [],\n },\n {\n id: 'docx/chart-design',\n label: 'Chart design',\n category: 'information-design',\n defaultSeverity: 'warning',\n description:\n 'What a chart claims about its numbers: the comparison, the palette, the unit and the caption.',\n parameters: [\n {\n name: 'maximumSeries',\n type: 'number',\n default: 4,\n description:\n 'Series before the reader spends the chart on its legend.',\n },\n {\n name: 'maximumSlices',\n type: 'number',\n default: 6,\n description:\n 'Slices before a pie’s wedges are too close in angle to rank by eye.',\n },\n ],\n },\n {\n id: 'docx/table-design',\n label: 'Table design',\n category: 'information-design',\n defaultSeverity: 'warning',\n description:\n 'How a table lays its numbers out: alignment, rounding, rules and length.',\n parameters: [\n {\n name: 'maximumRows',\n type: 'number',\n default: 25,\n description:\n 'Rows before a table is a data dump rather than something read in place.',\n },\n ],\n },\n {\n id: 'docx/font-count',\n label: 'Font count',\n category: 'brand',\n defaultSeverity: 'warning',\n description: 'Distinct font families the document can paint.',\n parameters: [\n {\n name: 'maximumFamilies',\n type: 'number',\n default: 3,\n description:\n 'Families before a document reads as assembled rather than designed.',\n },\n ],\n },\n {\n id: 'docx/palette-adherence',\n label: 'Palette adherence',\n category: 'brand',\n defaultSeverity: 'info',\n description: 'A literal colour the resolved theme does not define.',\n parameters: [],\n },\n {\n id: 'docx/required-chrome',\n label: 'Required chrome',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'A block slot with a role a profile or policy requires — a takeaway, a source — left empty. Off until one names roles.',\n parameters: [\n {\n name: 'required',\n type: 'string-list',\n default: [],\n description:\n 'Slot roles every block that declares them must fill: actionTitle, takeaway, source, tracker, footer.',\n },\n ],\n },\n {\n id: 'docx/running-head',\n label: 'Running head',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'A body section without the running head a profile or policy expects. Off until one names parts.',\n parameters: [\n {\n name: 'required',\n type: 'string-list',\n default: [],\n description:\n 'Parts every section from fromSection on must carry: header, footer, pageNumber.',\n },\n {\n name: 'fromSection',\n type: 'number',\n default: 1,\n description:\n 'Zero-based index of the first section that owes a running head; 1 leaves the cover section clean.',\n },\n ],\n },\n {\n id: 'docx/exhibit-required',\n label: 'Exhibit required',\n category: 'composition',\n defaultSeverity: 'warning',\n description:\n 'Fewer data exhibits — charts, or tables of two or more columns — than a profile or policy expects. Off until one sets a minimum.',\n parameters: [\n {\n name: 'minimumExhibits',\n type: 'number',\n default: 1,\n description:\n 'Charts plus tables of two or more columns the document must carry; a kpi-row does not count.',\n },\n ],\n },\n {\n id: 'docx/type-scale',\n label: 'Type scale',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'An authored size the theme never paints: not a style, not a font role, not a step of its scale. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'docx/size-count',\n label: 'Size count',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'More distinct text sizes than maximumSizes allows, blocks included. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'maximumSizes',\n type: 'number',\n default: 8,\n description:\n 'Distinct sizes a document may paint; the client-report profile keeps the default.',\n },\n ],\n },\n {\n id: 'docx/role-drift',\n label: 'Role drift',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'One heading level, table role or paragraph style painted at two sizes; the theme size is the fix. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'docx/body-measure',\n label: 'Body measure',\n category: 'legibility',\n defaultSeverity: 'warning',\n description:\n 'A section whose body copy runs outside the readable measure. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'minimumCharacters',\n type: 'number',\n default: 45,\n description:\n 'Shortest line of body copy a reader follows comfortably.',\n },\n {\n name: 'maximumCharacters',\n type: 'number',\n default: 90,\n description:\n 'Longest line of body copy a reader follows comfortably.',\n },\n ],\n },\n {\n id: 'docx/section-content',\n label: 'Section content',\n category: 'hierarchy',\n defaultSeverity: 'warning',\n description:\n 'A section that renders nothing, or one that carries body copy under no heading. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'minimumWordsForHeading',\n type: 'number',\n default: 60,\n description: 'Words past which a section owes the reader a heading.',\n },\n ],\n },\n {\n id: 'docx/heading-keep-next',\n label: 'Heading keep-next',\n category: 'hierarchy',\n defaultSeverity: 'warning',\n description:\n 'A heading that is not bound to the content under it, so a page break can strand it; the fix sets keepNext on an authored heading. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'docx/figure-label',\n label: 'Figure label',\n category: 'accessibility',\n defaultSeverity: 'warning',\n description:\n 'An image with neither a caption beside it nor alt text on it. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'docx/image-aspect',\n label: 'Image aspect',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'An image drawn at an aspect the asset does not have, where the asset can be read from the document.',\n parameters: [\n {\n name: 'tolerance',\n type: 'number',\n default: 0.02,\n description:\n 'How far the drawn aspect may sit from the asset\\u2019s, as a fraction.',\n },\n ],\n },\n {\n id: 'docx/contents-missing',\n label: 'Contents missing',\n category: 'hierarchy',\n defaultSeverity: 'info',\n description:\n 'More headings than minimumHeadings with no table of contents. Off at 0.',\n parameters: [\n {\n name: 'minimumHeadings',\n type: 'number',\n default: 0,\n description:\n 'Headings past which a document owes a contents page; 0 disables the rule.',\n },\n ],\n },\n ],\n pptx: [\n {\n id: 'pptx/canvas',\n label: 'Canvas',\n category: 'composition',\n defaultSeverity: 'info',\n description:\n 'Slide dimensions: partially declared, legacy 4:3, or a size matching no known preset.',\n parameters: [],\n },\n {\n id: 'pptx/minimum-font-size',\n label: 'Minimum font size',\n category: 'legibility',\n defaultSeverity: 'warning',\n description: 'Text below the size a projected slide can carry.',\n parameters: [\n {\n name: 'minimumFontPt',\n type: 'number',\n default: 7,\n description:\n 'Smallest acceptable point size. The executive profile raises this to 14.',\n },\n ],\n },\n {\n id: 'pptx/text-fit',\n label: 'Text fit',\n category: 'integrity',\n defaultSeverity: 'info',\n description:\n 'Estimated text height against its box. An estimate, not a measurement.',\n parameters: [\n {\n name: 'characterWidthFactor',\n type: 'number',\n default: 0.46,\n description:\n 'Average glyph width as a fraction of point size. Tuned against rendered ground truth — changing it moves both detection and false alarms.',\n },\n {\n name: 'safetyBufferPt',\n type: 'number',\n default: 8,\n description: 'Slack before a tight fit is called an overflow.',\n },\n ],\n },\n {\n id: 'pptx/slide-density',\n label: 'Slide density',\n category: 'information-design',\n defaultSeverity: 'warning',\n description: 'Body word count per slide.',\n parameters: [\n {\n name: 'maximumBodyWords',\n type: 'number',\n default: 130,\n description:\n 'Words before a slide reads as dense. The executive profile lowers this to 70.',\n },\n ],\n },\n {\n id: 'pptx/text-contrast',\n label: 'Text contrast',\n category: 'accessibility',\n defaultSeverity: 'warning',\n description:\n 'Text against the surface behind it, judged by WCAG AA. Text over an image or a chart is skipped.',\n parameters: [\n {\n name: 'normalRatio',\n type: 'number',\n default: 4.5,\n description: 'Contrast ratio normal text has to clear.',\n },\n {\n name: 'largeRatio',\n type: 'number',\n default: 3,\n description: 'Contrast ratio large text has to clear.',\n },\n {\n name: 'largeTextPt',\n type: 'number',\n default: 18,\n description: 'Point size from which text counts as large.',\n },\n {\n name: 'largeBoldTextPt',\n type: 'number',\n default: 14,\n description: 'Point size from which bold text counts as large.',\n },\n ],\n },\n {\n id: 'pptx/placeholder-text',\n label: 'Placeholder text',\n category: 'integrity',\n defaultSeverity: 'warning',\n description: 'An unfilled scaffold slot, or leftover filler copy.',\n parameters: [],\n },\n {\n id: 'pptx/box-overlap',\n label: 'Box overlap',\n category: 'integrity',\n defaultSeverity: 'info',\n description:\n 'Two opaque boxes on one slide that land on each other. A duplicate, or anything covering data, is a warning.',\n parameters: [\n {\n name: 'minimumOverlapPt',\n type: 'number',\n default: 4,\n description:\n 'Overlap on both axes before two boxes count as colliding, in points.',\n },\n {\n name: 'minimumAreaRatio',\n type: 'number',\n default: 0.15,\n description:\n 'Overlap as a fraction of the smaller box before it is reported.',\n },\n ],\n },\n {\n id: 'pptx/chart-design',\n label: 'Chart design',\n category: 'information-design',\n defaultSeverity: 'warning',\n description:\n 'What a chart claims about its numbers: the comparison, the scale, the palette and the unit.',\n parameters: [\n {\n name: 'maximumSeries',\n type: 'number',\n default: 4,\n description:\n 'Series before the reader spends the chart on its legend.',\n },\n {\n name: 'maximumSlices',\n type: 'number',\n default: 6,\n description:\n 'Slices before a pie’s wedges are too close in angle to rank by eye.',\n },\n ],\n },\n {\n id: 'pptx/table-design',\n label: 'Table design',\n category: 'information-design',\n defaultSeverity: 'warning',\n description:\n 'How a table lays its numbers out: alignment, rounding, rules and length.',\n parameters: [\n {\n name: 'maximumRows',\n type: 'number',\n default: 12,\n description:\n 'Rows a slide table can carry at a size an audience can read.',\n },\n ],\n },\n {\n id: 'pptx/font-count',\n label: 'Font count',\n category: 'brand',\n defaultSeverity: 'warning',\n description: 'Distinct font families the deck can paint.',\n parameters: [\n {\n name: 'maximumFamilies',\n type: 'number',\n default: 3,\n description:\n 'Families before a deck reads as assembled rather than designed.',\n },\n ],\n },\n {\n id: 'pptx/palette-adherence',\n label: 'Palette adherence',\n category: 'brand',\n defaultSeverity: 'info',\n description: 'A literal colour the resolved theme does not define.',\n parameters: [],\n },\n {\n id: 'pptx/off-canvas',\n label: 'Off canvas',\n category: 'integrity',\n defaultSeverity: 'warning',\n description: 'Text ink drawn past the edge of the slide.',\n parameters: [\n {\n name: 'tolerancePt',\n type: 'number',\n default: 2,\n description: 'Overrun in points to forgive as renderer rounding.',\n },\n {\n name: 'characterWidthFactor',\n type: 'number',\n default: 0.46,\n description:\n 'Average glyph advance as a fraction of the font size, for the ink estimate.',\n },\n ],\n },\n {\n id: 'pptx/slot-budget',\n label: 'Slot budget',\n category: 'composition',\n defaultSeverity: 'warning',\n description: 'A block slot over the word budget its definition declares.',\n parameters: [],\n },\n {\n id: 'pptx/required-chrome',\n label: 'Required chrome',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'A block slot with a role a profile or policy requires — a takeaway, a source — left empty. Off until one names roles.',\n parameters: [\n {\n name: 'required',\n type: 'string-list',\n default: [],\n description:\n 'Slot roles every block that declares them must fill: actionTitle, takeaway, source, tracker, footer.',\n },\n ],\n },\n {\n id: 'pptx/action-title',\n label: 'Action title length',\n category: 'hierarchy',\n defaultSeverity: 'warning',\n description:\n 'An action-title slot that wraps past the lines a profile or policy allows. Off at 0.',\n parameters: [\n {\n name: 'maxLines',\n type: 'number',\n default: 0,\n description:\n 'Lines an action title may take in the box its definition drew; 0 disables the rule.',\n },\n ],\n },\n {\n id: 'pptx/type-scale',\n label: 'Type scale',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'An authored size the theme never paints: not a style, not a type role, not a step of its scale. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'pptx/size-count',\n label: 'Size count',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'More distinct text sizes than maximumSizes allows, blocks included. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'maximumSizes',\n type: 'number',\n default: 8,\n description: 'Distinct text sizes the deck may paint.',\n },\n ],\n },\n {\n id: 'pptx/role-drift',\n label: 'Role drift',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'One named style or type role painted at two sizes across the deck; the theme size is the fix. Off until a profile or policy enables it.',\n parameters: [],\n },\n {\n id: 'pptx/title-drift',\n label: 'Title drift',\n category: 'consistency',\n defaultSeverity: 'warning',\n description:\n 'A slide title away from the left edge or baseline the deck\\u2019s other titles of that kind share. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'titleStyles',\n type: 'string-list',\n default: ['title'],\n description:\n 'Named styles a hand-placed title is set in; block titles are found by their actionTitle slot.',\n },\n {\n name: 'tolerancePt',\n type: 'number',\n default: 2,\n description:\n 'How far two titles may sit apart before the deck reads as unaligned.',\n },\n ],\n },\n {\n id: 'pptx/bullet-density',\n label: 'Bullet density',\n category: 'information-design',\n defaultSeverity: 'warning',\n description:\n 'More bullets in one box, or more words in one bullet, than the profile allows. Off at 0.',\n parameters: [\n {\n name: 'maximumBullets',\n type: 'number',\n default: 0,\n description: 'Bullets one box may carry; 0 disables the count.',\n },\n {\n name: 'maximumWordsPerBullet',\n type: 'number',\n default: 0,\n description:\n 'Words one bullet may run to; 0 disables the length check.',\n },\n ],\n },\n {\n id: 'pptx/safe-area',\n label: 'Safe area',\n category: 'composition',\n defaultSeverity: 'warning',\n description:\n 'Content outside the theme\\u2019s safe area that is neither chrome nor a full bleed. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'tolerancePt',\n type: 'number',\n default: 2,\n description:\n 'How far a box may cross the safe area before it is reported.',\n },\n ],\n },\n {\n id: 'pptx/slide-title',\n label: 'Slide title',\n category: 'hierarchy',\n defaultSeverity: 'warning',\n description:\n 'A content slide with no title: no actionTitle slot, no box in a title style. Off until a profile or policy enables it.',\n parameters: [\n {\n name: 'titleStyles',\n type: 'string-list',\n default: ['title', 'display', 'heading1'],\n description: 'Named styles that read as a slide title.',\n },\n ],\n },\n {\n id: 'pptx/image-aspect',\n label: 'Image aspect',\n category: 'integrity',\n defaultSeverity: 'warning',\n description:\n 'An image drawn at an aspect the asset does not have, where the asset can be read from the document.',\n parameters: [\n {\n name: 'tolerance',\n type: 'number',\n default: 0.02,\n description:\n 'How far the drawn aspect may sit from the asset\\u2019s, as a fraction.',\n },\n ],\n },\n ],\n};\n\n/** The rules that can appear in this playground's policy. */\nexport function rulesForFormat(): readonly QualityRuleInfo[] {\n return QUALITY_RULES[FORMAT];\n}\n","/**\n * JSON Schema for the run-policy editor, built from the rule catalog.\n *\n * It exists for Monaco: hovering a rule id explains it, and completion offers\n * the ids and parameters rather than leaving an author to remember them. The\n * server validates what it is actually sent, so this is guidance, not a gate.\n */\n\nimport { rulesForFormat } from './quality-rules';\n\n/** Distinct from any document or theme file, so only the policy model matches. */\nexport const QUALITY_POLICY_MODEL_PATH = 'inmemory://jto/quality-policy.json';\nexport const QUALITY_POLICY_SCHEMA_URI =\n 'https://json-to-office.dev/schema/quality-policy/v1';\n\nconst SEVERITY = {\n enum: ['error', 'warning', 'info'],\n description: 'Overrides the severity this rule reports at.',\n};\n\nexport function createQualityPolicySchemaConfig(): {\n uri: string;\n fileMatch: string[];\n schema: object;\n} {\n const rules = rulesForFormat();\n\n const ruleProperties: Record<string, unknown> = {};\n for (const rule of rules) {\n const parameters: Record<string, unknown> = {};\n for (const parameter of rule.parameters) {\n parameters[parameter.name] =\n parameter.type === 'string-list'\n ? {\n type: 'array',\n items: { type: 'string' },\n default: [...parameter.default],\n description: `${parameter.description} (default ${JSON.stringify(parameter.default)})`,\n }\n : {\n type: 'number',\n default: parameter.default,\n description: `${parameter.description} (default ${parameter.default})`,\n };\n }\n ruleProperties[rule.id] = {\n type: 'object',\n description: `${rule.description} Category ${rule.category}; reports at ${rule.defaultSeverity} by default.`,\n properties: {\n enabled: {\n type: 'boolean',\n description: 'Set false to switch this rule off for the run.',\n },\n severity: { type: 'string', ...SEVERITY },\n ...(rule.parameters.length > 0 && {\n parameters: {\n type: 'object',\n description: 'Tuning for this rule.',\n properties: parameters,\n additionalProperties: false,\n },\n }),\n },\n additionalProperties: false,\n };\n }\n\n return {\n uri: QUALITY_POLICY_SCHEMA_URI,\n fileMatch: [QUALITY_POLICY_MODEL_PATH, '*quality-policy.json'],\n schema: {\n type: 'object',\n title: 'Quality run policy',\n description:\n 'Per-run rule configuration. The gate and profile have their own controls and are not set here.',\n properties: {\n rules: {\n type: 'object',\n description: 'Overrides keyed by rule id.',\n properties: ruleProperties,\n additionalProperties: false,\n },\n suppressions: {\n type: 'array',\n description:\n 'Findings to mute. Every entry must say why, so a muted rule stays accountable.',\n items: {\n type: 'object',\n required: ['reason'],\n properties: {\n ruleId: {\n type: 'string',\n enum: rules.map((rule) => rule.id),\n description: 'Mute this rule.',\n },\n code: {\n type: 'string',\n description:\n 'Mute this diagnostic code, e.g. W_QUALITY_HEADING_SKIP.',\n },\n path: {\n type: 'string',\n description: 'RFC 6901 pointer the suppression applies to.',\n },\n pathMatch: {\n enum: ['exact', 'subtree'],\n description:\n '`subtree` also mutes everything beneath `path`. Defaults to exact.',\n },\n reason: {\n type: 'string',\n minLength: 1,\n description: 'Why this finding is acceptable here.',\n },\n },\n additionalProperties: false,\n },\n },\n maxDiagnostics: {\n type: 'integer',\n minimum: 0,\n description:\n 'Stop after this many diagnostics. The report is marked truncated.',\n },\n onRuleError: {\n enum: ['continue', 'throw'],\n description:\n 'What a crashing rule does: report and carry on, or fail the run.',\n },\n },\n additionalProperties: false,\n },\n };\n}\n","/**\n * Editor References Store\n * Manages references to Monaco editor instances for selection context\n */\n\nimport { create } from 'zustand';\nimport type { editor as MonacoEditorType } from 'monaco-editor';\nimport type { Monaco } from '@monaco-editor/react';\nimport type { CollapseController } from '../lib/monaco-collapse-strings';\n\nexport interface EditorReference {\n editor: MonacoEditorType.IStandaloneCodeEditor;\n monaco: Monaco;\n documentName: string;\n /**\n * Reconstruct the full document text from the live model text, expanding any\n * collapsed long-string sentinels (`§jtoc:<id>§`) back to their real values.\n * Any consumer that reads `editor.getValue()` for persistence or rendering\n * MUST pipe it through this, or sentinels leak into the output.\n */\n toStorageValue: (modelText: string) => string;\n /**\n * Long-string collapse controller for this editor, when installed. Consumers\n * that apply edits which MOVE model text (e.g. the outline drag-reorder)\n * must call `collapse.resyncDecorations()` afterwards so chips re-anchor.\n */\n collapse?: CollapseController;\n /**\n * Commit any keystrokes still sitting in the save debounce.\n *\n * Anything that WRITES the document back to the store must call this first,\n * or the trailing save fires afterwards holding pre-write text and silently\n * reverts the write.\n */\n flushPendingSave?: () => void;\n}\n\ninterface EditorRefsState {\n editors: Map<string, EditorReference>;\n activeEditorName: string | null;\n}\n\ninterface EditorRefsActions {\n registerEditor: (\n documentName: string,\n editor: MonacoEditorType.IStandaloneCodeEditor,\n monaco: Monaco,\n toStorageValue?: (modelText: string) => string,\n collapse?: CollapseController,\n flushPendingSave?: () => void\n ) => void;\n unregisterEditor: (documentName: string) => void;\n setActiveEditor: (documentName: string | null) => void;\n getActiveEditor: () => EditorReference | null;\n getEditor: (documentName: string) => EditorReference | null;\n /** The editor showing this model — how a language feature finds its document. */\n getEditorForModel: (\n model: MonacoEditorType.ITextModel\n ) => EditorReference | null;\n}\n\nexport type EditorRefsStore = EditorRefsState & EditorRefsActions;\n\nexport const useEditorRefsStore = create<EditorRefsStore>((set, get) => ({\n editors: new Map(),\n activeEditorName: null,\n\n registerEditor: (\n documentName,\n editor,\n monaco,\n toStorageValue,\n collapse,\n flushPendingSave\n ) => {\n set((state) => {\n const newEditors = new Map(state.editors);\n newEditors.set(documentName, {\n editor,\n monaco,\n documentName,\n toStorageValue: toStorageValue ?? ((text) => text),\n collapse,\n flushPendingSave,\n });\n return { editors: newEditors };\n });\n },\n\n unregisterEditor: (documentName) => {\n set((state) => {\n const newEditors = new Map(state.editors);\n newEditors.delete(documentName);\n return {\n editors: newEditors,\n activeEditorName:\n state.activeEditorName === documentName\n ? null\n : state.activeEditorName,\n };\n });\n },\n\n setActiveEditor: (documentName) => {\n set({ activeEditorName: documentName });\n },\n\n getActiveEditor: () => {\n const state = get();\n if (!state.activeEditorName) return null;\n return state.editors.get(state.activeEditorName) || null;\n },\n\n getEditor: (documentName) => {\n return get().editors.get(documentName) || null;\n },\n\n getEditorForModel: (model) => {\n for (const entry of get().editors.values())\n if (entry.editor.getModel() === model) return entry;\n return null;\n },\n}));\n","/**\n * The reference block catalog: every definition the server's discovered\n * documents carry, with a working invocation and dependencies each. Fetched\n * once and shared — completion asks for it on every keystroke, and the list\n * only changes when a document on disk does. A failed fetch is remembered\n * for a while rather than retried on the next keystroke.\n */\nimport type { BlockReference } from '@json-to-office/shared';\nimport { API_BASE_URL } from '../config/api';\n\nconst RETRY_AFTER_MS = 30_000;\nlet catalog: Promise<BlockReference[]> | null = null;\n\nexport function loadBlockReferences(): Promise<BlockReference[]> {\n catalog ??= fetch(`${API_BASE_URL}/discovery/blocks`)\n .then(async (response) => {\n if (!response.ok)\n throw new Error(`Block discovery failed: ${response.statusText}`);\n const result = (await response.json()) as {\n success: boolean;\n data?: BlockReference[];\n error?: string;\n };\n if (!result.success || !result.data)\n throw new Error(result.error || 'Block discovery failed');\n return result.data;\n })\n .catch((error) => {\n console.warn('[blocks] reference catalog unavailable:', error);\n setTimeout(() => {\n catalog = null;\n }, RETRY_AFTER_MS);\n return [];\n });\n return catalog;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\n/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport function createScanner(text, ignoreTrivia = false) {\n const len = text.length;\n let pos = 0, value = '', tokenOffset = 0, token = 16 /* SyntaxKind.Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* ScanError.None */;\n function scanHexDigits(count, exact) {\n let digits = 0;\n let value = 0;\n while (digits < count || !exact) {\n let ch = text.charCodeAt(pos);\n if (ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */) {\n value = value * 16 + ch - 48 /* CharacterCodes._0 */;\n }\n else if (ch >= 65 /* CharacterCodes.A */ && ch <= 70 /* CharacterCodes.F */) {\n value = value * 16 + ch - 65 /* CharacterCodes.A */ + 10;\n }\n else if (ch >= 97 /* CharacterCodes.a */ && ch <= 102 /* CharacterCodes.f */) {\n value = value * 16 + ch - 97 /* CharacterCodes.a */ + 10;\n }\n else {\n break;\n }\n pos++;\n digits++;\n }\n if (digits < count) {\n value = -1;\n }\n return value;\n }\n function setPosition(newPosition) {\n pos = newPosition;\n value = '';\n tokenOffset = 0;\n token = 16 /* SyntaxKind.Unknown */;\n scanError = 0 /* ScanError.None */;\n }\n function scanNumber() {\n let start = pos;\n if (text.charCodeAt(pos) === 48 /* CharacterCodes._0 */) {\n pos++;\n }\n else {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n if (pos < text.length && text.charCodeAt(pos) === 46 /* CharacterCodes.dot */) {\n pos++;\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n else {\n scanError = 3 /* ScanError.UnexpectedEndOfNumber */;\n return text.substring(start, pos);\n }\n }\n let end = pos;\n if (pos < text.length && (text.charCodeAt(pos) === 69 /* CharacterCodes.E */ || text.charCodeAt(pos) === 101 /* CharacterCodes.e */)) {\n pos++;\n if (pos < text.length && text.charCodeAt(pos) === 43 /* CharacterCodes.plus */ || text.charCodeAt(pos) === 45 /* CharacterCodes.minus */) {\n pos++;\n }\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n end = pos;\n }\n else {\n scanError = 3 /* ScanError.UnexpectedEndOfNumber */;\n }\n }\n return text.substring(start, end);\n }\n function scanString() {\n let result = '', start = pos;\n while (true) {\n if (pos >= len) {\n result += text.substring(start, pos);\n scanError = 2 /* ScanError.UnexpectedEndOfString */;\n break;\n }\n const ch = text.charCodeAt(pos);\n if (ch === 34 /* CharacterCodes.doubleQuote */) {\n result += text.substring(start, pos);\n pos++;\n break;\n }\n if (ch === 92 /* CharacterCodes.backslash */) {\n result += text.substring(start, pos);\n pos++;\n if (pos >= len) {\n scanError = 2 /* ScanError.UnexpectedEndOfString */;\n break;\n }\n const ch2 = text.charCodeAt(pos++);\n switch (ch2) {\n case 34 /* CharacterCodes.doubleQuote */:\n result += '\\\"';\n break;\n case 92 /* CharacterCodes.backslash */:\n result += '\\\\';\n break;\n case 47 /* CharacterCodes.slash */:\n result += '/';\n break;\n case 98 /* CharacterCodes.b */:\n result += '\\b';\n break;\n case 102 /* CharacterCodes.f */:\n result += '\\f';\n break;\n case 110 /* CharacterCodes.n */:\n result += '\\n';\n break;\n case 114 /* CharacterCodes.r */:\n result += '\\r';\n break;\n case 116 /* CharacterCodes.t */:\n result += '\\t';\n break;\n case 117 /* CharacterCodes.u */:\n const ch3 = scanHexDigits(4, true);\n if (ch3 >= 0) {\n result += String.fromCharCode(ch3);\n }\n else {\n scanError = 4 /* ScanError.InvalidUnicode */;\n }\n break;\n default:\n scanError = 5 /* ScanError.InvalidEscapeCharacter */;\n }\n start = pos;\n continue;\n }\n if (ch >= 0 && ch <= 0x1f) {\n if (isLineBreak(ch)) {\n result += text.substring(start, pos);\n scanError = 2 /* ScanError.UnexpectedEndOfString */;\n break;\n }\n else {\n scanError = 6 /* ScanError.InvalidCharacter */;\n // mark as error but continue with string\n }\n }\n pos++;\n }\n return result;\n }\n function scanNext() {\n value = '';\n scanError = 0 /* ScanError.None */;\n tokenOffset = pos;\n lineStartOffset = lineNumber;\n prevTokenLineStartOffset = tokenLineStartOffset;\n if (pos >= len) {\n // at the end\n tokenOffset = len;\n return token = 17 /* SyntaxKind.EOF */;\n }\n let code = text.charCodeAt(pos);\n // trivia: whitespace\n if (isWhiteSpace(code)) {\n do {\n pos++;\n value += String.fromCharCode(code);\n code = text.charCodeAt(pos);\n } while (isWhiteSpace(code));\n return token = 15 /* SyntaxKind.Trivia */;\n }\n // trivia: newlines\n if (isLineBreak(code)) {\n pos++;\n value += String.fromCharCode(code);\n if (code === 13 /* CharacterCodes.carriageReturn */ && text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {\n pos++;\n value += '\\n';\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n return token = 14 /* SyntaxKind.LineBreakTrivia */;\n }\n switch (code) {\n // tokens: []{}:,\n case 123 /* CharacterCodes.openBrace */:\n pos++;\n return token = 1 /* SyntaxKind.OpenBraceToken */;\n case 125 /* CharacterCodes.closeBrace */:\n pos++;\n return token = 2 /* SyntaxKind.CloseBraceToken */;\n case 91 /* CharacterCodes.openBracket */:\n pos++;\n return token = 3 /* SyntaxKind.OpenBracketToken */;\n case 93 /* CharacterCodes.closeBracket */:\n pos++;\n return token = 4 /* SyntaxKind.CloseBracketToken */;\n case 58 /* CharacterCodes.colon */:\n pos++;\n return token = 6 /* SyntaxKind.ColonToken */;\n case 44 /* CharacterCodes.comma */:\n pos++;\n return token = 5 /* SyntaxKind.CommaToken */;\n // strings\n case 34 /* CharacterCodes.doubleQuote */:\n pos++;\n value = scanString();\n return token = 10 /* SyntaxKind.StringLiteral */;\n // comments\n case 47 /* CharacterCodes.slash */:\n const start = pos - 1;\n // Single-line comment\n if (text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {\n pos += 2;\n while (pos < len) {\n if (isLineBreak(text.charCodeAt(pos))) {\n break;\n }\n pos++;\n }\n value = text.substring(start, pos);\n return token = 12 /* SyntaxKind.LineCommentTrivia */;\n }\n // Multi-line comment\n if (text.charCodeAt(pos + 1) === 42 /* CharacterCodes.asterisk */) {\n pos += 2;\n const safeLength = len - 1; // For lookahead.\n let commentClosed = false;\n while (pos < safeLength) {\n const ch = text.charCodeAt(pos);\n if (ch === 42 /* CharacterCodes.asterisk */ && text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {\n pos += 2;\n commentClosed = true;\n break;\n }\n pos++;\n if (isLineBreak(ch)) {\n if (ch === 13 /* CharacterCodes.carriageReturn */ && text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {\n pos++;\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n }\n }\n if (!commentClosed) {\n pos++;\n scanError = 1 /* ScanError.UnexpectedEndOfComment */;\n }\n value = text.substring(start, pos);\n return token = 13 /* SyntaxKind.BlockCommentTrivia */;\n }\n // just a single slash\n value += String.fromCharCode(code);\n pos++;\n return token = 16 /* SyntaxKind.Unknown */;\n // numbers\n case 45 /* CharacterCodes.minus */:\n value += String.fromCharCode(code);\n pos++;\n if (pos === len || !isDigit(text.charCodeAt(pos))) {\n return token = 16 /* SyntaxKind.Unknown */;\n }\n // found a minus, followed by a number so\n // we fall through to proceed with scanning\n // numbers\n case 48 /* CharacterCodes._0 */:\n case 49 /* CharacterCodes._1 */:\n case 50 /* CharacterCodes._2 */:\n case 51 /* CharacterCodes._3 */:\n case 52 /* CharacterCodes._4 */:\n case 53 /* CharacterCodes._5 */:\n case 54 /* CharacterCodes._6 */:\n case 55 /* CharacterCodes._7 */:\n case 56 /* CharacterCodes._8 */:\n case 57 /* CharacterCodes._9 */:\n value += scanNumber();\n return token = 11 /* SyntaxKind.NumericLiteral */;\n // literals and unknown symbols\n default:\n // is a literal? Read the full word.\n while (pos < len && isUnknownContentCharacter(code)) {\n pos++;\n code = text.charCodeAt(pos);\n }\n if (tokenOffset !== pos) {\n value = text.substring(tokenOffset, pos);\n // keywords: true, false, null\n switch (value) {\n case 'true': return token = 8 /* SyntaxKind.TrueKeyword */;\n case 'false': return token = 9 /* SyntaxKind.FalseKeyword */;\n case 'null': return token = 7 /* SyntaxKind.NullKeyword */;\n }\n return token = 16 /* SyntaxKind.Unknown */;\n }\n // some\n value += String.fromCharCode(code);\n pos++;\n return token = 16 /* SyntaxKind.Unknown */;\n }\n }\n function isUnknownContentCharacter(code) {\n if (isWhiteSpace(code) || isLineBreak(code)) {\n return false;\n }\n switch (code) {\n case 125 /* CharacterCodes.closeBrace */:\n case 93 /* CharacterCodes.closeBracket */:\n case 123 /* CharacterCodes.openBrace */:\n case 91 /* CharacterCodes.openBracket */:\n case 34 /* CharacterCodes.doubleQuote */:\n case 58 /* CharacterCodes.colon */:\n case 44 /* CharacterCodes.comma */:\n case 47 /* CharacterCodes.slash */:\n return false;\n }\n return true;\n }\n function scanNextNonTrivia() {\n let result;\n do {\n result = scanNext();\n } while (result >= 12 /* SyntaxKind.LineCommentTrivia */ && result <= 15 /* SyntaxKind.Trivia */);\n return result;\n }\n return {\n setPosition: setPosition,\n getPosition: () => pos,\n scan: ignoreTrivia ? scanNextNonTrivia : scanNext,\n getToken: () => token,\n getTokenValue: () => value,\n getTokenOffset: () => tokenOffset,\n getTokenLength: () => pos - tokenOffset,\n getTokenStartLine: () => lineStartOffset,\n getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,\n getTokenError: () => scanError,\n };\n}\nfunction isWhiteSpace(ch) {\n return ch === 32 /* CharacterCodes.space */ || ch === 9 /* CharacterCodes.tab */;\n}\nfunction isLineBreak(ch) {\n return ch === 10 /* CharacterCodes.lineFeed */ || ch === 13 /* CharacterCodes.carriageReturn */;\n}\nfunction isDigit(ch) {\n return ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */;\n}\nvar CharacterCodes;\n(function (CharacterCodes) {\n CharacterCodes[CharacterCodes[\"lineFeed\"] = 10] = \"lineFeed\";\n CharacterCodes[CharacterCodes[\"carriageReturn\"] = 13] = \"carriageReturn\";\n CharacterCodes[CharacterCodes[\"space\"] = 32] = \"space\";\n CharacterCodes[CharacterCodes[\"_0\"] = 48] = \"_0\";\n CharacterCodes[CharacterCodes[\"_1\"] = 49] = \"_1\";\n CharacterCodes[CharacterCodes[\"_2\"] = 50] = \"_2\";\n CharacterCodes[CharacterCodes[\"_3\"] = 51] = \"_3\";\n CharacterCodes[CharacterCodes[\"_4\"] = 52] = \"_4\";\n CharacterCodes[CharacterCodes[\"_5\"] = 53] = \"_5\";\n CharacterCodes[CharacterCodes[\"_6\"] = 54] = \"_6\";\n CharacterCodes[CharacterCodes[\"_7\"] = 55] = \"_7\";\n CharacterCodes[CharacterCodes[\"_8\"] = 56] = \"_8\";\n CharacterCodes[CharacterCodes[\"_9\"] = 57] = \"_9\";\n CharacterCodes[CharacterCodes[\"a\"] = 97] = \"a\";\n CharacterCodes[CharacterCodes[\"b\"] = 98] = \"b\";\n CharacterCodes[CharacterCodes[\"c\"] = 99] = \"c\";\n CharacterCodes[CharacterCodes[\"d\"] = 100] = \"d\";\n CharacterCodes[CharacterCodes[\"e\"] = 101] = \"e\";\n CharacterCodes[CharacterCodes[\"f\"] = 102] = \"f\";\n CharacterCodes[CharacterCodes[\"g\"] = 103] = \"g\";\n CharacterCodes[CharacterCodes[\"h\"] = 104] = \"h\";\n CharacterCodes[CharacterCodes[\"i\"] = 105] = \"i\";\n CharacterCodes[CharacterCodes[\"j\"] = 106] = \"j\";\n CharacterCodes[CharacterCodes[\"k\"] = 107] = \"k\";\n CharacterCodes[CharacterCodes[\"l\"] = 108] = \"l\";\n CharacterCodes[CharacterCodes[\"m\"] = 109] = \"m\";\n CharacterCodes[CharacterCodes[\"n\"] = 110] = \"n\";\n CharacterCodes[CharacterCodes[\"o\"] = 111] = \"o\";\n CharacterCodes[CharacterCodes[\"p\"] = 112] = \"p\";\n CharacterCodes[CharacterCodes[\"q\"] = 113] = \"q\";\n CharacterCodes[CharacterCodes[\"r\"] = 114] = \"r\";\n CharacterCodes[CharacterCodes[\"s\"] = 115] = \"s\";\n CharacterCodes[CharacterCodes[\"t\"] = 116] = \"t\";\n CharacterCodes[CharacterCodes[\"u\"] = 117] = \"u\";\n CharacterCodes[CharacterCodes[\"v\"] = 118] = \"v\";\n CharacterCodes[CharacterCodes[\"w\"] = 119] = \"w\";\n CharacterCodes[CharacterCodes[\"x\"] = 120] = \"x\";\n CharacterCodes[CharacterCodes[\"y\"] = 121] = \"y\";\n CharacterCodes[CharacterCodes[\"z\"] = 122] = \"z\";\n CharacterCodes[CharacterCodes[\"A\"] = 65] = \"A\";\n CharacterCodes[CharacterCodes[\"B\"] = 66] = \"B\";\n CharacterCodes[CharacterCodes[\"C\"] = 67] = \"C\";\n CharacterCodes[CharacterCodes[\"D\"] = 68] = \"D\";\n CharacterCodes[CharacterCodes[\"E\"] = 69] = \"E\";\n CharacterCodes[CharacterCodes[\"F\"] = 70] = \"F\";\n CharacterCodes[CharacterCodes[\"G\"] = 71] = \"G\";\n CharacterCodes[CharacterCodes[\"H\"] = 72] = \"H\";\n CharacterCodes[CharacterCodes[\"I\"] = 73] = \"I\";\n CharacterCodes[CharacterCodes[\"J\"] = 74] = \"J\";\n CharacterCodes[CharacterCodes[\"K\"] = 75] = \"K\";\n CharacterCodes[CharacterCodes[\"L\"] = 76] = \"L\";\n CharacterCodes[CharacterCodes[\"M\"] = 77] = \"M\";\n CharacterCodes[CharacterCodes[\"N\"] = 78] = \"N\";\n CharacterCodes[CharacterCodes[\"O\"] = 79] = \"O\";\n CharacterCodes[CharacterCodes[\"P\"] = 80] = \"P\";\n CharacterCodes[CharacterCodes[\"Q\"] = 81] = \"Q\";\n CharacterCodes[CharacterCodes[\"R\"] = 82] = \"R\";\n CharacterCodes[CharacterCodes[\"S\"] = 83] = \"S\";\n CharacterCodes[CharacterCodes[\"T\"] = 84] = \"T\";\n CharacterCodes[CharacterCodes[\"U\"] = 85] = \"U\";\n CharacterCodes[CharacterCodes[\"V\"] = 86] = \"V\";\n CharacterCodes[CharacterCodes[\"W\"] = 87] = \"W\";\n CharacterCodes[CharacterCodes[\"X\"] = 88] = \"X\";\n CharacterCodes[CharacterCodes[\"Y\"] = 89] = \"Y\";\n CharacterCodes[CharacterCodes[\"Z\"] = 90] = \"Z\";\n CharacterCodes[CharacterCodes[\"asterisk\"] = 42] = \"asterisk\";\n CharacterCodes[CharacterCodes[\"backslash\"] = 92] = \"backslash\";\n CharacterCodes[CharacterCodes[\"closeBrace\"] = 125] = \"closeBrace\";\n CharacterCodes[CharacterCodes[\"closeBracket\"] = 93] = \"closeBracket\";\n CharacterCodes[CharacterCodes[\"colon\"] = 58] = \"colon\";\n CharacterCodes[CharacterCodes[\"comma\"] = 44] = \"comma\";\n CharacterCodes[CharacterCodes[\"dot\"] = 46] = \"dot\";\n CharacterCodes[CharacterCodes[\"doubleQuote\"] = 34] = \"doubleQuote\";\n CharacterCodes[CharacterCodes[\"minus\"] = 45] = \"minus\";\n CharacterCodes[CharacterCodes[\"openBrace\"] = 123] = \"openBrace\";\n CharacterCodes[CharacterCodes[\"openBracket\"] = 91] = \"openBracket\";\n CharacterCodes[CharacterCodes[\"plus\"] = 43] = \"plus\";\n CharacterCodes[CharacterCodes[\"slash\"] = 47] = \"slash\";\n CharacterCodes[CharacterCodes[\"formFeed\"] = 12] = \"formFeed\";\n CharacterCodes[CharacterCodes[\"tab\"] = 9] = \"tab\";\n})(CharacterCodes || (CharacterCodes = {}));\n","export const cachedSpaces = new Array(20).fill(0).map((_, index) => {\n return ' '.repeat(index);\n});\nconst maxCachedValues = 200;\nexport const cachedBreakLinesWithSpaces = {\n ' ': {\n '\\n': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\n' + ' '.repeat(index);\n }),\n '\\r': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\r' + ' '.repeat(index);\n }),\n '\\r\\n': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\r\\n' + ' '.repeat(index);\n }),\n },\n '\\t': {\n '\\n': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\n' + '\\t'.repeat(index);\n }),\n '\\r': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\r' + '\\t'.repeat(index);\n }),\n '\\r\\n': new Array(maxCachedValues).fill(0).map((_, index) => {\n return '\\r\\n' + '\\t'.repeat(index);\n }),\n }\n};\nexport const supportedEols = ['\\n', '\\r', '\\r\\n'];\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport { createScanner } from './scanner';\nvar ParseOptions;\n(function (ParseOptions) {\n ParseOptions.DEFAULT = {\n allowTrailingComma: false\n };\n})(ParseOptions || (ParseOptions = {}));\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport function getLocation(text, position) {\n const segments = []; // strings or numbers\n const earlyReturnException = new Object();\n let previousNode = undefined;\n const previousNodeInst = {\n value: {},\n offset: 0,\n length: 0,\n type: 'object',\n parent: undefined\n };\n let isAtPropertyKey = false;\n function setPreviousNode(value, offset, length, type) {\n previousNodeInst.value = value;\n previousNodeInst.offset = offset;\n previousNodeInst.length = length;\n previousNodeInst.type = type;\n previousNodeInst.colonOffset = undefined;\n previousNode = previousNodeInst;\n }\n try {\n visit(text, {\n onObjectBegin: (offset, length) => {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n isAtPropertyKey = position > offset;\n segments.push(''); // push a placeholder (will be replaced)\n },\n onObjectProperty: (name, offset, length) => {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(name, offset, length, 'property');\n segments[segments.length - 1] = name;\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onObjectEnd: (offset, length) => {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.pop();\n },\n onArrayBegin: (offset, length) => {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.push(0);\n },\n onArrayEnd: (offset, length) => {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = undefined;\n segments.pop();\n },\n onLiteralValue: (value, offset, length) => {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(value, offset, length, getNodeType(value));\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onSeparator: (sep, offset, length) => {\n if (position <= offset) {\n throw earlyReturnException;\n }\n if (sep === ':' && previousNode && previousNode.type === 'property') {\n previousNode.colonOffset = offset;\n isAtPropertyKey = false;\n previousNode = undefined;\n }\n else if (sep === ',') {\n const last = segments[segments.length - 1];\n if (typeof last === 'number') {\n segments[segments.length - 1] = last + 1;\n }\n else {\n isAtPropertyKey = true;\n segments[segments.length - 1] = '';\n }\n previousNode = undefined;\n }\n }\n });\n }\n catch (e) {\n if (e !== earlyReturnException) {\n throw e;\n }\n }\n return {\n path: segments,\n previousNode,\n isAtPropertyKey,\n matches: (pattern) => {\n let k = 0;\n for (let i = 0; k < pattern.length && i < segments.length; i++) {\n if (pattern[k] === segments[i] || pattern[k] === '*') {\n k++;\n }\n else if (pattern[k] !== '**') {\n return false;\n }\n }\n return k === pattern.length;\n }\n };\n}\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore always check the errors list to find out if the input was valid.\n */\nexport function parse(text, errors = [], options = ParseOptions.DEFAULT) {\n let currentProperty = null;\n let currentParent = [];\n const previousParents = [];\n function onValue(value) {\n if (Array.isArray(currentParent)) {\n currentParent.push(value);\n }\n else if (currentProperty !== null) {\n currentParent[currentProperty] = value;\n }\n }\n const visitor = {\n onObjectBegin: () => {\n const object = {};\n onValue(object);\n previousParents.push(currentParent);\n currentParent = object;\n currentProperty = null;\n },\n onObjectProperty: (name) => {\n currentProperty = name;\n },\n onObjectEnd: () => {\n currentParent = previousParents.pop();\n },\n onArrayBegin: () => {\n const array = [];\n onValue(array);\n previousParents.push(currentParent);\n currentParent = array;\n currentProperty = null;\n },\n onArrayEnd: () => {\n currentParent = previousParents.pop();\n },\n onLiteralValue: onValue,\n onError: (error, offset, length) => {\n errors.push({ error, offset, length });\n }\n };\n visit(text, visitor, options);\n return currentParent[0];\n}\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {\n let currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root\n function ensurePropertyComplete(endOffset) {\n if (currentParent.type === 'property') {\n currentParent.length = endOffset - currentParent.offset;\n currentParent = currentParent.parent;\n }\n }\n function onValue(valueNode) {\n currentParent.children.push(valueNode);\n return valueNode;\n }\n const visitor = {\n onObjectBegin: (offset) => {\n currentParent = onValue({ type: 'object', offset, length: -1, parent: currentParent, children: [] });\n },\n onObjectProperty: (name, offset, length) => {\n currentParent = onValue({ type: 'property', offset, length: -1, parent: currentParent, children: [] });\n currentParent.children.push({ type: 'string', value: name, offset, length, parent: currentParent });\n },\n onObjectEnd: (offset, length) => {\n ensurePropertyComplete(offset + length); // in case of a missing value for a property: make sure property is complete\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onArrayBegin: (offset, length) => {\n currentParent = onValue({ type: 'array', offset, length: -1, parent: currentParent, children: [] });\n },\n onArrayEnd: (offset, length) => {\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onLiteralValue: (value, offset, length) => {\n onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });\n ensurePropertyComplete(offset + length);\n },\n onSeparator: (sep, offset, length) => {\n if (currentParent.type === 'property') {\n if (sep === ':') {\n currentParent.colonOffset = offset;\n }\n else if (sep === ',') {\n ensurePropertyComplete(offset);\n }\n }\n },\n onError: (error, offset, length) => {\n errors.push({ error, offset, length });\n }\n };\n visit(text, visitor, options);\n const result = currentParent.children[0];\n if (result) {\n delete result.parent;\n }\n return result;\n}\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport function findNodeAtLocation(root, path) {\n if (!root) {\n return undefined;\n }\n let node = root;\n for (let segment of path) {\n if (typeof segment === 'string') {\n if (node.type !== 'object' || !Array.isArray(node.children)) {\n return undefined;\n }\n let found = false;\n for (const propertyNode of node.children) {\n if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {\n node = propertyNode.children[1];\n found = true;\n break;\n }\n }\n if (!found) {\n return undefined;\n }\n }\n else {\n const index = segment;\n if (node.type !== 'array' || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {\n return undefined;\n }\n node = node.children[index];\n }\n }\n return node;\n}\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport function getNodePath(node) {\n if (!node.parent || !node.parent.children) {\n return [];\n }\n const path = getNodePath(node.parent);\n if (node.parent.type === 'property') {\n const key = node.parent.children[0].value;\n path.push(key);\n }\n else if (node.parent.type === 'array') {\n const index = node.parent.children.indexOf(node);\n if (index !== -1) {\n path.push(index);\n }\n }\n return path;\n}\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport function getNodeValue(node) {\n switch (node.type) {\n case 'array':\n return node.children.map(getNodeValue);\n case 'object':\n const obj = Object.create(null);\n for (let prop of node.children) {\n const valueNode = prop.children[1];\n if (valueNode) {\n obj[prop.children[0].value] = getNodeValue(valueNode);\n }\n }\n return obj;\n case 'null':\n case 'string':\n case 'number':\n case 'boolean':\n return node.value;\n default:\n return undefined;\n }\n}\nexport function contains(node, offset, includeRightBound = false) {\n return (offset >= node.offset && offset < (node.offset + node.length)) || includeRightBound && (offset === (node.offset + node.length));\n}\n/**\n * Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport function findNodeAtOffset(node, offset, includeRightBound = false) {\n if (contains(node, offset, includeRightBound)) {\n const children = node.children;\n if (Array.isArray(children)) {\n for (let i = 0; i < children.length && children[i].offset <= offset; i++) {\n const item = findNodeAtOffset(children[i], offset, includeRightBound);\n if (item) {\n return item;\n }\n }\n }\n return node;\n }\n return undefined;\n}\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport function visit(text, visitor, options = ParseOptions.DEFAULT) {\n const _scanner = createScanner(text, false);\n // Important: Only pass copies of this to visitor functions to prevent accidental modification, and\n // to not affect visitor functions which stored a reference to a previous JSONPath\n const _jsonPath = [];\n // Depth of onXXXBegin() callbacks suppressed. onXXXEnd() decrements this if it isn't 0 already.\n // Callbacks are only called when this value is 0.\n let suppressedCallbacks = 0;\n function toNoArgVisit(visitFunction) {\n return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;\n }\n function toOneArgVisit(visitFunction) {\n return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;\n }\n function toOneArgVisitWithPath(visitFunction) {\n return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;\n }\n function toBeginVisit(visitFunction) {\n return visitFunction ?\n () => {\n if (suppressedCallbacks > 0) {\n suppressedCallbacks++;\n }\n else {\n let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());\n if (cbReturn === false) {\n suppressedCallbacks = 1;\n }\n }\n }\n : () => true;\n }\n function toEndVisit(visitFunction) {\n return visitFunction ?\n () => {\n if (suppressedCallbacks > 0) {\n suppressedCallbacks--;\n }\n if (suppressedCallbacks === 0) {\n visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());\n }\n }\n : () => true;\n }\n const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);\n const disallowComments = options && options.disallowComments;\n const allowTrailingComma = options && options.allowTrailingComma;\n function scanNext() {\n while (true) {\n const token = _scanner.scan();\n switch (_scanner.getTokenError()) {\n case 4 /* ScanError.InvalidUnicode */:\n handleError(14 /* ParseErrorCode.InvalidUnicode */);\n break;\n case 5 /* ScanError.InvalidEscapeCharacter */:\n handleError(15 /* ParseErrorCode.InvalidEscapeCharacter */);\n break;\n case 3 /* ScanError.UnexpectedEndOfNumber */:\n handleError(13 /* ParseErrorCode.UnexpectedEndOfNumber */);\n break;\n case 1 /* ScanError.UnexpectedEndOfComment */:\n if (!disallowComments) {\n handleError(11 /* ParseErrorCode.UnexpectedEndOfComment */);\n }\n break;\n case 2 /* ScanError.UnexpectedEndOfString */:\n handleError(12 /* ParseErrorCode.UnexpectedEndOfString */);\n break;\n case 6 /* ScanError.InvalidCharacter */:\n handleError(16 /* ParseErrorCode.InvalidCharacter */);\n break;\n }\n switch (token) {\n case 12 /* SyntaxKind.LineCommentTrivia */:\n case 13 /* SyntaxKind.BlockCommentTrivia */:\n if (disallowComments) {\n handleError(10 /* ParseErrorCode.InvalidCommentToken */);\n }\n else {\n onComment();\n }\n break;\n case 16 /* SyntaxKind.Unknown */:\n handleError(1 /* ParseErrorCode.InvalidSymbol */);\n break;\n case 15 /* SyntaxKind.Trivia */:\n case 14 /* SyntaxKind.LineBreakTrivia */:\n break;\n default:\n return token;\n }\n }\n }\n function handleError(error, skipUntilAfter = [], skipUntil = []) {\n onError(error);\n if (skipUntilAfter.length + skipUntil.length > 0) {\n let token = _scanner.getToken();\n while (token !== 17 /* SyntaxKind.EOF */) {\n if (skipUntilAfter.indexOf(token) !== -1) {\n scanNext();\n break;\n }\n else if (skipUntil.indexOf(token) !== -1) {\n break;\n }\n token = scanNext();\n }\n }\n }\n function parseString(isValue) {\n const value = _scanner.getTokenValue();\n if (isValue) {\n onLiteralValue(value);\n }\n else {\n onObjectProperty(value);\n // add property name afterwards\n _jsonPath.push(value);\n }\n scanNext();\n return true;\n }\n function parseLiteral() {\n switch (_scanner.getToken()) {\n case 11 /* SyntaxKind.NumericLiteral */:\n const tokenValue = _scanner.getTokenValue();\n let value = Number(tokenValue);\n if (isNaN(value)) {\n handleError(2 /* ParseErrorCode.InvalidNumberFormat */);\n value = 0;\n }\n onLiteralValue(value);\n break;\n case 7 /* SyntaxKind.NullKeyword */:\n onLiteralValue(null);\n break;\n case 8 /* SyntaxKind.TrueKeyword */:\n onLiteralValue(true);\n break;\n case 9 /* SyntaxKind.FalseKeyword */:\n onLiteralValue(false);\n break;\n default:\n return false;\n }\n scanNext();\n return true;\n }\n function parseProperty() {\n if (_scanner.getToken() !== 10 /* SyntaxKind.StringLiteral */) {\n handleError(3 /* ParseErrorCode.PropertyNameExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);\n return false;\n }\n parseString(false);\n if (_scanner.getToken() === 6 /* SyntaxKind.ColonToken */) {\n onSeparator(':');\n scanNext(); // consume colon\n if (!parseValue()) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);\n }\n }\n else {\n handleError(5 /* ParseErrorCode.ColonExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);\n }\n _jsonPath.pop(); // remove processed property name\n return true;\n }\n function parseObject() {\n onObjectBegin();\n scanNext(); // consume open brace\n let needsComma = false;\n while (_scanner.getToken() !== 2 /* SyntaxKind.CloseBraceToken */ && _scanner.getToken() !== 17 /* SyntaxKind.EOF */) {\n if (_scanner.getToken() === 5 /* SyntaxKind.CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 2 /* SyntaxKind.CloseBraceToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* ParseErrorCode.CommaExpected */, [], []);\n }\n if (!parseProperty()) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);\n }\n needsComma = true;\n }\n onObjectEnd();\n if (_scanner.getToken() !== 2 /* SyntaxKind.CloseBraceToken */) {\n handleError(7 /* ParseErrorCode.CloseBraceExpected */, [2 /* SyntaxKind.CloseBraceToken */], []);\n }\n else {\n scanNext(); // consume close brace\n }\n return true;\n }\n function parseArray() {\n onArrayBegin();\n scanNext(); // consume open bracket\n let isFirstElement = true;\n let needsComma = false;\n while (_scanner.getToken() !== 4 /* SyntaxKind.CloseBracketToken */ && _scanner.getToken() !== 17 /* SyntaxKind.EOF */) {\n if (_scanner.getToken() === 5 /* SyntaxKind.CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 4 /* SyntaxKind.CloseBracketToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* ParseErrorCode.CommaExpected */, [], []);\n }\n if (isFirstElement) {\n _jsonPath.push(0);\n isFirstElement = false;\n }\n else {\n _jsonPath[_jsonPath.length - 1]++;\n }\n if (!parseValue()) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], [4 /* SyntaxKind.CloseBracketToken */, 5 /* SyntaxKind.CommaToken */]);\n }\n needsComma = true;\n }\n onArrayEnd();\n if (!isFirstElement) {\n _jsonPath.pop(); // remove array index\n }\n if (_scanner.getToken() !== 4 /* SyntaxKind.CloseBracketToken */) {\n handleError(8 /* ParseErrorCode.CloseBracketExpected */, [4 /* SyntaxKind.CloseBracketToken */], []);\n }\n else {\n scanNext(); // consume close bracket\n }\n return true;\n }\n function parseValue() {\n switch (_scanner.getToken()) {\n case 3 /* SyntaxKind.OpenBracketToken */:\n return parseArray();\n case 1 /* SyntaxKind.OpenBraceToken */:\n return parseObject();\n case 10 /* SyntaxKind.StringLiteral */:\n return parseString(true);\n default:\n return parseLiteral();\n }\n }\n scanNext();\n if (_scanner.getToken() === 17 /* SyntaxKind.EOF */) {\n if (options.allowEmptyContent) {\n return true;\n }\n handleError(4 /* ParseErrorCode.ValueExpected */, [], []);\n return false;\n }\n if (!parseValue()) {\n handleError(4 /* ParseErrorCode.ValueExpected */, [], []);\n return false;\n }\n if (_scanner.getToken() !== 17 /* SyntaxKind.EOF */) {\n handleError(9 /* ParseErrorCode.EndOfFileExpected */, [], []);\n }\n return true;\n}\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport function stripComments(text, replaceCh) {\n let _scanner = createScanner(text), parts = [], kind, offset = 0, pos;\n do {\n pos = _scanner.getPosition();\n kind = _scanner.scan();\n switch (kind) {\n case 12 /* SyntaxKind.LineCommentTrivia */:\n case 13 /* SyntaxKind.BlockCommentTrivia */:\n case 17 /* SyntaxKind.EOF */:\n if (offset !== pos) {\n parts.push(text.substring(offset, pos));\n }\n if (replaceCh !== undefined) {\n parts.push(_scanner.getTokenValue().replace(/[^\\r\\n]/g, replaceCh));\n }\n offset = _scanner.getPosition();\n break;\n }\n } while (kind !== 17 /* SyntaxKind.EOF */);\n return parts.join('');\n}\nexport function getNodeType(value) {\n switch (typeof value) {\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n case 'object': {\n if (!value) {\n return 'null';\n }\n else if (Array.isArray(value)) {\n return 'array';\n }\n return 'object';\n }\n default: return 'null';\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\nimport * as formatter from './impl/format';\nimport * as edit from './impl/edit';\nimport * as scanner from './impl/scanner';\nimport * as parser from './impl/parser';\n/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport const createScanner = scanner.createScanner;\nexport var ScanError;\n(function (ScanError) {\n ScanError[ScanError[\"None\"] = 0] = \"None\";\n ScanError[ScanError[\"UnexpectedEndOfComment\"] = 1] = \"UnexpectedEndOfComment\";\n ScanError[ScanError[\"UnexpectedEndOfString\"] = 2] = \"UnexpectedEndOfString\";\n ScanError[ScanError[\"UnexpectedEndOfNumber\"] = 3] = \"UnexpectedEndOfNumber\";\n ScanError[ScanError[\"InvalidUnicode\"] = 4] = \"InvalidUnicode\";\n ScanError[ScanError[\"InvalidEscapeCharacter\"] = 5] = \"InvalidEscapeCharacter\";\n ScanError[ScanError[\"InvalidCharacter\"] = 6] = \"InvalidCharacter\";\n})(ScanError || (ScanError = {}));\nexport var SyntaxKind;\n(function (SyntaxKind) {\n SyntaxKind[SyntaxKind[\"OpenBraceToken\"] = 1] = \"OpenBraceToken\";\n SyntaxKind[SyntaxKind[\"CloseBraceToken\"] = 2] = \"CloseBraceToken\";\n SyntaxKind[SyntaxKind[\"OpenBracketToken\"] = 3] = \"OpenBracketToken\";\n SyntaxKind[SyntaxKind[\"CloseBracketToken\"] = 4] = \"CloseBracketToken\";\n SyntaxKind[SyntaxKind[\"CommaToken\"] = 5] = \"CommaToken\";\n SyntaxKind[SyntaxKind[\"ColonToken\"] = 6] = \"ColonToken\";\n SyntaxKind[SyntaxKind[\"NullKeyword\"] = 7] = \"NullKeyword\";\n SyntaxKind[SyntaxKind[\"TrueKeyword\"] = 8] = \"TrueKeyword\";\n SyntaxKind[SyntaxKind[\"FalseKeyword\"] = 9] = \"FalseKeyword\";\n SyntaxKind[SyntaxKind[\"StringLiteral\"] = 10] = \"StringLiteral\";\n SyntaxKind[SyntaxKind[\"NumericLiteral\"] = 11] = \"NumericLiteral\";\n SyntaxKind[SyntaxKind[\"LineCommentTrivia\"] = 12] = \"LineCommentTrivia\";\n SyntaxKind[SyntaxKind[\"BlockCommentTrivia\"] = 13] = \"BlockCommentTrivia\";\n SyntaxKind[SyntaxKind[\"LineBreakTrivia\"] = 14] = \"LineBreakTrivia\";\n SyntaxKind[SyntaxKind[\"Trivia\"] = 15] = \"Trivia\";\n SyntaxKind[SyntaxKind[\"Unknown\"] = 16] = \"Unknown\";\n SyntaxKind[SyntaxKind[\"EOF\"] = 17] = \"EOF\";\n})(SyntaxKind || (SyntaxKind = {}));\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport const getLocation = parser.getLocation;\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore, always check the errors list to find out if the input was valid.\n */\nexport const parse = parser.parse;\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport const parseTree = parser.parseTree;\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport const findNodeAtLocation = parser.findNodeAtLocation;\n/**\n * Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport const findNodeAtOffset = parser.findNodeAtOffset;\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport const getNodePath = parser.getNodePath;\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport const getNodeValue = parser.getNodeValue;\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport const visit = parser.visit;\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport const stripComments = parser.stripComments;\nexport var ParseErrorCode;\n(function (ParseErrorCode) {\n ParseErrorCode[ParseErrorCode[\"InvalidSymbol\"] = 1] = \"InvalidSymbol\";\n ParseErrorCode[ParseErrorCode[\"InvalidNumberFormat\"] = 2] = \"InvalidNumberFormat\";\n ParseErrorCode[ParseErrorCode[\"PropertyNameExpected\"] = 3] = \"PropertyNameExpected\";\n ParseErrorCode[ParseErrorCode[\"ValueExpected\"] = 4] = \"ValueExpected\";\n ParseErrorCode[ParseErrorCode[\"ColonExpected\"] = 5] = \"ColonExpected\";\n ParseErrorCode[ParseErrorCode[\"CommaExpected\"] = 6] = \"CommaExpected\";\n ParseErrorCode[ParseErrorCode[\"CloseBraceExpected\"] = 7] = \"CloseBraceExpected\";\n ParseErrorCode[ParseErrorCode[\"CloseBracketExpected\"] = 8] = \"CloseBracketExpected\";\n ParseErrorCode[ParseErrorCode[\"EndOfFileExpected\"] = 9] = \"EndOfFileExpected\";\n ParseErrorCode[ParseErrorCode[\"InvalidCommentToken\"] = 10] = \"InvalidCommentToken\";\n ParseErrorCode[ParseErrorCode[\"UnexpectedEndOfComment\"] = 11] = \"UnexpectedEndOfComment\";\n ParseErrorCode[ParseErrorCode[\"UnexpectedEndOfString\"] = 12] = \"UnexpectedEndOfString\";\n ParseErrorCode[ParseErrorCode[\"UnexpectedEndOfNumber\"] = 13] = \"UnexpectedEndOfNumber\";\n ParseErrorCode[ParseErrorCode[\"InvalidUnicode\"] = 14] = \"InvalidUnicode\";\n ParseErrorCode[ParseErrorCode[\"InvalidEscapeCharacter\"] = 15] = \"InvalidEscapeCharacter\";\n ParseErrorCode[ParseErrorCode[\"InvalidCharacter\"] = 16] = \"InvalidCharacter\";\n})(ParseErrorCode || (ParseErrorCode = {}));\nexport function printParseErrorCode(code) {\n switch (code) {\n case 1 /* ParseErrorCode.InvalidSymbol */: return 'InvalidSymbol';\n case 2 /* ParseErrorCode.InvalidNumberFormat */: return 'InvalidNumberFormat';\n case 3 /* ParseErrorCode.PropertyNameExpected */: return 'PropertyNameExpected';\n case 4 /* ParseErrorCode.ValueExpected */: return 'ValueExpected';\n case 5 /* ParseErrorCode.ColonExpected */: return 'ColonExpected';\n case 6 /* ParseErrorCode.CommaExpected */: return 'CommaExpected';\n case 7 /* ParseErrorCode.CloseBraceExpected */: return 'CloseBraceExpected';\n case 8 /* ParseErrorCode.CloseBracketExpected */: return 'CloseBracketExpected';\n case 9 /* ParseErrorCode.EndOfFileExpected */: return 'EndOfFileExpected';\n case 10 /* ParseErrorCode.InvalidCommentToken */: return 'InvalidCommentToken';\n case 11 /* ParseErrorCode.UnexpectedEndOfComment */: return 'UnexpectedEndOfComment';\n case 12 /* ParseErrorCode.UnexpectedEndOfString */: return 'UnexpectedEndOfString';\n case 13 /* ParseErrorCode.UnexpectedEndOfNumber */: return 'UnexpectedEndOfNumber';\n case 14 /* ParseErrorCode.InvalidUnicode */: return 'InvalidUnicode';\n case 15 /* ParseErrorCode.InvalidEscapeCharacter */: return 'InvalidEscapeCharacter';\n case 16 /* ParseErrorCode.InvalidCharacter */: return 'InvalidCharacter';\n }\n return '<unknown ParseErrorCode>';\n}\n/**\n * Computes the edit operations needed to format a JSON document.\n *\n * @param documentText The input text\n * @param range The range to format or `undefined` to format the full content\n * @param options The formatting options\n * @returns The edit operations describing the formatting changes to the original document following the format described in {@linkcode EditResult}.\n * To apply the edit operations to the input, use {@linkcode applyEdits}.\n */\nexport function format(documentText, range, options) {\n return formatter.format(documentText, range, options);\n}\n/**\n * Computes the edit operations needed to modify a value in the JSON document.\n *\n * @param documentText The input text\n * @param path The path of the value to change. The path represents either to the document root, a property or an array item.\n * If the path points to an non-existing property or item, it will be created.\n * @param value The new value for the specified property or item. If the value is undefined,\n * the property or item will be removed.\n * @param options Options\n * @returns The edit operations describing the changes to the original document, following the format described in {@linkcode EditResult}.\n * To apply the edit operations to the input, use {@linkcode applyEdits}.\n */\nexport function modify(text, path, value, options) {\n return edit.setProperty(text, path, value, options);\n}\n/**\n * Applies edits to an input string.\n * @param text The input text\n * @param edits Edit operations following the format described in {@linkcode EditResult}.\n * @returns The text with the applied edits.\n * @throws An error if the edit operations are not well-formed as described in {@linkcode EditResult}.\n */\nexport function applyEdits(text, edits) {\n let sortedEdits = edits.slice(0).sort((a, b) => {\n const diff = a.offset - b.offset;\n if (diff === 0) {\n return a.length - b.length;\n }\n return diff;\n });\n let lastModifiedOffset = text.length;\n for (let i = sortedEdits.length - 1; i >= 0; i--) {\n let e = sortedEdits[i];\n if (e.offset + e.length <= lastModifiedOffset) {\n text = edit.applyEdit(text, e);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = e.offset;\n }\n return text;\n}\n","/**\n * Block snippets for the JSON editor: what the language service cannot offer\n * from a schema alone.\n *\n * The schema (see monaco-config) completes the names a document already\n * defines and their slots. Two more things belong in the completion list:\n * a reference block the document does *not* define yet — offered at `ref`,\n * and inserting it brings its definition (and the definitions it depends\n * on) into `props.blocks` in the same edit, so no reference is ever left\n * unresolved — and, wherever a slide or section takes content, a whole\n * invocation of any block at typical slot cardinality, with tab stops on its\n * text slots.\n *\n * Everything here is text in, edits out (offsets, not positions), so it runs\n * and is tested without Monaco; monaco-config maps the result onto ranges.\n */\nimport {\n findNodeAtLocation,\n findNodeAtOffset,\n getLocation,\n parse,\n parseTree,\n type Node,\n} from 'jsonc-parser';\nimport {\n blockInvocationExample,\n type BlockInvocationExample,\n type BlockReference,\n type JsonBlockDefinition,\n type OfficeFormat,\n} from '@json-to-office/shared';\nimport type { DocumentBlockDefinitions } from './document-blocks';\n\nexport interface TextEdit {\n offset: number;\n length: number;\n content: string;\n}\n\nexport interface BlockSnippet {\n /** `ref` replaces the reference string; `component` inserts an invocation. */\n kind: 'ref' | 'component';\n label: string;\n detail: string;\n documentation: string;\n /** Monaco snippet syntax (`${1:text}`) for `component`, plain JSON for `ref`. */\n insertText: string;\n /**\n * What Monaco matches the typed text against. The editor filters an item\n * by the text between its range start and the cursor — the opening quote\n * of a reference, the brace of a fresh object, then whatever the author\n * typed — so the fixed lead goes first and the label after it: a bare\n * label never matches the quote and is dropped silently, while a lead that\n * swallowed the typed letters would match everything.\n */\n filterText: string;\n /** What the insert replaces; zero-length when inserting at the cursor. */\n replace: { offset: number; length: number };\n /** Definitions to add elsewhere in the document, applied with the insert. */\n additionalEdits: TextEdit[];\n}\n\nexport interface BlockSnippetOptions {\n references: readonly BlockReference[];\n /** The definitions the document already carries (see document-blocks). */\n definitions: DocumentBlockDefinitions;\n format: OfficeFormat;\n /**\n * The document as data, for the example a local definition's own\n * invocation provides. The editor passes the expanded document here — its\n * model text stands in collapsed-string sentinels for long values, which\n * must not reach a snippet — and `text` stays the model text the offsets\n * belong to. Omitted, `text` is parsed.\n */\n document?: unknown;\n}\n\n/** Containers whose `children` take a block invocation directly. */\nconst CONTENT_OWNERS: Record<OfficeFormat, readonly string[]> = {\n pptx: ['slide', 'group'],\n docx: ['docx', 'section', 'group'],\n};\n\nexport interface BlockCompletionContext {\n kind: 'ref' | 'component';\n replace: { offset: number; length: number };\n}\n\nfunction objectNameAt(\n root: Node,\n path: (string | number)[]\n): string | undefined {\n const node = findNodeAtLocation(root, [...path, 'name']);\n return node?.type === 'string' ? (node.value as string) : undefined;\n}\n\nfunction isSingleLine(text: string, node: Node): boolean {\n return !text.slice(node.offset, node.offset + node.length).includes('\\n');\n}\n\nfunction parseTolerant(text: string): Node | undefined {\n try {\n return parseTree(text, [], { allowTrailingComma: true });\n } catch {\n return undefined;\n }\n}\n\n/** Where the cursor is, in block terms; null anywhere snippets do not apply. */\nexport function blockCompletionContext(\n text: string,\n offset: number,\n format: OfficeFormat,\n root: Node | undefined = parseTolerant(text)\n): BlockCompletionContext | null {\n if (!root) return null;\n const location = getLocation(text, offset);\n const path = location.path;\n const node = findNodeAtOffset(root, offset, true);\n\n // `\"ref\": \"|\"` on a block invocation: the reference string being typed.\n if (\n !location.isAtPropertyKey &&\n path.length >= 2 &&\n path[path.length - 1] === 'ref' &&\n path[path.length - 2] === 'props' &&\n objectNameAt(root, path.slice(0, -2)) === 'block' &&\n node?.type === 'string'\n )\n return {\n kind: 'ref',\n replace: { offset: node.offset, length: node.length },\n };\n\n // An element of a content container's `children`: either a fresh object —\n // `{|}`, `{\"|\"}`, `{\"name\": \"|\"}` — still on one line, or the empty slot of\n // an array. Multi-line objects are being edited, not started; leave them.\n let elementDepth = -1;\n for (let index = path.length - 1; index >= 1; index--)\n if (typeof path[index] === 'number' && path[index - 1] === 'children') {\n elementDepth = index;\n break;\n }\n if (elementDepth < 0) return null;\n const owner = objectNameAt(root, path.slice(0, elementDepth - 1));\n if (!owner || !CONTENT_OWNERS[format].includes(owner)) return null;\n const element = findNodeAtLocation(root, path.slice(0, elementDepth + 1));\n if (!element) {\n // `\"children\": [|]` — nothing there yet.\n const array = findNodeAtLocation(root, path.slice(0, elementDepth));\n if (array?.type !== 'array' || (array.children?.length ?? 0) > 0)\n return null;\n return { kind: 'component', replace: { offset, length: 0 } };\n }\n if (element.type !== 'object' || !isSingleLine(text, element)) return null;\n const properties = element.children ?? [];\n const onlyName =\n properties.length === 0 ||\n (properties.length === 1 &&\n ['', 'name'].includes(String(properties[0].children?.[0]?.value ?? '')));\n if (!onlyName || path.length > elementDepth + 2) return null;\n return {\n kind: 'component',\n replace: { offset: element.offset, length: element.length },\n };\n}\n\n/** Text a Monaco snippet takes literally. */\nfunction escapeSnippet(value: string): string {\n return value.replace(/[\\\\$}]/g, (match) => `\\\\${match}`);\n}\n\n/**\n * The invocation as snippet text: JSON in the document's indentation unit,\n * each string slot a tab stop. Lines are relative — Monaco prepends the\n * insertion line's own indentation to every line of a snippet — and deep\n * values (a chart's data) stay literal.\n */\nexport function invocationSnippet(\n example: BlockInvocationExample,\n unit = ' '\n): string {\n const stops: string[] = [];\n const marker = (index: number) => `\\u0007${index}\\u0007`;\n const slots = Object.fromEntries(\n Object.entries(example.props.slots ?? {}).map(([key, value]) => [\n key,\n typeof value === 'string' ? marker(stops.push(value)) : value,\n ])\n );\n const json = JSON.stringify(\n { name: 'block', props: { ref: example.props.ref, slots } },\n null,\n unit\n );\n return json.replace(/\"\\\\u0007(\\d+)\\\\u0007\"/g, (_match, index) => {\n const value = JSON.stringify(stops[Number(index) - 1]).slice(1, -1);\n return `\"\\${${index}:${escapeSnippet(value)}}\"`;\n });\n}\n\n/** The indentation unit the document uses; two spaces when it says nothing. */\nfunction indentUnit(text: string): string {\n return /\\n([ \\t]+)\\S/.exec(text)?.[1] ?? ' ';\n}\n\nfunction lineIndent(text: string, offset: number): string {\n const start = text.lastIndexOf('\\n', offset - 1) + 1;\n return /^[ \\t]*/.exec(text.slice(start, offset))?.[0] ?? '';\n}\n\nfunction indentLines(json: string, indent: string): string {\n return json\n .split('\\n')\n .map((line, index) => (index === 0 ? line : indent + line))\n .join('\\n');\n}\n\n/**\n * Add definitions to `props.blocks`, creating `props` and `blocks` when the\n * document has neither. Names already defined are left as they are — the\n * author's definition wins over a reference copy.\n */\nexport function insertBlockDefinitions(\n text: string,\n definitions: Record<string, JsonBlockDefinition>,\n root: Node | undefined = parseTolerant(text)\n): TextEdit[] {\n if (!root || root.type !== 'object') return [];\n const unit = indentUnit(text);\n const blocks = findNodeAtLocation(root, ['props', 'blocks']);\n const props = findNodeAtLocation(root, ['props']);\n const existing = new Set(\n blocks?.type === 'object'\n ? (blocks.children ?? []).map((property) =>\n String(property.children?.[0]?.value ?? '')\n )\n : []\n );\n const entries = Object.entries(definitions).filter(\n ([name]) => !existing.has(name)\n );\n if (!entries.length) return [];\n\n // The object the new property goes into, and how deep the definitions sit\n // below its indentation once the missing wrappers are written.\n const target =\n blocks?.type === 'object'\n ? blocks\n : props?.type === 'object'\n ? props\n : root;\n const depth = target === blocks ? 1 : target === props ? 2 : 3;\n const base = lineIndent(text, target.offset);\n const at = (level: number) => base + unit.repeat(level);\n const list = entries\n .map(\n ([name, definition]) =>\n `${at(depth)}${JSON.stringify(name)}: ${indentLines(\n JSON.stringify(definition, null, unit),\n at(depth)\n )}`\n )\n .join(',\\n');\n const body =\n target === blocks\n ? list\n : target === props\n ? `${at(1)}\"blocks\": {\\n${list}\\n${at(1)}}`\n : `${at(1)}\"props\": {\\n${at(2)}\"blocks\": {\\n${list}\\n${at(2)}}\\n${at(1)}}`;\n const hasProperties = (target.children?.length ?? 0) > 0;\n const content = hasProperties ? `\\n${body},` : `\\n${body}\\n${base}`;\n return [{ offset: target.offset + 1, length: 0, content }];\n}\n\n/** Apply offset edits (non-overlapping) to text. */\nexport function applyTextEdits(\n text: string,\n edits: readonly TextEdit[]\n): string {\n let result = text;\n for (const edit of [...edits].sort((a, b) => b.offset - a.offset))\n result =\n result.slice(0, edit.offset) +\n edit.content +\n result.slice(edit.offset + edit.length);\n return result;\n}\n\n/** Definitions a reference needs in this document, dependencies first. */\nfunction definitionsToInsert(\n reference: BlockReference,\n references: readonly BlockReference[],\n present: DocumentBlockDefinitions\n): Record<string, JsonBlockDefinition> {\n const out: Record<string, JsonBlockDefinition> = {};\n for (const name of [...reference.dependencies, reference.name]) {\n if (name in present) continue;\n const entry = references.find(\n (candidate) =>\n candidate.template === reference.template && candidate.name === name\n );\n if (entry) out[name] = entry.definition;\n }\n return out;\n}\n\n/** The snippets to offer at this cursor, if any. */\nexport function blockSnippets(\n text: string,\n offset: number,\n options: BlockSnippetOptions\n): BlockSnippet[] {\n const root = parseTolerant(text);\n const context = blockCompletionContext(text, offset, options.format, root);\n if (!context) return [];\n // The fixed lead Monaco will match first: what stands between the range\n // start and the author's own letters (`\"`, `{\"name\": \"`), never the\n // letters themselves.\n const lead = text\n .slice(context.replace.offset, offset)\n .replace(/[\\w-]*$/, '');\n const snippet = (\n kind: BlockSnippet['kind'],\n label: string,\n detail: string,\n documentation: string,\n insertText: string,\n additionalEdits: TextEdit[]\n ): BlockSnippet => ({\n kind,\n label,\n detail,\n documentation,\n insertText,\n filterText: lead + label,\n replace: context.replace,\n additionalEdits,\n });\n const references = options.references.filter(\n (reference) =>\n reference.format === options.format &&\n !(reference.name in options.definitions)\n );\n const edits = (reference: BlockReference) =>\n insertBlockDefinitions(\n text,\n definitionsToInsert(reference, options.references, options.definitions),\n root\n );\n if (context.kind === 'ref')\n return references.map((reference) =>\n snippet(\n 'ref',\n reference.name,\n `block from ${reference.template}`,\n reference.description,\n JSON.stringify(reference.name),\n edits(reference)\n )\n );\n const unit = indentUnit(text);\n let document: unknown = options.document;\n if (document === undefined) {\n try {\n document = parse(text, [], { allowTrailingComma: true });\n } catch {\n document = undefined;\n }\n }\n const local = Object.entries(options.definitions).map(([name, definition]) =>\n snippet(\n 'component',\n name,\n 'block defined in this document',\n definition.description ?? '',\n invocationSnippet(\n blockInvocationExample(name, definition, {\n document,\n format: options.format,\n }),\n unit\n ),\n []\n )\n );\n const remote = references.map((reference) =>\n snippet(\n 'component',\n reference.name,\n `block from ${reference.template}`,\n reference.description,\n invocationSnippet(reference.example, unit),\n edits(reference)\n )\n );\n return [...local, ...remote];\n}\n","/**\n * The block definitions of the document being edited, read from the editor\n * text as it is — often mid-edit and temporarily invalid — so the schema\n * Monaco validates against can name them.\n *\n * Built on jsonc-parser, like document-outline.ts: `parseTree` tolerates a\n * missing comma three lines down from the definition being read. Only\n * definitions that satisfy the block schema count; a half-typed one is left\n * out until it is whole, rather than turning the whole document's completion\n * off.\n */\nimport { findNodeAtLocation, getNodeValue, parseTree } from 'jsonc-parser';\nimport { Value } from '@sinclair/typebox/value';\nimport {\n JsonBlockDefinitionSchema,\n type JsonBlockDefinition,\n} from '@json-to-office/shared';\n\nexport type DocumentBlockDefinitions = Record<string, JsonBlockDefinition>;\n\nexport function readDocumentBlockDefinitions(\n text: string\n): DocumentBlockDefinitions {\n if (!text.trim()) return {};\n let root;\n try {\n root = parseTree(text, [], { allowTrailingComma: true });\n } catch {\n return {};\n }\n if (!root) return {};\n const blocks = findNodeAtLocation(root, ['props', 'blocks']);\n if (!blocks || blocks.type !== 'object') return {};\n const definitions: DocumentBlockDefinitions = {};\n for (const property of blocks.children ?? []) {\n if (property.type !== 'property' || !property.children) continue;\n const [key, valueNode] = property.children;\n const name = key?.value;\n if (typeof name !== 'string' || !valueNode) continue;\n let value: unknown;\n try {\n value = getNodeValue(valueNode);\n } catch {\n continue;\n }\n if (Value.Check(JsonBlockDefinitionSchema, value))\n definitions[name] = value as JsonBlockDefinition;\n }\n return definitions;\n}\n\n/** Changes exactly when the schema built from these definitions would. */\nexport function blockDefinitionsSignature(\n definitions: DocumentBlockDefinitions\n): string {\n return JSON.stringify(definitions);\n}\n","/**\n * Global Monaco Editor Configuration\n * Sets up JSON schemas and language defaults for all Monaco instances\n */\n\nimport { loader } from '@monaco-editor/react';\nimport type { Monaco } from '@monaco-editor/react';\nimport {\n createReportSchemaConfig,\n createThemeSchemaConfig,\n} from './json-schema-generator';\nimport { schemaService } from './schema-service';\nimport { registerFontCodeLens } from './monaco-fonts-codelens';\nimport { registerMonacoThemes } from './monaco-theme';\nimport {\n applyDocumentBlocksToSchema,\n unionBranches,\n type DocumentBlockTarget,\n} from '@json-to-office/shared';\nimport { preparePptxDocumentBlockTargets } from '@json-to-office/shared-pptx';\nimport { docxDocumentBlockTargets } from '@json-to-office/shared-docx';\nimport { createQualityPolicySchemaConfig } from './quality-policy-schema';\nimport type { BrowserComponentSchemaInfo } from '../store/browser-plugins-store';\nimport { useEditorRefsStore } from '../store/editor-refs-store';\nimport { FORMAT } from './env';\nimport { loadBlockReferences } from './block-references';\nimport { blockSnippets } from './block-snippets';\nimport {\n blockDefinitionsSignature,\n readDocumentBlockDefinitions,\n type DocumentBlockDefinitions,\n} from './document-blocks';\n\nlet isConfigured = false;\nlet completionDisposable: { dispose(): void } | null = null;\n// Remember last custom theme names so callers that don't pass them\n// (e.g. applyPluginsWithValidation) still get them injected.\nlet lastCustomThemeNames: string[] = [];\n// Same for the browser plugins: a caller refreshing for a disk-plugin toggle\n// must not drop the components compiled in the page.\nlet lastBrowserComponents: BrowserComponentSchemaInfo[] = [];\n// Refreshes overlap constantly — every plugin that finishes compiling asks for\n// its own schema, and a page with four of them loads with four requests in\n// flight at once. The responses are megabytes each and come back in whatever\n// order the server and the network settle on, so without this counter the last\n// response to *arrive* wins rather than the newest one, and Monaco is regularly\n// left validating against a schema built before the newest plugin existed: its\n// component reads as an unknown `name` until something else forces a refresh.\nlet schemaGeneration = 0;\n// The document schema as fetched (or the static fallback), never mutated:\n// what Monaco actually validates against is a copy of it with the custom\n// theme names and the active document's block definitions applied.\nlet baseDocumentSchema: any = null;\n// The block definitions of the document being edited. They are part of the\n// schema — `ref` completes them, their slots complete and validate — so the\n// schema is reinstalled whenever they change (see updateMonacoDocumentBlocks).\nlet lastDocumentBlocks: DocumentBlockDefinitions = {};\nlet lastDocumentBlocksSignature = blockDefinitionsSignature({});\n\nconst DOCUMENT_SCHEMA_URI = 'https://json-to-office.dev/schema/report/v1.0.0';\n\nexport interface MonacoSchemaConfig {\n uri: string;\n fileMatch: string[];\n schema: any;\n}\n\n/**\n * Configure Monaco globally with JSON schemas\n * This should be called once when the app initializes\n */\nexport async function configureMonaco(): Promise<void> {\n if (isConfigured) {\n return;\n }\n\n try {\n const monaco = await loader.init();\n configureMonacoInstance(monaco);\n isConfigured = true;\n console.log('Monaco configured globally with JSON schemas');\n } catch (error) {\n console.error('Failed to configure Monaco globally:', error);\n }\n}\n\n/**\n * Remove trailing commas from JSON string\n * This is a simple regex-based approach that handles most cases\n */\nfunction removeTrailingCommas(jsonStr: string): string {\n // Remove trailing commas before closing brackets/braces\n // This regex finds commas followed by optional whitespace and then ] or }\n return jsonStr.replace(/,(\\s*[}\\]])/g, '$1');\n}\n\n/**\n * Configure a Monaco instance with JSON schemas\n */\nexport function configureMonacoInstance(monaco: Monaco): void {\n // Paint the editor chrome from the design tokens (idempotent).\n registerMonacoThemes(monaco);\n\n // Configure JSON language defaults with enhanced settings\n monaco.languages.json.jsonDefaults.setModeConfiguration({\n documentFormattingEdits: true,\n documentRangeFormattingEdits: true,\n completionItems: false,\n hovers: true,\n documentSymbols: true,\n tokens: true,\n colors: true,\n foldingRanges: true,\n diagnostics: true,\n selectionRanges: true,\n });\n\n // Register custom document formatting provider to remove trailing commas\n monaco.languages.registerDocumentFormattingEditProvider('json', {\n provideDocumentFormattingEdits(model) {\n const text = model.getValue();\n\n // First, remove trailing commas\n const cleanedText = removeTrailingCommas(text);\n\n // Parse and re-stringify to ensure proper formatting\n try {\n const parsed = JSON.parse(cleanedText);\n const formatted = JSON.stringify(parsed, null, 2);\n\n return [\n {\n range: model.getFullModelRange(),\n text: formatted,\n },\n ];\n } catch (error) {\n // If parsing fails, just return the text with trailing commas removed\n // Monaco's built-in formatter will handle the rest\n return [\n {\n range: model.getFullModelRange(),\n text: cleanedText,\n },\n ];\n }\n },\n });\n\n // Register custom JSON completion provider that shows schema descriptions inline\n registerJsonCompletionProvider(monaco);\n\n // The reference block catalog the provider offers: asked for now so the\n // first completion does not go without it.\n void loadBlockReferences();\n\n // Register CodeLens provider that puts a \"Pick font…\" action above any\n // font-name string in the active JSON doc.\n registerFontCodeLens(monaco);\n\n // The static schema until the plugin-aware one arrives from the server.\n const reportSchema = createReportSchemaConfig();\n stripDiscriminator(reportSchema.schema);\n baseDocumentSchema = reportSchema.schema;\n installDocumentSchema(monaco);\n\n console.log('Monaco instance configured with schemas:', {\n reportSchema: {\n uri: DOCUMENT_SCHEMA_URI,\n fileMatch: reportSchema.fileMatch,\n schemaKeys: Object.keys(reportSchema.schema),\n },\n });\n}\n\n/** Where a document's own block definitions apply in the running format. */\nfunction documentBlockTargets(schema: any): DocumentBlockTarget[] {\n return FORMAT === 'pptx'\n ? preparePptxDocumentBlockTargets(schema)\n : docxDocumentBlockTargets(schema);\n}\n\n/**\n * Install the document schema Monaco validates against: the base schema with\n * the custom theme names and the active document's block definitions\n * applied. Called whenever any of the three changes.\n */\nfunction installDocumentSchema(monaco: Monaco): void {\n if (!baseDocumentSchema) return;\n const schema = JSON.parse(JSON.stringify(baseDocumentSchema));\n if (lastCustomThemeNames.length) {\n injectCustomThemeNames(schema, lastCustomThemeNames);\n }\n applyDocumentBlocksToSchema(\n schema,\n lastDocumentBlocks,\n documentBlockTargets(schema)\n );\n const reportSchema: MonacoSchemaConfig = {\n uri: DOCUMENT_SCHEMA_URI,\n fileMatch: ['*.docx.json', '*.pptx.json'],\n schema,\n };\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n validate: true,\n enableSchemaRequest: false,\n allowComments: false,\n trailingCommas: 'error',\n schemaValidation: 'error', // Strict schema validation\n schemas: [\n reportSchema,\n createThemeSchemaConfig(),\n createQualityPolicySchemaConfig(),\n ],\n schemaRequest: 'ignore', // Ignore unresolvable $schema URIs (domain doesn't exist)\n });\n}\n\n/**\n * Tell Monaco which blocks the document being edited defines. Cheap when\n * nothing changed — the common case on a keystroke inside a slide — and a\n * schema reinstall when a definition was added, removed or edited, so the\n * editor completes and validates invocations against what the document says\n * now. Returns whether the schema was reinstalled.\n */\nexport function updateMonacoDocumentBlocks(\n monaco: Monaco,\n definitions: DocumentBlockDefinitions\n): boolean {\n const signature = blockDefinitionsSignature(definitions);\n if (signature === lastDocumentBlocksSignature) return false;\n lastDocumentBlocks = definitions;\n lastDocumentBlocksSignature = signature;\n installDocumentSchema(monaco);\n return true;\n}\n\n/**\n * Reset Monaco configuration\n * Useful for testing or when schemas need to be updated\n */\nexport async function resetMonacoConfig(): Promise<void> {\n isConfigured = false;\n await configureMonaco();\n}\n\n/**\n * Recursively strip 'discriminator' keywords from a JSON Schema object.\n * The OpenAPI-style 'discriminator' is not part of JSON Schema Draft-07\n * and may cause unexpected behavior in Monaco's JSON validator.\n */\nfunction stripDiscriminator(obj: any): void {\n if (typeof obj !== 'object' || obj === null) return;\n if (Array.isArray(obj)) {\n obj.forEach((item) => stripDiscriminator(item));\n return;\n }\n delete obj.discriminator;\n for (const value of Object.values(obj)) {\n stripDiscriminator(value);\n }\n}\n\n/**\n * Inject custom theme names into the document schema's theme property\n * so Monaco autocomplete suggests them alongside built-in themes.\n */\nfunction injectCustomThemeNames(schema: any, themeNames: string[]): void {\n function inject(themeProp: any): void {\n if (!themeProp) return;\n // `theme` is a bare string on docx but `string | inline theme config` on\n // pptx, and a TypeBox union compiles to a node carrying `anyOf` and no\n // `type` of its own. Checking `type` first skipped every pptx document\n // silently: the property was reached, the names were never added, and the\n // editor offered only the built-ins the schema was born with. The string\n // branch is the one that takes names; the object branch has no `type`\n // 'string' and falls out below.\n const branches = themeProp.anyOf ?? themeProp.oneOf;\n if (Array.isArray(branches)) {\n branches.forEach(inject);\n return;\n }\n if (themeProp.type !== 'string') return;\n const existing = Array.isArray(themeProp.examples)\n ? themeProp.examples\n : [];\n themeProp.examples = [...new Set([...existing, ...themeNames])];\n }\n\n // Direct path (docx schema)\n inject(schema?.properties?.props?.properties?.theme);\n\n // Union branches — flat anyOf or restructured if/then dispatch. The PPTX\n // root dispatches on `renderer` to one referenced definition per profile,\n // each of which is itself a union carrying the root component.\n const deref = (node: any): any =>\n typeof node?.$ref === 'string'\n ? schema?.definitions?.[node.$ref.replace('#/definitions/', '')]\n : node;\n for (const branch of unionBranches(schema)) {\n const resolved = deref(branch);\n inject(resolved?.properties?.props?.properties?.theme);\n for (const inner of unionBranches(resolved)) {\n inject((inner as any)?.properties?.props?.properties?.theme);\n }\n }\n}\n\n/**\n * Map LSP CompletionItemKind (1-based) to Monaco CompletionItemKind\n */\nfunction lspToMonacoKind(lspKind: number | undefined, monaco: Monaco): number {\n if (lspKind === undefined) {\n return monaco.languages.CompletionItemKind.Property;\n }\n const map: Record<number, number> = {\n 1: monaco.languages.CompletionItemKind.Text,\n 2: monaco.languages.CompletionItemKind.Method,\n 3: monaco.languages.CompletionItemKind.Function,\n 4: monaco.languages.CompletionItemKind.Constructor,\n 5: monaco.languages.CompletionItemKind.Field,\n 6: monaco.languages.CompletionItemKind.Variable,\n 7: monaco.languages.CompletionItemKind.Class,\n 8: monaco.languages.CompletionItemKind.Interface,\n 9: monaco.languages.CompletionItemKind.Module,\n 10: monaco.languages.CompletionItemKind.Property,\n 11: monaco.languages.CompletionItemKind.Unit,\n 12: monaco.languages.CompletionItemKind.Value,\n 13: monaco.languages.CompletionItemKind.Enum,\n 14: monaco.languages.CompletionItemKind.Keyword,\n 15: monaco.languages.CompletionItemKind.Snippet,\n 16: monaco.languages.CompletionItemKind.Color,\n 17: monaco.languages.CompletionItemKind.File,\n 18: monaco.languages.CompletionItemKind.Reference,\n 19: monaco.languages.CompletionItemKind.Folder,\n 20: monaco.languages.CompletionItemKind.EnumMember,\n 21: monaco.languages.CompletionItemKind.Constant,\n 22: monaco.languages.CompletionItemKind.Struct,\n 23: monaco.languages.CompletionItemKind.Event,\n 24: monaco.languages.CompletionItemKind.Operator,\n 25: monaco.languages.CompletionItemKind.TypeParameter,\n };\n return map[lspKind] ?? monaco.languages.CompletionItemKind.Property;\n}\n\n/**\n * Register a custom JSON completion provider that wraps the built-in JSON worker\n * and copies schema `description` into the `detail` field (shown as inline muted text).\n */\nfunction registerJsonCompletionProvider(monaco: Monaco): void {\n if (completionDisposable) {\n completionDisposable.dispose();\n completionDisposable = null;\n }\n\n completionDisposable = monaco.languages.registerCompletionItemProvider(\n 'json',\n {\n triggerCharacters: ['\"', ':', ' '],\n\n async provideCompletionItems(model, position) {\n // Access the JSON worker via the undeclared-but-available getWorker export\n const getWorker = (monaco.languages.json as any).getWorker;\n if (!getWorker) return { suggestions: [] };\n\n const workerFn = await getWorker();\n const worker = await workerFn(model.uri);\n\n // doComplete expects LSP Position (0-based line, 0-based character)\n const completionList = await worker.doComplete(model.uri.toString(), {\n line: position.lineNumber - 1,\n character: position.column - 1,\n });\n\n const suggestions = (completionList?.items ?? []).map((item: any) => {\n // Extract documentation text for inline detail display\n let detail = '';\n if (item.documentation) {\n if (typeof item.documentation === 'string') {\n detail = item.documentation;\n } else if (item.documentation.value) {\n detail = item.documentation.value;\n }\n }\n if (!detail && item.detail) {\n detail = item.detail;\n }\n\n // Convert LSP textEdit range (0-based) to Monaco range (1-based)\n let range;\n if (item.textEdit) {\n const r = item.textEdit.range;\n range = {\n startLineNumber: r.start.line + 1,\n startColumn: r.start.character + 1,\n endLineNumber: r.end.line + 1,\n endColumn: r.end.character + 1,\n };\n } else {\n const wordInfo = model.getWordUntilPosition(position);\n range = {\n startLineNumber: position.lineNumber,\n startColumn: wordInfo.startColumn,\n endLineNumber: position.lineNumber,\n endColumn: wordInfo.endColumn,\n };\n }\n\n const insertText =\n item.textEdit?.newText ??\n item.insertText ??\n (typeof item.label === 'string'\n ? item.label\n : item.label?.label ?? '');\n\n // Build Monaco documentation from LSP documentation\n let documentation: string | { value: string } | undefined;\n if (item.documentation) {\n if (typeof item.documentation === 'string') {\n documentation = item.documentation;\n } else if (item.documentation.kind === 'markdown') {\n documentation = { value: item.documentation.value };\n } else {\n documentation = item.documentation.value;\n }\n }\n\n const suggestion: any = {\n label:\n typeof item.label === 'string'\n ? item.label\n : item.label?.label ?? '',\n kind: lspToMonacoKind(item.kind, monaco),\n detail,\n documentation,\n insertText,\n range,\n sortText: item.sortText,\n filterText: item.filterText,\n preselect: item.preselect,\n };\n\n if (item.insertTextFormat === 2) {\n suggestion.insertTextRules =\n monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;\n }\n\n return suggestion;\n });\n\n // Block snippets: reference blocks the document does not define yet,\n // inserted with their definitions, and whole invocations wherever a\n // slide or section takes content. Offsets from the pure module map\n // onto model positions here.\n const text = model.getValue();\n // Long strings sit in the model as collapse sentinels; definitions\n // and the example an invocation provides are read from the expanded\n // document, while offsets and edits stay in model text.\n const expanded =\n useEditorRefsStore\n .getState()\n .getEditorForModel(model)\n ?.toStorageValue(text) ?? text;\n let document: unknown;\n try {\n document = JSON.parse(expanded);\n } catch {\n document = undefined;\n }\n const toRange = (span: { offset: number; length: number }) => {\n const start = model.getPositionAt(span.offset);\n const end = model.getPositionAt(span.offset + span.length);\n return {\n startLineNumber: start.lineNumber,\n startColumn: start.column,\n endLineNumber: end.lineNumber,\n endColumn: end.column,\n };\n };\n for (const snippet of blockSnippets(text, model.getOffsetAt(position), {\n references: await loadBlockReferences(),\n definitions: readDocumentBlockDefinitions(expanded),\n format: FORMAT,\n document,\n })) {\n suggestions.push({\n label: snippet.label,\n kind:\n snippet.kind === 'ref'\n ? monaco.languages.CompletionItemKind.Value\n : monaco.languages.CompletionItemKind.Snippet,\n detail: snippet.detail,\n documentation: snippet.documentation\n ? { value: snippet.documentation }\n : undefined,\n insertText: snippet.insertText,\n filterText: snippet.filterText,\n insertTextRules:\n snippet.kind === 'component'\n ? monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet\n : undefined,\n range: toRange(snippet.replace),\n additionalTextEdits: snippet.additionalEdits.map((edit) => ({\n range: toRange(edit),\n text: edit.content,\n })),\n // Ahead of the worker's items: a block is the answer to \"what\n // goes on this slide\" more often than a bare text box.\n sortText: `0 ${snippet.label}`,\n });\n }\n\n return { suggestions };\n },\n }\n );\n}\n\n/**\n * Update Monaco schemas with plugin-aware document schema\n * @param monaco Monaco instance\n * @param pluginNames Array of plugin names to include in the schema\n * @param customThemeNames Custom theme names to offer for `props.theme`\n * @param browserComponents Components compiled in the browser; omitted means\n * \"keep the last set\", so a refresh for another reason does not drop them\n * @returns Promise that resolves to true if successful, false otherwise\n */\nexport async function updateMonacoWithPlugins(\n monaco: Monaco,\n pluginNames?: string[],\n customThemeNames?: string[],\n browserComponents?: BrowserComponentSchemaInfo[]\n): Promise<boolean> {\n const generation = ++schemaGeneration;\n try {\n if (browserComponents) {\n lastBrowserComponents = browserComponents;\n }\n\n // Fetch the enhanced schema with plugins from the backend.\n // Deep clone so client-side mutations (theme injection, discriminator\n // stripping) don't pollute the cached copy.\n // Never a stored answer: the cache key cannot see a plugin rebuilt on disk\n // under an unchanged name. `bypassCache` skips the store without declaring\n // anything stale, so the several refreshes that land in the same tick on\n // load still share one request instead of sending the same megabytes twice.\n const cachedSchema = await schemaService.fetchDocumentSchema(\n pluginNames,\n lastBrowserComponents,\n { bypassCache: true }\n );\n // A newer refresh started while this one was in flight. Its request was\n // built from a later view of the plugins, so installing this older schema\n // would undo it. Report success: the call that superseded this one owns\n // the outcome, and a `false` here would surface as a failed apply.\n if (generation !== schemaGeneration) {\n return true;\n }\n\n const documentSchema = JSON.parse(JSON.stringify(cachedSchema));\n\n // Validate that we received a valid schema\n if (!documentSchema || typeof documentSchema !== 'object') {\n throw new Error('Invalid schema received from server');\n }\n\n // Strip non-standard 'discriminator' keyword from definitions.\n // Monaco's JSON validator (vscode-json-languageservice) may not fully\n // support OpenAPI-style discriminators; standard anyOf validation works\n // correctly without it.\n stripDiscriminator(documentSchema);\n\n // Update cached theme names when explicitly provided\n if (customThemeNames) {\n lastCustomThemeNames = customThemeNames;\n }\n\n // Re-register custom document formatting provider to ensure it's available\n monaco.languages.registerDocumentFormattingEditProvider('json', {\n provideDocumentFormattingEdits(model) {\n const text = model.getValue();\n\n // First, remove trailing commas\n const cleanedText = removeTrailingCommas(text);\n\n // Parse and re-stringify to ensure proper formatting\n try {\n const parsed = JSON.parse(cleanedText);\n const formatted = JSON.stringify(parsed, null, 2);\n\n return [\n {\n range: model.getFullModelRange(),\n text: formatted,\n },\n ];\n } catch (error) {\n // If parsing fails, just return the text with trailing commas removed\n return [\n {\n range: model.getFullModelRange(),\n text: cleanedText,\n },\n ];\n }\n },\n });\n\n // Install it, with the custom theme names and the active document's\n // block definitions applied on top.\n baseDocumentSchema = documentSchema;\n installDocumentSchema(monaco);\n\n console.log('Monaco updated with plugin-aware schemas:', {\n plugins: pluginNames || [],\n browserPlugins: lastBrowserComponents.map((c) => c.name),\n blocks: Object.keys(lastDocumentBlocks),\n reportSchema: { uri: DOCUMENT_SCHEMA_URI },\n });\n\n // Force Monaco to re-validate all open models with the new schema\n const models = monaco.editor.getModels();\n let validationSuccess = true;\n\n models.forEach((model) => {\n if (model.getLanguageId() === 'json') {\n try {\n // Trigger revalidation by re-setting the language\n monaco.editor.setModelLanguage(model, 'json');\n console.log('🔄 Re-validating model:', model.uri.toString());\n } catch (modelError) {\n console.error(\n 'Failed to revalidate model:',\n model.uri.toString(),\n modelError\n );\n validationSuccess = false;\n }\n }\n });\n\n // Verify that the schema was properly applied\n const diagnosticsOptions =\n monaco.languages.json.jsonDefaults.diagnosticsOptions;\n const hasSchema = diagnosticsOptions.schemas?.some(\n (s: any) => s.uri === DOCUMENT_SCHEMA_URI\n );\n\n if (!hasSchema) {\n throw new Error('Schema was not properly applied to Monaco editor');\n }\n\n console.log('✅ Schema validation successful');\n return validationSuccess;\n } catch (error) {\n console.error('Failed to update Monaco with plugin schemas:', error);\n // Same rule as the success path: a failed refresh must not roll a newer\n // one back to the plugin-free defaults.\n if (generation === schemaGeneration) {\n // Fallback to default schemas\n configureMonacoInstance(monaco);\n }\n throw error; // Re-throw to let caller handle the error\n }\n}\n","import { StrictMode } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport './index.css';\nimport App from './App';\nimport { configureMonaco } from './lib/monaco-config';\n\n// Initialize Monaco configuration early for better autocomplete\nconfigureMonaco()\n .then(() => {\n console.log(\n 'Monaco editor configured with JSON schemas for better autocomplete'\n );\n })\n .catch((error) => {\n console.error('Failed to configure Monaco:', error);\n });\n\nconst rootElement = document.getElementById('root')!;\nconst root = createRoot(rootElement);\n\n// Only use StrictMode in development\nif (import.meta.env.DEV) {\n root.render(\n <StrictMode>\n <App />\n </StrictMode>\n );\n} else {\n root.render(<App />);\n}\n"],"file":"assets/index-2S58SOrb.js"}