@domphy/doctor 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # @domphy/doctor
1
+ # @domphy/doctor
2
+
3
+ **[domphy.com](https://domphy.com)** · [Docs](https://domphy.com/docs/doctor/) · [npm](https://www.npmjs.com/package/@domphy/doctor)
2
4
 
3
5
  A static analyzer for Domphy element trees. It walks the plain-object tree and flags non-idiomatic patterns, giving humans — and especially **AI agents** — a feedback loop to self-correct generated code.
4
6
 
@@ -61,4 +63,4 @@ By default the doctor **invokes reactive content functions** with a no-op listen
61
63
 
62
64
  ## For AI agents
63
65
 
64
- Run `diagnose()` on generated Domphy code and feed `format()` back to the model — it will fix the issues itself. This is the self-correction loop that lets agents write correct Domphy despite having little training data for it. See the repo `AGENTS.md` and [`llms.txt`](https://www.domphy.com/llms.txt) for the rules the doctor enforces.
66
+ Run `diagnose()` on generated Domphy code and feed `format()` back to the model — it will fix the issues itself. This is the self-correction loop that lets agents write correct Domphy despite having little training data for it. See the repo `AGENTS.md` and [`llms.txt`](https://domphy.com/llms.txt) for the rules the doctor enforces.
@@ -1,5 +1,5 @@
1
- "use strict";var Domphy=(()=>{var w=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(e,s)=>{for(var t in s)w(e,t,{get:s[t],enumerable:!0})},B=(e,s,t,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of j(s))!N.call(e,r)&&r!==t&&w(e,r,{get:()=>s[r],enumerable:!(i=M(s,r))||i.enumerable});return e};var D=e=>B(w({},"__esModule",{value:!0}),e);var Y={};T(Y,{doctor:()=>v});var v={};T(v,{diagnose:()=>S,fix:()=>L,format:()=>$,validate:()=>_});var m=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"];var p=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","foreignObject"],y=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],A=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],X=A.reduce((e,s)=>{let t=s.slice(2).toLowerCase();return e[t]=s,e},{});var Z=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production";var P=new Set([...m,...p]),I=new Set(y),F=new Set(["$","style","_key","_portal","_context","_metadata"]),U=new Set(["fontSize","lineHeight","fontWeight","letterSpacing"]),W=new Set(["color","backgroundColor","background","borderColor","border","outlineColor","outline","fill","stroke"]),H=/#[0-9a-fA-F]{3,8}\b|\b(?:rgba?|hsla?)\s*\(/,V=/^(?:increase|decrease|shift)-\d+$/;function z(e){return e==="inherit"||e==="base"||/^-?\d+$/.test(e)?!0:V.test(e)}function k(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function C(e){for(let s in e)if(P.has(s))return s}function S(e,s={}){let t=[];return g(e,"",t,!1,s.runReactive!==!1),t}function g(e,s,t,i,r){var R;if(typeof e=="function"){if(!r)return;let l;try{l=e(()=>{})}catch(o){return}g(l,s,t,!0,r);return}if(Array.isArray(e)){let l=e.filter(n=>k(n)&&C(n));i&&(l.length>1&&l.some(n=>n._key===void 0)&&t.push({rule:"missing-key",severity:"warning",path:s||"(list)",message:"Dynamic list child without `_key` \u2014 reordered/keyed lists need a stable `_key` for correct reconcile.",hint:"Add `_key: <stable id>` to each item produced by the reactive function."}),l.length>1&&l.every((n,a)=>n._key===a)&&t.push({rule:"unstable-key",severity:"warning",path:s||"(list)",message:"Dynamic list `_key` values are the array index (0, 1, 2, \u2026) \u2014 index keys are unstable across reorders/inserts.",hint:"Key by a stable identity from the data (e.g. `_key: item.id`), not the loop index."}));let o=new Map;for(let n of l){let a=n._key;if(a==null)continue;let f=`${typeof a}:${String(a)}`;o.set(f,((R=o.get(f))!=null?R:0)+1)}for(let[n,a]of o)if(a>1){let f=n.slice(n.indexOf(":")+1);t.push({rule:"duplicate-key",severity:"error",path:s||"(list)",message:`Duplicate \`_key\` "${f}" among ${a} siblings \u2014 keys must be unique within a list.`,hint:"Give each sibling a distinct stable `_key` (e.g. a record id, not a constant)."})}e.forEach((n,a)=>{g(n,`${s}[${a}]`,t,!1,r)});return}if(!k(e))return;let u=e,h=C(u),d=h?s?`${s} > ${h}`:h:s||"(root)";if(!h){let l=Object.keys(u).filter(o=>!F.has(o)&&!o.startsWith("_on")&&!o.startsWith("on")&&!o.startsWith("data")&&!o.startsWith("aria"));l.length===1&&t.push({rule:"unknown-tag",severity:"warning",path:d,message:`"${l[0]}" is not a known HTML/SVG tag \u2014 likely a typo.`,hint:"An element's first key must be a valid tag (div, button, span, \u2026)."});return}let c=u[h];if(I.has(h)&&c!==null&&c!==void 0&&t.push({rule:"void-content",severity:"error",path:d,message:`Void tag "${h}" must have null content (got ${Array.isArray(c)?"array":typeof c}).`,hint:`Write { ${h}: null, \u2026 } and put attributes as sibling keys.`}),k(u.style)){let l=u.style;for(let o in l){let n=l[o];U.has(o)&&typeof n!="function"&&t.push({rule:"inline-typography",severity:"warning",path:d,message:`Inline \`${o}\` \u2014 avoid inline typography styles.`,hint:"Use a typography patch (paragraph()/heading()/small()/strong()/\u2026) via $ so the theme owns the type scale."}),W.has(o)&&typeof n=="string"&&H.test(n)&&t.push({rule:"raw-theme-value",severity:"info",path:d,message:`Inline \`${o}\` uses a literal color (${n}).`,hint:"Prefer a theme token \u2014 (l) => themeColor(l, tone, color) \u2014 so theming and dark mode apply."})}}let b=u.dataTone;typeof b=="string"&&!z(b)&&t.push({rule:"unknown-tone",severity:"warning",path:d,message:`\`dataTone\` "${b}" is not a valid tone.`,hint:'Use "inherit", "base", a number, or "increase-N"/"decrease-N"/"shift-N" (e.g. "shift-9"). Words like "surface"/"text" are not Domphy tones.'}),g(c,d,t,!1,r)}function _(e,s={}){let t=S(e,s),i={error:0,warning:0,info:0,total:t.length};for(let r of t)i[r.severity]+=1;return{ok:i.error===0,issues:t,summary:i}}function $(e){if(e.length===0)return"\u2713 No issues found.";let s=t=>t==="error"?"\u2717":t==="warning"?"\u26A0":"i";return e.map(t=>`${s(t.severity)} [${t.rule}] ${t.path}
1
+ "use strict";var Domphy=(()=>{var x=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var C=(e,s)=>{for(var t in s)x(e,t,{get:s[t],enumerable:!0})},z=(e,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of U(s))!F.call(e,r)&&r!==t&&x(e,r,{get:()=>s[r],enumerable:!(n=P(s,r))||n.enumerable});return e};var H=e=>z(x({},"__esModule",{value:!0}),e);var at={};C(at,{doctor:()=>S});var S={};C(S,{diagnose:()=>$,fix:()=>B,format:()=>D,validate:()=>M});var b=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"];var w=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","foreignObject"],v=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"];var q=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],ht=q.reduce((e,s)=>{let t=s.slice(2).toLowerCase();return e[t]=s,e},{});var ut=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production";var W=e=>{let s=t=>t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;return e.map(s)};var L=e=>{let s=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return W([s,t,n])};var N=e=>{let[s,t,n]=e,r=.4124564*s+.3575761*t+.1804375*n,i=.2126729*s+.7151522*t+.072175*n,u=.0193339*s+.119192*t+.9503041*n,l=.95047,d=1,m=1.08883,f=a=>a>.008856?Math.cbrt(a):7.787*a+16/116,p=f(r/l),g=f(i/d),o=f(u/m);return[116*g-16,500*(p-g),200*(g-o)]};var O=e=>{let[s,t,n]=e,r=Math.sqrt(t*t+n*n);if(r<1e-4)return[s,0,0];let i=(Math.atan2(n,t)*180/Math.PI+360)%360;return i>=359.9999&&(i=0),[s,r,i]};var j=e=>{let s=e.match(/\d+(\.\d+)?/g);if(!s||s.length<3)throw new Error("Invalid CSS rgb()");let t=n=>{let r=n/255;return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)};return[t(Number(s[0])),t(Number(s[1])),t(Number(s[2]))]};var V=new Set([...b,...w]),G=new Set(v),K=new Set(["$","style","_key","_portal","_context","_metadata"]),Y=new Set(["fontSize","lineHeight","fontWeight","letterSpacing","fontFamily","textDecoration"]),Z=new Set(["color","backgroundColor","background","borderColor","border","outlineColor","outline","fill","stroke"]),J=/#[0-9a-fA-F]{3,8}\b|\b(?:rgba?|hsla?)\s*\(/,X=new Set(["margin","marginTop","marginRight","marginBottom","marginLeft","marginInline","marginBlock","marginInlineStart","marginInlineEnd","marginBlockStart","marginBlockEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingInline","paddingBlock","paddingInlineStart","paddingInlineEnd","paddingBlockStart","paddingBlockEnd","gap","rowGap","columnGap"]),Q=/^(\d+(?:\.\d+)?)(rem|em|px)$/;function _(e){let s=e.match(/^(increase|decrease|shift)-(\d+)$/);return s?{family:s[1],n:parseInt(s[2],10)}:null}function tt(e){if(e==="inherit"||e==="base"||/^-?\d+$/.test(e))return!0;let s=_(e);return s?s.n<=17:!1}function et(e){try{let s=e.trim(),t;if(s.startsWith("#")){let i=s;if(i.length===9&&(i=i.slice(0,7)),i.length===5&&(i=i.slice(0,4)),i.length===4&&(i=`#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}`),i.length!==7)return null;t=L(i)}else if(/^rgba?\s*\(/.test(s))t=j(s);else return null;let n=N(t),r=O(n);return[r[0],r[1],r[2]]}catch(s){return null}}function st(e){let[s,t,n]=e,r=Math.round((s-50)/10),i=Math.max(-9,Math.min(9,r)),u;Math.abs(i)<=1?u='"base"':i<0?u=`"decrease-${Math.abs(i)}"`:u=`"increase-${i}"`;let l;return t<12?l="neutral":n<30||n>=330?l="error":n<75?l="warning":n<165?l="success":(n<265,l="primary"),`(l) => themeColor(l, ${u}, "${l}") [perceptual LCH L=${Math.round(s)} C=${Math.round(t)} h=${Math.round(n)}\xB0]`}function nt(e,s){let t=Q.exec(s);if(!t)return null;let n=parseFloat(t[1]),r=t[2],i;return r==="rem"||r==="em"?i=Math.round(n*4):i=Math.round(n/4),i<=0?null:`${e}: themeSpacing(${i}) \u2014 themeSpacing(n)=n/4em, so ${i}/4=${i/4}em \u2248 ${s} at default density`}function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function A(e){for(let s in e)if(V.has(s))return s}function $(e,s={}){let t=[];return k(e,"",t,!1,s.runReactive!==!1),t}function k(e,s,t,n,r){var g;if(typeof e=="function"){if(!r)return;let o;try{o=e(()=>{})}catch(a){return}k(o,s,t,!0,r);return}if(Array.isArray(e)){let o=e.filter(h=>E(h)&&A(h));n&&(o.length>1&&o.some(h=>h._key===void 0)&&t.push({rule:"missing-key",severity:"warning",path:s||"(list)",message:"Dynamic list child without `_key` \u2014 reordered/keyed lists need a stable `_key` for correct reconcile.",hint:"Add `_key: <stable id>` to each item produced by the reactive function."}),o.length>1&&o.every((h,c)=>h._key===c)&&t.push({rule:"unstable-key",severity:"warning",path:s||"(list)",message:"Dynamic list `_key` values are the array index (0, 1, 2, \u2026) \u2014 index keys are unstable across reorders/inserts.",hint:"Key by a stable identity from the data (e.g. `_key: item.id`), not the loop index."}));let a=new Map;for(let h of o){let c=h._key;if(c==null)continue;let y=`${typeof c}:${String(c)}`;a.set(y,((g=a.get(y))!=null?g:0)+1)}for(let[h,c]of a)if(c>1){let y=h.slice(h.indexOf(":")+1);t.push({rule:"duplicate-key",severity:"error",path:s||"(list)",message:`Duplicate \`_key\` "${y}" among ${c} siblings \u2014 keys must be unique within a list.`,hint:"Give each sibling a distinct stable `_key` (e.g. a record id, not a constant)."})}e.forEach((h,c)=>{k(h,`${s}[${c}]`,t,!1,r)});return}if(!E(e))return;let i=e,u=A(i),l=u?s?`${s} > ${u}`:u:s||"(root)";if(!u){let o=Object.keys(i).filter(a=>!K.has(a)&&!a.startsWith("_on")&&!a.startsWith("on")&&!a.startsWith("data")&&!a.startsWith("aria"));o.length===1&&t.push({rule:"unknown-tag",severity:"warning",path:l,message:`"${o[0]}" is not a known HTML/SVG tag \u2014 likely a typo.`,hint:"An element's first key must be a valid tag (div, button, span, \u2026)."});return}let d=i[u];if(G.has(u)&&d!==null&&d!==void 0&&t.push({rule:"void-content",severity:"error",path:l,message:`Void tag "${u}" must have null content (got ${Array.isArray(d)?"array":typeof d}).`,hint:`Write { ${u}: null, \u2026 } and put attributes as sibling keys.`}),E(i.style)){let o=i.style;for(let a in o){let h=o[a];if(Y.has(a)&&typeof h!="function"&&t.push({rule:"inline-typography",severity:"warning",path:l,message:`Inline \`${a}\` \u2014 avoid inline typography styles.`,hint:"Use a typography patch (paragraph()/heading()/small()/strong()/\u2026) via $ so the theme owns the type scale."}),Z.has(a)&&typeof h=="string"&&J.test(h)){let c=et(h),y=c?st(c):"(l) => themeColor(l, tone, colorName)";t.push({rule:"raw-theme-value",severity:"info",path:l,message:`Inline \`${a}\` uses a literal color (${h}).`,hint:`Prefer a theme token \u2014 ${y} \u2014 so theming and dark mode apply.`})}if(X.has(a)&&typeof h=="string"){let c=nt(a,h);c&&t.push({rule:"raw-spacing-value",severity:"info",path:l,message:`Inline \`${a}: "${h}"\` uses a literal spacing value.`,hint:`Prefer themeSpacing() for theme density: ${c}`})}}}let m=i.dataTone;if(typeof m=="string")if(!tt(m))t.push({rule:"unknown-tone",severity:"warning",path:l,message:`\`dataTone\` "${m}" is not a valid tone.`,hint:'Use "inherit", "base", a number, or "shift-N"/"increase-N"/"decrease-N" with N \u2264 17 (the ramp has 18 steps). Words like "surface"/"text" are not tones.'});else{let o=_(m);(o==null?void 0:o.family)==="shift"&&o.n>=4&&o.n<=13&&t.push({rule:"middle-surface-anchor",severity:"warning",path:l,message:`\`dataTone: "${m}"\` uses a mid-ramp surface anchor (steps 4\u201313). Child tones derived from this surface may clamp and collapse contrast.`,hint:"Prefer edge anchors: shift-0\u20133 for light surfaces, shift-14\u201317 for dark. Mid anchors are only correct for intentionally inverted/highlighted regions."})}let f=i.dataDensity;if(typeof f=="string"&&f!=="inherit"){let o=_(f);!o||o.family==="shift"?t.push({rule:"unknown-density",severity:"warning",path:l,message:`\`dataDensity\` "${f}" is not a valid density offset.`,hint:'Use "inherit", "increase-N", or "decrease-N" where N is 0\u20134. "shift-" is not valid for density.'}):o.n>4&&t.push({rule:"unknown-density",severity:"error",path:l,message:`\`dataDensity\` "${f}" N=${o.n} is out of range \u2014 the density scale has 5 steps (max offset: 4).`,hint:'Use "increase-N" or "decrease-N" where N \u2264 4. Density factors: [0.75, 1, 1.5, 2, 2.5].'})}let p=i.dataSize;if(typeof p=="string"&&p!=="inherit"){let o=_(p);!o||o.family==="shift"?t.push({rule:"unknown-size",severity:"warning",path:l,message:`\`dataSize\` "${p}" is not a valid size offset.`,hint:'Use "inherit", "increase-N", or "decrease-N" where N is 0\u20137. "shift-" is not valid for size.'}):o.n>7&&t.push({rule:"unknown-size",severity:"error",path:l,message:`\`dataSize\` "${p}" N=${o.n} is out of range \u2014 the size scale has 8 steps (max offset: 7).`,hint:'Use "increase-N" or "decrease-N" where N \u2264 7.'})}k(d,l,t,!1,r)}function M(e,s={}){let t=$(e,s),n={error:0,warning:0,info:0,total:t.length};for(let r of t)n[r.severity]+=1;return{ok:n.error===0,issues:t,summary:n}}function D(e){if(e.length===0)return"\u2713 No issues found.";let s=t=>t==="error"?"\u2717":t==="warning"?"\u26A0":"i";return e.map(t=>`${s(t.severity)} [${t.rule}] ${t.path}
2
2
  ${t.message}${t.hint?`
3
3
  \u2192 ${t.hint}`:""}`).join(`
