@gramlot/gramlot 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gramlot.js +51 -6
- package/dist/gramlot.min.js +2 -2
- package/package.json +1 -1
- package/src/builder/gramlot-builder.d.ts +6 -3
- package/src/builder/gramlot-builder.js +9 -2
- package/src/builder/source.js +27 -0
- package/src/handlers/source-handler.d.ts +2 -2
- package/src/handlers/source-handler.js +2 -2
- package/src/server/conformance.js +9 -0
- package/src/server/gramlot-server.js +13 -5
- package/src/server/page.d.ts +2 -2
- package/src/server/page.js +2 -2
package/dist/gramlot.js
CHANGED
|
@@ -22016,6 +22016,43 @@ var GramlotBuilderBag = class _GramlotBuilderBag extends SourceBag {
|
|
|
22016
22016
|
get nodeClass() {
|
|
22017
22017
|
return GramlotBuilderBagNode;
|
|
22018
22018
|
}
|
|
22019
|
+
/**
|
|
22020
|
+
* A copy of this Source without the elements whose `auth` rule `auth` refuses, as the Python
|
|
22021
|
+
* `authorized_copy`. `auth` is a function `rule => null | 'not_authenticated' | 'not_authorized'`.
|
|
22022
|
+
* An element whose `auth` attribute `auth` answers with a code is left out with its subtree;
|
|
22023
|
+
* nested Source branches are copied the same way. This Bag is not changed. A non-string `auth`
|
|
22024
|
+
* attribute is a TypeError.
|
|
22025
|
+
*/
|
|
22026
|
+
authorizedCopy(auth) {
|
|
22027
|
+
const result = new this.constructor();
|
|
22028
|
+
for (const node of this.getNodes()) {
|
|
22029
|
+
const rule = node.getAttr("auth") ?? null;
|
|
22030
|
+
if (rule !== null) {
|
|
22031
|
+
if (typeof rule !== "string") {
|
|
22032
|
+
throw new TypeError(`${node.nodeTag} '${node.label}': 'auth' must be a string rule, not ${typeof rule}`);
|
|
22033
|
+
}
|
|
22034
|
+
if (auth(rule) !== null) continue;
|
|
22035
|
+
}
|
|
22036
|
+
let value = node.staticValue;
|
|
22037
|
+
if (value instanceof _GramlotBuilderBag) value = value.authorizedCopy(auth);
|
|
22038
|
+
const { auth: _rule, ...attributes } = node.getAttr();
|
|
22039
|
+
const copied = result.setItem(
|
|
22040
|
+
node.label,
|
|
22041
|
+
value,
|
|
22042
|
+
attributes,
|
|
22043
|
+
">",
|
|
22044
|
+
false,
|
|
22045
|
+
false,
|
|
22046
|
+
null,
|
|
22047
|
+
false,
|
|
22048
|
+
true,
|
|
22049
|
+
null,
|
|
22050
|
+
node.nodeTag
|
|
22051
|
+
);
|
|
22052
|
+
copied.xmlTag = node.xmlTag;
|
|
22053
|
+
}
|
|
22054
|
+
return result;
|
|
22055
|
+
}
|
|
22019
22056
|
/** Activate the inline code of every node, nested Source branches included (GramlotBuilderBagNode.activateCode); returns this. */
|
|
22020
22057
|
activateCode() {
|
|
22021
22058
|
for (const node of this.getNodes()) {
|
|
@@ -22686,11 +22723,17 @@ var GramlotBuilder = class _GramlotBuilder extends HtmlBuilder {
|
|
|
22686
22723
|
}
|
|
22687
22724
|
return prefixes;
|
|
22688
22725
|
}
|
|
22689
|
-
constructor(name = null, { collections = [] } = {}) {
|
|
22726
|
+
constructor(name = null, { collections = [], auth = null } = {}) {
|
|
22690
22727
|
super(name);
|
|
22691
22728
|
this._binding = null;
|
|
22729
|
+
this._auth = auth;
|
|
22692
22730
|
for (const collection of collections) this.loadCollection(collection);
|
|
22693
22731
|
}
|
|
22732
|
+
/** The `auth` evaluator, `rule => null | 'not_authenticated' | 'not_authorized'`, or null:
|
|
22733
|
+
* without it every element is serialised. */
|
|
22734
|
+
get auth() {
|
|
22735
|
+
return this._auth;
|
|
22736
|
+
}
|
|
22694
22737
|
/** The BindingRuntime of the Gramlot page that owns this builder, or null for authoring alone. */
|
|
22695
22738
|
get binding() {
|
|
22696
22739
|
return this._binding;
|
|
@@ -22801,8 +22844,10 @@ var GramlotBuilder = class _GramlotBuilder extends HtmlBuilder {
|
|
|
22801
22844
|
}
|
|
22802
22845
|
return { $gramlotRef: id, kind };
|
|
22803
22846
|
}
|
|
22847
|
+
/** The Source encoded as TYTX text, as the Python `to_tytx`. With an `auth` evaluator, the elements
|
|
22848
|
+
* whose `auth` rule it refuses are left out (GramlotBuilderBag.authorizedCopy). */
|
|
22804
22849
|
toTytx() {
|
|
22805
|
-
return toTytx(this.source);
|
|
22850
|
+
return toTytx(this.auth === null ? this.source : this.source.authorizedCopy(this.auth));
|
|
22806
22851
|
}
|
|
22807
22852
|
};
|
|
22808
22853
|
|
|
@@ -25743,8 +25788,8 @@ var SourceHandler = class extends Handler {
|
|
|
25743
25788
|
* The request lives as long as the target's NodeBinding (P24): a DOM rebuild
|
|
25744
25789
|
* or a freeze keeps it, the removal of the target cancels it.
|
|
25745
25790
|
*
|
|
25746
|
-
*
|
|
25747
|
-
*
|
|
25791
|
+
* `@source` / `registerSource` declare the fragments this method requests (GC-230 §035); the
|
|
25792
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
25748
25793
|
*/
|
|
25749
25794
|
async remoteSource(target, method, params = {}) {
|
|
25750
25795
|
const rpc = this.gramlot.rpc;
|
|
@@ -26109,8 +26154,8 @@ var Page = class {
|
|
|
26109
26154
|
* Mark the own method `methodName` of this page class as a remote Source method,
|
|
26110
26155
|
* equivalent to Python `@source`; call it after the class.
|
|
26111
26156
|
*
|
|
26112
|
-
*
|
|
26113
|
-
*
|
|
26157
|
+
* A declared fragment is requested from code with `gramlot.src.remoteSource` (GC-230 §035); the
|
|
26158
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
26114
26159
|
*/
|
|
26115
26160
|
static registerSource(methodName, { auth = null } = {}) {
|
|
26116
26161
|
declare(this, methodName, SOURCE_METHOD, auth);
|
package/dist/gramlot.min.js
CHANGED
|
@@ -20,8 +20,8 @@ ${" ".repeat(s)}</${a}>`:`<${a}${u}>${f}</${a}>`:t===null||t.includes(a)?`<${a}
|
|
|
20
20
|
`)}toString(e=!0,t=null,n=""){t||(t=new Set);let s=[],i=[...this._nodes];for(let a=0;a<i.length;a++){let o=i[a],u=a===i.length-1,l=o.getValue(e),c="",d=o.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(u?" ":"\u2502 ");if(l&&typeof l._htraverse=="function"){let h=o;if(t.has(h))s.push(`${n}${f}${o.label}${c} \u2192 (circular ref)`);else{t.add(h),s.push(`${n}${f}${o.label}${c}`);let m=l.toString(e,t,p);m&&s.push(m)}}else{let h;l==null?h="null":typeof l=="string"&&l.length>50?h=JSON.stringify(l.slice(0,47)+"..."):typeof l=="string"?h=JSON.stringify(l):h=String(l),s.push(`${n}${f}${o.label}: ${h}${c}`)}}return s.join(`
|
|
21
21
|
`)}},Gr=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(P);_i(P);At(P.tytxSuffix,{...xe(P.tytxSuffix),Bag:P});var Xo=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function Yo(r){return r.endsWith("_")&&Xo.has(r.slice(0,-1))?r.slice(0,-1):r}function Zo(r){let e=Yo(r);return e!==r?e:r.startsWith("_")&&Xo.has(r.slice(1))?r.slice(1):r}function Wr(r,{renderTag:e=null,ns:t=null,dialectName:n=null}={}){let s=e||r;if(!s)return s;if(s=Yo(s),t&&!e){let i=`${n}_`;s.startsWith(i)&&(s=s.slice(i.length)),s=`${t}:${s}`}return s}var Dt=Symbol("value"),Tt=new Set(["_meta","datapath","node_id","ns","form","formId","_anchor","updateOn"]);function ye(r){return Object.entries(r||{}).filter(([e])=>!Tt.has(e)).map(([e,t])=>[Zo(e),t])}var Ve=class extends Oe{constructor(e,t,n=null,s=null,i=null,a=null,o=null){super(e,t,n,s,i,a,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let t=this.getAttr("_meta")||{},n=e.split(",").map(s=>s.trim());return n.length===1?t[n[0]]!==void 0?t[n[0]]:null:n.map(s=>t[s]!==void 0?t[s]:null)}pointerType(e){return typeof e=="string"&&(e[0]==="^"||e[0]==="=")?e[0]:null}pointers(){let e=[];for(let[t,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([t,n]);return this.pointerType(this.value)==="^"&&e.push(["",this.value]),e}fixedAttrItems(){return ye(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(Dt,this.value),e}absDatapath(e){let t=e;this.pointerType(e)&&(e=e.slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._resolveSymbolicDatapath(e,t):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,t)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,t){return e=this._collapseParentDatapath(e,e),t?`${e}?${t}`:e}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");s!=null&&(e=e==="."?s:s+e),n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_collapseParentDatapath(e,t){let n=[];for(let s of e.split("."))if(s==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${t}`);n.pop()}else n.push(s);return n.join(".")}_resolveSymbolicDatapath(e,t){let n=e.slice(1),s=n.indexOf("."),i=s===-1?n:n.slice(0,s),a=s===-1?"":n.slice(s+1),o;if(i==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,t);else if(i==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,t);else{let u=this.rootBuilder;if(!u)throw new Error(`#<id>: cannot resolve ${t} on a node without builder`);if(o=u.source.getNodeByAttr("node_id",i),o==null)throw new Error(`#<id>: cannot resolve ${t}`)}return o.absDatapath(a?`.${a}`:".")}_findMarkedDatapathAncestor(e,t,n){let s=this;for(;s!=null;){let a=s.getAttr()||{};if(e&&(a.formId!=null||a.form===!0)||t&&"_anchor"in a)return s;s=s.parentNode}let i=e?"FORM":"ANCHOR";throw new Error(`#${i}: no marked ancestor found for ${n}`)}getRelativeData(e,t=null,{autocreate:n=!1}={}){let s=this.data,i=this.absDatapath(e);return n&&s.getItem(i)==null&&s.setItem(i,t),s.getItem(i,t)}setRelativeData(e,t,{attributes:n=null,fired:s=!1,reason:i=null}={}){let a=this.data,o=this.absDatapath(e);a.setItem(o,t,n,">",!1,!0,i===null?!0:i,s)}fireEvent(e,t=!0,{attributes:n=null,reason:s=null}={}){this.setRelativeData(e,t,{attributes:n,fired:!0,reason:s})}SET(e,t){this.setRelativeData(e,t)}GET(e){return this.getRelativeData(e)}PUT(e,t){this.setRelativeData(e,t,{reason:!1})}FIRE(e,t=!0){this.setRelativeData(e,t,{fired:!0})}},D=class r extends P{constructor(e=null,t=null){super(e),this._builder=t,this._insertingBuilder=null}get nodeClass(){return Ve}_setBuilderItem(e,t,n,...s){let i=t?.map(([o])=>[o,o._builder])||null;if(t)for(let[o,u]of t)o._builder=u;let a=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...s)}catch(o){if(this.node(n)==null&&i)for(let[u,l]of i)u._builder=l;throw o}finally{this._insertingBuilder=a}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let t=this._builderBindingPlan(e);for(let[n,s]of t)n._builder=s;return this.setBackref(),this}_builderBindingPlan(e){let t=[],n=new WeakSet,s=(i,a)=>{if(n.has(i))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(i),t.push([i,a]);for(let o of i.getNodes()){let u=a,l=o._getMeta("subbuilder");l!=null&&(u=a._resolveSubbuilderReference(l,o.getAttr()||{},o.nodeTag)),t.push([o,u]);let c=o.getValue(!0);c instanceof r&&s(c,u)}};return s(this,e),t}};if((xe(D.tytxSuffix).SourceBag??D)!==D)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");At(D.tytxSuffix,{...xe(D.tytxSuffix),SourceBag:D});function np(r){if(r.length===0)return{value:null,attrs:{}};let e=r[0];if(e!==null&&typeof e=="object"){let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return{value:null,attrs:e}}return{value:e,attrs:r[1]||{}}}var sp=new Set(["then","toJSON"]),Ko=new WeakMap;function Ie(r){return Ko.get(r)||r}function vi(r){if(r==null)return r;r=Ie(r);let e=r._builder||r.parentBag&&r.parentBag._builder;return e?e.wrapSource(r):r}function Qo(r,e){let t=e instanceof P,n=new Proxy(e,{get(s,i){if(typeof i=="symbol"||i.startsWith("_")||sp.has(i))return Reflect.get(s,i,s);let a=r.schemaTag(i);if(t&&a)return Jo(r,s,a,t);if(i in s){let u=Reflect.get(s,i,s);return typeof u=="function"?u.bind(s):u}if(a)return Jo(r,s,a,t);let o=r.containerMethod(i);if(o)return(...u)=>r[o](r.wrapSource(s),...u)}});return Ko.set(n,e),n}function Jo(r,e,t,n){return(...s)=>{let{value:i,attrs:a}=np(s),o=n?r.bagCall(e,t,i,a):r.commandOnNode(e,t,i,a);return o.builder.wrapSource(o)}}function Ei(r,e,{transport:t="json"}={}){let n=H(r,t==="json"?null:t);if(!(n instanceof D))throw new TypeError("TYTX payload did not decode to SourceBag");return n.bindBuilder(e)}var tl=/^[A-Za-z_][A-Za-z0-9_]*$/,ip=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),ap=new Set(["framework","value","attribute"]),op=new Map([["builtins.str",r=>typeof r=="string"],["builtins.int",r=>Number.isInteger(r)],["builtins.float",r=>typeof r=="number"&&Number.isFinite(r)],["builtins.bool",r=>typeof r=="boolean"],["builtins.list",r=>Array.isArray(r)],["builtins.dict",r=>r!==null&&typeof r=="object"&&!Array.isArray(r)],["builtins.tuple",r=>Array.isArray(r)],["builtins.set",r=>Array.isArray(r)||r instanceof Set],["builtins.NoneType",r=>r===null],["builtins.object",r=>!0]]);function Xr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function T(r,e){throw new TypeError(`${r}: ${e}`)}function xt(r,e,t,n){Xr(r)||T(n,"must be an object");for(let s of Object.keys(r))e.includes(s)||T(n,`unknown field '${s}'`);for(let s of t)Object.hasOwn(r,s)||T(n,`missing field '${s}'`)}function ar(r,e){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r))return r.forEach((t,n)=>ar(t,`${e}[${n}]`));if(Xr(r))return Object.entries(r).forEach(([t,n])=>ar(n,`${e}.${t}`));T(e,"must be lossless JSON data")}}function ir(r,e,t=!1){if(r===null)return null;switch(xt(r,["kind","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),r.kind){case"any":return{...r,test:n=>!0};case"type":{(typeof r.module!="string"||typeof r.name!="string")&&T(e,"type requires string module/name");let n=`${r.module}.${r.name}`;if(n==="collections.abc.Callable")return{...r,test:i=>typeof i=="function",portable:!1};let s=op.get(n);return s||T(e,`unsupported type '${n}'`),{...r,test:s}}case"union":{(!Array.isArray(r.items)||!r.items.length)&&T(e,"union items must be non-empty");let n=r.items.map((s,i)=>ir(s,`${e}.items[${i}]`,!0));return{...r,items:n,test:s=>n.some(i=>i.test&&i.test(s))}}case"literal":return Array.isArray(r.values)||T(e,"literal values must be an array"),r.values.forEach((n,s)=>ar(n,`${e}.values[${s}]`)),{...r,test:n=>r.values.some(s=>Object.is(s,n))};case"annotated":{Array.isArray(r.metadata)||T(e,"annotated metadata must be an array");let n=ir(r.base,`${e}.base`,!0),s=r.metadata.map((i,a)=>ir(i,`${e}.metadata[${a}]`,!0));return{...r,base:n,metadata:s,test:i=>n.test(i)&&s.every(a=>!a.test||a.test(i))}}case"range":{for(let n of["ge","le","gt","lt"])Object.hasOwn(r,n)||T(e,`range missing '${n}'`);for(let n of["ge","le","gt","lt"])r[n]!==null&&(typeof r[n]!="number"||!Number.isFinite(r[n]))&&T(e,`${n} must be finite number or null`);return{...r,test:n=>typeof n=="number"&&(r.ge===null||n>=r.ge)&&(r.le===null||n<=r.le)&&(r.gt===null||n>r.gt)&&(r.lt===null||n<r.lt)}}case"regex":{(typeof r.pattern!="string"||!Number.isInteger(r.flags)||r.flags<0)&&T(e,"regex requires pattern and non-negative integer flags");let n=r.flags&-59;n&&T(e,`unsupported Python regex flags ${n}`),r.flags&2&&T(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZwWdDsS]|\(\?P[<=!]|\(\?\(|\(\?>/.test(r.pattern)&&T(e,"regex uses a non-portable construct or character class");let s="uy";r.flags&8&&(s+="m"),r.flags&16&&(s+="s");let i;try{i=new RegExp(`(?:${r.pattern})(?![\\s\\S])`,s)}catch(a){T(e,`invalid portable regex: ${a.message}`)}return{...r,test:a=>typeof a!="string"?!1:(i.lastIndex=0,i.test(a))}}case"value":return ar(r.value,`${e}.value`),{...r};case"generic":{let n=ir(r.origin,`${e}.origin`,!0);(r.origin?.kind!=="type"||r.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(r.origin.name))&&T(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(r.arguments)||T(e,"generic arguments must be an array");let s=r.arguments.map((i,a)=>ir(i,`${e}.arguments[${a}]`,!0));return{...r,origin:n,arguments:s,test:i=>n.test(i)&&lp(r.origin,s,i)}}case"arguments":T(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return t||T(e,"ellipsis is only valid as a nested descriptor"),{...r};default:T(e,`unknown annotation kind '${r.kind}'`)}}function lp(r,e,t){let n=`${r.module}.${r.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?t.length===e.length&&t.every((s,i)=>e[i].test(s)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...t].every(s=>!e[0]?.test||e[0].test(s)):n==="builtins.dict"?Object.entries(t).every(([s,i])=>(!e[0]?.test||e[0].test(s))&&(!e[1]?.test||e[1].test(i))):!1}function rl(r,e){if(r===null)return null;if(typeof r!="string"&&T(e,"must be string or null"),r==="")return new Map;let t=new Map;for(let n of r.split(",")){let s=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(s)&&T(e,`invalid cardinality item '${n}'`);let i=s.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);i||T(e,`invalid cardinality item '${n}'`);let[,a,o,u,l]=i;t.has(a)&&T(e,`duplicate tag '${a}'`);let c=0,d=1/0;s.includes("[")&&(s.includes(":")?(c=u?Number(u):0,d=l?Number(l):1/0):c=d=Number(o)),d<c&&T(e,`maximum ${d} is below minimum ${c}`),t.set(a,{min:c,max:d})}return t.has("*")&&t.size>1&&T(e,"wildcard '*' cannot be combined with named tags"),t}function nl(r,e){if(r===null)return null;typeof r!="string"&&T(e,"must be string or null");let t=new Set;for(let n of r.split(",")){let s=n.trim();s&&((!tl.test(s)||t.has(s))&&T(e,`invalid or duplicate parent '${n}'`),t.add(s))}return t}function up(r,e){if(r===null)return null;xt(r,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let t=r.parameters??[];Array.isArray(t)||T(e,"parameters must be an array"),r={parameters:t,accepts_var_keyword:t.some(o=>o.kind==="var_keyword"),accepts_var_positional:t.some(o=>o.kind==="var_positional"),...r},(!Array.isArray(r.parameters)||typeof r.accepts_var_keyword!="boolean"||typeof r.accepts_var_positional!="boolean")&&T(e,"invalid signature descriptor");let n=new Set,s=!1,i=!1,a=r.parameters.map((o,u)=>{let l=`${e}.parameters[${u}]`;return xt(o,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],l),(typeof o.name!="string"||!tl.test(o.name)||n.has(o.name))&&T(l,"invalid or duplicate parameter name"),n.add(o.name),(!ip.has(o.kind)||!ap.has(o.role)||typeof o.has_default!="boolean")&&T(l,"invalid kind, role, or has_default"),o.has_default!==Object.hasOwn(o,"default")&&T(l,"default presence must equal has_default"),o.has_default&&ar(o.default,`${l}.default`),s||=o.kind==="var_keyword",i||=o.kind==="var_positional",{...o,annotation:ir(o.annotation,`${l}.annotation`)}});return(s!==r.accepts_var_keyword||i!==r.accepts_var_positional)&&T(e,"variadic summary flags do not match parameters"),{...r,parameters:a}}function el(r,e,t){let n=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...t?["node_label","collection_key"]:[],"_meta"];xt(r,n,[],e),r={...Object.fromEntries(n.map(s=>[s,null])),...r};for(let s of["doc","inherits_from","ns",...t?["node_label","collection_key"]:[]])r[s]!==null&&typeof r[s]!="string"&&T(e,`${s} must be string or null`);return r._meta!==null&&(Xr(r._meta)||T(e,"_meta must be object or null"),ar(r._meta,`${e}._meta`)),rl(r.sub_tags,`${e}.sub_tags`),nl(r.parent_tags,`${e}.parent_tags`),{...r,attributes:up(r.attributes,`${e}.attributes`)}}function sl(r){return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function il(r,e){let t={...e};for(let[n,s]of Object.entries(r))n==="inherits_from"||n.startsWith("_")||t[n]||(t[n]=s);return t._meta={...r._meta||{},...e._meta||{}},t}function al(r){let e={...r};return e._subSpec=Object.hasOwn(e,"sub_tags")?rl(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?nl(e.parent_tags,"resolved.parent_tags"):null,e}function ol(r,e,t,n){if(t.get(r)===1&&T(n,`inheritance cycle at '${r}'`),t.get(r)===2)return e[r];let s=e[r];s||T(n,`unknown abstract '${r}'`),t.set(r,1);let i={...s};for(let a of sl(s.inherits_from))i=il(ol(a,e,t,n),i);return i=al(i),t.set(r,2),e[r]=i,i}function ki({abstracts:r={},elements:e={}}){let t={...r},n=new Map;for(let i of Object.keys(t))ol(i,t,n,`abstracts.${i}.inherits_from`);let s={};for(let[i,a]of Object.entries(e)){let o={...a};for(let u of sl(a.inherits_from)){let l=t[u];l||T(`elements.${i}.inherits_from`,`unknown abstract '${u}'`),o=il(l,o)}s[i]=al(o)}return{abstracts:t,elements:s}}function Ai(r){xt(r,["document_format","grammar","abstracts","elements"],["document_format","grammar","abstracts","elements"],"grammar document"),xt(r.document_format,["name","version"],["name","version"],"document_format"),(r.document_format.name!=="builder_grammar"||r.document_format.version!=="1.1")&&T("document_format","expected builder_grammar version 1.1"),xt(r.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof r.grammar.name!="string"||!r.grammar.name)&&T("grammar.name","must be non-empty string");for(let n of["version","title","description"])r.grammar[n]!==null&&typeof r.grammar[n]!="string"&&T(`grammar.${n}`,"must be string or null");(!Xr(r.abstracts)||!Xr(r.elements))&&T("grammar document","abstracts/elements must be objects");let e={};for(let[n,s]of Object.entries(r.abstracts))(!n||n.startsWith("_"))&&T("abstracts",`invalid public name '${n}'`),e[n]=el(s,`abstracts.${n}`,!1);let t={};for(let[n,s]of Object.entries(r.elements))(!n||n.startsWith("_"))&&T("elements",`invalid public name '${n}'`),t[n]=el(s,`elements.${n}`,!0);return{grammar:structuredClone(r.grammar),abstracts:e,elements:t}}function ll(r,e,t,n){let s=e.attributes;if(!s)return;let i={...n};t!=null&&(i.node_value=t);let a=new Set(s.parameters.filter(l=>l.role==="attribute").map(l=>l.name)),o=new Set(["node_label","node_position","node_id","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!s.accepts_var_keyword)for(let l of Object.keys(n))!a.has(l)&&!o.has(l)&&T(r,`unknown attribute '${l}'`);let u=e._meta?.component?s.parameters.find(l=>l.role!=="framework"&&["positional_only","positional_or_keyword"].includes(l.kind))?.name:null;for(let l of s.parameters){if(l.name===u||l.role==="framework"||l.kind.startsWith("var_"))continue;let c=Object.hasOwn(i,l.name);!c&&!l.has_default&&T(r,`missing required ${l.role} '${l.name}'`),c&&l.annotation!==null&&(!l.annotation.test||!l.annotation.test(i[l.name]))&&T(r,`invalid value for ${l.role} '${l.name}'`)}}function ul(r,e,t=[]){if(e===null)return structuredClone(r);if(t.length===2&&["abstracts","elements"].includes(t[0]))return structuredClone(e);if(or(r)&&or(e)){let n=structuredClone(r);for(let[s,i]of Object.entries(e))i!==null&&Object.defineProperty(n,s,{value:ul(n[s],i,[...t,s]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function or(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&Object.getPrototypeOf(r)===Object.prototype}function Di(r){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r)){r.forEach(Di);return}if(or(r)){Object.values(r).forEach(Di);return}throw new TypeError("collection must contain only finite JSON values")}}var Ke=class r{#e;constructor(e){Di(e);let t=["document_format","grammar","abstracts","elements"];if(!or(e)||Object.keys(e).length!==t.length||t.some(s=>!Object.hasOwn(e,s)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!or(n)||Object.keys(n).length!==2||n.name!=="builder_grammar"||n.version!=="1.1")throw new TypeError("expected builder_grammar version 1.1");for(let s of["grammar","abstracts","elements"])if(!or(e[s]))throw new TypeError(`${s} must be an object`);this.#e=structuredClone(e)}update(e){let t=new r(e);return this.#e=ul(this.#e,t.#e),this}toDocument(){return structuredClone(this.#e)}};var St=class{static renderType="string";static mode=null;constructor(e){this._builder=e,this.renders=new Map([[e,this]])}get builder(){return this._builder}get renderType(){return this.constructor.renderType}get mode(){return this.constructor.mode}addRender(e,t){this.renders.set(e,t)}getRender(e){let t=this.renders.get(e);if(t!==void 0)return t;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,t={}){let n=e.builder,[s,i]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,i,t);let a=this.getRender(n),o;return[o,i]=a._handleMeta(e,i),e._getMeta("subbuilder")||(i=a.adaptAttrs(i)),e.value instanceof D&&(s=this.renderChildren(e.value,t)),a.renderedItem(e,s,i,{tag:o,...t})}renderChildren(e,t={}){let n=[];for(let s of e.getNodes()){let i=this.render(s,t);i!==null&&(Array.isArray(i)?n.push(...i):n.push(i))}return n}_renderComponent(e,t,n){let[s,i,a,o]=this._expansionInputs(e,t);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,s,a,o,n);if(i==null)return[];if(!(i instanceof P))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${i?.constructor?.name||typeof i}`);return i.getNodes().map(u=>this._expandBlock(e,s,a,{node_label:u.label},n))}_expansionInputs(e,t){let n=e.builder,s=n.componentMethod(e.nodeTag),i=s&&n[s];if(typeof i!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let a=t.iterate;delete t.iterate,delete t.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let u of Object.keys(t)){let l=e.getAttr(u);e.pointerType(l)==="^"&&(t[u]=`^${e.absDatapath(l)}`)}return[i,a,o,t]}_expandBlock(e,t,n,s,i){let a=e.builder._expansionRoot(n);t.call(e.builder,vi(a),s);let o=a.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let u={...i,depthOffset:this._nodeDepth(e,i.depthOffset||0)};return this.render(o[0],u)}preprocess(e){return e}renderedItem(e,t,n,s){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,t){let[n,s]=e._getMeta("render_tag,render_attributes"),i=Wr(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!i)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return s&&(t={...t,...s}),[i,t]}adaptAttrs(e){return e}adapt(e){let t=`${this.builder.constructor._name}_`;return e.startsWith(t)?e.slice(t.length):e}finalize(e,t=null,n={}){let s=this._composeStringFragments(e);if(t==null)return s;if(typeof t=="string")throw new TypeError("string render targets require filesystem support, which is unavailable in the portable renderer; pass a callable or writable target instead");if(typeof t.full=="function"&&typeof t.write!="function")return t.full(s),null;if(typeof t.write=="function")return t.write(s),null;if(typeof t=="function")return t(s),null;throw new TypeError("render target must be writable (.write), callable, or expose .full")}_composeStringFragments(e){if(!Array.isArray(e))return e;if(e.some(t=>typeof t!="string"))throw new TypeError("String composition requires string fragments; object renderers must define their own composition");return e.join("")}_escapeText(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',""")}_nodeDepth(e,t=0){let s=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(s-1,0)+t}};var Nt=class extends St{static mode="xml";renderedItem(e,t,n,{tag:s,pretty:i=!1,depthOffset:a=0}={}){let o=this._formatAttrs(n),u=i?" ".repeat(this._nodeDepth(e,a)):"",l=i?`
|
|
22
22
|
`:"";if(Array.isArray(t)){let c=this._composeStringFragments(t);return`${u}<${s}${o}>${l}${c}${u}</${s}>${l}`}return t==null?`${u}<${s}${o}></${s}>${l}`:`${u}<${s}${o}>${this._escapeText(t)}</${s}>${l}`}finalize(e,t=null,{docHeader:n=null}={}){let s=this._composeStringFragments(e);return n===!0?s=`<?xml version='1.0' encoding='UTF-8'?>${s}`:typeof n=="string"&&(s=n+s),super.finalize(s,t)}_formatAttrs(e){return Object.entries(e||{}).map(([t,n])=>` ${t.startsWith("xmlns_")?`xmlns:${t.slice(6)}`:t}="${this._escapeAttr(n)}"`).join("")}};var cl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"base",version:null,title:null,description:null},abstracts:{},elements:{dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};function dl(r){let e=[];for(;r&&r!==Function.prototype;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function dp(r){let e=Object.create(null),t=(n,s)=>{let i=n.toLowerCase(),a=e[i];if(a!==void 0&&a!==s)throw new Error(`container '${n}' is already tied to implementation method '${a}' (cannot rebind to '${s}')`);e[i]=s};for(let n of dl(r))if(Object.hasOwn(n,"containers"))for(let s of n.containers||[])t(s,s);return e}function Yr(r){let e=Object.create(null);for(let t of Object.keys(r)){let n=t.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${t}' has a case-insensitive collision with '${e[n]}'`);e[n]=t}return e}var Zr="_root_",Ti="_root_",fl=new Set(["destination","func","value","_on_start"]),he=class r{static _sourceClass=D;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof r))throw new TypeError("registerBuilder requires a BuilderBase subclass");let t=e._name;if(typeof t!="string"||!t)throw new TypeError("registered builders require a non-empty static _name");let n=r._registry.get(t);if(n&&n!==e)throw new Error(`Builder name '${t}' is already registered to ${n.name}; cannot register ${e.name}`);return r._registry.set(t,e),e}static getBuilderClass(e){let t=r._registry.get(e);if(!t)throw new Error(`No builder registered with name '${e}'`);return t}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new P,this._dataroot.setBackref(),this._dataroot.setItem(Ti,new P),this.data=this._dataroot.getItem(Ti),this._defaultTargets=new Map,this.materialized=Object.create(null),this._collection=null,this._schemaOverride=null,this._tagNamesOverride=null,this._componentMap=null,this._targetSerial=0,this._subbuilders=new Map,this._sourceHandles=new WeakMap;let t=this.constructor._sourceClass;this._sourceroot=new t(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(Zr,new t(null,this)),this.source=this._sourceroot.getItem(Zr)}wrapSource(e){if(e=Ie(e),!(e instanceof D)&&!(e instanceof Ve))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let t=this._sourceHandles.get(e);return t||(t=Qo(this,e),this._sourceHandles.set(e,t)),t}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let t=this._subbuilders.get(e);if(!t){let n=r.getBuilderClass(e);t=new n,this._subbuilders.set(e,t)}return t._dataroot=this._dataroot,t.data=this.data,t}_resolveSubbuilderReference(e,t,n){if(typeof e!="string"||!e)throw new Error(`'${n}': subbuilder declaration must be a non-empty string`);if(e.includes(":"))throw new Error(`'${n}': runtime subbuilder reference '${e}' is unsupported`);return this.getSubbuilder(e)}static defineGrammar(e){let t=this._classCollection,n=t?new Ke(t.toDocument()).update(e):new Ke(e),s=Ai(n.toDocument()),i=ki(s),a=Yr(i.elements);this._classCollection=n,this._classSchema=i.elements,this._abstracts=i.abstracts,this._tagNames=a}static{this.defineGrammar(cl)}get _containers(){return dp(this.constructor)}containerMethod(e){return this._containers[e.toLowerCase()]||null}componentMethod(e){return this._componentMap?.[e.toLowerCase()]||null}get schema(){return this._schemaOverride||this.constructor._classSchema||{}}get schemaTagNames(){return this._schemaOverride?this._tagNamesOverride??=Yr(this.schema):this.constructor._tagNames??=Yr(this.schema)}schemaTag(e){let t=e.toLowerCase(),n=this.schemaTagNames[t];if(n)return n;let s=`${this.constructor._name}_`;return t.startsWith(s)&&this.schemaTagNames[t.slice(s.length)]||null}loadGrammar(e,{replace:t=!1}={}){let n=this._collection||this.constructor._classCollection,s=t?new Ke(e):new Ke(n.toDocument()).update(e),i=Ai(s.toDocument()),a=ki(i),o=Yr(a.elements);return this._collection=s,this._schemaOverride=a.elements,this._tagNamesOverride=o,this}validateNodeValues(e,t,n={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);return ll(s,this.schema[s],t,n),!0}validateNode(e,{value:t,attrs:n,childTags:s}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let i=t!==void 0?t:e.value instanceof D?null:e.value;this.validateNodeValues(e.nodeTag,i,n||e.getAttr?.()||{});let a=this.schema[this.schemaTag(e.nodeTag)],o=s||(e.value instanceof D?e.value.getNodes().map(u=>u.nodeTag):null);return o&&this._validateChildren(e.nodeTag,a,o,!1),!0}validateChildren(e,t,{includeMinimum:n=!1}={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);if(!Array.isArray(t)||t.some(i=>typeof i!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(s,this.schema[s],t,n)}validateParent(e,t=null){let n=this.schemaTag(e);if(!n)throw new Error(`unknown element '${e}'`);let s=this.schema[n];if(!this._countsForGrammar(s))return!0;let i=s._parentSpec;if(i==null||i.has("*"))return!0;if(t===null)throw new Error(`'${n}' requires a declared parent`);let a=this.schemaTag(t);if(!a)throw new Error(`unknown parent element '${t}'`);return this._validateParent(n,s,a),!0}bagCall(e,t,n,s){return this.setChild(e,t,n,s)}commandOnNode(e,t,n,s){if(e=Ie(e),e.value instanceof D)return this.setChild(e.value,t,n,s);let i=e.value,a=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(a,t,n,s,e);return this.promoteNodeValue(e,i,a),o}promoteNodeValue(e,t,n){e.setValue(n)}setChild(e,t,n,s,i=null){let a={...s},o=this.schema[t];if(!o)throw new Error(`unknown element '${t}'`);this.validateNodeValues(t,n,a);let u=o._meta?.subbuilder,c=(u==null?null:this._resolveSubbuilderReference(u,a,t))||this,d=n instanceof D?n._builderBindingPlan(c):null,f=i?.rootBuilder||e.root._builder||this;if(a.node_id!=null&&f.source.getNodeByAttr("node_id",a.node_id))throw new Error(`Duplicate node_id '${a.node_id}'`);n instanceof D&&this._validateChildren(t,o,n.getNodes().map(w=>w.nodeTag),!1);let p=i||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(t,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),t],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${t}' requires a declared parent`);o._meta&&!("_meta"in a)&&(a._meta=o._meta),o.ns&&!("ns"in a)&&(a.ns=o.ns);let m=a.node_position;delete a.node_position;let g=a.node_label;delete a.node_label;let b;if(h?.collection_key){if(g!=null)throw new Error(`'${t}': node_label is not allowed in a collection`);b=this._collectionLabel(h.collection_key,t,a)}else{let w=h?._subSpec?.get(t);if(w&&w.max===1){if(g!=null)throw new Error(`'${t}': node_label is not allowed on a singleton`);b=t}else b=g||o.node_label||this._autoLabel(e,t)}if(e.node(b)!=null)throw new Error(`duplicate node label '${b}'`);return e._setBuilderItem(c,d,b,n,a,m||">",!1,!0,null,!1,!0,null,t)}_countsForGrammar(e){let t=e?._meta||{};return!(t.data_element||t.subbuilder||t.component)}_validateParent(e,t,n){let s=t._parentSpec;if(!(s==null||s.has("*")||!this._countsForGrammar(t))&&!s.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,t,n,s){let i=t._subSpec;if(i==null||i.has("*")||t._meta?.subbuilder)return[];let a=new Map;for(let o of n){let u=this.schema[o];if(u&&!this._countsForGrammar(u))continue;let l=i.get(o);if(!l)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(a.get(o)||0)+1;if(a.set(o,c),c>l.max)throw new Error(`too many '${o}' in '${e}'`)}return s?[...i].filter(([o,u])=>(a.get(o)||0)<u.min).map(([o])=>o):[]}_collectionLabel(e,t,n){let s=i=>{if(n[i]===null||n[i]===void 0)throw new Error(`'${t}': collection key needs attribute '${i}'`);return String(n[i])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(i,a)=>s(a)):s(e)}validateSource(){let e=[],t=(n,s="")=>{for(let i of n.getNodes()){let a=s?`${s}.${i.label}`:i.label,o=i.builder,u=o.schema[i.nodeTag];if(u&&!i._getMeta("data_element,subbuilder,component").some(Boolean)){let l=i.value instanceof D?i.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(i.nodeTag,u,l,!0);c.length&&e.push([a,c])}i.value instanceof D&&t(i.value,a)}};return t(this.source),e}_autoLabel(e,t){let n=0;for(;e.node(`${t}_${n}`)!==null&&e.node(`${t}_${n}`)!==void 0;)n+=1;return`${t}_${n}`}nodeById(e){let t=this.source.getNodeByAttr("node_id",e);if(t==null)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}runtimeValues(e){let t=new Map,n={},s=e._getMeta("data_element");for(let[o,u]of e.runtimeToEvaluate()){if(u instanceof ne){t.set(o,u.resolve());continue}if(!e.pointerType(u)){t.set(o,u);continue}let l=e.absDatapath(u);if(t.set(o,this.data.getItem(l)),!s&&!l.includes("?")&&o===Dt){let c=this.data.getNode(l);c&&Object.assign(n,c.getAttr("_wdg"))}}let i=new Set;for(let[o,u]of t)s||o===Dt||typeof u!="string"||t.set(o,u.replace(/(\\)?\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(l,c,d)=>{if(c)return l.slice(1);if(!t.has(d))throw new Error(`Unknown template parameter '${d}'`);i.add(d);let f=t.get(d);return f===null?"":String(f)}));let a=t.get(Dt);t.delete(Dt);for(let o of i)t.delete(o);return[a,{...Object.fromEntries(t),...n}]}targetId(e){if(e._targetId)return e._targetId;let t=e.rootBuilder;return e.parentBag.root!==t.source.root?null:(t._targetSerial+=1,e._targetId=`n${t._targetSerial}`,e._targetId)}get dataLogic(){if(!this._dataLogic){let e=this._buildDataLogic();this._dataLogic=Array.isArray(e)?e:[e]}return this._dataLogic}_buildDataLogic(){return this}_resolveLogicFunc(e){if(typeof e=="function")return e;if(typeof e!="string")throw new Error("data-element func must be a name or a function");for(let t of this.dataLogic){let s=(typeof t=="function"?t:t.constructor)[e];if(typeof s=="function")return s}throw new Error(`data-element func '${e}' not found on any data_logic source`)}_bindings(e){let[,t]=this.runtimeValues(e),n={};for(let[s,i]of Object.entries(t))fl.has(s)||(n[s]=i);return n}computeLogic(e){for(let t of e)this._computeNode(t)}_computeNode(e){let t=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[s,i]of Object.entries(t))s!=="destination"&&s!=="value"&&!s.startsWith("_")&&(n[s]=i);e.setRelativeData(t.destination,t.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(t.func);e.setRelativeData(t.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(t.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],t=n=>{for(let s of n.getNodes())s._getMeta("data_element")&&e.push(s),s.value instanceof D&&t(s.value)};return t(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of dl(this.constructor))if(Object.hasOwn(o,"components"))for(let u of o.components||[])e[u]=u;if(!Object.keys(e).length)return;let t={...this.schema},n={};for(let[o,u]of Object.entries(e))t[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=u;let s=Yr(t),i=this._collection||this.constructor._classCollection,a=i.toDocument();a.abstracts={},a.elements=Object.fromEntries(Object.keys(e).map(o=>[o,t[o]])),this._collection=new Ke(i.toDocument()).update(a),this._schemaOverride=t,this._componentMap=n,this._tagNamesOverride=s}_expansionRoot(e=null){let t=this.constructor._sourceClass,n=new t(null,this);return n.setBackref(),n.setItem(Zr,new t(null,this),e?{datapath:e}:null),n.getItem(Zr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new Nt(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let t=this[`renderer_${e}`];if(!t)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return t}materialize(e=null,t={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),s=n.renderChildren(n.preprocess(this.source),t);return this.materialized[e]=s,s}setRenderTarget(e,t=null){t??=this.constructor._defaultRenderMode,this._defaultTargets.set(t,e)}render({mode:e=null,target:t=null,...n}={}){e??=this.constructor._defaultRenderMode;let s=this.getRenderer(e);if(t===!1&&s.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let i=t===!1?null:t||this._defaultTargets.get(s.mode)||null,a={...i?.renderOpts,...n};return s.finalize(this.materialize(e,a),i,a)}};he._registry=new Map;var fp=new Set(["short","medium","long","full"]),pp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function hp(r,e){if(!(r instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(r.getTime()))throw new RangeError("Invalid date");let t=e||le(r).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(t))throw new RangeError(`Unsupported temporal dtype: ${t}`);return t}function mp(r,e,t,n){let s=e.match(pp)||[];if(s.join("")!==e)throw new RangeError("Unclosed format literal");let i=(c,d=2)=>String(c).padStart(d,"0"),a=c=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...c}).format(r),l={...n==="H"?{}:{y:()=>String(r.getUTCFullYear()),yy:()=>i(r.getUTCFullYear()%100),yyyy:()=>i(r.getUTCFullYear(),4),M:()=>String(r.getUTCMonth()+1),MM:()=>i(r.getUTCMonth()+1),MMM:()=>a({month:"short"}),MMMM:()=>a({month:"long"}),d:()=>String(r.getUTCDate()),dd:()=>i(r.getUTCDate()),EEE:()=>a({weekday:"short"}),EEEE:()=>a({weekday:"long"})},...n==="D"?{}:{H:()=>String(r.getUTCHours()),HH:()=>i(r.getUTCHours()),h:()=>String(r.getUTCHours()%12||12),hh:()=>i(r.getUTCHours()%12||12),m:()=>String(r.getUTCMinutes()),mm:()=>i(r.getUTCMinutes()),s:()=>String(r.getUTCSeconds()),ss:()=>i(r.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(r).find(c=>c.type==="dayPeriod").value}};return s.map(c=>{if(c.startsWith("'"))return c==="''"?"'":c.slice(1,-1).replaceAll("''","'");if(!/^[a-zA-Z]/.test(c))return c;if(!l[c])throw new RangeError(`Unsupported date format token: ${c}`);return l[c]()}).join("")}function pl(r,{format:e,mask:t,locale:n,dtype:s,places:i}={}){let a=r==null?"":String(r);if(r!=null&&r!==""&&(e!=null&&e!==""||i!=null))if(typeof r=="number"||Je(r))a=_p(r,{format:e,locale:n,places:i});else{let o=hp(r,s);if(fp.has(e)){let u={timeZone:"UTC"};o!=="H"&&(u.dateStyle=e),o!=="D"&&(u.timeStyle=e),a=new Intl.DateTimeFormat(n||void 0,u).format(r)}else a=mp(r,String(e),n||void 0,o)}return t==null?a:String(t).replaceAll("%s",()=>a)}function gp({format:r="decimal",places:e}={}){let t={maximumFractionDigits:20};if(!r||r==="decimal")t.style="decimal";else if(r==="percent")t.style="percent";else if(r==="scientific")t.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(r);if(!n||r.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${r}`);t.useGrouping=n[1].includes(","),t.minimumFractionDigits=(n[2]||"").length,t.maximumFractionDigits=(n[2]||"").length+(n[3]||"").length}if(e!=null&&e!==""){let n=Number(e);if(!Number.isInteger(n)||n<0||n>20)throw new RangeError("places must be an integer from 0 to 20");t.minimumFractionDigits=n,t.maximumFractionDigits=n}return t}function _p(r,e={}){if(typeof r!="number"&&!Je(r))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(r)))throw new RangeError("Number must be finite");let t=new Intl.NumberFormat(e.locale||void 0,gp(e));if(Je(r)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return t.format(Je(r)?r.toString():r)}var bp=new Set(["style","script"]),wp=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),hl=new Set(["width","height","top","left","right","bottom","padding","margin","border","position","display","overflow","float","clear","resize","z_index","min_width","min_height","max_width","max_height","color","background","font","text","line_height","white_space","vertical_align","flex","gap","row_gap","column_gap","grid","align_content","justify_content","align_items","justify_items","visibility","opacity","cursor"]),Jr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),ml=r=>r===!0?"true":r===!1?"false":String(r),is=r=>typeof r=="number"&&Number.isFinite(r)?`${r}px`:String(r);function yp(r){if(hl.has(r))return!0;for(let e of hl)if(r.startsWith(`${e}_`))return!0;return!1}function vp(r){let e=new Map;if(!r)return e;let t=[],n=0,s=null,i=!1,a=!1,o=0,u=String(r);for(let l=0;l<u.length;l+=1){let c=u[l],d=u[l+1];if(a){c==="*"&&d==="/"&&(a=!1,l+=1);continue}if(i){i=!1;continue}if(c==="\\"){i=!0;continue}if(s){c===s&&(s=null);continue}c==='"'||c==="'"?s=c:c==="/"&&d==="*"?(a=!0,l+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(t.push(u.slice(n,l)),n=l+1)}t.push(u.slice(n));for(let l of t){let c=l.trim();if(!c)continue;let d=c.indexOf(":");if(d<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,d).trim(),c.slice(d+1).trim())}return e}var Ct=class extends St{static mode="html";renderedItem(e,t,n,{tag:s,xml:i=!0,pretty:a=!1,depthOffset:o=0,includeDatapath:u=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:p,dtype:h,...m}=n;!Array.isArray(t)&&(c!=null||d!=null||p!=null)&&(t=pl(t,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(u){if(!Object.hasOwn(n,"id")){let k=this.builder.targetId(e);k!==null&&(g+=` id="${this._htmlAttrValue(k)}"`)}for(let[k,I]of Object.entries(e.getAttr()))e.pointerType(I)&&(g+=` data-${this.adapt(k)}-pointer="${this._htmlAttrValue(e.absDatapath(I))}"`)}let b=a?" ".repeat(this._nodeDepth(e,o)):"",v=a?`
|
|
23
|
-
`:"";if(e._getMeta("void"))return`${b}<${s}${g}${i?"/":""}>${v}`;if(Array.isArray(t)){let k=this._composeStringFragments(t);return`${b}<${s}${g}>${v}${k}${b}</${s}>${v}`}if(t==null)return`${b}<${s}${g}></${s}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):bp.has(s)?String(t):this._escapeText(t);return`${b}<${s}${g}>${w}</${s}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let s=n.getAttr("locale");if(s==null)continue;let i=n.pointerType(s)?n.data.getItem(n.absDatapath(s)):s;if(i)return i}}adaptAttrs(e){let t={},n={};for(let[i,a]of Object.entries(e||{}))if(i.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(i)]=a;else if(i==="dtype")t.dtype=a;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>i.startsWith(o)))continue;this._isStyleContribution(i)?n[i]=a:t[i]=a}let s=this._adaptStyle(n);return s&&(t.style=s),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Jr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Jr.has(t)||yp(e)}_adaptStyle(e){let t=vp(e.style),n=new Map,s=new Map;for(let[i,a]of Object.entries(e))if(i!=="style")if(i.startsWith("style_"))t.set(i.slice(6).replaceAll("_","-"),ml(a));else if(Jr.has(i))n.set(i,a);else{let o=i.indexOf("_"),u=o<0?i:i.slice(0,o);o>=0&&Jr.has(u)?(s.has(u)||s.set(u,{}),s.get(u)[i.slice(o+1)]=a):t.set(i.replaceAll("_","-"),ml(a))}for(let i of Jr)(n.has(i)||s.has(i))&&this[`_macro_${i}`](n.get(i),s.get(i)||{},t);return[...t].map(([i,a])=>`${i}: ${a}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,s]of Object.entries(e||{}))wp.has(n)?s&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(s)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,t,n){let s=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[i,a]of Object.entries(t))if(i==="top"||i==="bottom")s[`${i}_left`]=a,s[`${i}_right`]=a;else if(i==="left"||i==="right")s[`top_${i}`]=a,s[`bottom_${i}`]=a;else if(["top_left","top_right","bottom_left","bottom_right"].includes(i))s[i]=a;else throw new TypeError(`rounded: unknown sub-kwarg '${i}'`);for(let[i,a]of Object.entries(s))n.set(`border-${i.replaceAll("_","-")}-radius`,is(a))}_macro_transform(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`rotate(${a}deg)`):i==="scale"||i==="translate"?s.push(`${i}(${a})`):i==="translate_x"?s.push(`translateX(${is(a)})`):i==="translate_y"?s.push(`translateY(${is(a)})`):i==="skew_x"?s.push(`skewX(${a}deg)`):i==="skew_y"?s.push(`skewY(${a}deg)`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("transform",s.join(" "))}_macro_filter(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`hue-rotate(${a}deg)`):i==="blur"?s.push(`blur(${is(a)})`):i==="drop_shadow"?s.push(`drop-shadow(${a})`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("filter",s.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[s,i]of Object.entries(t))n.set(`transition-${s.replaceAll("_","-")}`,String(i))}_macro_zoom(e,t,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,t,n){e!==void 0&&n.set("box-shadow",String(e));for(let[s,i]of Object.entries(t))n.set(`box-shadow-${s.replaceAll("_","-")}`,String(i))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var Ep=new Set(["alignment_baseline","baseline_shift","clip_path","clip_rule","color_interpolation","color_interpolation_filters","dominant_baseline","fill_opacity","fill_rule","flood_color","flood_opacity","font_family","font_size","font_size_adjust","font_stretch","font_style","font_variant","font_weight","glyph_orientation_horizontal","glyph_orientation_vertical","image_rendering","letter_spacing","lighting_color","marker_end","marker_mid","marker_start","overline_position","overline_thickness","paint_order","pointer_events","shape_rendering","stop_color","stop_opacity","strikethrough_position","strikethrough_thickness","stroke_dasharray","stroke_dashoffset","stroke_linecap","stroke_linejoin","stroke_miterlimit","stroke_opacity","stroke_width","text_anchor","text_decoration","text_rendering","underline_position","underline_thickness","unicode_bidi","word_spacing","writing_mode"]);function as(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[Ep.has(e)?e.replaceAll("_","-"):e,t]))}var Ot=class extends Nt{static mode="svg";adaptAttrs(e){return as(e)}};var gl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"html",version:null,title:null,description:null},abstracts:{},elements:{svg:{doc:"Switch to the SVG dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to SVG from this node down. No ``render_tag``: ``<svg>`` is\n emitted verbatim (HTML5 has a native ``<svg>`` tag).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"svg"}},a:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},abbr:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},address:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},area:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},article:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},aside:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},audio:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},b:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},base:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},bdi:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},bdo:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},blockquote:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},body:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},br:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},button:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},canvas:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},caption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},cite:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},code:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},col:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},colgroup:{doc:null,sub_tags:"col,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},data:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},datalist:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,option,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dd:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},del_:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},details:{doc:null,sub_tags:"summary[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dfn:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dialog:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},div:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dl:{doc:null,sub_tags:"dd,div,dt,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dt:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},em:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},embed:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},fieldset:{doc:null,sub_tags:"legend[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figcaption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figure:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figcaption[0:1],figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},footer:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},form:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h1:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h2:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h3:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h4:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h5:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h6:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},head:{doc:null,sub_tags:"base[0:1],link,meta,noscript,script,style,template,title[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},header:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hgroup:{doc:null,sub_tags:"h1,h2,h3,h4,h5,h6,p,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},html:{doc:null,sub_tags:"head[0:1],body[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},i:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},iframe:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},img:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},input:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},ins:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},kbd:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},label:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},legend:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},li:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},link:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},main:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},map:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mark:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},menu:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},meta:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},meter:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},nav:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},noscript:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},object:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ol:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},optgroup:{doc:null,sub_tags:"div,legend,noscript,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},option:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,div,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},output:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},p:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},picture:{doc:null,sub_tags:"img[0:1],script,source,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pre:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},progress:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},q:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rp:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rt:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ruby:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},s:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},samp:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},script:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},search:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},section:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},select:{doc:null,sub_tags:"button,div,hr,noscript,optgroup,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},slot:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},small:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},source:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},span:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},strong:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},style:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sub:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},summary:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sup:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},table:{doc:null,sub_tags:"caption[0:1],colgroup,script,tbody,template,tfoot[0:1],thead[0:1],tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tbody:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},td:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},template:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,del_,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,tr,track,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textarea:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tfoot:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},th:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},thead:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},time:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tr:{doc:null,sub_tags:"script,td,template,th",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},track:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},u:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ul:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},var:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},video:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},wbr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},selectedcontent:{doc:"Mirror of the selected option for Customizable Select (HTML 2024).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var pt=class extends he{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(gl)}get renderer_html(){return new Ct(this)}};he.registerBuilder(pt);var _l={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"svg",version:null,title:null,description:null},abstracts:{graphics:{doc:"SVG graphics content: any graphical element.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null},containerElement:{doc:"SVG container content: elements that can hold children.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null}},elements:{html:{doc:"Switch to the HTML dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to HTML from this node down. The source tag ``html`` is\n rendered as ``_meta['render_tag']`` (``<foreignObject>``) carrying\n ``_meta['render_attributes']`` (the SVG namespace). The immediate\n HTML child declares XHTML so both sides of the XML boundary retain\n their native namespace.\n ",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"html",render_tag:"foreignObject",render_attributes:{xmlns:"http://www.w3.org/2000/svg"}}},svg:{doc:"Root SVG container or nested SVG viewport.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},g:{doc:"Group container for applying transforms and styles.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},defs:{doc:"Container for referenced elements (gradients, patterns, etc.).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},symbol:{doc:"Reusable graphical template, rendered only when referenced by <use>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},use:{doc:"Reference and render a <symbol> or other element.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rect:{doc:"Rectangle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},circle:{doc:"Circle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ellipse:{doc:"Ellipse.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},line:{doc:"Line segment between two points.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polyline:{doc:"Open shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polygon:{doc:"Closed shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},path:{doc:"Arbitrary shape defined by path commands (d attribute).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},image:{doc:"Embedded raster image.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},text:{doc:"Text block. Contains text content and optional <tspan>/<textPath>.",sub_tags:"tspan,textPath",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tspan:{doc:"Inline text span within <text>.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textPath:{doc:"Text rendered along a path shape.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},linearGradient:{doc:"Linear gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},radialGradient:{doc:"Radial gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},stop:{doc:"Gradient stop (color and offset).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pattern:{doc:"Tile pattern definition. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},clipPath:{doc:"Clipping path definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mask:{doc:"Alpha mask definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},marker:{doc:"Marker symbol for line endpoints or vertices.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},filter:{doc:"Filter effect container. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feGaussianBlur:{doc:"Gaussian blur filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feOffset:{doc:"Offset filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feBlend:{doc:"Blend filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feColorMatrix:{doc:"Color matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feComposite:{doc:"Composite filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feFlood:{doc:"Flood fill filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMerge:{doc:"Merge filter primitive (container for feMergeNode).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMergeNode:{doc:"Single input for feMerge.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDropShadow:{doc:"Drop shadow filter primitive (SVG 2).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDiffuseLighting:{doc:"Diffuse lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpecularLighting:{doc:"Specular lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},fePointLight:{doc:"Point light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDistantLight:{doc:"Distant light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpotLight:{doc:"Spot light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMorphology:{doc:"Morphology filter primitive (erode/dilate).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTurbulence:{doc:"Turbulence noise filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDisplacementMap:{doc:"Displacement map filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feConvolveMatrix:{doc:"Convolution matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feImage:{doc:"Image filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTile:{doc:"Tile filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animate:{doc:"Animate an attribute over time.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateTransform:{doc:"Animate a transform attribute.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateMotion:{doc:"Animate motion along a path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},set:{doc:"Set an attribute to a value for a duration.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:"Accessible title (tooltip in browsers).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},desc:{doc:"Accessible description.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},metadata:{doc:"Metadata container (RDF, Dublin Core, etc.).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},a:{doc:"Hyperlink wrapper.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},foreignObject:{doc:"Container for non-SVG content (HTML, MathML).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},switch:{doc:"Conditional processing (renders first matching child).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var ht=class extends he{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(_l)}get renderer_svg(){return new Ot(this)}};he.registerBuilder(ht);var Re=class{constructor(e){this.gramlot=e}};var Dp={dataFormula:["formula","_if","_else"],dataController:["script","_if","_else"],dataRpc:["_if","_else","_onCalling","_onResult","_onError"],button:["action"]};function bl(r){return typeof r=="string"&&r.startsWith("==")}var Bt=class extends Ve{#e=new Set;#t=null;codeAttributes(){let e=Dp[this.nodeTag]??[],t=[];for(let[n,s]of Object.entries(this.getAttr()??{}))typeof s=="string"&&(e.includes(n)||n.startsWith("connect_on"))&&t.push([n,s]);for(let[n,s]of ye(this.getAttr()))bl(s)&&t.push([n,s]);return bl(this.staticValue)&&t.push(["",this.staticValue]),t}activateCode(){let e=new Map;for(let[t,n]of this.codeAttributes()){if(this.pointerType(n))throw new Error(`${this.nodeTag} '${this.label}': '${t}' is inline code and cannot be the pointer '${n}'; inline code is never read from Data`);e.set(t,n)}this.#t=e}activatedCode(e){return this.#t?.get(e)??null}pointerType(e){return typeof e=="string"&&e.startsWith("==")?null:super.pointerType(e)}pointers(){return super.pointers().filter(([e,t])=>!this.#n(e,t))}runtimeToEvaluate(){let e=super.runtimeToEvaluate();for(let[t,n]of e)this.pointerType(n)&&(this.#n(t,n)?e.set(t,n.slice(1)):this.absDatapath(n)===null&&e.set(t,null));return e}pathAttribute(e){let t=this.getAttr(e);return this.pointerType(t)&&this.#n(e,t)?t.slice(1):t}getRelativeData(e,t=null,n={}){return this.absDatapath(e)===null?null:super.getRelativeData(e,t,n)}setRelativeData(e,t,n={}){this.#i(e),super.setRelativeData(e,t,n)}PUT(e,t){this.#i(e),this.data.setItem(this.absDatapath(e),t,null,">",!1,!0,this,!1,!1)}FIRE(e,t=!0,n=null){t===null&&(t=!0),this.#i(e);let s=this.absDatapath(e);if(s.includes("?")){this.#r(s,t);return}this.data.getNode(s)?.setValue(null,!1);try{this.fireEvent(e,t,{attributes:n})}finally{this.data.getNode(s)?.setValue(null,!1)}}#r(e,t){let[n,s]=e.split("?",2),i=this.data;i.getNode(n)?.setAttr({[s]:null},!1);try{let a=i.getNode(n);a?a.setValue(a.staticValue,!0,{[s]:t},!0,!0,!0,!0):i.setItem(n,null,{[s]:t},">",!0,!0,!0,!0)}finally{i.getNode(n)?.setAttr({[s]:null},!1)}}FIRE_AFTER(e,t=!0,n=10){this.#i(e);let s=this.rootBuilder?.binding?.bindingFor(this)??null,i=null,a=setTimeout(()=>{i?.(),this.FIRE(e,t)},n);return i=s?.track(()=>clearTimeout(a))??null,()=>{clearTimeout(a),i?.()}}absDatapath(e){let t=this.pointerType(e)?e.slice(1):e;if(t.startsWith("#")&&t.includes("?")){let[n,s]=t.split("?",2),i=super.absDatapath(n);return i===null?null:`${i}?${s}`}return super.absDatapath(e)}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");if(this.pointerType(s)&&(s=this.#s(n,s),s===null))return null;if(s!=null&&(e=e==="."?s:s+e),e.startsWith("#"))return n.parentNode._resolveSymbolicDatapath(e,t);n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_finalizeAbsPath(e,t){return e===null?null:super._finalizeAbsPath(e,t)}_resolveSymbolicDatapath(e,t){let n=e.slice(1).split(".",1)[0];if(n==="FORM"||n==="ANCHOR")return super._resolveSymbolicDatapath(e,t);let s=this.rootBuilder?.binding;if(!s)return super._resolveSymbolicDatapath(e,t);let i=s.nodeIds.get(n);if(!i)throw new Error(`#<id>: cannot resolve ${t}`);let a=e.slice(n.length+2);return i.absDatapath(a?`.${a}`:".")}#s(e,t){let n=e.parentNode.absDatapath(t);if(n===null)return null;let s=this.data.getItem(n);return s==null||s===""?null:s}#n(e,t){return typeof e!="string"||!e.endsWith("_path")?!1:(this.#e.has(e)||(this.#e.add(e),console.warn(`${this.nodeTag} '${this.label}': '${e}' holds a bare Data path; the pointer symbol of '${t}' is removed`)),!0)}#i(e){if(this.absDatapath(e)===null)throw new Error(`${this.nodeTag} '${this.label}': write on a null path: '${e}'`)}},se=class r extends D{get nodeClass(){return Bt}activateCode(){for(let e of this.getNodes())e.activateCode(),e.staticValue instanceof r&&e.staticValue.activateCode();return this}};if((xe(se.tytxSuffix).GramlotBuilderBag??se)!==se)throw new Error("TYTX subtype name 'GramlotBuilderBag' is already registered for another class");At(se.tytxSuffix,{...xe(se.tytxSuffix),GramlotBuilderBag:se});var Ee="http://www.w3.org/1999/xhtml",Kr="http://www.w3.org/2000/svg",Tp=new Set(["default","default_value","live","group","visible","action","fire","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges"]),xp=["default_","attr_","fire_","connect_on"],Sp={table:["width","border"],editor:["height"],embed:["width","height"],img:["width","height"],canvas:["width","height"]},Np=/(?<!\\)\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,Cp=["format","mask","locale","places","dtype"],Op=new Set(["href","src","formaction","xlink:href","xlink_href"]);function mt(r){return Object.fromEntries(Object.entries(r).filter(([e])=>!Tp.has(e)&&!xp.some(t=>e.startsWith(t))))}function os(r,e,t=[]){for(let[n,s]of Object.entries(cr(mt(e)))){let i=t.find(o=>n.startsWith(o)),a=i?n.slice(i.length):n;if(/^on./i.test(a))throw new Error(`${r.nodeTag} '${r.label}': '${n}' has the form of a native event handler, run by the browser outside Gramlot; write connect_${a} for an event, or rename the attribute`);if(Op.has(a.toLowerCase())&&Bp(s))throw new Error(`${r.nodeTag} '${r.label}': '${n}' holds a javascript: URL, run by the browser as code; write connect_onclick or the action of a button instead`)}}function Bp(r){return typeof r=="string"&&/^javascript:/i.test(r.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,""))}function wl(r,e,t=[]){if(r.nodeTag!=="iframe")return e;let n=u=>{let l=t.find(c=>u.startsWith(c))??"";return[l,u.slice(l.length).toLowerCase()]},s=Object.fromEntries(ye(r.getAttr())),i=[...Object.keys(s),...Object.keys(e)].find(u=>n(u)[1]==="srcdoc");if(i===void 0||Object.keys(s).some(u=>n(u)[1]==="sandbox"))return e;let a=(u,l)=>{let c=s[u];return l.add(u),r.pointerType(c)!==null||Se(c)||lr(c).some(d=>Object.hasOwn(s,d)&&!l.has(d)&&a(d,l))};if(r.pointerType(r.value)===null&&!(Object.hasOwn(s,i)&&a(i,new Set)))return e;let o=Object.fromEntries(Object.entries(e).filter(([u])=>n(u)[1]!=="sandbox"));return{[`${n(i)[0]}sandbox`]:"",...o}}function cr(r){return Object.fromEntries(Object.entries(r).filter(([,e])=>e!=null))}function Qr(r){return Object.fromEntries(Object.entries(r).map(([e,t])=>e.startsWith("xmlns_")?[`xmlns:${e.slice(6)}`,t]:e.startsWith("data_")||e.startsWith("aria_")?[e.replaceAll("_","-"),t]:[e,t]))}function ls(r){let{_meta:e,...t}=r;return Qr(cr(mt(t)))}function yl(r,e){let t=Sp[String(r).toLowerCase()]??[],n={},s={};for(let[i,a]of Object.entries(e))t.includes(i)?s[i]=a:n[i]=a;return[n,s]}function ur(r){return String(r)}function en(r,e){let t={...e},n=t.mask;for(let i of Cp)delete t[i];if(Array.isArray(r))return[r,t];if(typeof r=="boolean"&&(r=ur(r)),n==null)return[r,t];let s=r==null?"":ur(r);return[s===""?s:String(n).replaceAll("%s",()=>s),t]}function lr(r){return typeof r=="string"?[...r.matchAll(Np)].map(([,e])=>e):[]}function Se(r){return typeof r=="string"&&r.startsWith("==")}function vl(r){if(Se(r.value)&&lr(r.value).length)throw new Error(`${r.nodeTag} '${r.label}': the == node value contains a \${\u2026} template, not accepted in a == expression`);let e=Object.fromEntries(ye(r.getAttr()));for(let[t,n]of Object.entries(e)){if(Se(n)&&lr(n).length)throw new Error(`${r.nodeTag} '${r.label}': '${t}' contains a \${\u2026} template, not accepted in a == expression`);for(let s of lr(n))if(Se(e[s]))throw new Error(`${r.nodeTag} '${r.label}': the template of '${t}' uses '${s}', a == expression`)}}var Ip=new Set(["animate","animateMotion","animateTransform","circle","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","image","line","metadata","path","polygon","polyline","rect","set","stop","use"]),tn=class extends Ot{constructor(e,t){super(e),this._owner=t}get owner(){return this._owner}_handleMeta(e,t){let n=this.owner.evaluateExpressions(e,t);os(e,n);let[s,i]=super._handleMeta(e,n);return e._getMeta("subbuilder")?[s,as(ls(i))]:[s,i]}adaptAttrs(e){let{_meta:t,...n}=e;return Qr(super.adaptAttrs(cr(mt(n))))}renderedItem(e,t,n,s={}){if(this.owner.renderType==="object")return this.owner.renderedItem(e,t,n,s);let{_text:i,...a}=n;return t=this.owner.expressionValue(e,t),Array.isArray(t)&&i!=null&&(t=[this._escapeText(ur(i)),...t]),Ip.has(s.tag)?`${s.pretty?" ".repeat(this._nodeDepth(e,s.depthOffset??0)):""}<${s.tag}${this._formatAttrs(a)} />${s.pretty?`
|
|
24
|
-
`:""}`:super.renderedItem(e,t,a,s)}};var It=class extends Ct{#e=new WeakMap;#t=new WeakMap;get inlineCompiler(){return null}getRender(e){return this.renders.has(e)||(e instanceof pt?this.addRender(e,this):e instanceof ht&&this.addRender(e,new tn(e,this))),super.getRender(e)}render(e,t={}){return e._getMeta("data_element")?null:super.render(e,t)}_handleMeta(e,t){let n=this.builder.constructor.dialectPrefixes,s=this.evaluateExpressions(e,t);os(e,s,n);let[i,a]=super._handleMeta(e,wl(e,s,n));if(e._getMeta("subbuilder")){let l=ls(a);return e._getMeta("subbuilder")==="html"&&(l.xmlns=Kr),[i,l]}let[o,u]=yl(i,a);return Object.keys(u).length&&this.#e.set(e,u),[i,o]}evaluateExpressions(e,t){vl(e);let n=this.inlineCompiler,s=(a,o)=>n?n.compileExpression(e,a,o)(t):null,i={...t};for(let[a,o]of ye(e.getAttr()))Se(o)&&Object.hasOwn(i,a)&&(i[a]=s(a,o));return Se(e.value)&&this.#t.set(e,s("",e.value)),i}expressionValue(e,t){return Se(e.value)?this.#t.get(e)??null:t}restoreNativeAttributes(e,t){let n=this.#e.get(e);return n?(this.#e.delete(e),{...t,...cr(n)}):t}adaptAttrs(e){let{_meta:t,...n}=e,s=`${this.builder.constructor._name}_`,i=this.builder.constructor.dialectPrefixes,a={},o={};for(let[u,l]of Object.entries(mt(n))){if(l==null)continue;if(u.startsWith(s))throw new Error(`${u}: the attribute prefix '${s}' is not accepted; use the prefix '${i[0]}'`);let c=i.find(d=>u.startsWith(d));c?a[u.slice(c.length)]=l:o[u]=l}return Qr({...super.adaptAttrs(o),...a})}renderedItem(e,t,n,s={}){let i;[t,i]=en(this.expressionValue(e,t),this.restoreNativeAttributes(e,n));let{_text:a,...o}=i;Array.isArray(t)&&a!=null&&(t=[this._escapeText(ur(a)),...t]);let u=e.parentNode?._getMeta("subbuilder")==="html"?{xmlns:Ee,...o}:o;return super.renderedItem(e,t,u,s)}finalize(e,t=null,n={}){if(!n.doctype)return super.finalize(e,t,n);let s=this._composeStringFragments(e),i=this.builder.source.getNodes().filter(a=>!a._getMeta("data_element"));return i.length===1&&i[0].nodeTag==="html"||(s=`<html>${s}</html>`),super.finalize(`<!doctype html>${s}`,t,n)}};var El={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"binding",version:null,title:"Gramlot binding",description:"Data-elements of Gramlot 0.2.0 with the signatures of decision P18; loaded after the HTML grammar."},abstracts:{},elements:{dataSetter:{doc:"Initial Data value, written literally at destination_path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!0,default:null},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:"Computed Data value written at result_path; formula is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"formula",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:"Side effects on Data; script is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"script",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataRpc:{doc:"Server endpoint called through gramlot.rpc; the value is written at result_path when given.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"method",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"timeout",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"int"},{kind:"type",module:"builtins",name:"float"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Mp="data is forbidden: write dataSetter for a Data value or html_data for the HTML5 <data> element",$p=new Set(["dataremote"]),Lp=new Set(["serverpath","dbenv","shared_id","remote","_ask","ask"]),Fp=["subscribe_","selfsubscribe_","formsubscribe_"],Up={dataSetter:"destination_path",dataFormula:"result_path",dataRpc:"result_path"},Pp={dataFormula:"formula",dataController:"script"};function kl(r,e){let t=Up[r];if(t&&String(e[t]??"").includes("?"))return`'${t}' does not accept '?attr': '${e[t]}'`;let n=Pp[r];return n&&e[n]!=null&&e.func!=null?`'func' and '${n}' cannot be declared on the same node`:n&&e._if!=null&&e.func!=null?"'_if' is inline and cannot be declared with 'func': write the condition in the method":null}function Al(r){return Object.keys(r).find(e=>Lp.has(e)||Fp.some(t=>e.startsWith(t)))}var Qe=class r extends pt{static _name="gramlot";static _sourceClass=se;static{this.defineGrammar(El)}static get dialectPrefixes(){let e=[];for(let t=Object.getPrototypeOf(r);t&&t!==Function.prototype;t=Object.getPrototypeOf(t))Object.hasOwn(t,"_name")&&t._name&&e.push(`${t._name}_`);return e}constructor(e=null,{collections:t=[]}={}){super(e),this._binding=null;for(let n of t)this.loadCollection(n)}get binding(){return this._binding}set binding(e){this._binding=e}nodeById(e){if(!this.binding)return super.nodeById(e);let t=this.binding.nodeIds.get(e);if(!t)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}loadCollection(e){return this.loadGrammar(e),this}schemaTag(e){let t=e.toLowerCase(),n=r.dialectPrefixes;if(t.startsWith(`${r._name}_`))throw new Error(`${e}: the tag prefix '${r._name}_' is not accepted; use the prefix '${n[0]}'`);if($p.has(t))throw new Error(`${e}: excluded from Gramlot 0.2.0`);let s=this.schemaTagNames[t];if(s)return s;for(let i of n)if(t.startsWith(i)&&this.schemaTagNames[t.slice(i.length)])return t;return null}bagCall(e,t,n,s){return super.bagCall(e,this.#e(t),n,s)}commandOnNode(e,t,n,s){return super.commandOnNode(e,this.#e(t),n,s)}validateNodeValues(e,t,n={}){let s=Al(n);if(s)throw new Error(`${e}: attribute '${s}' is excluded from Gramlot 0.2.0`);let i=kl(e,n);if(i)throw new Error(`${e}: ${i}`);return super.validateNodeValues(e,t,n)}validateNode(e,t={}){let n=Al(t.attrs??e.getAttr());if(n)throw new Error(`${e.nodeTag} '${e.label}': attribute '${n}' is excluded from Gramlot 0.2.0`);let s=kl(e.nodeTag,t.attrs??e.getAttr());if(s)throw new Error(`${e.nodeTag} '${e.label}': ${s}`);return super.validateNode(e,t)}setChild(e,t,n,s,i=null){let o=t==="dataSetter"&&s?.value!==null&&typeof s?.value=="object"&&Object.getPrototypeOf(s.value)===Object.prototype?{...s,value:new P(s.value)}:s;return super.setChild(e,t,n,o,i)}#e(e){if(e==="data")throw new Error(Mp);if(this.schemaTagNames[e.toLowerCase()]===e)return e;let t=r.dialectPrefixes.find(n=>e.startsWith(n));return this.schemaTagNames[e.slice(t.length)]}get renderer_html(){return new It(this)}create(){this.setup(this.data),this.main(this.root)}computeLogic(){}promoteNodeValue(e,t,n){let s=t!=null?{_text:t}:null;e.setValue(n,!0,s,!0)}reference(e,t="node"){if(e=Ie(e),!(e instanceof Ve)||!["node","dom"].includes(t))throw new TypeError("Reference requires an element and node/dom kind");let n=e.getAttr("__ref");return n==null&&(n=crypto.randomUUID().replaceAll("-",""),e.setAttr({__ref:n})),{$gramlotRef:n,kind:t}}toTytx(){return le(this.source)}};var qp=new Set(["input","select","textarea"]),jp=["type","multiple","group"];function Dl(r,e){let t=r.getAttr(e);return r.pointerType(t)?r.getRelativeData(t):t}var me=class r{static liveWrites=!1;static writesDefault=!0;#e;#t;#r=!1;#s=!1;#n=!1;static for(e,t){let n=r.classFor(t.element,t.attrs);return n?new n(e,t):null}static classFor(e,t){if(e.namespaceURI!==Ee)return null;if(e.localName==="textarea")return He;if(e.localName==="select")return rn;if(e.localName!=="input")return null;let n=t.type==null?"text":String(t.type).toLowerCase();return Object.hasOwn(xl,n)?xl[n]:He}static shape(e,t){return e?.namespaceURI!==Ee||!qp.has(e.localName)?null:JSON.stringify(jp.map(n=>t[n]??null))}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get element(){return this.#t.element}get node(){return this.binding.node}get resolved(){return this.#t.resolved}get live(){return!!this.resolved.live}get writeEvent(){return this.constructor.liveWrites&&this.live?"input":"change"}project(e,t){if(this.#s){this.#n=!0;return}this.#r&&this.same(this.read(),e)||(this.constructor.writesDefault&&!this.node.pointerType(this.node.getAttr("value"))&&this.writeDefault(e),this.write(e))}read(){return this.element.value}write(e){let t=e==null?"":String(e);this.element.value!==t&&(this.element.value=t)}writeDefault(e){let t=e==null?"":String(e);this.element.localName==="textarea"?this.#t.text.data!==t&&(this.#t.text.data=t):this.element.defaultValue!==t&&(this.element.defaultValue=t)}same(e,t){return Object.is(e,t)}commit(e){if(this.binding.closed)return;let t=this.node.getAttr("value");if(this.node.pointerType(t)==="^"){this.#r=!0;try{this.node.setRelativeData(t.slice(1),this.read())}finally{this.#r=!1}}}attach(){for(let e of["input","change","compositionstart","compositionend"])this.element.addEventListener(e,this)}detach(){for(let e of["input","change","compositionstart","compositionend"])this.element.removeEventListener(e,this);this.#n=!1}refresh(){}handleEvent(e){if(!this.binding.closed){if(e.type==="compositionstart"){this.#s=!0;return}if(e.type==="compositionend"){this.#s=!1,this.writeEvent==="input"&&this.commit(e),this.#n&&(this.#n=!1,this.binding.runtime.renderer.project(this.node));return}this.#s||e.isComposing||e.type===this.writeEvent&&this.commit(e)}}},He=class extends me{static liveWrites=!0},xi=class extends me{static liveWrites=!0;read(){return this.element.value===""?null:Number(this.element.value)}commit(e){this.element.validity.badInput||super.commit(e)}},Si=class extends me{static liveWrites=!0;read(){return Number(this.element.value)}},rn=class extends me{static writesDefault=!1;read(){return this.element.multiple?[...this.element.selectedOptions].map(e=>e.value):this.element.selectedIndex===-1?null:this.element.value}write(e){let t=this.element;if(t.multiple){if(e!=null&&!Array.isArray(e))throw new TypeError(`${this.node.nodeTag} '${this.node.label}': a multiple select requires an array`);let n=new Set((e??[]).map(String));for(let s of t.options){let i=n.has(s.value);s.selected!==i&&(s.selected=i)}}else e==null?t.selectedIndex!==-1&&(t.selectedIndex=-1):(t.selectedIndex===-1||t.value!==String(e))&&(t.value=String(e))}same(e,t){return Array.isArray(e)?Array.isArray(t)&&t.length===e.length&&t.every((n,s)=>Object.is(n,e[s])):super.same(e,t)}},Rt=class extends me{read(){return this.element.value===""?null:this.element.value}},Ni=class extends me{},us=class extends me{static writesDefault=!1;read(){return this.element.checked}write(e){let t=!!e;this.element.checked!==t&&(this.element.checked=t)}same(e,t){return e===!!t}attach(){let e=this.node;if(e.getAttr("checked")!=null&&e.pointerType(e.getAttr("value"))==="^")throw new TypeError(`${e.nodeTag} '${e.label}': checked and a ^ value are two sources`);super.attach()}},Ci=class extends us{#e=null;#t=!1;get groups(){return this.binding.runtime.renderer.radioGroups}attach(){let e=this.node,t=this.resolved.group??null,n=Tl(e);if(t!=null){if(e.getAttr("name")!=null)throw new TypeError(`${e.nodeTag} '${e.label}': name and group are two names`);this.#r(t,n)}super.attach(),t!=null&&(this.#e=this.groups.join(this,t,n),this.element.setAttribute("name",this.#e))}detach(){this.#e!==null&&(this.groups.leave(this),this.element.removeAttribute("name"),this.#e=null),super.detach()}refresh(){if(this.#e===null)return;let e=this.resolved.group,t=Tl(this.node);this.groups.nameOf(e,t)!==this.#e&&(this.#r(e,t),this.groups.leave(this),this.#e=this.groups.join(this,e,t),this.element.setAttribute("name",this.#e))}#r(e,t){let n=this.node;if(Dl(n,"value")&&this.groups.peersOf(e,t).some(s=>!s.binding.closed&&s.read()))throw new Error(`${n.nodeTag} '${n.label}': several true values in radio group '${e}'`)}project(e,t){let n=!this.#t;this.#t=!0;let s=this.read();super.project(e,t),!n&&!s&&this.read()&&this.turnOffPeers()}commit(e){let t=this.read();super.commit(e),t&&!this.binding.closed&&this.turnOffPeers()}turnOffPeers(){if(this.#e!==null)for(let e of this.groups.peers(this)){if(this.binding.closed)return;e.binding.closed||(e.element.checked&&(e.element.checked=!1),Dl(e.node,"value")&&e.commit(null))}}},cs=class{#e;#t=new Map;#r=new Map;#s=new WeakMap;#n=0;constructor(e){this.#e=e}join(e,t,n){let s=this.nameOf(t,n);return this.#t.has(s)||this.#t.set(s,new Set),this.#t.get(s).add(e),this.#r.set(e,s),s}leave(e){let t=this.#r.get(e);this.#r.delete(e);let n=this.#t.get(t);n?.delete(e),n?.size===0&&this.#t.delete(t)}peers(e){let t=this.#r.get(e);return[...this.#t.get(t)??[]].filter(n=>n!==e)}peersOf(e,t){return[...this.#t.get(this.nameOf(e,t))??[]]}nameOf(e,t){t!==null&&!this.#s.has(t)&&this.#s.set(t,this.#n++);let n=t===null?"page":`form${this.#s.get(t)}`;return`gramlot-${this.#e.instanceId}-${n}-${e}`}};function Tl(r){for(let e=r;e;e=e.parentNode){let t=e.getAttr()??{};if(t.formId!=null||t.form===!0)return e}return null}var xl={text:He,password:He,email:He,url:He,tel:He,search:He,number:xi,range:Si,color:Ni,date:Rt,time:Rt,month:Rt,week:Rt,"datetime-local":Rt,checkbox:us,radio:Ci,hidden:null,file:null,button:null,submit:null,reset:null,image:null};var Oi=Symbol("source text"),Sl={xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Vp=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formNoValidate","hidden","inert","isMap","itemscope","loop","multiple","muted","noModule","noValidate","open","playsInline","readOnly","required","reversed","selected"]),Hp=new Set(["checked","muted","selected","value"]),zp=new Map([["allowfullscreen","allowFullscreen"],["formnovalidate","formNoValidate"],["ismap","isMap"],["nomodule","noModule"],["novalidate","noValidate"],["playsinline","playsInline"],["readonly","readOnly"]]);function Gp(r){let e=r.replace(/-([a-z])/g,(t,n)=>n.toUpperCase());return zp.get(e.toLowerCase())??e}var ds=class{constructor({metadataAttributes:e=[]}={}){this.metadataAttributes=new Set([...Tt,"_text",...e])}definition(e){let t=e.builder,s={...t.schema[t.schemaTag(e.nodeTag)]._meta,...e.getAttr("_meta")},i=Wr(e.nodeTag,{renderTag:s.render_tag,ns:e.getAttr("ns"),dialectName:t.constructor._name}),a=i==="foreignObject"?Kr:s.render_attributes?.xmlns??e.getAttr("xmlns")??(t instanceof ht?Kr:Ee);return{meta:s,namespace:a,tag:i}}validate(e,t=e.builder){let n=e.value instanceof D,s=n?e.getAttr("_text"):e.value;if(s!=null&&!["string","number","boolean"].includes(typeof s))throw new TypeError("HTML text must be scalar");for(let[o,u]of Object.entries(e.attr))if(!this.metadataAttributes.has(o)&&u!=null&&!["string","number","boolean"].includes(typeof u))throw new TypeError(`HTML attribute ${o} must be scalar`);let i=Object.fromEntries(Object.entries(e.attr).filter(([o])=>!this.metadataAttributes.has(o))),a=n?e.value.getNodes().map(o=>o.nodeTag).filter(Boolean):[];t.validateNode(e,{value:s,attrs:i,childTags:a})}create(e,t,n=null,s=e.attr,i=null){let{tag:a,namespace:o,meta:u}=this.definition(e);n??=a;let l=o===Ee?t.createElement(n):t.createElementNS(o,n),c=t.createTextNode(this.text(e));(o!==Ee||!u.void)&&l.append(c);let d={element:l,text:c,tag:n};return this.update(d,e,s,Oi,i),d}matches(e,t){let{tag:n,namespace:s}=this.definition(t);return(s===Ee?e.tag.toLowerCase()===n.toLowerCase():e.tag===n)&&e.element.namespaceURI===s}compose(e,t,n){e.text.data=t??"";for(let s of n)e.element.append(s)}update(e,t,n=t.attr,s=Oi,i=null){let{element:a,text:o}=e,u=a.namespaceURI===Ee,l=this.definition(t).meta.render_attributes??{},c=e.attrs??{};n=Object.fromEntries(ye({...n,...l}));let d=me.classFor(a,n)!==null;s===Oi&&(s=this.text(t));let f=s==null?"":String(s);o.data!==f&&(o.data=f);let p=[...new Set([...Object.keys(c),...Object.keys(n)])];p.sort((h,m)=>(m==="sandbox")-(h==="sandbox"));for(let h of p){if(this.metadataAttributes.has(h)||d&&h==="value")continue;let m=n[h],g=h,b=Gp(g),v=u&&Vp.has(b)&&typeof a[b]=="boolean",w=g==="xmlns"?"xmlns":g.includes(":")?g.split(":")[0]:"",k=Object.hasOwn(Sl,w)?Sl[w]:null;if(Object.is(c[h],m)||(m==null||v&&!m?k?a.removeAttributeNS(k,g.split(":").at(-1)):a.removeAttribute(g):k?a.setAttributeNS(k,g,String(m)):a.setAttribute(g,v?"":String(m))),u&&(v||Hp.has(b))&&b in a){let I=b==="value"?m==null?"":String(m):!!m;a[b]!==I&&(a[b]=I)}}i===!1?a.style.visibility!=="hidden"&&(a.style.visibility="hidden"):e.visible===!1&&(n.style==null?a.removeAttribute("style"):a.setAttribute("style",String(n.style))),e.visible=i,e.attrs=n}text(e){return e.value instanceof D?e.getAttr("_text")==null?"":String(e.attr._text):e.value==null?"":String(e.value)}};var fs=class r{#e;#t;static for(e,t){let n=t.element;return n?.namespaceURI!==Ee||n.localName!=="button"?null:new r(e,t)}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get controllers(){let e=this.node.value;return e?.getNodes?e.getNodes().filter(t=>t.nodeTag==="dataController"||t.nodeTag==="dataRpc"):[]}get mechanism(){let e=this.node,t=this.controllers;if(t.length>1)throw new Error(`${e.nodeTag} '${e.label}': several dataController or dataRpc children; a button has one click mechanism`);let n=e.getAttr()??{},s=[];if(t.length&&s.push("controller"),n.action!=null&&s.push("action"),Nl(n).length&&s.push("fire"),s.length>1)throw new Error(`${e.nodeTag} '${e.label}': ${s.join(" and ")} together; a button has one click mechanism`);return s[0]??null}attach(){this.refresh(),this.element.addEventListener("click",this)}refresh(){this.mechanism&&this.node.getAttr("type")==null&&this.element.getAttribute("type")!=="button"&&this.element.setAttribute("type","button")}detach(){this.element.removeEventListener("click",this)}handleEvent(e){this.onClick(e)}onClick(e){if(this.binding.closed)return;let t=this.mechanism;if(!t||(e.stopPropagation(),this.element.disabled))return;let n=this.binding.countClick(),s=this.node,i=Wp(e);if(t==="controller")this.binding.runtime.bindingFor(this.controllers[0])?.providers[0]?.invoke({kind:"click",event:e,counter:n});else if(t==="action"){let[,a]=s.builder.runtimeValues(s),o={...a,event:e,_counter:n,modifiers:i};this.binding.runtime.inlineCompiler.compile(s,"action",s.getAttr("action"),Object.keys(o))(o)}else{let a={modifier:i,_counter:n},o=s.getAttr("fire");if(o!=null){s.FIRE(o,i||!0,a);return}for(let[u,l]of Nl(s.getAttr())){if(this.binding.closed)return;s.FIRE(l,u.slice(5),a)}}}};function Nl(r){return Object.entries(r??{}).filter(([e,t])=>t!=null&&(e==="fire"||e.startsWith("fire_")))}function Wp(r){return["shift","ctrl","alt","meta"].filter(e=>r[`${e}Key`]).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}var ps="connect_on",Xp=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/,nn=class{#e;#t;#r;#s;#n;static declared(e){return Object.entries(e.getAttr()??{}).filter(([t,n])=>t.startsWith(ps)&&t.length>ps.length&&n!=null).map(([t,n])=>[t,t.slice(ps.length).toLowerCase(),n])}constructor(e,t,n,s,i=`${ps}${n}`){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get eventName(){return this.#r}get handler(){return this.#s}get attribute(){return this.#n}attach(){this.element.addEventListener(this.eventName,this)}detach(){this.element.removeEventListener(this.eventName,this)}handleEvent(e){if(this.binding.closed)return;let t=this.node,n=this.binding.runtime;if(Xp.test(this.handler)){let{group:s,method:i}=n.logicRegistry.resolve(this.handler,t);i.call(s,t,e);return}n.inlineCompiler.compile(t,this.attribute,this.handler,["event"])({event:e})}};var sn=class{constructor(e=null){this.entries=new Map,this.sourceRoot=e}validate(e,t=new Set){let n=new Map,s=i=>{for(let a of i.getNodes()){let o=a.getAttr("__ref");if(o){if(n.has(o))throw new Error("Duplicate Source reference");let u=this.entries.get(o);if(e!==this.sourceRoot&&u&&u.node!==a&&!t.has(u.node))throw new Error("Duplicate Source reference");n.set(o,a)}a.value instanceof D&&s(a.value)}};s(e)}register(e,t){let n=e.getAttr("__ref");if(n){if(this.entries.has(n))throw new Error(`Duplicate Source reference: ${n}`);this.entries.set(n,{node:e,dom:t})}}remove(e){for(let[t,n]of this.entries)n.node===e&&this.entries.delete(t)}resolve(e){if(!e||!["node","dom"].includes(e.kind))throw new TypeError("Expected a node or DOM reference");let t=this.entries.get(e.$gramlotRef);if(!t)throw new Error("Source reference is not mounted");return t[e.kind]}};var Yp="_root_",hs=class{constructor(e=null,t=null){this.parent=e,this.segment=t,this.children=new Map,this.registrations=new Set}},Bi=class{#e;#t;#r;#s;#n;#i=!0;constructor(e,{path:t,attr:n,recipient:s,order:i}){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get router(){return this.#e}get path(){return this.#t}get attr(){return this.#r}get recipient(){return this.#s}get active(){return this.#i}get order(){return this.#n}close(){this.active&&(this.#i=!1,this.router.unregister(this))}},Ii=class{constructor({evt:e,node:t,path:n,oldvalue:s,attrsDiff:i,reason:a,fired:o,level:u,registration:l}){this.evt=e,this.node=t,this.path=n,this.oldvalue=s,this.attrsDiff=i,this.reason=a,this.fired=o,this.level=u,this.registration=l}},ms=class{#e;#t=new hs;#r=new Map;#s=0;#n=0;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return this.#s}register({path:e,attr:t=null,recipient:n}){if(typeof e!="string"||e==="")throw new TypeError(`A Data registration requires a path: ${e}`);let s=this.#t;for(let a of e.split(".")){let o=s.children.get(a);o||(o=new hs(s,a),s.children.set(a,o)),s=o}this.#n+=1;let i=new Bi(this,{path:e,attr:t,recipient:n,order:this.#n});return s.registrations.add(i),this.#r.set(i,s),this.#s+=1,i}unregister(e){let t=this.#r.get(e);if(t)for(this.#r.delete(e),t.registrations.delete(e),this.#s-=1;t.parent&&!t.children.size&&!t.registrations.size;)t.parent.children.delete(t.segment),t=t.parent}deliver(e){let{pathlist:t}=e;if(!t?.length||t[0]!==Yp||e.reason==="autocreate")return;let n=t.slice(1),s=e.evt==="ins"||e.evt==="del";for(let i of Array.isArray(e.node)?e.node:[e.node]){let a=s?[...n,i.label]:n,o=a.join(".");for(let[u,l]of this.#i(a,e))u.active&&u.recipient.receive(new Ii({evt:e.evt,node:i,path:o,oldvalue:e.oldvalue??null,attrsDiff:e.attrs_diff??null,reason:e.reason??null,fired:e.fired??!1,level:l,registration:u}))}}#i(e,t){let n=[],s=this.#t;for(let a of e){for(let o of s.registrations)s!==this.#t&&this.#a(o,"child",t)&&n.push([o,"child"]);if(s=s.children.get(a),!s)return n.sort(([o],[u])=>o.order-u.order)}for(let a of s.registrations)this.#a(a,"node",t)&&n.push([a,"node"]);let i=[...s.children.values()];for(;i.length;){let a=i.pop();for(let o of a.registrations)this.#a(o,"container",t)&&n.push([o,"container"]);i.push(...a.children.values())}return n.sort(([a],[o])=>a.order-o.order)}#a(e,t,n){let{evt:s}=n;return e.attr===null?s==="upd_attrs"?!1:!(t==="child"&&n.fired):t==="child"?!1:t==="container"?s!=="upd_attrs":s==="ins"||s==="del"?!0:Object.hasOwn(n.attrs_diff??{},e.attr)}};var gs=class{#e;constructor(e){this.#e=e}get runtime(){return this.#e}install(e){let t=an(e),n=this.setterNodes(e);Ri(e);for(let s of n){let i=this.runtime.openBinding(s);i.hasStamp("installed")||(this.applySetter(s),i.stamp("installed"))}this.applyDefaults(t.filter(s=>s.nodeTag&&!s._getMeta("data_element")))}setterNodes(e){return an(e).filter(t=>t.nodeTag==="dataSetter")}applySetter(e){let t=e.absDatapath(e.pathAttribute("destination_path"));if(t===null)return;let n=e.getAttr("value")??null,s=Jp(e.getAttr()),i=this.runtime.data;if(n!==null)i.setItem(t,n,s,">",!1,!0,e),n instanceof P&&e.setAttr({value:null},!1);else{let a=i.getNode(t);a?s&&a.setAttr(s,!0):i.setItem(t,null,s,">",!1,!0,e)}}applyDefaults(e){for(let t of e){let n=t.getAttr();for(let[s,i]of Object.entries(n)){if(!Zp(t,s,i))continue;let a=s==="value"?n.default_value??n.default:n[`default_${s}`];a!=null&&this.#t(t,i,a)}this.#r(t,n)}}#t(e,t,n){let s=e.absDatapath(t);if(s===null)return;let[i,a=null]=s.split("?",2),o=this.runtime.data,u=o.getNode(i);if(a===null){if(u&&u.value!==null&&u.value!==void 0)return;o.setItem(i,n,null,">",!1,!0,e)}else if(u){let l=u.getAttr(a);l==null&&u.setAttr({[a]:n},!0)}else o.setItem(i,null,{[a]:n},">",!1,!0,e)}#r(e,t){let n={};for(let[a,o]of Object.entries(t))a.startsWith("attr_")&&(n[a.slice(5)]=e.pointerType(o)?e.getRelativeData(o):o);if(!Object.keys(n).length)return;let s=[t.value,t.src].find(a=>e.pointerType(a));if(!s)return;let i=e.absDatapath(s);i!==null&&this.runtime.data.getNode(i.split("?",1)[0])?.setAttr(n,!0,!0,!1)}};function Zp(r,e,t){return e==="_meta"||Tt.has(e)||e==="default"||e.startsWith("default_")||e.startsWith("attr_")||e.endsWith("_path")?!1:r.pointerType(t)!==null}function Jp(r){let e={};for(let[t,n]of Object.entries(mt(r??{})))Tt.has(t)||t.startsWith("_")||t==="destination_path"||t==="value"||n!=null&&(e[t]=n);return Object.keys(e).length?e:null}function Kp(r){let e=r.builder;if(!(e instanceof Qe))throw new Error(`dataSetter '${r.label}': dataSetter is not supported inside ${e.constructor._name}`)}function Ri(r){for(let e of an(r))e.nodeTag==="dataSetter"&&Kp(e),nh(e)}var Qp=["_init","_onStart","_onBuilt","_delay","_timing","_userChanges"],eh=new Set(["dataFormula","dataController","dataRpc"]),th=["_onCalling","_onResult","_onError"],rh=["_init","_onBuilt","_onStart"];function nh(r){let e=n=>r.getAttr(n)!==null&&r.getAttr(n)!==void 0;if(r.nodeTag!=="dataRpc"){let n=th.find(e);if(n)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${n}' is allowed only on dataRpc`)}if(eh.has(r.nodeTag)){let n=Object.entries(r.getAttr()).find(([,s])=>Se(s));if(n)throw new Error(`${r.nodeTag} '${r.label}': '${n[0]}' is a == expression, not accepted on ${r.nodeTag}`);for(let s of rh){let i=r.getAttr(s);if(!(i==null||typeof i=="boolean"||typeof i=="number"))throw new Error(`${r.nodeTag} '${r.label}': '${s}' accepts true, false, null or a number, not ${JSON.stringify(i)}`)}return}let t=Qp.find(e);if(t)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${t}' is allowed only on dataFormula, dataController and dataRpc`)}function an(r){if(r instanceof D)return r.getNodes().flatMap(t=>an(t));let e=[r];return r.value instanceof D&&e.push(...an(r.value)),e}var sh=new Set(["destination_path","result_path","func","formula","script","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges","method","timeout","_onCalling","_onResult","_onError"]),on=class{#e;#t=[];#r=null;#s=null;#n=null;#i=null;constructor(e){this.#e=e,e.track(()=>{this.cancel(),this.#c()})}get binding(){return this.#e}get node(){return this.binding.node}get kind(){throw new Error("Provider.kind is defined by FormulaProvider, ControllerProvider and RpcProvider")}register(){let e=this.node,t=e.getAttr("_onStart");if(typeof t=="number"&&!(Number.isFinite(t)&&t>=0))throw new Error(`${e.nodeTag} '${e.label}': _onStart must be true or a delay in ms not below 0: ${t}`);this.#c();let n=this.binding.runtime.router;for(let[s,i]of e.pointers()){if(s==="datapath")continue;let a=e.absDatapath(i);if(a===null)continue;let[o,u=null]=a.split("?",2),l=n.register({path:o,attr:u,recipient:this});this.#t.push(l),s==="_timing"&&(this.#r=l)}this.#a()}receive(e){if(e.registration===this.#r){this.#a();return}if(this.#l("_userChanges")&&e.level!=="node")return;let t={kind:"data",change:e},n=this.#l("_delay");n>0?this.#u(t,n):this.invoke(t)}invoke(e){if(this.binding.closed)return;let t=this.node,n=this.kind==="formula",s=this.kind==="rpc",i=this.readArguments(e),[a,o]=[n?"formula":"script",t.getAttr(n?"formula":"script")],u=t.getAttr("_if");if(u&&!this.#o("_if",u,`return (${u})`,i,!1)){if([a,o]=["_else",t.getAttr("_else")],!o)return;if(s){this.#o(a,o,o,i,!0);return}}if(s)return this.#f(i);let l=t.getAttr("func"),c;if(o)c=this.#o(a,o,n?`return ${o}`:o,i,!0);else if(l==null){if(!n)return;c=new P(Mi(i))}else{let{group:d,method:f}=this.binding.runtime.logicRegistry.resolve(l,t);c=n?f.call(d,i):f.call(d,t,i)}n&&t.setRelativeData(t.pathAttribute("result_path"),c)}readArguments(e){let t=this.node,[,n]=t.builder.runtimeValues(t),s={};for(let[o,u]of Object.entries(n))sh.has(o)||(s[o]=u);let i=e.change??null,a=i?i.level:e.kind;return s._node=i?i.node:null,s._triggerpars={kw:i,trigger_reason:a},s._reason=a,e.kind==="click"&&Object.assign(s,ih(e)),s}cancel(){this.#n?.(),this.#s?.()}#a(){this.#s?.();let e=this.#l("_timing");if(!(e>0))return;let t=setInterval(()=>this.invoke({kind:"timing",change:null}),e*1e3),n=this.binding.track(()=>clearInterval(t));this.#s=()=>{clearInterval(t),n(),this.#s=null}}#u(e,t){this.#n?.();let n=null,s=setTimeout(()=>{n(),this.#n=null,this.invoke(e)},t);n=this.binding.track(()=>clearTimeout(s)),this.#n=()=>{clearTimeout(s),n(),this.#n=null}}#l(e){let t=this.node,n=t.getAttr(e);return t.pointerType(n)?t.getRelativeData(n):n??null}#o(e,t,n,s,i){let a=[...i?["_kwargs"]:[],...Cl,...Ol,...Object.keys(Mi(s))];return this.binding.runtime.inlineCompiler.compile(this.node,e,t,a,n)({...s,_kwargs:s})}async#f(e){let t=this.node,[n,s,i]=["_onCalling","_onResult","_onError"].map(h=>t.getAttr(h));n&&this.#o("_onCalling",n,n,e,!0),this.#i?.abort();let a=new AbortController;this.#i=a;let o=this.binding.track(()=>a.abort()),u=this.#l("timeout"),l=u>0?setTimeout(()=>{let h=new Error(`${t.nodeTag} '${t.label}': no answer within ${u} ms`);h.name="TimeoutError",a.abort(h)},u):null,c=new Promise((h,m)=>{a.signal.addEventListener("abort",()=>m(a.signal.reason),{once:!0})}),d;try{let h=this.binding.runtime.gramlot.rpc.call("data",this.#l("method"),Mi(e),{signal:a.signal});d={result:await Promise.race([h,c])}}catch(h){d={error:h}}clearTimeout(l),o();let f=this.#i===a&&!this.binding.closed;if(this.#i===a&&(this.#i=null),!f)return;if("error"in d){if(!i)throw d.error;this.#o("_onError",i,i,{...e,error:d.error},!0);return}let{result:p}=d;t.getAttr("result_path")!=null&&t.setRelativeData(t.pathAttribute("result_path"),p),s&&this.#o("_onResult",s,s,{...e,result:p},!0)}#c(){for(let e of this.#t.splice(0))e.close();this.#r=null}},_s=class extends on{get kind(){return"formula"}},bs=class extends on{get kind(){return"controller"}},ws=class extends on{get kind(){return"rpc"}},Cl=["_node","_triggerpars","_reason"],Ol=["_evt","button_counter","button_shift","button_ctrl","button_alt","button_meta"];function Mi(r){let e={...r};for(let t of[...Cl,...Ol])delete e[t];return e}function ih({event:r,counter:e}){return{_evt:r,button_counter:e,button_shift:!!r.shiftKey,button_ctrl:!!r.ctrlKey,button_alt:!!r.altKey,button_meta:!!r.metaKey}}var ah=[[null,/(\W|^)GET (?:\s*)(\^?[\w.#@$?-]+)/g,"$1this.GET('$2')"],[/;SET/g,/(\W|^)SET (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.SET('$2', $3)$4 "],[/;PUT/g,/(\W|^)PUT (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.PUT('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE_AFTER('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE_AFTER('$2')$3 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE('$2', $3)$4 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE('$2')$3 "]],oh=/(\W|^)PUBLISH (?:\s*)(\^?[\w.#@$?-]+)/,lh=new Set(["arguments","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]),ys=class{#e;#t=new Map;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return[...this.#t.values()].reduce((e,t)=>e+t.size,0)}preprocess(e,t,n){let s=n.trim();if(oh.test(s))throw new Error(`${ln(e,t)}: the PUBLISH macro is excluded from Gramlot 0.2.0`);let i=s.replace(/\$(\d+)/g,(a,o)=>`arguments[${parseInt(o,10)-1}]`);for(let[a,o,u]of ah)a&&(i=i.replace(a,`; ${a.source.slice(1)}`)),i=i.replace(o,u);return i!==s&&console.warn(`${ln(e,t)}: legacy macros are deprecated; write this.GET(path), this.SET(path, value), this.PUT(path, value), this.FIRE(path, value), this.FIRE_AFTER(path, value) and arguments[n] in place of GET, SET, PUT, FIRE, FIRE_AFTER and $n`),i}compile(e,t,n,s,i=n){if(e.activatedCode(t)!==n)throw new Error(`${ln(e,t)}: inline code runs only as received with the Source (main or a remote Source); a text written later is not run: use named logic`);let a=this.#t.get(e);a||(a=new Map,this.#t.set(e,a),this.runtime.bindingFor(e).track(()=>this.release(e)));let o=a.get(t);o?.source!==i&&(o={source:i,text:this.preprocess(e,t,i),key:null,run:null},a.set(t,o));let u=s.filter(Bl),l=u.join(",");if(o.key!==l){let c=uh(e,t,o.text,u);o.key=l,o.run=d=>c.apply(e,u.map(f=>d[f]))}return o.run}compileExpression(e,t,n){let s=n.slice(2),i=ye(e.getAttr()).filter(([,o])=>!Se(o)),a=this.compile(e,t,n,i.map(([o])=>o),`return ${s}`);return o=>{let u={};for(let[l,c]of i)if(Object.hasOwn(o,l))u[l]=o[l];else if(lr(c).length){if(Bl(l)&&new RegExp(`(?<![\\w$])${l.replaceAll("$","\\$")}(?![\\w$])`).test(s))throw new Error(`${e.nodeTag} '${e.label}': '${t}' uses '${l}', a template consumed by another template, whose value is not available; write a dataFormula`)}else u[l]=e.pointerType(c)?e.getRelativeData(c):c;return a(u)}}release(e,t=null){if(t===null){this.#t.delete(e);return}let n=this.#t.get(e);if(n)for(let s of t){n.delete(s);for(let[i]of ye({[s]:null}))n.delete(i)}}};function Bl(r){return/^[A-Za-z_$][\w$]*$/.test(r)&&!lh.has(r)}function ln(r,e){return`${r.nodeTag} '${r.label}' ${e?`'${e}'`:"node value"}`}function uh(r,e,t,n){try{return t.startsWith("function")?new Function(`return (${t}
|
|
23
|
+
`:"";if(e._getMeta("void"))return`${b}<${s}${g}${i?"/":""}>${v}`;if(Array.isArray(t)){let k=this._composeStringFragments(t);return`${b}<${s}${g}>${v}${k}${b}</${s}>${v}`}if(t==null)return`${b}<${s}${g}></${s}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):bp.has(s)?String(t):this._escapeText(t);return`${b}<${s}${g}>${w}</${s}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let s=n.getAttr("locale");if(s==null)continue;let i=n.pointerType(s)?n.data.getItem(n.absDatapath(s)):s;if(i)return i}}adaptAttrs(e){let t={},n={};for(let[i,a]of Object.entries(e||{}))if(i.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(i)]=a;else if(i==="dtype")t.dtype=a;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>i.startsWith(o)))continue;this._isStyleContribution(i)?n[i]=a:t[i]=a}let s=this._adaptStyle(n);return s&&(t.style=s),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Jr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Jr.has(t)||yp(e)}_adaptStyle(e){let t=vp(e.style),n=new Map,s=new Map;for(let[i,a]of Object.entries(e))if(i!=="style")if(i.startsWith("style_"))t.set(i.slice(6).replaceAll("_","-"),ml(a));else if(Jr.has(i))n.set(i,a);else{let o=i.indexOf("_"),u=o<0?i:i.slice(0,o);o>=0&&Jr.has(u)?(s.has(u)||s.set(u,{}),s.get(u)[i.slice(o+1)]=a):t.set(i.replaceAll("_","-"),ml(a))}for(let i of Jr)(n.has(i)||s.has(i))&&this[`_macro_${i}`](n.get(i),s.get(i)||{},t);return[...t].map(([i,a])=>`${i}: ${a}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,s]of Object.entries(e||{}))wp.has(n)?s&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(s)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,t,n){let s=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[i,a]of Object.entries(t))if(i==="top"||i==="bottom")s[`${i}_left`]=a,s[`${i}_right`]=a;else if(i==="left"||i==="right")s[`top_${i}`]=a,s[`bottom_${i}`]=a;else if(["top_left","top_right","bottom_left","bottom_right"].includes(i))s[i]=a;else throw new TypeError(`rounded: unknown sub-kwarg '${i}'`);for(let[i,a]of Object.entries(s))n.set(`border-${i.replaceAll("_","-")}-radius`,is(a))}_macro_transform(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`rotate(${a}deg)`):i==="scale"||i==="translate"?s.push(`${i}(${a})`):i==="translate_x"?s.push(`translateX(${is(a)})`):i==="translate_y"?s.push(`translateY(${is(a)})`):i==="skew_x"?s.push(`skewX(${a}deg)`):i==="skew_y"?s.push(`skewY(${a}deg)`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("transform",s.join(" "))}_macro_filter(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`hue-rotate(${a}deg)`):i==="blur"?s.push(`blur(${is(a)})`):i==="drop_shadow"?s.push(`drop-shadow(${a})`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("filter",s.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[s,i]of Object.entries(t))n.set(`transition-${s.replaceAll("_","-")}`,String(i))}_macro_zoom(e,t,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,t,n){e!==void 0&&n.set("box-shadow",String(e));for(let[s,i]of Object.entries(t))n.set(`box-shadow-${s.replaceAll("_","-")}`,String(i))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var Ep=new Set(["alignment_baseline","baseline_shift","clip_path","clip_rule","color_interpolation","color_interpolation_filters","dominant_baseline","fill_opacity","fill_rule","flood_color","flood_opacity","font_family","font_size","font_size_adjust","font_stretch","font_style","font_variant","font_weight","glyph_orientation_horizontal","glyph_orientation_vertical","image_rendering","letter_spacing","lighting_color","marker_end","marker_mid","marker_start","overline_position","overline_thickness","paint_order","pointer_events","shape_rendering","stop_color","stop_opacity","strikethrough_position","strikethrough_thickness","stroke_dasharray","stroke_dashoffset","stroke_linecap","stroke_linejoin","stroke_miterlimit","stroke_opacity","stroke_width","text_anchor","text_decoration","text_rendering","underline_position","underline_thickness","unicode_bidi","word_spacing","writing_mode"]);function as(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[Ep.has(e)?e.replaceAll("_","-"):e,t]))}var Ot=class extends Nt{static mode="svg";adaptAttrs(e){return as(e)}};var gl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"html",version:null,title:null,description:null},abstracts:{},elements:{svg:{doc:"Switch to the SVG dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to SVG from this node down. No ``render_tag``: ``<svg>`` is\n emitted verbatim (HTML5 has a native ``<svg>`` tag).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"svg"}},a:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},abbr:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},address:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},area:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},article:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},aside:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},audio:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},b:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},base:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},bdi:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},bdo:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},blockquote:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},body:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},br:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},button:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},canvas:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},caption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},cite:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},code:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},col:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},colgroup:{doc:null,sub_tags:"col,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},data:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},datalist:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,option,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dd:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},del_:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},details:{doc:null,sub_tags:"summary[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dfn:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dialog:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},div:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dl:{doc:null,sub_tags:"dd,div,dt,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dt:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},em:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},embed:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},fieldset:{doc:null,sub_tags:"legend[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figcaption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figure:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figcaption[0:1],figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},footer:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},form:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h1:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h2:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h3:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h4:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h5:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h6:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},head:{doc:null,sub_tags:"base[0:1],link,meta,noscript,script,style,template,title[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},header:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hgroup:{doc:null,sub_tags:"h1,h2,h3,h4,h5,h6,p,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},html:{doc:null,sub_tags:"head[0:1],body[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},i:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},iframe:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},img:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},input:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},ins:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},kbd:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},label:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},legend:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},li:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},link:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},main:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},map:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mark:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},menu:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},meta:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},meter:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},nav:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},noscript:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},object:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ol:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},optgroup:{doc:null,sub_tags:"div,legend,noscript,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},option:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,div,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},output:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},p:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},picture:{doc:null,sub_tags:"img[0:1],script,source,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pre:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},progress:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},q:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rp:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rt:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ruby:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},s:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},samp:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},script:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},search:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},section:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},select:{doc:null,sub_tags:"button,div,hr,noscript,optgroup,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},slot:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},small:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},source:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},span:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},strong:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},style:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sub:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},summary:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sup:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},table:{doc:null,sub_tags:"caption[0:1],colgroup,script,tbody,template,tfoot[0:1],thead[0:1],tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tbody:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},td:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},template:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,del_,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,tr,track,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textarea:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tfoot:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},th:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},thead:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},time:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tr:{doc:null,sub_tags:"script,td,template,th",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},track:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},u:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ul:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},var:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},video:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},wbr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},selectedcontent:{doc:"Mirror of the selected option for Customizable Select (HTML 2024).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var pt=class extends he{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(gl)}get renderer_html(){return new Ct(this)}};he.registerBuilder(pt);var _l={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"svg",version:null,title:null,description:null},abstracts:{graphics:{doc:"SVG graphics content: any graphical element.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null},containerElement:{doc:"SVG container content: elements that can hold children.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null}},elements:{html:{doc:"Switch to the HTML dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to HTML from this node down. The source tag ``html`` is\n rendered as ``_meta['render_tag']`` (``<foreignObject>``) carrying\n ``_meta['render_attributes']`` (the SVG namespace). The immediate\n HTML child declares XHTML so both sides of the XML boundary retain\n their native namespace.\n ",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"html",render_tag:"foreignObject",render_attributes:{xmlns:"http://www.w3.org/2000/svg"}}},svg:{doc:"Root SVG container or nested SVG viewport.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},g:{doc:"Group container for applying transforms and styles.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},defs:{doc:"Container for referenced elements (gradients, patterns, etc.).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},symbol:{doc:"Reusable graphical template, rendered only when referenced by <use>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},use:{doc:"Reference and render a <symbol> or other element.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rect:{doc:"Rectangle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},circle:{doc:"Circle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ellipse:{doc:"Ellipse.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},line:{doc:"Line segment between two points.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polyline:{doc:"Open shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polygon:{doc:"Closed shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},path:{doc:"Arbitrary shape defined by path commands (d attribute).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},image:{doc:"Embedded raster image.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},text:{doc:"Text block. Contains text content and optional <tspan>/<textPath>.",sub_tags:"tspan,textPath",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tspan:{doc:"Inline text span within <text>.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textPath:{doc:"Text rendered along a path shape.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},linearGradient:{doc:"Linear gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},radialGradient:{doc:"Radial gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},stop:{doc:"Gradient stop (color and offset).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pattern:{doc:"Tile pattern definition. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},clipPath:{doc:"Clipping path definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mask:{doc:"Alpha mask definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},marker:{doc:"Marker symbol for line endpoints or vertices.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},filter:{doc:"Filter effect container. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feGaussianBlur:{doc:"Gaussian blur filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feOffset:{doc:"Offset filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feBlend:{doc:"Blend filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feColorMatrix:{doc:"Color matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feComposite:{doc:"Composite filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feFlood:{doc:"Flood fill filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMerge:{doc:"Merge filter primitive (container for feMergeNode).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMergeNode:{doc:"Single input for feMerge.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDropShadow:{doc:"Drop shadow filter primitive (SVG 2).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDiffuseLighting:{doc:"Diffuse lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpecularLighting:{doc:"Specular lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},fePointLight:{doc:"Point light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDistantLight:{doc:"Distant light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpotLight:{doc:"Spot light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMorphology:{doc:"Morphology filter primitive (erode/dilate).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTurbulence:{doc:"Turbulence noise filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDisplacementMap:{doc:"Displacement map filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feConvolveMatrix:{doc:"Convolution matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feImage:{doc:"Image filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTile:{doc:"Tile filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animate:{doc:"Animate an attribute over time.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateTransform:{doc:"Animate a transform attribute.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateMotion:{doc:"Animate motion along a path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},set:{doc:"Set an attribute to a value for a duration.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:"Accessible title (tooltip in browsers).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},desc:{doc:"Accessible description.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},metadata:{doc:"Metadata container (RDF, Dublin Core, etc.).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},a:{doc:"Hyperlink wrapper.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},foreignObject:{doc:"Container for non-SVG content (HTML, MathML).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},switch:{doc:"Conditional processing (renders first matching child).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var ht=class extends he{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(_l)}get renderer_svg(){return new Ot(this)}};he.registerBuilder(ht);var Re=class{constructor(e){this.gramlot=e}};var Dp={dataFormula:["formula","_if","_else"],dataController:["script","_if","_else"],dataRpc:["_if","_else","_onCalling","_onResult","_onError"],button:["action"]};function bl(r){return typeof r=="string"&&r.startsWith("==")}var Bt=class extends Ve{#e=new Set;#t=null;codeAttributes(){let e=Dp[this.nodeTag]??[],t=[];for(let[n,s]of Object.entries(this.getAttr()??{}))typeof s=="string"&&(e.includes(n)||n.startsWith("connect_on"))&&t.push([n,s]);for(let[n,s]of ye(this.getAttr()))bl(s)&&t.push([n,s]);return bl(this.staticValue)&&t.push(["",this.staticValue]),t}activateCode(){let e=new Map;for(let[t,n]of this.codeAttributes()){if(this.pointerType(n))throw new Error(`${this.nodeTag} '${this.label}': '${t}' is inline code and cannot be the pointer '${n}'; inline code is never read from Data`);e.set(t,n)}this.#t=e}activatedCode(e){return this.#t?.get(e)??null}pointerType(e){return typeof e=="string"&&e.startsWith("==")?null:super.pointerType(e)}pointers(){return super.pointers().filter(([e,t])=>!this.#n(e,t))}runtimeToEvaluate(){let e=super.runtimeToEvaluate();for(let[t,n]of e)this.pointerType(n)&&(this.#n(t,n)?e.set(t,n.slice(1)):this.absDatapath(n)===null&&e.set(t,null));return e}pathAttribute(e){let t=this.getAttr(e);return this.pointerType(t)&&this.#n(e,t)?t.slice(1):t}getRelativeData(e,t=null,n={}){return this.absDatapath(e)===null?null:super.getRelativeData(e,t,n)}setRelativeData(e,t,n={}){this.#i(e),super.setRelativeData(e,t,n)}PUT(e,t){this.#i(e),this.data.setItem(this.absDatapath(e),t,null,">",!1,!0,this,!1,!1)}FIRE(e,t=!0,n=null){t===null&&(t=!0),this.#i(e);let s=this.absDatapath(e);if(s.includes("?")){this.#r(s,t);return}this.data.getNode(s)?.setValue(null,!1);try{this.fireEvent(e,t,{attributes:n})}finally{this.data.getNode(s)?.setValue(null,!1)}}#r(e,t){let[n,s]=e.split("?",2),i=this.data;i.getNode(n)?.setAttr({[s]:null},!1);try{let a=i.getNode(n);a?a.setValue(a.staticValue,!0,{[s]:t},!0,!0,!0,!0):i.setItem(n,null,{[s]:t},">",!0,!0,!0,!0)}finally{i.getNode(n)?.setAttr({[s]:null},!1)}}FIRE_AFTER(e,t=!0,n=10){this.#i(e);let s=this.rootBuilder?.binding?.bindingFor(this)??null,i=null,a=setTimeout(()=>{i?.(),this.FIRE(e,t)},n);return i=s?.track(()=>clearTimeout(a))??null,()=>{clearTimeout(a),i?.()}}absDatapath(e){let t=this.pointerType(e)?e.slice(1):e;if(t.startsWith("#")&&t.includes("?")){let[n,s]=t.split("?",2),i=super.absDatapath(n);return i===null?null:`${i}?${s}`}return super.absDatapath(e)}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");if(this.pointerType(s)&&(s=this.#s(n,s),s===null))return null;if(s!=null&&(e=e==="."?s:s+e),e.startsWith("#"))return n.parentNode._resolveSymbolicDatapath(e,t);n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_finalizeAbsPath(e,t){return e===null?null:super._finalizeAbsPath(e,t)}_resolveSymbolicDatapath(e,t){let n=e.slice(1).split(".",1)[0];if(n==="FORM"||n==="ANCHOR")return super._resolveSymbolicDatapath(e,t);let s=this.rootBuilder?.binding;if(!s)return super._resolveSymbolicDatapath(e,t);let i=s.nodeIds.get(n);if(!i)throw new Error(`#<id>: cannot resolve ${t}`);let a=e.slice(n.length+2);return i.absDatapath(a?`.${a}`:".")}#s(e,t){let n=e.parentNode.absDatapath(t);if(n===null)return null;let s=this.data.getItem(n);return s==null||s===""?null:s}#n(e,t){return typeof e!="string"||!e.endsWith("_path")?!1:(this.#e.has(e)||(this.#e.add(e),console.warn(`${this.nodeTag} '${this.label}': '${e}' holds a bare Data path; the pointer symbol of '${t}' is removed`)),!0)}#i(e){if(this.absDatapath(e)===null)throw new Error(`${this.nodeTag} '${this.label}': write on a null path: '${e}'`)}},se=class r extends D{get nodeClass(){return Bt}authorizedCopy(e){let t=new this.constructor;for(let n of this.getNodes()){let s=n.getAttr("auth")??null;if(s!==null){if(typeof s!="string")throw new TypeError(`${n.nodeTag} '${n.label}': 'auth' must be a string rule, not ${typeof s}`);if(e(s)!==null)continue}let i=n.staticValue;i instanceof r&&(i=i.authorizedCopy(e));let{auth:a,...o}=n.getAttr(),u=t.setItem(n.label,i,o,">",!1,!1,null,!1,!0,null,n.nodeTag);u.xmlTag=n.xmlTag}return t}activateCode(){for(let e of this.getNodes())e.activateCode(),e.staticValue instanceof r&&e.staticValue.activateCode();return this}};if((xe(se.tytxSuffix).GramlotBuilderBag??se)!==se)throw new Error("TYTX subtype name 'GramlotBuilderBag' is already registered for another class");At(se.tytxSuffix,{...xe(se.tytxSuffix),GramlotBuilderBag:se});var Ee="http://www.w3.org/1999/xhtml",Kr="http://www.w3.org/2000/svg",Tp=new Set(["default","default_value","live","group","visible","action","fire","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges"]),xp=["default_","attr_","fire_","connect_on"],Sp={table:["width","border"],editor:["height"],embed:["width","height"],img:["width","height"],canvas:["width","height"]},Np=/(?<!\\)\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,Cp=["format","mask","locale","places","dtype"],Op=new Set(["href","src","formaction","xlink:href","xlink_href"]);function mt(r){return Object.fromEntries(Object.entries(r).filter(([e])=>!Tp.has(e)&&!xp.some(t=>e.startsWith(t))))}function os(r,e,t=[]){for(let[n,s]of Object.entries(cr(mt(e)))){let i=t.find(o=>n.startsWith(o)),a=i?n.slice(i.length):n;if(/^on./i.test(a))throw new Error(`${r.nodeTag} '${r.label}': '${n}' has the form of a native event handler, run by the browser outside Gramlot; write connect_${a} for an event, or rename the attribute`);if(Op.has(a.toLowerCase())&&Bp(s))throw new Error(`${r.nodeTag} '${r.label}': '${n}' holds a javascript: URL, run by the browser as code; write connect_onclick or the action of a button instead`)}}function Bp(r){return typeof r=="string"&&/^javascript:/i.test(r.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,""))}function wl(r,e,t=[]){if(r.nodeTag!=="iframe")return e;let n=u=>{let l=t.find(c=>u.startsWith(c))??"";return[l,u.slice(l.length).toLowerCase()]},s=Object.fromEntries(ye(r.getAttr())),i=[...Object.keys(s),...Object.keys(e)].find(u=>n(u)[1]==="srcdoc");if(i===void 0||Object.keys(s).some(u=>n(u)[1]==="sandbox"))return e;let a=(u,l)=>{let c=s[u];return l.add(u),r.pointerType(c)!==null||Se(c)||lr(c).some(d=>Object.hasOwn(s,d)&&!l.has(d)&&a(d,l))};if(r.pointerType(r.value)===null&&!(Object.hasOwn(s,i)&&a(i,new Set)))return e;let o=Object.fromEntries(Object.entries(e).filter(([u])=>n(u)[1]!=="sandbox"));return{[`${n(i)[0]}sandbox`]:"",...o}}function cr(r){return Object.fromEntries(Object.entries(r).filter(([,e])=>e!=null))}function Qr(r){return Object.fromEntries(Object.entries(r).map(([e,t])=>e.startsWith("xmlns_")?[`xmlns:${e.slice(6)}`,t]:e.startsWith("data_")||e.startsWith("aria_")?[e.replaceAll("_","-"),t]:[e,t]))}function ls(r){let{_meta:e,...t}=r;return Qr(cr(mt(t)))}function yl(r,e){let t=Sp[String(r).toLowerCase()]??[],n={},s={};for(let[i,a]of Object.entries(e))t.includes(i)?s[i]=a:n[i]=a;return[n,s]}function ur(r){return String(r)}function en(r,e){let t={...e},n=t.mask;for(let i of Cp)delete t[i];if(Array.isArray(r))return[r,t];if(typeof r=="boolean"&&(r=ur(r)),n==null)return[r,t];let s=r==null?"":ur(r);return[s===""?s:String(n).replaceAll("%s",()=>s),t]}function lr(r){return typeof r=="string"?[...r.matchAll(Np)].map(([,e])=>e):[]}function Se(r){return typeof r=="string"&&r.startsWith("==")}function vl(r){if(Se(r.value)&&lr(r.value).length)throw new Error(`${r.nodeTag} '${r.label}': the == node value contains a \${\u2026} template, not accepted in a == expression`);let e=Object.fromEntries(ye(r.getAttr()));for(let[t,n]of Object.entries(e)){if(Se(n)&&lr(n).length)throw new Error(`${r.nodeTag} '${r.label}': '${t}' contains a \${\u2026} template, not accepted in a == expression`);for(let s of lr(n))if(Se(e[s]))throw new Error(`${r.nodeTag} '${r.label}': the template of '${t}' uses '${s}', a == expression`)}}var Ip=new Set(["animate","animateMotion","animateTransform","circle","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","image","line","metadata","path","polygon","polyline","rect","set","stop","use"]),tn=class extends Ot{constructor(e,t){super(e),this._owner=t}get owner(){return this._owner}_handleMeta(e,t){let n=this.owner.evaluateExpressions(e,t);os(e,n);let[s,i]=super._handleMeta(e,n);return e._getMeta("subbuilder")?[s,as(ls(i))]:[s,i]}adaptAttrs(e){let{_meta:t,...n}=e;return Qr(super.adaptAttrs(cr(mt(n))))}renderedItem(e,t,n,s={}){if(this.owner.renderType==="object")return this.owner.renderedItem(e,t,n,s);let{_text:i,...a}=n;return t=this.owner.expressionValue(e,t),Array.isArray(t)&&i!=null&&(t=[this._escapeText(ur(i)),...t]),Ip.has(s.tag)?`${s.pretty?" ".repeat(this._nodeDepth(e,s.depthOffset??0)):""}<${s.tag}${this._formatAttrs(a)} />${s.pretty?`
|
|
24
|
+
`:""}`:super.renderedItem(e,t,a,s)}};var It=class extends Ct{#e=new WeakMap;#t=new WeakMap;get inlineCompiler(){return null}getRender(e){return this.renders.has(e)||(e instanceof pt?this.addRender(e,this):e instanceof ht&&this.addRender(e,new tn(e,this))),super.getRender(e)}render(e,t={}){return e._getMeta("data_element")?null:super.render(e,t)}_handleMeta(e,t){let n=this.builder.constructor.dialectPrefixes,s=this.evaluateExpressions(e,t);os(e,s,n);let[i,a]=super._handleMeta(e,wl(e,s,n));if(e._getMeta("subbuilder")){let l=ls(a);return e._getMeta("subbuilder")==="html"&&(l.xmlns=Kr),[i,l]}let[o,u]=yl(i,a);return Object.keys(u).length&&this.#e.set(e,u),[i,o]}evaluateExpressions(e,t){vl(e);let n=this.inlineCompiler,s=(a,o)=>n?n.compileExpression(e,a,o)(t):null,i={...t};for(let[a,o]of ye(e.getAttr()))Se(o)&&Object.hasOwn(i,a)&&(i[a]=s(a,o));return Se(e.value)&&this.#t.set(e,s("",e.value)),i}expressionValue(e,t){return Se(e.value)?this.#t.get(e)??null:t}restoreNativeAttributes(e,t){let n=this.#e.get(e);return n?(this.#e.delete(e),{...t,...cr(n)}):t}adaptAttrs(e){let{_meta:t,...n}=e,s=`${this.builder.constructor._name}_`,i=this.builder.constructor.dialectPrefixes,a={},o={};for(let[u,l]of Object.entries(mt(n))){if(l==null)continue;if(u.startsWith(s))throw new Error(`${u}: the attribute prefix '${s}' is not accepted; use the prefix '${i[0]}'`);let c=i.find(d=>u.startsWith(d));c?a[u.slice(c.length)]=l:o[u]=l}return Qr({...super.adaptAttrs(o),...a})}renderedItem(e,t,n,s={}){let i;[t,i]=en(this.expressionValue(e,t),this.restoreNativeAttributes(e,n));let{_text:a,...o}=i;Array.isArray(t)&&a!=null&&(t=[this._escapeText(ur(a)),...t]);let u=e.parentNode?._getMeta("subbuilder")==="html"?{xmlns:Ee,...o}:o;return super.renderedItem(e,t,u,s)}finalize(e,t=null,n={}){if(!n.doctype)return super.finalize(e,t,n);let s=this._composeStringFragments(e),i=this.builder.source.getNodes().filter(a=>!a._getMeta("data_element"));return i.length===1&&i[0].nodeTag==="html"||(s=`<html>${s}</html>`),super.finalize(`<!doctype html>${s}`,t,n)}};var El={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"binding",version:null,title:"Gramlot binding",description:"Data-elements of Gramlot 0.2.0 with the signatures of decision P18; loaded after the HTML grammar."},abstracts:{},elements:{dataSetter:{doc:"Initial Data value, written literally at destination_path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!0,default:null},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:"Computed Data value written at result_path; formula is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"formula",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:"Side effects on Data; script is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"script",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataRpc:{doc:"Server endpoint called through gramlot.rpc; the value is written at result_path when given.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"method",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"timeout",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"int"},{kind:"type",module:"builtins",name:"float"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Mp="data is forbidden: write dataSetter for a Data value or html_data for the HTML5 <data> element",$p=new Set(["dataremote"]),Lp=new Set(["serverpath","dbenv","shared_id","remote","_ask","ask"]),Fp=["subscribe_","selfsubscribe_","formsubscribe_"],Up={dataSetter:"destination_path",dataFormula:"result_path",dataRpc:"result_path"},Pp={dataFormula:"formula",dataController:"script"};function kl(r,e){let t=Up[r];if(t&&String(e[t]??"").includes("?"))return`'${t}' does not accept '?attr': '${e[t]}'`;let n=Pp[r];return n&&e[n]!=null&&e.func!=null?`'func' and '${n}' cannot be declared on the same node`:n&&e._if!=null&&e.func!=null?"'_if' is inline and cannot be declared with 'func': write the condition in the method":null}function Al(r){return Object.keys(r).find(e=>Lp.has(e)||Fp.some(t=>e.startsWith(t)))}var Qe=class r extends pt{static _name="gramlot";static _sourceClass=se;static{this.defineGrammar(El)}static get dialectPrefixes(){let e=[];for(let t=Object.getPrototypeOf(r);t&&t!==Function.prototype;t=Object.getPrototypeOf(t))Object.hasOwn(t,"_name")&&t._name&&e.push(`${t._name}_`);return e}constructor(e=null,{collections:t=[],auth:n=null}={}){super(e),this._binding=null,this._auth=n;for(let s of t)this.loadCollection(s)}get auth(){return this._auth}get binding(){return this._binding}set binding(e){this._binding=e}nodeById(e){if(!this.binding)return super.nodeById(e);let t=this.binding.nodeIds.get(e);if(!t)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}loadCollection(e){return this.loadGrammar(e),this}schemaTag(e){let t=e.toLowerCase(),n=r.dialectPrefixes;if(t.startsWith(`${r._name}_`))throw new Error(`${e}: the tag prefix '${r._name}_' is not accepted; use the prefix '${n[0]}'`);if($p.has(t))throw new Error(`${e}: excluded from Gramlot 0.2.0`);let s=this.schemaTagNames[t];if(s)return s;for(let i of n)if(t.startsWith(i)&&this.schemaTagNames[t.slice(i.length)])return t;return null}bagCall(e,t,n,s){return super.bagCall(e,this.#e(t),n,s)}commandOnNode(e,t,n,s){return super.commandOnNode(e,this.#e(t),n,s)}validateNodeValues(e,t,n={}){let s=Al(n);if(s)throw new Error(`${e}: attribute '${s}' is excluded from Gramlot 0.2.0`);let i=kl(e,n);if(i)throw new Error(`${e}: ${i}`);return super.validateNodeValues(e,t,n)}validateNode(e,t={}){let n=Al(t.attrs??e.getAttr());if(n)throw new Error(`${e.nodeTag} '${e.label}': attribute '${n}' is excluded from Gramlot 0.2.0`);let s=kl(e.nodeTag,t.attrs??e.getAttr());if(s)throw new Error(`${e.nodeTag} '${e.label}': ${s}`);return super.validateNode(e,t)}setChild(e,t,n,s,i=null){let o=t==="dataSetter"&&s?.value!==null&&typeof s?.value=="object"&&Object.getPrototypeOf(s.value)===Object.prototype?{...s,value:new P(s.value)}:s;return super.setChild(e,t,n,o,i)}#e(e){if(e==="data")throw new Error(Mp);if(this.schemaTagNames[e.toLowerCase()]===e)return e;let t=r.dialectPrefixes.find(n=>e.startsWith(n));return this.schemaTagNames[e.slice(t.length)]}get renderer_html(){return new It(this)}create(){this.setup(this.data),this.main(this.root)}computeLogic(){}promoteNodeValue(e,t,n){let s=t!=null?{_text:t}:null;e.setValue(n,!0,s,!0)}reference(e,t="node"){if(e=Ie(e),!(e instanceof Ve)||!["node","dom"].includes(t))throw new TypeError("Reference requires an element and node/dom kind");let n=e.getAttr("__ref");return n==null&&(n=crypto.randomUUID().replaceAll("-",""),e.setAttr({__ref:n})),{$gramlotRef:n,kind:t}}toTytx(){return le(this.auth===null?this.source:this.source.authorizedCopy(this.auth))}};var qp=new Set(["input","select","textarea"]),jp=["type","multiple","group"];function Dl(r,e){let t=r.getAttr(e);return r.pointerType(t)?r.getRelativeData(t):t}var me=class r{static liveWrites=!1;static writesDefault=!0;#e;#t;#r=!1;#s=!1;#n=!1;static for(e,t){let n=r.classFor(t.element,t.attrs);return n?new n(e,t):null}static classFor(e,t){if(e.namespaceURI!==Ee)return null;if(e.localName==="textarea")return He;if(e.localName==="select")return rn;if(e.localName!=="input")return null;let n=t.type==null?"text":String(t.type).toLowerCase();return Object.hasOwn(xl,n)?xl[n]:He}static shape(e,t){return e?.namespaceURI!==Ee||!qp.has(e.localName)?null:JSON.stringify(jp.map(n=>t[n]??null))}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get element(){return this.#t.element}get node(){return this.binding.node}get resolved(){return this.#t.resolved}get live(){return!!this.resolved.live}get writeEvent(){return this.constructor.liveWrites&&this.live?"input":"change"}project(e,t){if(this.#s){this.#n=!0;return}this.#r&&this.same(this.read(),e)||(this.constructor.writesDefault&&!this.node.pointerType(this.node.getAttr("value"))&&this.writeDefault(e),this.write(e))}read(){return this.element.value}write(e){let t=e==null?"":String(e);this.element.value!==t&&(this.element.value=t)}writeDefault(e){let t=e==null?"":String(e);this.element.localName==="textarea"?this.#t.text.data!==t&&(this.#t.text.data=t):this.element.defaultValue!==t&&(this.element.defaultValue=t)}same(e,t){return Object.is(e,t)}commit(e){if(this.binding.closed)return;let t=this.node.getAttr("value");if(this.node.pointerType(t)==="^"){this.#r=!0;try{this.node.setRelativeData(t.slice(1),this.read())}finally{this.#r=!1}}}attach(){for(let e of["input","change","compositionstart","compositionend"])this.element.addEventListener(e,this)}detach(){for(let e of["input","change","compositionstart","compositionend"])this.element.removeEventListener(e,this);this.#n=!1}refresh(){}handleEvent(e){if(!this.binding.closed){if(e.type==="compositionstart"){this.#s=!0;return}if(e.type==="compositionend"){this.#s=!1,this.writeEvent==="input"&&this.commit(e),this.#n&&(this.#n=!1,this.binding.runtime.renderer.project(this.node));return}this.#s||e.isComposing||e.type===this.writeEvent&&this.commit(e)}}},He=class extends me{static liveWrites=!0},xi=class extends me{static liveWrites=!0;read(){return this.element.value===""?null:Number(this.element.value)}commit(e){this.element.validity.badInput||super.commit(e)}},Si=class extends me{static liveWrites=!0;read(){return Number(this.element.value)}},rn=class extends me{static writesDefault=!1;read(){return this.element.multiple?[...this.element.selectedOptions].map(e=>e.value):this.element.selectedIndex===-1?null:this.element.value}write(e){let t=this.element;if(t.multiple){if(e!=null&&!Array.isArray(e))throw new TypeError(`${this.node.nodeTag} '${this.node.label}': a multiple select requires an array`);let n=new Set((e??[]).map(String));for(let s of t.options){let i=n.has(s.value);s.selected!==i&&(s.selected=i)}}else e==null?t.selectedIndex!==-1&&(t.selectedIndex=-1):(t.selectedIndex===-1||t.value!==String(e))&&(t.value=String(e))}same(e,t){return Array.isArray(e)?Array.isArray(t)&&t.length===e.length&&t.every((n,s)=>Object.is(n,e[s])):super.same(e,t)}},Rt=class extends me{read(){return this.element.value===""?null:this.element.value}},Ni=class extends me{},us=class extends me{static writesDefault=!1;read(){return this.element.checked}write(e){let t=!!e;this.element.checked!==t&&(this.element.checked=t)}same(e,t){return e===!!t}attach(){let e=this.node;if(e.getAttr("checked")!=null&&e.pointerType(e.getAttr("value"))==="^")throw new TypeError(`${e.nodeTag} '${e.label}': checked and a ^ value are two sources`);super.attach()}},Ci=class extends us{#e=null;#t=!1;get groups(){return this.binding.runtime.renderer.radioGroups}attach(){let e=this.node,t=this.resolved.group??null,n=Tl(e);if(t!=null){if(e.getAttr("name")!=null)throw new TypeError(`${e.nodeTag} '${e.label}': name and group are two names`);this.#r(t,n)}super.attach(),t!=null&&(this.#e=this.groups.join(this,t,n),this.element.setAttribute("name",this.#e))}detach(){this.#e!==null&&(this.groups.leave(this),this.element.removeAttribute("name"),this.#e=null),super.detach()}refresh(){if(this.#e===null)return;let e=this.resolved.group,t=Tl(this.node);this.groups.nameOf(e,t)!==this.#e&&(this.#r(e,t),this.groups.leave(this),this.#e=this.groups.join(this,e,t),this.element.setAttribute("name",this.#e))}#r(e,t){let n=this.node;if(Dl(n,"value")&&this.groups.peersOf(e,t).some(s=>!s.binding.closed&&s.read()))throw new Error(`${n.nodeTag} '${n.label}': several true values in radio group '${e}'`)}project(e,t){let n=!this.#t;this.#t=!0;let s=this.read();super.project(e,t),!n&&!s&&this.read()&&this.turnOffPeers()}commit(e){let t=this.read();super.commit(e),t&&!this.binding.closed&&this.turnOffPeers()}turnOffPeers(){if(this.#e!==null)for(let e of this.groups.peers(this)){if(this.binding.closed)return;e.binding.closed||(e.element.checked&&(e.element.checked=!1),Dl(e.node,"value")&&e.commit(null))}}},cs=class{#e;#t=new Map;#r=new Map;#s=new WeakMap;#n=0;constructor(e){this.#e=e}join(e,t,n){let s=this.nameOf(t,n);return this.#t.has(s)||this.#t.set(s,new Set),this.#t.get(s).add(e),this.#r.set(e,s),s}leave(e){let t=this.#r.get(e);this.#r.delete(e);let n=this.#t.get(t);n?.delete(e),n?.size===0&&this.#t.delete(t)}peers(e){let t=this.#r.get(e);return[...this.#t.get(t)??[]].filter(n=>n!==e)}peersOf(e,t){return[...this.#t.get(this.nameOf(e,t))??[]]}nameOf(e,t){t!==null&&!this.#s.has(t)&&this.#s.set(t,this.#n++);let n=t===null?"page":`form${this.#s.get(t)}`;return`gramlot-${this.#e.instanceId}-${n}-${e}`}};function Tl(r){for(let e=r;e;e=e.parentNode){let t=e.getAttr()??{};if(t.formId!=null||t.form===!0)return e}return null}var xl={text:He,password:He,email:He,url:He,tel:He,search:He,number:xi,range:Si,color:Ni,date:Rt,time:Rt,month:Rt,week:Rt,"datetime-local":Rt,checkbox:us,radio:Ci,hidden:null,file:null,button:null,submit:null,reset:null,image:null};var Oi=Symbol("source text"),Sl={xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Vp=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formNoValidate","hidden","inert","isMap","itemscope","loop","multiple","muted","noModule","noValidate","open","playsInline","readOnly","required","reversed","selected"]),Hp=new Set(["checked","muted","selected","value"]),zp=new Map([["allowfullscreen","allowFullscreen"],["formnovalidate","formNoValidate"],["ismap","isMap"],["nomodule","noModule"],["novalidate","noValidate"],["playsinline","playsInline"],["readonly","readOnly"]]);function Gp(r){let e=r.replace(/-([a-z])/g,(t,n)=>n.toUpperCase());return zp.get(e.toLowerCase())??e}var ds=class{constructor({metadataAttributes:e=[]}={}){this.metadataAttributes=new Set([...Tt,"_text",...e])}definition(e){let t=e.builder,s={...t.schema[t.schemaTag(e.nodeTag)]._meta,...e.getAttr("_meta")},i=Wr(e.nodeTag,{renderTag:s.render_tag,ns:e.getAttr("ns"),dialectName:t.constructor._name}),a=i==="foreignObject"?Kr:s.render_attributes?.xmlns??e.getAttr("xmlns")??(t instanceof ht?Kr:Ee);return{meta:s,namespace:a,tag:i}}validate(e,t=e.builder){let n=e.value instanceof D,s=n?e.getAttr("_text"):e.value;if(s!=null&&!["string","number","boolean"].includes(typeof s))throw new TypeError("HTML text must be scalar");for(let[o,u]of Object.entries(e.attr))if(!this.metadataAttributes.has(o)&&u!=null&&!["string","number","boolean"].includes(typeof u))throw new TypeError(`HTML attribute ${o} must be scalar`);let i=Object.fromEntries(Object.entries(e.attr).filter(([o])=>!this.metadataAttributes.has(o))),a=n?e.value.getNodes().map(o=>o.nodeTag).filter(Boolean):[];t.validateNode(e,{value:s,attrs:i,childTags:a})}create(e,t,n=null,s=e.attr,i=null){let{tag:a,namespace:o,meta:u}=this.definition(e);n??=a;let l=o===Ee?t.createElement(n):t.createElementNS(o,n),c=t.createTextNode(this.text(e));(o!==Ee||!u.void)&&l.append(c);let d={element:l,text:c,tag:n};return this.update(d,e,s,Oi,i),d}matches(e,t){let{tag:n,namespace:s}=this.definition(t);return(s===Ee?e.tag.toLowerCase()===n.toLowerCase():e.tag===n)&&e.element.namespaceURI===s}compose(e,t,n){e.text.data=t??"";for(let s of n)e.element.append(s)}update(e,t,n=t.attr,s=Oi,i=null){let{element:a,text:o}=e,u=a.namespaceURI===Ee,l=this.definition(t).meta.render_attributes??{},c=e.attrs??{};n=Object.fromEntries(ye({...n,...l}));let d=me.classFor(a,n)!==null;s===Oi&&(s=this.text(t));let f=s==null?"":String(s);o.data!==f&&(o.data=f);let p=[...new Set([...Object.keys(c),...Object.keys(n)])];p.sort((h,m)=>(m==="sandbox")-(h==="sandbox"));for(let h of p){if(this.metadataAttributes.has(h)||d&&h==="value")continue;let m=n[h],g=h,b=Gp(g),v=u&&Vp.has(b)&&typeof a[b]=="boolean",w=g==="xmlns"?"xmlns":g.includes(":")?g.split(":")[0]:"",k=Object.hasOwn(Sl,w)?Sl[w]:null;if(Object.is(c[h],m)||(m==null||v&&!m?k?a.removeAttributeNS(k,g.split(":").at(-1)):a.removeAttribute(g):k?a.setAttributeNS(k,g,String(m)):a.setAttribute(g,v?"":String(m))),u&&(v||Hp.has(b))&&b in a){let I=b==="value"?m==null?"":String(m):!!m;a[b]!==I&&(a[b]=I)}}i===!1?a.style.visibility!=="hidden"&&(a.style.visibility="hidden"):e.visible===!1&&(n.style==null?a.removeAttribute("style"):a.setAttribute("style",String(n.style))),e.visible=i,e.attrs=n}text(e){return e.value instanceof D?e.getAttr("_text")==null?"":String(e.attr._text):e.value==null?"":String(e.value)}};var fs=class r{#e;#t;static for(e,t){let n=t.element;return n?.namespaceURI!==Ee||n.localName!=="button"?null:new r(e,t)}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get controllers(){let e=this.node.value;return e?.getNodes?e.getNodes().filter(t=>t.nodeTag==="dataController"||t.nodeTag==="dataRpc"):[]}get mechanism(){let e=this.node,t=this.controllers;if(t.length>1)throw new Error(`${e.nodeTag} '${e.label}': several dataController or dataRpc children; a button has one click mechanism`);let n=e.getAttr()??{},s=[];if(t.length&&s.push("controller"),n.action!=null&&s.push("action"),Nl(n).length&&s.push("fire"),s.length>1)throw new Error(`${e.nodeTag} '${e.label}': ${s.join(" and ")} together; a button has one click mechanism`);return s[0]??null}attach(){this.refresh(),this.element.addEventListener("click",this)}refresh(){this.mechanism&&this.node.getAttr("type")==null&&this.element.getAttribute("type")!=="button"&&this.element.setAttribute("type","button")}detach(){this.element.removeEventListener("click",this)}handleEvent(e){this.onClick(e)}onClick(e){if(this.binding.closed)return;let t=this.mechanism;if(!t||(e.stopPropagation(),this.element.disabled))return;let n=this.binding.countClick(),s=this.node,i=Wp(e);if(t==="controller")this.binding.runtime.bindingFor(this.controllers[0])?.providers[0]?.invoke({kind:"click",event:e,counter:n});else if(t==="action"){let[,a]=s.builder.runtimeValues(s),o={...a,event:e,_counter:n,modifiers:i};this.binding.runtime.inlineCompiler.compile(s,"action",s.getAttr("action"),Object.keys(o))(o)}else{let a={modifier:i,_counter:n},o=s.getAttr("fire");if(o!=null){s.FIRE(o,i||!0,a);return}for(let[u,l]of Nl(s.getAttr())){if(this.binding.closed)return;s.FIRE(l,u.slice(5),a)}}}};function Nl(r){return Object.entries(r??{}).filter(([e,t])=>t!=null&&(e==="fire"||e.startsWith("fire_")))}function Wp(r){return["shift","ctrl","alt","meta"].filter(e=>r[`${e}Key`]).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}var ps="connect_on",Xp=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/,nn=class{#e;#t;#r;#s;#n;static declared(e){return Object.entries(e.getAttr()??{}).filter(([t,n])=>t.startsWith(ps)&&t.length>ps.length&&n!=null).map(([t,n])=>[t,t.slice(ps.length).toLowerCase(),n])}constructor(e,t,n,s,i=`${ps}${n}`){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get eventName(){return this.#r}get handler(){return this.#s}get attribute(){return this.#n}attach(){this.element.addEventListener(this.eventName,this)}detach(){this.element.removeEventListener(this.eventName,this)}handleEvent(e){if(this.binding.closed)return;let t=this.node,n=this.binding.runtime;if(Xp.test(this.handler)){let{group:s,method:i}=n.logicRegistry.resolve(this.handler,t);i.call(s,t,e);return}n.inlineCompiler.compile(t,this.attribute,this.handler,["event"])({event:e})}};var sn=class{constructor(e=null){this.entries=new Map,this.sourceRoot=e}validate(e,t=new Set){let n=new Map,s=i=>{for(let a of i.getNodes()){let o=a.getAttr("__ref");if(o){if(n.has(o))throw new Error("Duplicate Source reference");let u=this.entries.get(o);if(e!==this.sourceRoot&&u&&u.node!==a&&!t.has(u.node))throw new Error("Duplicate Source reference");n.set(o,a)}a.value instanceof D&&s(a.value)}};s(e)}register(e,t){let n=e.getAttr("__ref");if(n){if(this.entries.has(n))throw new Error(`Duplicate Source reference: ${n}`);this.entries.set(n,{node:e,dom:t})}}remove(e){for(let[t,n]of this.entries)n.node===e&&this.entries.delete(t)}resolve(e){if(!e||!["node","dom"].includes(e.kind))throw new TypeError("Expected a node or DOM reference");let t=this.entries.get(e.$gramlotRef);if(!t)throw new Error("Source reference is not mounted");return t[e.kind]}};var Yp="_root_",hs=class{constructor(e=null,t=null){this.parent=e,this.segment=t,this.children=new Map,this.registrations=new Set}},Bi=class{#e;#t;#r;#s;#n;#i=!0;constructor(e,{path:t,attr:n,recipient:s,order:i}){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get router(){return this.#e}get path(){return this.#t}get attr(){return this.#r}get recipient(){return this.#s}get active(){return this.#i}get order(){return this.#n}close(){this.active&&(this.#i=!1,this.router.unregister(this))}},Ii=class{constructor({evt:e,node:t,path:n,oldvalue:s,attrsDiff:i,reason:a,fired:o,level:u,registration:l}){this.evt=e,this.node=t,this.path=n,this.oldvalue=s,this.attrsDiff=i,this.reason=a,this.fired=o,this.level=u,this.registration=l}},ms=class{#e;#t=new hs;#r=new Map;#s=0;#n=0;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return this.#s}register({path:e,attr:t=null,recipient:n}){if(typeof e!="string"||e==="")throw new TypeError(`A Data registration requires a path: ${e}`);let s=this.#t;for(let a of e.split(".")){let o=s.children.get(a);o||(o=new hs(s,a),s.children.set(a,o)),s=o}this.#n+=1;let i=new Bi(this,{path:e,attr:t,recipient:n,order:this.#n});return s.registrations.add(i),this.#r.set(i,s),this.#s+=1,i}unregister(e){let t=this.#r.get(e);if(t)for(this.#r.delete(e),t.registrations.delete(e),this.#s-=1;t.parent&&!t.children.size&&!t.registrations.size;)t.parent.children.delete(t.segment),t=t.parent}deliver(e){let{pathlist:t}=e;if(!t?.length||t[0]!==Yp||e.reason==="autocreate")return;let n=t.slice(1),s=e.evt==="ins"||e.evt==="del";for(let i of Array.isArray(e.node)?e.node:[e.node]){let a=s?[...n,i.label]:n,o=a.join(".");for(let[u,l]of this.#i(a,e))u.active&&u.recipient.receive(new Ii({evt:e.evt,node:i,path:o,oldvalue:e.oldvalue??null,attrsDiff:e.attrs_diff??null,reason:e.reason??null,fired:e.fired??!1,level:l,registration:u}))}}#i(e,t){let n=[],s=this.#t;for(let a of e){for(let o of s.registrations)s!==this.#t&&this.#a(o,"child",t)&&n.push([o,"child"]);if(s=s.children.get(a),!s)return n.sort(([o],[u])=>o.order-u.order)}for(let a of s.registrations)this.#a(a,"node",t)&&n.push([a,"node"]);let i=[...s.children.values()];for(;i.length;){let a=i.pop();for(let o of a.registrations)this.#a(o,"container",t)&&n.push([o,"container"]);i.push(...a.children.values())}return n.sort(([a],[o])=>a.order-o.order)}#a(e,t,n){let{evt:s}=n;return e.attr===null?s==="upd_attrs"?!1:!(t==="child"&&n.fired):t==="child"?!1:t==="container"?s!=="upd_attrs":s==="ins"||s==="del"?!0:Object.hasOwn(n.attrs_diff??{},e.attr)}};var gs=class{#e;constructor(e){this.#e=e}get runtime(){return this.#e}install(e){let t=an(e),n=this.setterNodes(e);Ri(e);for(let s of n){let i=this.runtime.openBinding(s);i.hasStamp("installed")||(this.applySetter(s),i.stamp("installed"))}this.applyDefaults(t.filter(s=>s.nodeTag&&!s._getMeta("data_element")))}setterNodes(e){return an(e).filter(t=>t.nodeTag==="dataSetter")}applySetter(e){let t=e.absDatapath(e.pathAttribute("destination_path"));if(t===null)return;let n=e.getAttr("value")??null,s=Jp(e.getAttr()),i=this.runtime.data;if(n!==null)i.setItem(t,n,s,">",!1,!0,e),n instanceof P&&e.setAttr({value:null},!1);else{let a=i.getNode(t);a?s&&a.setAttr(s,!0):i.setItem(t,null,s,">",!1,!0,e)}}applyDefaults(e){for(let t of e){let n=t.getAttr();for(let[s,i]of Object.entries(n)){if(!Zp(t,s,i))continue;let a=s==="value"?n.default_value??n.default:n[`default_${s}`];a!=null&&this.#t(t,i,a)}this.#r(t,n)}}#t(e,t,n){let s=e.absDatapath(t);if(s===null)return;let[i,a=null]=s.split("?",2),o=this.runtime.data,u=o.getNode(i);if(a===null){if(u&&u.value!==null&&u.value!==void 0)return;o.setItem(i,n,null,">",!1,!0,e)}else if(u){let l=u.getAttr(a);l==null&&u.setAttr({[a]:n},!0)}else o.setItem(i,null,{[a]:n},">",!1,!0,e)}#r(e,t){let n={};for(let[a,o]of Object.entries(t))a.startsWith("attr_")&&(n[a.slice(5)]=e.pointerType(o)?e.getRelativeData(o):o);if(!Object.keys(n).length)return;let s=[t.value,t.src].find(a=>e.pointerType(a));if(!s)return;let i=e.absDatapath(s);i!==null&&this.runtime.data.getNode(i.split("?",1)[0])?.setAttr(n,!0,!0,!1)}};function Zp(r,e,t){return e==="_meta"||Tt.has(e)||e==="default"||e.startsWith("default_")||e.startsWith("attr_")||e.endsWith("_path")?!1:r.pointerType(t)!==null}function Jp(r){let e={};for(let[t,n]of Object.entries(mt(r??{})))Tt.has(t)||t.startsWith("_")||t==="destination_path"||t==="value"||n!=null&&(e[t]=n);return Object.keys(e).length?e:null}function Kp(r){let e=r.builder;if(!(e instanceof Qe))throw new Error(`dataSetter '${r.label}': dataSetter is not supported inside ${e.constructor._name}`)}function Ri(r){for(let e of an(r))e.nodeTag==="dataSetter"&&Kp(e),nh(e)}var Qp=["_init","_onStart","_onBuilt","_delay","_timing","_userChanges"],eh=new Set(["dataFormula","dataController","dataRpc"]),th=["_onCalling","_onResult","_onError"],rh=["_init","_onBuilt","_onStart"];function nh(r){let e=n=>r.getAttr(n)!==null&&r.getAttr(n)!==void 0;if(r.nodeTag!=="dataRpc"){let n=th.find(e);if(n)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${n}' is allowed only on dataRpc`)}if(eh.has(r.nodeTag)){let n=Object.entries(r.getAttr()).find(([,s])=>Se(s));if(n)throw new Error(`${r.nodeTag} '${r.label}': '${n[0]}' is a == expression, not accepted on ${r.nodeTag}`);for(let s of rh){let i=r.getAttr(s);if(!(i==null||typeof i=="boolean"||typeof i=="number"))throw new Error(`${r.nodeTag} '${r.label}': '${s}' accepts true, false, null or a number, not ${JSON.stringify(i)}`)}return}let t=Qp.find(e);if(t)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${t}' is allowed only on dataFormula, dataController and dataRpc`)}function an(r){if(r instanceof D)return r.getNodes().flatMap(t=>an(t));let e=[r];return r.value instanceof D&&e.push(...an(r.value)),e}var sh=new Set(["destination_path","result_path","func","formula","script","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges","method","timeout","_onCalling","_onResult","_onError"]),on=class{#e;#t=[];#r=null;#s=null;#n=null;#i=null;constructor(e){this.#e=e,e.track(()=>{this.cancel(),this.#c()})}get binding(){return this.#e}get node(){return this.binding.node}get kind(){throw new Error("Provider.kind is defined by FormulaProvider, ControllerProvider and RpcProvider")}register(){let e=this.node,t=e.getAttr("_onStart");if(typeof t=="number"&&!(Number.isFinite(t)&&t>=0))throw new Error(`${e.nodeTag} '${e.label}': _onStart must be true or a delay in ms not below 0: ${t}`);this.#c();let n=this.binding.runtime.router;for(let[s,i]of e.pointers()){if(s==="datapath")continue;let a=e.absDatapath(i);if(a===null)continue;let[o,u=null]=a.split("?",2),l=n.register({path:o,attr:u,recipient:this});this.#t.push(l),s==="_timing"&&(this.#r=l)}this.#a()}receive(e){if(e.registration===this.#r){this.#a();return}if(this.#l("_userChanges")&&e.level!=="node")return;let t={kind:"data",change:e},n=this.#l("_delay");n>0?this.#u(t,n):this.invoke(t)}invoke(e){if(this.binding.closed)return;let t=this.node,n=this.kind==="formula",s=this.kind==="rpc",i=this.readArguments(e),[a,o]=[n?"formula":"script",t.getAttr(n?"formula":"script")],u=t.getAttr("_if");if(u&&!this.#o("_if",u,`return (${u})`,i,!1)){if([a,o]=["_else",t.getAttr("_else")],!o)return;if(s){this.#o(a,o,o,i,!0);return}}if(s)return this.#f(i);let l=t.getAttr("func"),c;if(o)c=this.#o(a,o,n?`return ${o}`:o,i,!0);else if(l==null){if(!n)return;c=new P(Mi(i))}else{let{group:d,method:f}=this.binding.runtime.logicRegistry.resolve(l,t);c=n?f.call(d,i):f.call(d,t,i)}n&&t.setRelativeData(t.pathAttribute("result_path"),c)}readArguments(e){let t=this.node,[,n]=t.builder.runtimeValues(t),s={};for(let[o,u]of Object.entries(n))sh.has(o)||(s[o]=u);let i=e.change??null,a=i?i.level:e.kind;return s._node=i?i.node:null,s._triggerpars={kw:i,trigger_reason:a},s._reason=a,e.kind==="click"&&Object.assign(s,ih(e)),s}cancel(){this.#n?.(),this.#s?.()}#a(){this.#s?.();let e=this.#l("_timing");if(!(e>0))return;let t=setInterval(()=>this.invoke({kind:"timing",change:null}),e*1e3),n=this.binding.track(()=>clearInterval(t));this.#s=()=>{clearInterval(t),n(),this.#s=null}}#u(e,t){this.#n?.();let n=null,s=setTimeout(()=>{n(),this.#n=null,this.invoke(e)},t);n=this.binding.track(()=>clearTimeout(s)),this.#n=()=>{clearTimeout(s),n(),this.#n=null}}#l(e){let t=this.node,n=t.getAttr(e);return t.pointerType(n)?t.getRelativeData(n):n??null}#o(e,t,n,s,i){let a=[...i?["_kwargs"]:[],...Cl,...Ol,...Object.keys(Mi(s))];return this.binding.runtime.inlineCompiler.compile(this.node,e,t,a,n)({...s,_kwargs:s})}async#f(e){let t=this.node,[n,s,i]=["_onCalling","_onResult","_onError"].map(h=>t.getAttr(h));n&&this.#o("_onCalling",n,n,e,!0),this.#i?.abort();let a=new AbortController;this.#i=a;let o=this.binding.track(()=>a.abort()),u=this.#l("timeout"),l=u>0?setTimeout(()=>{let h=new Error(`${t.nodeTag} '${t.label}': no answer within ${u} ms`);h.name="TimeoutError",a.abort(h)},u):null,c=new Promise((h,m)=>{a.signal.addEventListener("abort",()=>m(a.signal.reason),{once:!0})}),d;try{let h=this.binding.runtime.gramlot.rpc.call("data",this.#l("method"),Mi(e),{signal:a.signal});d={result:await Promise.race([h,c])}}catch(h){d={error:h}}clearTimeout(l),o();let f=this.#i===a&&!this.binding.closed;if(this.#i===a&&(this.#i=null),!f)return;if("error"in d){if(!i)throw d.error;this.#o("_onError",i,i,{...e,error:d.error},!0);return}let{result:p}=d;t.getAttr("result_path")!=null&&t.setRelativeData(t.pathAttribute("result_path"),p),s&&this.#o("_onResult",s,s,{...e,result:p},!0)}#c(){for(let e of this.#t.splice(0))e.close();this.#r=null}},_s=class extends on{get kind(){return"formula"}},bs=class extends on{get kind(){return"controller"}},ws=class extends on{get kind(){return"rpc"}},Cl=["_node","_triggerpars","_reason"],Ol=["_evt","button_counter","button_shift","button_ctrl","button_alt","button_meta"];function Mi(r){let e={...r};for(let t of[...Cl,...Ol])delete e[t];return e}function ih({event:r,counter:e}){return{_evt:r,button_counter:e,button_shift:!!r.shiftKey,button_ctrl:!!r.ctrlKey,button_alt:!!r.altKey,button_meta:!!r.metaKey}}var ah=[[null,/(\W|^)GET (?:\s*)(\^?[\w.#@$?-]+)/g,"$1this.GET('$2')"],[/;SET/g,/(\W|^)SET (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.SET('$2', $3)$4 "],[/;PUT/g,/(\W|^)PUT (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.PUT('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE_AFTER('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE_AFTER('$2')$3 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE('$2', $3)$4 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE('$2')$3 "]],oh=/(\W|^)PUBLISH (?:\s*)(\^?[\w.#@$?-]+)/,lh=new Set(["arguments","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]),ys=class{#e;#t=new Map;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return[...this.#t.values()].reduce((e,t)=>e+t.size,0)}preprocess(e,t,n){let s=n.trim();if(oh.test(s))throw new Error(`${ln(e,t)}: the PUBLISH macro is excluded from Gramlot 0.2.0`);let i=s.replace(/\$(\d+)/g,(a,o)=>`arguments[${parseInt(o,10)-1}]`);for(let[a,o,u]of ah)a&&(i=i.replace(a,`; ${a.source.slice(1)}`)),i=i.replace(o,u);return i!==s&&console.warn(`${ln(e,t)}: legacy macros are deprecated; write this.GET(path), this.SET(path, value), this.PUT(path, value), this.FIRE(path, value), this.FIRE_AFTER(path, value) and arguments[n] in place of GET, SET, PUT, FIRE, FIRE_AFTER and $n`),i}compile(e,t,n,s,i=n){if(e.activatedCode(t)!==n)throw new Error(`${ln(e,t)}: inline code runs only as received with the Source (main or a remote Source); a text written later is not run: use named logic`);let a=this.#t.get(e);a||(a=new Map,this.#t.set(e,a),this.runtime.bindingFor(e).track(()=>this.release(e)));let o=a.get(t);o?.source!==i&&(o={source:i,text:this.preprocess(e,t,i),key:null,run:null},a.set(t,o));let u=s.filter(Bl),l=u.join(",");if(o.key!==l){let c=uh(e,t,o.text,u);o.key=l,o.run=d=>c.apply(e,u.map(f=>d[f]))}return o.run}compileExpression(e,t,n){let s=n.slice(2),i=ye(e.getAttr()).filter(([,o])=>!Se(o)),a=this.compile(e,t,n,i.map(([o])=>o),`return ${s}`);return o=>{let u={};for(let[l,c]of i)if(Object.hasOwn(o,l))u[l]=o[l];else if(lr(c).length){if(Bl(l)&&new RegExp(`(?<![\\w$])${l.replaceAll("$","\\$")}(?![\\w$])`).test(s))throw new Error(`${e.nodeTag} '${e.label}': '${t}' uses '${l}', a template consumed by another template, whose value is not available; write a dataFormula`)}else u[l]=e.pointerType(c)?e.getRelativeData(c):c;return a(u)}}release(e,t=null){if(t===null){this.#t.delete(e);return}let n=this.#t.get(e);if(n)for(let s of t){n.delete(s);for(let[i]of ye({[s]:null}))n.delete(i)}}};function Bl(r){return/^[A-Za-z_$][\w$]*$/.test(r)&&!lh.has(r)}function ln(r,e){return`${r.nodeTag} '${r.label}' ${e?`'${e}'`:"node value"}`}function uh(r,e,t,n){try{return t.startsWith("function")?new Function(`return (${t}
|
|
25
25
|
)`)():new Function(...n,`${t}
|
|
26
26
|
`)}catch(s){throw s instanceof EvalError?new EvalError(`${ln(r,e)}: inline code blocked by the Content Security Policy of the page (no 'unsafe-eval'); move the code to named logic (a method of the page's class Logic) or serve the page with the permissive CSP profile, which allows 'unsafe-eval'`,{cause:s}):new SyntaxError(`${ln(r,e)}: ${s.message} in the inline code:
|
|
27
27
|
${t}`,{cause:s})}}var Il={dataFormula:_s,dataController:bs,dataRpc:ws},ch=["datapath","_anchor","node_id","form","formId"],dr=class{#e;#t=new Map;#r=new Map;#s;#n;#i;#a=`gramlot-data-${crypto.randomUUID()}`;#u=!1;constructor(e){this.#e=e,this.#s=new ms(this),this.#n=new gs(this),this.#i=new ys(this)}get gramlot(){return this.#e}get builder(){return this.gramlot.src.builder}get renderer(){return this.gramlot.src.renderer}get logicRegistry(){return this.gramlot.src.logicRegistry}get data(){return this.builder.data}get root(){return this.data.parent}get size(){return this.#t.size}get disposed(){return this.#u}get router(){return this.#s}get installer(){return this.#n}get inlineCompiler(){return this.#i}get nodeIds(){return this.#r}attach(){this.root.subscribe(this.#a,{any:e=>this.receiveData(e)})}receiveData(e){this.router.deliver(e)}bindingFor(e){return this.#t.get(e)??null}openBinding(e){if(this.disposed)throw new Error("BindingRuntime is disposed");let t=this.bindingFor(e);return t||(t=new $i(this,e),this.#t.set(e,t)),t}closeBranch(e){let t=[];if(e.value instanceof D)for(let s of e.value.getNodes())try{this.closeBranch(s)}catch(i){t.push(i)}let n=this.bindingFor(e);if(n){this.#t.delete(e);let s=e.getAttr("node_id");this.nodeIds.get(s)===e&&this.nodeIds.delete(s);try{n.close()}catch(i){t.push(i)}}if(t.length)throw new AggregateError(t,"Source branch close failed")}rebindBranch(e){let t=this.#d(e);for(let n of t)this.bindingFor(n)?.rebind();for(let n of t)this.renderer.project(n)}handleSourceEvent(e){let{evt:t,node:n}=e,s=[],i=a=>{try{this.closeBranch(a)}catch(o){s.push(o)}};try{if(t==="ins")this.#l(n);else if(t==="del")for(let a of Array.isArray(n)?n:[n])i(a);else if(t==="upd_value"||t==="upd_value_attr"){if(e.oldvalue instanceof D)for(let a of e.oldvalue.getNodes())i(a);this.inlineCompiler.release(n,[""]),t==="upd_value_attr"?this.#c(n,e.attrs_diff):this.#p(n).rebind(),n.value instanceof D&&this.#l(n.value)}else if(t==="upd_attrs")this.#c(n,e.attrs_diff);else throw new Error(`Unsupported Source event: ${t}`)}catch(a){throw s.length?new AggregateError([...s,a],"Source event failed"):a}return s}branchBuilt(e){let t=[];for(let n of this.#d(e)){let s=this.bindingFor(n);!s||s.hasStamp("built")||!this.renderer.attached(n)||(s.stamp("built"),t.push(s))}for(let n of t)this.renderer.attached(n.node)&&this.#f(n,"built","_onBuilt");if(this.gramlot.state==="started")for(let n of t)this.renderer.attached(n.node)&&this.#o(n)}pageStarted(){for(let e of[...this.#t.values()])!e.closed&&e.hasStamp("built")&&this.#o(e)}dispose(){if(this.disposed)return;this.#u=!0,this.root.unsubscribe(this.#a,{any:!0}),this.nodeIds.clear();let e=[];for(let[t,n]of[...this.#t.entries()].reverse()){this.#t.delete(t);try{n.close()}catch(s){e.push(s)}}if(e.length)throw new AggregateError(e,"Binding cleanup failed")}#l(e){if(!(e instanceof D)&&this.bindingFor(e))return;let t=e instanceof D?e.getNodes().flatMap(i=>this.#d(i)):this.#d(e),n=new Set(t.filter(i=>this.bindingFor(i))),s=new Map;for(let i of t){let a=i.getAttr("node_id");if(a!=null){if(s.has(a)||this.nodeIds.has(a)&&this.nodeIds.get(a)!==i)throw new Error(`Duplicate node_id '${a}'`);s.set(a,i)}}for(let[i,a]of s)this.nodeIds.set(i,a);try{this.installer.install(e);for(let i of t)this.openBinding(i);for(let i of t)this.bindingFor(i).registerPointers()}catch(i){let a=[i];for(let o of t.filter(u=>!n.has(u)).reverse()){let u=o.getAttr("node_id");s.get(u)===o&&this.nodeIds.get(u)===o&&this.nodeIds.delete(u);let l=this.bindingFor(o);if(l){this.#t.delete(o);try{l.close()}catch(c){a.push(c)}}}throw a.length>1?new AggregateError(a,"Source branch installation failed"):i}for(let i of t){let a=this.bindingFor(i);if(!(!a||a.hasStamp("init")||!this.renderer.attached(i))&&(a.stamp("init"),Rl(i.getAttr("_init"))))for(let o of a.providers)o.invoke({kind:"init",change:null})}}#o(e){e.hasStamp("start")||(e.stamp("start"),this.#f(e,"start","_onStart"))}#f(e,t,n){let s=e.node.getAttr(n);if(Rl(s))for(let i of e.providers){if(typeof s!="number"||s<=0){i.invoke({kind:t,change:null});continue}let a=null,o=setTimeout(()=>{a(),i.invoke({kind:t,change:null})},s);a=e.track(()=>clearTimeout(o))}}#c(e,t){let n=this.#p(e);if(this.inlineCompiler.release(e,Object.keys(t)),Object.hasOwn(t,"node_id")){let{old:s,new:i}=t.node_id;if(i!=null&&this.nodeIds.has(i)&&this.nodeIds.get(i)!==e)throw new Error(`Duplicate node_id '${i}'`);this.nodeIds.get(s)===e&&this.nodeIds.delete(s),i!=null&&this.nodeIds.set(i,e)}ch.some(s=>Object.hasOwn(t,s))?this.rebindBranch(e):n.rebind()}#p(e){let t=this.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': the node has no NodeBinding (its installation failed); remove it from the Source and insert it again`);return t}#d(e){let t=[e];if(e.value instanceof D)for(let n of e.value.getNodes())t.push(...this.#d(n));return t}};function Rl(r){return r===!0||typeof r=="number"}var $i=class{#e;#t;#r=!1;#s=[];#n=[];#i=new Set;#a=null;#u=0;#l=null;constructor(e,t){this.#e=e,this.#t=t}get runtime(){return this.#e}get node(){return this.#t}get closed(){return this.#r}get registrations(){return[...this.#n]}get providers(){return this.#a?[this.#a]:[]}get clickCount(){return this.#u}countClick(){return++this.#u}hasStamp(e){return this.#i.has(e)}stamp(e){this.#i.add(e)}registerPointers(){let e=this.node,t=e._getMeta("data_element");if(!(t&&!Il[e.nodeTag])){for(let[n,s]of e.pointers()){if(t&&n!=="datapath")continue;let a=(n==="datapath"?e.parentNode:e).absDatapath(s);if(a===null)continue;let[o,u=null]=a.split("?",2),l=this.runtime.router.register({path:o,attr:u,recipient:this});this.#n.push(l),n==="datapath"&&(this.#l=l)}t&&(this.#a??=new Il[e.nodeTag](this),this.#a.register())}}rebind(){this.#o(),this.registerPointers()}receive(e){e.registration===this.#l?this.runtime.rebindBranch(this.node):this.runtime.renderer.project(this.node,e)}track(e){if(this.closed)throw new Error(`NodeBinding of '${this.node.label}' is closed`);return this.#s.push(e),()=>{let t=this.#s.indexOf(e);t!==-1&&this.#s.splice(t,1)}}close(){if(this.closed)return;this.#r=!0,this.#o();let e=[];for(let t of this.#s.splice(0).reverse())try{t()}catch(n){e.push(n)}if(e.length)throw new AggregateError(e,`NodeBinding of '${this.node.label}' cleanup failed`)}#o(){for(let e of this.#n.splice(0))e.close();this.#l=null}};var un=class extends It{static renderType="object";#e=new Set;#t=new WeakMap;#r=new WeakMap;constructor(e,t,n,{binding:s}={}){if(super(e),!(e instanceof he)||!(t instanceof se)||n?.nodeType!==1)throw new TypeError("GramlotRenderer requires a BuilderBase, GramlotBuilderBag and HTML destination");if(!(s instanceof dr))throw new TypeError("GramlotRenderer requires a BindingRuntime");if(!(t._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");this._binding=s,this.source=t,this.destination=n,this.html=new ds({metadataAttributes:["__ref"]}),this.records=new Map,this.references=new sn(t),this.pending=[],this.building=!1,this.disposed=!1,this.elements=new WeakMap,this.instanceId=crypto.randomUUID(),this.radioGroups=new cs(this),this.subscription=`html-source-renderer-${this.instanceId}`,t.subscribe(this.subscription,{any:i=>this.receive(i)})}get binding(){return this._binding}get inlineCompiler(){return this.binding.inlineCompiler}evaluateExpressions(e,t){let n=this.#r.get(e)??super.evaluateExpressions(e,t);return this.#r.delete(e),this.#t.set(e,n),n}render(e,t={}){if(!(e instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(e._getMeta("data_element")||!this.binding.bindingFor(e)&&this.#a(e))return null;if(e.nodeTag)this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder);else if(!(e.value instanceof D))throw new TypeError("Source fragments must contain child SourceBags");return e.nodeTag?super.render(e,t):this.renderFragment(e,t)}renderFragment(e,{document:t=this.destination.ownerDocument,...n}={}){let s=t.createDocumentFragment(),i={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],start:t.createComment("source-fragment"),end:t.createComment("/source-fragment")};this.records.set(e,i),this.elements.set(s,i),s.append(i.start);for(let a of e.value.getNodes()){let o=this.render(a,{document:t,...n});if(o===null)continue;s.append(o);let u=this.elements.get(o);u&&(u.parent=i,i.children.add(a))}return s.append(i.end),s}renderedItem(e,t,n,{tag:s,document:i=this.destination.ownerDocument}={}){let a=n;t=this.expressionValue(e,t),this.getRender(e.builder)===this&&([t,a]=en(t,this.restoreNativeAttributes(e,n)));let o=Array.isArray(t)?t:[],u=Array.isArray(t)?a._text:t,l=this.#t.get(e),c={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],resolved:l,...this.html.create(e,i,s,a,l.visible??null)};this.html.compose(c,u,o),c.shape=me.shape(c.element,l),this.records.set(e,c),this.elements.set(c.element,c);let d=me.for(c.binding,c);d&&(c.control=d,d.attach(),c.cleanup.push(()=>d.detach()),this.#o(c,e,a,null));let f=fs.for(c.binding,c);f&&(c.button=f,f.attach(),c.cleanup.push(()=>f.detach())),this.#f(c),this.references?.register(e,c.element);for(let p of o){let h=this.elements.get(p);h&&(h.parent=c,h.container=c.element,c.children.add(h.node))}return c.element}validateCandidate(e,{replacingNode:t=null}={}){if(!(e instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");let n=new Set,s=i=>{n.add(i);for(let a of this.records.get(i)?.children??[])s(a)};for(let i of this.records.get(t)?.children??[])s(i);return this.#s(e,t?t.nodeTag:null),Ri(e),this.references?.validate(e,n),e}#s(e,t=null){let n=new Set,s=(i,a=null)=>{if(!(i instanceof se)||n.has(i))throw new TypeError("Source values must be unshared, acyclic GramlotBuilderBags");if(!(i._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");n.add(i);for(let o of i.getNodes()){if(!(o instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(!(o.builder instanceof he))throw new TypeError("SourceBagNode requires builder ownership");if(o.resolver)throw new TypeError("Source resolvers are outside this port");if(o._getMeta("data_element"))o.builder.validateNode(o);else if(o.nodeTag){let u=o._getMeta("subbuilder")?i._builder:o.builder;this.html.validate(o,u),o._getMeta("subbuilder")||o.builder.validateParent(o.nodeTag,a)}else{if(!(o.value instanceof D))throw new TypeError("Source fragments must contain child SourceBags");if(Object.keys(o.attr).some(u=>u!=="_meta"))throw new TypeError("Fragment attributes are unsupported")}o.value instanceof D&&s(o.value,o._getMeta("subbuilder")?null:o.nodeTag??a)}};s(e,t)}freeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Freeze requires a mounted Source node");t.frozen=!0}unfreeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Unfreeze requires a mounted Source node");let n=s=>{delete s.frozen;for(let i of s.children)n(this.records.get(i))};n(t),!this.#n(e)&&(this.attached(e)?this.#d(e):this.remove(e))}#n(e){for(;e;){let t=this.records.get(e);if(t?.frozen)return!0;e=e.parentBag?.parentNode??t?.parent?.node}return!1}receive(e){if(!this.disposed){if(Array.isArray(e.node)){let t=e.node.filter(n=>!this.#e.has(n));if(!t.length)return;e={...e,node:t}}else if(this.#e.has(e.node))return;if(this.pending.push(e),!this.building){this.building=!0;try{for(;this.pending.length;){let t=this.pending.shift();if(t.evt!=="del"&&!this.attached(t.node))continue;t.evt!=="del"&&t.evt!=="upd_attrs"&&this.#u(t);let n=this.binding.handleSourceEvent(t);try{this.#i(t,n)}catch(s){if(!n.length)throw s;n.push(s)}if(n.length)throw n.length===1?n[0]:new AggregateError(n,"Source cleanup failed")}}catch(t){throw this.pending.length=0,t}finally{this.building=!1}}}}#i(e,t){if(e.evt==="del"){for(let n of Array.isArray(e.node)?e.node:[e.node]){if(this.#n(n))continue;let s=this.records.get(n)?.parent??null;try{this.remove(n)}catch(i){t.push(i)}this.#c(s)}return}if(!this.#n(e.node))if(e.evt==="ins")this.insert(e.node);else if(e.evt.startsWith("upd_"))this.update(e.node,e.evt);else throw new Error(`Unsupported Source event: ${e.evt}`)}attached(e){let t=e.parentBag;for(;t&&t!==this.source;)t=t.parentNode?.parentBag;return t===this.source}#a(e){let t=new Set(this.pending.flatMap(n=>Array.isArray(n.node)?n.node:[n.node]));for(let n=e;n;n=n.parentBag?.parentNode)if(t.has(n))return!0;return!1}#u(e){let t=n=>{if(!(n instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(n.value instanceof D){if(!(n.value instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");for(let s of n.value.getNodes())t(s)}};t(e.node)}insert(e){if(!this.attached(e)||this.records.has(e))return;if(e._getMeta("data_element")){this.records.get(e.parentBag?.parentNode)?.button?.refresh(),this.binding.branchBuilt(e);return}let t=this.records.get(e.parentBag?.parentNode),n=t?.element??t?.container??this.destination,s=e.parentBag.getNodes(),i=t?.end??null;for(let a=s.indexOf(e)+1;a<s.length;a++){let o=this.records.get(s[a]);if(o){i=o.element??o.start;break}}this.buildNode(e,n,i,t)}buildNode(e,t,n=null,s=null){this.#e.add(e);let i;try{i=this.render(e,{document:t.ownerDocument})}catch(o){this.#l(e,o)}finally{this.#e.delete(e)}let a=this.records.get(e);return t.insertBefore(i,n),a.parent=s,this.assignContainer(a,t),s?.children.add(e),this.#c(s),this.binding.branchBuilt(e),a}#l(e,t){let n=[t],s=[],i=a=>{if(s.push(a),a.value instanceof D)for(let o of a.value.getNodes())i(o)};i(e);for(let a of s.reverse())try{this.remove(a)}catch(o){n.push(o)}throw n.length===1?t:new AggregateError(n,"Source build and cleanup failed")}assignContainer(e,t){e.container=t;let n=e.element??t;for(let s of e.children){let i=this.records.get(s);i&&this.assignContainer(i,n)}}update(e,t){let n=this.records.get(e);if(!n){this.insert(e);return}let s=e.value==null||["string","number","boolean"].includes(typeof e.value),i=t==="upd_value"&&s&&n.element&&n.children.size===0&&this.html.matches(n,e);(t==="upd_attrs"||i)&&n.element&&this.html.matches(n,e)?(e.nodeTag&&this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder),this.project(e),t==="upd_attrs"&&this.records.get(e)===n&&(this.references?.remove(e),this.references?.register(e,n.element))):this.#d(e)}project(e,t=null){let n=this.records.get(e);if(!n?.element)return;let s=this.getRender(e.builder),[i,a]=e.builder.runtimeValues(e),[,o]=s._handleMeta(e,a),u=this.#t.get(e);if(n.shape!==me.shape(n.element,u)){if(this.#n(e))return;this.#r.set(e,u);try{this.#d(e)}finally{this.#r.delete(e)}return}n.resolved=u;let l=e._getMeta("subbuilder")?o:s.adaptAttrs(o),c=e.value instanceof D,d=c?[]:this.expressionValue(e,i);s===this&&([d,l]=en(d,this.restoreNativeAttributes(e,l))),this.html.update(n,e,l,c?l._text:d,u.visible??null),this.#o(n,e,l,t),n.control?.refresh(),n.button?.refresh(),this.#f(n),(n.element.localName==="option"||n.element.localName==="optgroup")&&this.#c(n.parent)}#o(e,t,n,s){if(!e.control)return;let i=t.getAttr("value")!=null;(i||e.valueDeclared)&&e.control.project(n.value??null,s),e.valueDeclared=i}#f(e){let t=new Map(nn.declared(e.node).map(n=>[n[0],n]));if(!e.events){if(!t.size)return;e.events=new Map,e.cleanup.push(()=>{for(let n of e.events.values())n.detach();e.events.clear()})}for(let[n,s]of[...e.events])t.get(n)?.[2]!==s.handler&&(s.detach(),e.events.delete(n));for(let[n,[,s,i]]of t){if(e.events.has(n))continue;let a=new nn(e.binding,e,s,i,n);a.attach(),e.events.set(n,a)}}#c(e){for(let t=e;t;t=t.parent){if(t.control instanceof rn){this.project(t.node);return}if(t.element&&t.element.localName!=="optgroup")return}}getDomNode(e){let t=Ie(e),n=this.records.get(t);return n&&this.attached(t)?n.element??null:null}getBaseSourceNode(e){for(let t=e;t;t=t.parentNode){let n=t.nodeType===1?this.elements.get(t):null;if(n)return this.attached(n.node)?n.node:null}return null}#p(e){let t=this.binding.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': rendered without an open NodeBinding`);return t}#d(e){let t=this.records.get(e),n=t.element?.nextSibling??t.end?.nextSibling??null,s=t.container,i=t.parent,a=null;try{this.remove(e)}catch(o){a=o}try{this.buildNode(e,s,n,i)}catch(o){throw a?new AggregateError([a,o],"Source replacement cleanup and commit failed"):o}if(a)throw a}onDispose(e,t){let n=this.records.get(e);if(!n)throw new Error("Source node is not mounted");return n.cleanup.push(t),()=>{let s=n.cleanup.indexOf(t);s!==-1&&n.cleanup.splice(s,1)}}remove(e){let t=this.records.get(e);if(!t)return;let n=[];for(let s of[...t.children])try{this.remove(s)}catch(i){n.push(i)}for(let s of t.cleanup.splice(0).reverse())try{s()}catch(i){n.push(i)}if(this.references?.remove(e),t.element&&this.elements.delete(t.element),t.element?.remove(),t.start?.remove(),t.end?.remove(),t.parent?.children.delete(e),this.records.delete(e),n.length)throw new AggregateError(n,"Source cleanup failed")}dispose(){if(this.disposed)return;this.disposed=!0,this.source.unsubscribe(this.subscription,{any:!0}),this.pending.length=0;let e=[],t=[...this.records.entries()].filter(([,n])=>!n.parent).map(([n])=>n);for(let n of t)try{this.remove(n)}catch(s){e.push(s)}if(e.length)throw new AggregateError(e,"Renderer cleanup failed")}};var dh=new Set(["page","constructor"]);function Ml(r,e){if(r===null)return[];let t=r.split("/");for(let n of t)if(dh.has(n))throw new Error(`${e}: a logic group cannot be named '${n}' (group '${r}')`);return t}var fh=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function ph(r){return/^[\w$]/.test(r)?fh.has(r):r!==")"&&r!=="]"}function hh(r,e){let t=!1;for(let n=e+1;n<r.length;n++){let s=r[n];if(s===`
|
package/package.json
CHANGED
|
@@ -14,8 +14,11 @@ export class GramlotBuilder extends HtmlBuilder {
|
|
|
14
14
|
static _name: string;
|
|
15
15
|
/** Tag prefixes of the parent dialects, from the names of the classes above `GramlotBuilder`. */
|
|
16
16
|
static get dialectPrefixes(): string[];
|
|
17
|
-
/** Create a builder; `collections` are grammar documents loaded into it. */
|
|
18
|
-
constructor(name?: string | null, options?: {collections?: unknown[]
|
|
17
|
+
/** Create a builder; `collections` are grammar documents loaded into it; `auth` evaluates the `auth` rules of the elements when the Source is serialised. */
|
|
18
|
+
constructor(name?: string | null, options?: {collections?: unknown[];
|
|
19
|
+
auth?: ((rule: string) => null | 'not_authenticated' | 'not_authorized') | null});
|
|
20
|
+
/** The `auth` evaluator, or null: without it every element is serialised. */
|
|
21
|
+
readonly auth: ((rule: string) => null | 'not_authenticated' | 'not_authorized') | null;
|
|
19
22
|
/** The binding runtime of the Gramlot page that owns this builder, or null for authoring alone; set by `Gramlot` right after creating the builder. */
|
|
20
23
|
binding: unknown;
|
|
21
24
|
/** The node with `nodeId`; inside a Gramlot page it reads the node ids of the binding runtime. */
|
|
@@ -45,6 +48,6 @@ export class GramlotBuilder extends HtmlBuilder {
|
|
|
45
48
|
promoteNodeValue(node: SourceBagNode, oldValue: unknown, branch: SourceBag): void;
|
|
46
49
|
/** Create a transportable reference descriptor for an authored node. */
|
|
47
50
|
reference(node: SourceBagNode, kind?: 'node' | 'dom'): SourceReference;
|
|
48
|
-
/** The Source encoded as TYTX text. */
|
|
51
|
+
/** The Source encoded as TYTX text; with an `auth` evaluator, without the elements whose `auth` rule it refuses. */
|
|
49
52
|
toTytx(): string;
|
|
50
53
|
}
|
|
@@ -64,12 +64,17 @@ export class GramlotBuilder extends HtmlBuilder {
|
|
|
64
64
|
return prefixes;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
constructor(name = null, {collections = []} = {}) {
|
|
67
|
+
constructor(name = null, {collections = [], auth = null} = {}) {
|
|
68
68
|
super(name);
|
|
69
69
|
this._binding = null;
|
|
70
|
+
this._auth = auth;
|
|
70
71
|
for (const collection of collections) this.loadCollection(collection);
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
/** The `auth` evaluator, `rule => null | 'not_authenticated' | 'not_authorized'`, or null:
|
|
75
|
+
* without it every element is serialised. */
|
|
76
|
+
get auth() { return this._auth; }
|
|
77
|
+
|
|
73
78
|
/** The BindingRuntime of the Gramlot page that owns this builder, or null for authoring alone. */
|
|
74
79
|
get binding() { return this._binding; }
|
|
75
80
|
/** Set by Gramlot right after creating the builder (§4.3). */
|
|
@@ -183,5 +188,7 @@ export class GramlotBuilder extends HtmlBuilder {
|
|
|
183
188
|
return {$gramlotRef: id, kind};
|
|
184
189
|
}
|
|
185
190
|
|
|
186
|
-
|
|
191
|
+
/** The Source encoded as TYTX text, as the Python `to_tytx`. With an `auth` evaluator, the elements
|
|
192
|
+
* whose `auth` rule it refuses are left out (GramlotBuilderBag.authorizedCopy). */
|
|
193
|
+
toTytx() { return toTytx(this.auth === null ? this.source : this.source.authorizedCopy(this.auth)); }
|
|
187
194
|
}
|
package/src/builder/source.js
CHANGED
|
@@ -274,6 +274,33 @@ export class GramlotBuilderBag extends SourceBag {
|
|
|
274
274
|
return GramlotBuilderBagNode;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
/**
|
|
278
|
+
* A copy of this Source without the elements whose `auth` rule `auth` refuses, as the Python
|
|
279
|
+
* `authorized_copy`. `auth` is a function `rule => null | 'not_authenticated' | 'not_authorized'`.
|
|
280
|
+
* An element whose `auth` attribute `auth` answers with a code is left out with its subtree;
|
|
281
|
+
* nested Source branches are copied the same way. This Bag is not changed. A non-string `auth`
|
|
282
|
+
* attribute is a TypeError.
|
|
283
|
+
*/
|
|
284
|
+
authorizedCopy(auth) {
|
|
285
|
+
const result = new this.constructor();
|
|
286
|
+
for (const node of this.getNodes()) {
|
|
287
|
+
const rule = node.getAttr('auth') ?? null;
|
|
288
|
+
if (rule !== null) {
|
|
289
|
+
if (typeof rule !== 'string') {
|
|
290
|
+
throw new TypeError(`${node.nodeTag} '${node.label}': 'auth' must be a string rule, not ${typeof rule}`);
|
|
291
|
+
}
|
|
292
|
+
if (auth(rule) !== null) continue;
|
|
293
|
+
}
|
|
294
|
+
let value = node.staticValue;
|
|
295
|
+
if (value instanceof GramlotBuilderBag) value = value.authorizedCopy(auth);
|
|
296
|
+
const {auth: _rule, ...attributes} = node.getAttr();
|
|
297
|
+
const copied = result.setItem(node.label, value, attributes, '>', false, false, null, false, true,
|
|
298
|
+
null, node.nodeTag);
|
|
299
|
+
copied.xmlTag = node.xmlTag;
|
|
300
|
+
}
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
|
|
277
304
|
/** Activate the inline code of every node, nested Source branches included (GramlotBuilderBagNode.activateCode); returns this. */
|
|
278
305
|
activateCode() {
|
|
279
306
|
for (const node of this.getNodes()) {
|
|
@@ -40,8 +40,8 @@ export class SourceHandler extends Handler {
|
|
|
40
40
|
* Replace the children of one Source node with a remote Source, only after the incoming Source
|
|
41
41
|
* validates. Resolves with true when applied, false when superseded or cancelled.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* A declared fragment is requested from code with `gramlot.src.remoteSource` (GC-230 §035); the
|
|
44
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
45
45
|
*/
|
|
46
46
|
remoteSource(target: SourceBagNode, method: string, params?: Record<string, unknown>): Promise<boolean>;
|
|
47
47
|
}
|
|
@@ -79,8 +79,8 @@ export class SourceHandler extends Handler {
|
|
|
79
79
|
* The request lives as long as the target's NodeBinding (P24): a DOM rebuild
|
|
80
80
|
* or a freeze keeps it, the removal of the target cancels it.
|
|
81
81
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* `@source` / `registerSource` declare the fragments this method requests (GC-230 §035); the
|
|
83
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
84
84
|
*/
|
|
85
85
|
async remoteSource(target, method, params = {}) {
|
|
86
86
|
const rpc = this.gramlot.rpc;
|
|
@@ -173,6 +173,15 @@ export async function checkProtocol(baseUrl, pagePath) {
|
|
|
173
173
|
await outcome('GC-230-030', envelope('data', 'check_endpoint_auth'), 'not_authenticated', 'check_endpoint_auth');
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
response = await call(envelope('source', 'check_fragment_auth'));
|
|
177
|
+
const guarded = parse(response.body, JSON.parse)?.value;
|
|
178
|
+
expect('GC-230-030', response.status === 200 && typeof guarded === 'string' && guarded.includes('check-public'),
|
|
179
|
+
`check_fragment_auth answers ${response.status} ${response.body.slice(0, 200)}, not a fragment document`);
|
|
180
|
+
if (!config.capabilities.includes('auth')) {
|
|
181
|
+
expect('GC-230-030', !guarded.includes('check-refused'),
|
|
182
|
+
`check_fragment_auth answers ${guarded.slice(0, 200)}, which contains the element of the refused auth rule`);
|
|
183
|
+
}
|
|
184
|
+
|
|
176
185
|
const error = await outcome('GC-230-025', envelope('data', 'check_endpoint_raise'), 'application_error',
|
|
177
186
|
'check_endpoint_raise');
|
|
178
187
|
expect('GC-230-025', typeof error.name === 'string' && error.name !== '' && error.message === 'check',
|
|
@@ -91,6 +91,16 @@ export class GramlotServer {
|
|
|
91
91
|
return rule === null ? null : 'not_authenticated';
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/** evaluateAuth with its result checked: a value other than null, 'not_authenticated' and
|
|
95
|
+
* 'not_authorized' is a TypeError. */
|
|
96
|
+
#authOutcome(rule, owner) {
|
|
97
|
+
const refused = this.evaluateAuth(rule, {owner});
|
|
98
|
+
if (![null, 'not_authenticated', 'not_authorized'].includes(refused)) {
|
|
99
|
+
throw new TypeError("evaluateAuth must return null, 'not_authenticated' or 'not_authorized'");
|
|
100
|
+
}
|
|
101
|
+
return refused;
|
|
102
|
+
}
|
|
103
|
+
|
|
94
104
|
prune() {
|
|
95
105
|
const now = performance.now();
|
|
96
106
|
for (const [id, record] of this.pages) if (record.expires <= now) this.pages.delete(id);
|
|
@@ -181,16 +191,14 @@ export class GramlotServer {
|
|
|
181
191
|
}
|
|
182
192
|
rule = callable[source ? SOURCE_METHOD : ENDPOINT_METHOD].auth;
|
|
183
193
|
}
|
|
184
|
-
const refused = this
|
|
185
|
-
if (![null, 'not_authenticated', 'not_authorized'].includes(refused)) {
|
|
186
|
-
throw new TypeError("evaluateAuth must return null, 'not_authenticated' or 'not_authorized'");
|
|
187
|
-
}
|
|
194
|
+
const refused = this.#authOutcome(rule, owner);
|
|
188
195
|
if (refused !== null) {
|
|
189
196
|
const Refusal = [NotAuthenticated, NotAuthorized].find(ErrorClass => OUTCOME_CODES.get(ErrorClass) === refused);
|
|
190
197
|
throw new Refusal(`Access refused: ${name}`);
|
|
191
198
|
}
|
|
192
199
|
if (!source) return callable.call(page, params);
|
|
193
|
-
const builder = new record.PageClass.sourceBuilder(name
|
|
200
|
+
const builder = new record.PageClass.sourceBuilder(name,
|
|
201
|
+
{auth: elementRule => this.#authOutcome(elementRule, owner)});
|
|
194
202
|
const result = await callable.call(page, builder.root, params);
|
|
195
203
|
if (result !== undefined && result !== null) throw new TypeError('Source methods populate root and return no value');
|
|
196
204
|
return builder.toTytx();
|
package/src/server/page.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export class Page {
|
|
|
36
36
|
* equivalent to the Python `@source`; call it after the class. A Source method populates
|
|
37
37
|
* its `root` argument and returns nothing.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* A declared fragment is requested from code with `gramlot.src.remoteSource` (GC-230 §035); the
|
|
40
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
41
41
|
*/
|
|
42
42
|
static registerSource(methodName: string, options?: {auth?: string | null}): void;
|
|
43
43
|
/** Mark the own method `methodName` of this page class as an endpoint called with
|
package/src/server/page.js
CHANGED
|
@@ -61,8 +61,8 @@ export class Page {
|
|
|
61
61
|
* Mark the own method `methodName` of this page class as a remote Source method,
|
|
62
62
|
* equivalent to Python `@source`; call it after the class.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* A declared fragment is requested from code with `gramlot.src.remoteSource` (GC-230 §035); the
|
|
65
|
+
* declarative `remote` grammar attribute is not yet available.
|
|
66
66
|
*/
|
|
67
67
|
static registerSource(methodName, {auth = null} = {}) {
|
|
68
68
|
declare(this, methodName, SOURCE_METHOD, auth);
|