4
- `)}var G=new Set([...m,...p]),q=new Set(y);function O(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function K(e){for(let s in e)if(G.has(s))return s}function x(e){if(Array.isArray(e))return e.map(x);if(O(e)){let s={};for(let t in e)s[t]=x(e[t]);return s}return e}function L(e,s={}){let t=x(e),i=[];return E(t,"",i),{tree:t,applied:i,report:_(t,s)}}function E(e,s,t){if(Array.isArray(e)){e.forEach((u,h)=>E(u,`${s}[${h}]`,t));return}if(!O(e))return;let i=K(e);if(!i)return;let r=i?s?`${s} > ${i}`:i:s||"(root)";q.has(i)&&e[i]!==null&&e[i]!==void 0&&(e[i]=null,t.push({rule:"void-content",path:r,message:`Void tag <${i}> cannot have content \u2014 cleared to null.`})),E(e[i],r,t)}return D(Y);})();
4
+ `)}var it=new Set([...b,...w]),rt=new Set(v);function I(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ot(e){for(let s in e)if(it.has(s))return s}function R(e){if(Array.isArray(e))return e.map(R);if(I(e)){let s={};for(let t in e)s[t]=R(e[t]);return s}return e}function B(e,s={}){let t=R(e),n=[];return T(t,"",n),{tree:t,applied:n,report:M(t,s)}}function T(e,s,t){if(Array.isArray(e)){for(let[i,u]of e.entries())T(u,`${s}[${i}]`,t);return}if(!I(e))return;let n=ot(e);if(!n)return;let r=s?`${s} > ${n}`:n;rt.has(n)&&e[n]!==null&&e[n]!==void 0&&(e[n]=null,t.push({rule:"void-content",path:r,message:`Void tag <${n}> cannot have content \u2014 cleared to null.`})),T(e[n],r,t)}return H(at);})();
5
5
  //# sourceMappingURL=doctor.global.js.map