@gramlot/gramlot 0.3.31 → 0.3.33
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/components/charts/__init__.py +1 -1
- package/dist/components/charts/assets/collection.js +36 -21
- package/dist/components/charts/assets/index.js +1 -1
- package/dist/components/charts/grammar.json +15482 -232
- package/dist/components/grid/__init__.py +1 -1
- package/dist/components/grid/assets/collection.js +5 -5
- package/dist/components/grid/assets/index.js +1 -1
- package/dist/gramlot.js +22 -10
- package/dist/gramlot.min.js +2 -2
- package/dist/standard-collections.js +1 -1
- package/package.json +1 -1
- package/src/components/chart-boxplot-options.js +22 -0
- package/src/components/chart-candlestick-options.js +27 -0
- package/src/components/chart-controls.js +28 -6
- package/src/components/chart-domains.js +1 -1
- package/src/components/chart-engines/echarts.js +18 -0
- package/src/components/chart-fields.js +11 -1
- package/src/components/chart-funnel-options.js +19 -0
- package/src/components/chart-gauge-options.js +98 -0
- package/src/components/chart-gauge.js +105 -0
- package/src/components/chart-heatmap-options.js +29 -0
- package/src/components/chart-notice.js +126 -0
- package/src/components/chart-pane.js +7 -1
- package/src/components/chart-parallel-options.js +24 -0
- package/src/components/chart-radar-options.js +29 -0
- package/src/components/chart-renderer.js +2 -8
- package/src/components/chart-sankey-options.js +43 -0
- package/src/components/chart-sunburst-options.js +12 -0
- package/src/components/chart-syntax.js +82 -0
- package/src/components/chart-time.js +2 -1
- package/src/components/chart-treemap-options.js +16 -0
- package/src/components/chart-type-data.js +62 -0
- package/src/components/chart-types/area.js +6 -1
- package/src/components/chart-types/bar.js +6 -1
- package/src/components/chart-types/bar3D.js +7 -1
- package/src/components/chart-types/boxplot.js +11 -0
- package/src/components/chart-types/candlestick.js +10 -0
- package/src/components/chart-types/donut.js +6 -1
- package/src/components/chart-types/funnel.js +7 -0
- package/src/components/chart-types/heatmap.js +8 -0
- package/src/components/chart-types/horizontalBar.js +6 -1
- package/src/components/chart-types/index.js +21 -1
- package/src/components/chart-types/line.js +6 -1
- package/src/components/chart-types/line3D.js +7 -1
- package/src/components/chart-types/lines3D.js +7 -1
- package/src/components/chart-types/map.js +7 -1
- package/src/components/chart-types/map3D.js +6 -1
- package/src/components/chart-types/mapBar3D.js +6 -1
- package/src/components/chart-types/parallel.js +7 -0
- package/src/components/chart-types/pie.js +6 -1
- package/src/components/chart-types/polygons3D.js +7 -1
- package/src/components/chart-types/radar.js +7 -0
- package/src/components/chart-types/sankey.js +8 -0
- package/src/components/chart-types/scatter.js +6 -1
- package/src/components/chart-types/scatter3D.js +7 -1
- package/src/components/chart-types/stackedArea.js +6 -1
- package/src/components/chart-types/stackedBar.js +6 -1
- package/src/components/chart-types/sunburst.js +7 -0
- package/src/components/chart-types/surface.js +7 -1
- package/src/components/chart-types/treemap.js +7 -0
- package/src/components/charts.js +60 -13
- package/src/components/grid-selection.js +10 -3
- package/src/components/registry.js +9 -5
- package/src/page-store-connection.js +15 -5
- package/themes/gramlot-base/theme.css +2 -0
|
@@ -19,13 +19,13 @@ ${" ".repeat(i)}</${o}>`:`<${o}${l}>${f}</${o}>`:t===null||t.includes(o)?`<${o}
|
|
|
19
19
|
`)}toString(e=!0,t=null,n=""){t||(t=new Set);let i=[],s=[...this._nodes];for(let o=0;o<s.length;o++){let a=s[o],l=o===s.length-1,u=a.getValue(e),c="",d=a.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",h=n+(l?" ":"\u2502 ");if(u&&typeof u._htraverse=="function"){let p=a;if(t.has(p))i.push(`${n}${f}${a.label}${c} \u2192 (circular ref)`);else{t.add(p),i.push(`${n}${f}${a.label}${c}`);let m=u.toString(e,t,h);m&&i.push(m)}}else{let p;u==null?p="null":typeof u=="string"&&u.length>50?p=JSON.stringify(u.slice(0,47)+"..."):typeof u=="string"?p=JSON.stringify(u):p=String(u),i.push(`${n}${f}${a.label}: ${p}${c}`)}}return i.join(`
|
|
20
20
|
`)}},Ir=class extends Error{constructor(e){super(e),this.name="BagException"}};re.registerBagClass(ne);Ji(ne,"X",r=>r._toTytxPayload(),r=>ne._fromTytxPayload(r));Tr(ne.tytxSuffix,{...ze(ne.tytxSuffix),Bag:ne});var La=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 Fa(r){return r.endsWith("_")&&La.has(r.slice(0,-1))?r.slice(0,-1):r}function $a(r){let e=Fa(r);return e!==r?e:r.startsWith("_")&&La.has(r.slice(1))?r.slice(1):r}function as(r,{renderTag:e=null,ns:t=null,dialectName:n=null}={}){let i=e||r;if(!i)return i;if(i=Fa(i),t&&!e){let s=`${n}_`;i.startsWith(s)&&(i=i.slice(s.length)),i=`${t}:${i}`}return i}var Yt=Symbol("value"),qa=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function ls(r){return Object.entries(r||{}).filter(([e])=>!qa.has(e)).map(([e,t])=>[$a(e),t])}var Xt=class extends Ve{constructor(e,t,n=null,i=null,s=null,o=null,a=null){super(e,t,n,i,s,o,a),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(i=>i.trim());return n.length===1?t[n[0]]!==void 0?t[n[0]]:null:n.map(i=>t[i]!==void 0?t[i]:null)}pointerType(e){return typeof e=="string"&&(e[0]==="^"||e[0]==="=")&&!e.startsWith("==")?e[0]:null}pointers(){this.builder.validateCustomTypes(this);let e=[];for(let[t,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([t,n.split(":",1)[0]]);return this.pointerType(this.value)==="^"&&e.push(["",this.value.split(":",1)[0]]),e}fixedAttrItems(){return ls(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(Yt,this.value),e}absDatapath(e){let t=e;this.pointerType(e)&&(e=(ot(e)?.pointer??e).slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._finalizeAbsPath(this._resolveSymbolicDatapath(e,t),n):(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 i=n.getAttr("datapath");i!=null&&(e=e==="."?i:i+e),n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_collapseParentDatapath(e,t){let n=[];for(let i of e.split("."))if(i==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${t}`);n.pop()}else n.push(i);return n.join(".")}_resolveSymbolicDatapath(e,t){let n=e.slice(1),i=n.indexOf("."),s=i===-1?n:n.slice(0,i),o=i===-1?"":n.slice(i+1),a;if(s==="FORM")a=this._findMarkedDatapathAncestor(!0,!1,t);else if(s==="ANCHOR")a=this._findMarkedDatapathAncestor(!1,!0,t);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${t} on a node without builder`);if(a=l.source.getNodeByAttr("nodeId",s),a==null)throw new Error(`#<id>: cannot resolve ${t}`)}return a.absDatapath(o?`.${o}`:".")}_findMarkedDatapathAncestor(e,t,n){let i=this;for(;i!=null;){let o=i.getAttr()||{};if(e&&(o.formId!=null||o.form===!0)||t&&"_anchor"in o)return i;i=i.parentNode}let s=e?"FORM":"ANCHOR";throw new Error(`#${s}: no marked ancestor found for ${n}`)}getRelativeData(e,t=null,{autocreate:n=!1}={}){let i=this.data,s=this.absDatapath(e);return n&&i.getItem(s)==null&&i.setItem(s,t),i.getItem(s,t)}setRelativeData(e,t,{attributes:n=null,fired:i=!1,reason:s=null}={}){let o=this.data,a=this.absDatapath(e);o.setItem(a,t,n,">",!1,!0,s===null?!0:s,i)}fireEvent(e,t=!0,{attributes:n=null,reason:i=null}={}){this.setRelativeData(e,t,{attributes:n,fired:!0,reason:i})}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})}},X=class r extends ne{constructor(e=null,t=null){super(e),this._builder=t,this._insertingBuilder=null}get nodeClass(){return Xt}_setBuilderItem(e,t,n,...i){let s=t?.map(([a])=>[a,a._builder])||null;if(t)for(let[a,l]of t)a._builder=l;let o=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(a){if(this.node(n)==null&&s)for(let[l,u]of s)l._builder=u;throw a}finally{this._insertingBuilder=o}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let t=this._builderBindingPlan(e);for(let[n,i]of t)n._builder=i;return this.setBackref(),this}_builderBindingPlan(e){let t=[],n=new WeakSet,i=(s,o)=>{if(n.has(s))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(s),t.push([s,o]);for(let a of s.getNodes()){let l=o,u=a._getMeta("subbuilder");u!=null&&(l=o._resolveSubbuilderReference(u,a.getAttr()||{},a.nodeTag)),t.push([a,l]);let c=a.getValue(!0);c instanceof r&&i(c,l)}};return i(this,e),t}};if((ze(X.tytxSuffix).SourceBag??X)!==X)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Tr(X.tytxSuffix,{...ze(X.tytxSuffix),SourceBag:X});function Lf(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 Ff=new Set(["then","toJSON"]),Ua=new WeakMap;function Rr(r){return Ua.get(r)||r}function us(r){if(r==null)return r;r=Rr(r);let e=r._builder||r.parentBag&&r.parentBag._builder;return e?e.wrapSource(r):r}function ja(r,e){let t=e instanceof ne,n=new Proxy(e,{get(i,s){if(typeof s=="symbol"||s.startsWith("_")||Ff.has(s))return Reflect.get(i,s,i);let o=r.schemaTag(s);if(t&&o)return Pa(r,i,o,t);if(s in i){let l=Reflect.get(i,s,i);return typeof l=="function"?l.bind(i):l}if(o)return Pa(r,i,o,t);let a=r.containerMethod(s);if(a)return(...l)=>r[a](r.wrapSource(i),...l)}});return Ua.set(n,e),n}function Pa(r,e,t,n){return(...i)=>{let{value:s,attrs:o}=Lf(i),a=n?r.bagCall(e,t,s,o):r.commandOnNode(e,t,s,o);return a.builder.wrapSource(a)}}var Va=/^[A-Za-z_][A-Za-z0-9_]*$/,$f=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),Pf=new Set(["framework","value","attribute"]),qf=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 wt(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function k(r,e){throw new TypeError(`${r}: ${e}`)}function Le(r,e,t,n){wt(r)||k(n,"must be an object");for(let i of Object.keys(r))e.includes(i)||k(n,`unknown field '${i}'`);for(let i of t)Object.hasOwn(r,i)||k(n,`missing field '${i}'`)}function yt(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)=>yt(t,`${e}[${n}]`));if(wt(r))return Object.entries(r).forEach(([t,n])=>yt(n,`${e}.${t}`));k(e,"must be lossless JSON data")}}function Uf(r,e){let t="",n=!1;for(let i=0;i<r.length;i++){let s=r[i];if(s==="\\"){t+=s+(r[++i]??"");continue}s==="["&&(n=!0),!n&&s==="."&&!(e&16)?t+="[^\\n]":!n&&s==="^"&&e&8?t+="(?:^|(?<=\\n))":!n&&s==="$"?t+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":t+=s,s==="]"&&(n=!1)}return t}function _t(r,e,t=!1,n=null){if(r===null)return null;switch(Le(r,["kind","dtype","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),r.kind){case"custom":return Le(r,["kind","name"],["kind","name"],e),n||k(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(r.name,e);case"dtype":{Le(r,["kind","dtype"],["kind","dtype"],e);let i=r.dtype;typeof i!="string"&&k(e,"dtype must be a string");let s=Dr(i);return!s&&i!=="NN"&&k(e,`unknown dtype '${i}'`),{...r,test:a=>i==="NN"?a===null:i==="N"?F(a)&&!["NaN","Infinity","-Infinity"].includes(a.toString()):s===Number?typeof a=="number"&&Number.isFinite(a)&&(i!=="L"||Number.isInteger(a)):s===String?typeof a=="string":s===Boolean?typeof a=="boolean":s===Date?a instanceof Date&&Number.isFinite(a.getTime()):s===Object?wt(a)&&[Object.prototype,null].includes(Object.getPrototypeOf(a)):a instanceof s}}case"any":return{...r,test:i=>!0};case"type":{(typeof r.module!="string"||typeof r.name!="string")&&k(e,"type requires string module/name");let i=`${r.module}.${r.name}`;if(i==="collections.abc.Callable")return{...r,test:o=>typeof o=="function",portable:!1};let s=qf.get(i);return s||k(e,`unsupported type '${i}'`),{...r,test:s}}case"union":{(!Array.isArray(r.items)||!r.items.length)&&k(e,"union items must be non-empty");let i=r.items.map((s,o)=>_t(s,`${e}.items[${o}]`,!0,n));return{...r,items:i,inputConstraint:i.some(s=>s.inputConstraint),test:s=>i.some(o=>o.test&&o.test(s))}}case"literal":return Array.isArray(r.values)||k(e,"literal values must be an array"),r.values.forEach((i,s)=>yt(i,`${e}.values[${s}]`)),{...r,test:i=>r.values.some(s=>Object.is(s,i))};case"annotated":{Array.isArray(r.metadata)||k(e,"annotated metadata must be an array"),r.metadata.some(o=>!["regex","range","value"].includes(o?.kind))&&k(e,"unsupported annotation metadata kind");let i=_t(r.base,`${e}.base`,!0,n),s=r.metadata.map((o,a)=>_t(o,`${e}.metadata[${a}]`,!0,n));return{...r,base:i,metadata:s,inputConstraint:i.inputConstraint,test:o=>i.test(o)&&s.every(a=>!a.test||a.test(o))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(r,i)||k(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])r[i]!==null&&(typeof r[i]!="number"||!Number.isFinite(r[i]))&&k(e,`${i} must be finite number or null`);return{...r,test:i=>typeof i=="number"&&(r.ge===null||i>=r.ge)&&(r.le===null||i<=r.le)&&(r.gt===null||i>r.gt)&&(r.lt===null||i<r.lt)}}case"regex":{(typeof r.pattern!="string"||!Number.isInteger(r.flags)||r.flags<0)&&k(e,"regex requires pattern and non-negative integer flags");let i=r.flags&-59;i&&k(e,`unsupported Python regex flags ${i}`),r.flags&2&&k(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(r.pattern.replaceAll(String.raw`[\s\S]`,"."))&&k(e,"regex uses a non-portable construct or character class");let s="uy";r.flags&16&&(s+="s");let o;try{o=new RegExp(`(?:${Uf(r.pattern,r.flags)})(?![\\s\\S])`,s)}catch(a){k(e,`invalid portable regex: ${a.message}`)}return{...r,test:a=>typeof a!="string"?!1:(o.lastIndex=0,o.test(a))}}case"value":return yt(r.value,`${e}.value`),{...r};case"generic":{let i=_t(r.origin,`${e}.origin`,!0,n);(r.origin?.kind!=="type"||r.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(r.origin.name))&&k(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(r.arguments)||k(e,"generic arguments must be an array");let s=r.arguments.map((o,a)=>_t(o,`${e}.arguments[${a}]`,!0,n));return{...r,origin:i,arguments:s,inputConstraint:s.some(o=>o.inputConstraint),test:o=>i.test(o)&&jf(r.origin,s,o)}}case"arguments":k(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return t||k(e,"ellipsis is only valid as a nested descriptor"),{...r};default:k(e,`unknown annotation kind '${r.kind}'`)}}function jf(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((i,s)=>e[s].test(i)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...t].every(i=>!e[0]?.test||e[0].test(i)):n==="builtins.dict"?Object.entries(t).every(([i,s])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(s))):!1}function Ha(r,e){if(r===null)return null;if(typeof r!="string"&&k(e,"must be string or null"),r==="")return new Map;let t=new Map;for(let n of r.split(",")){let i=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(i)&&k(e,`invalid cardinality item '${n}'`);let s=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);s||k(e,`invalid cardinality item '${n}'`);let[,o,a,l,u]=s;t.has(o)&&k(e,`duplicate tag '${o}'`);let c=0,d=1/0;i.includes("[")&&(i.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(a)),d<c&&k(e,`maximum ${d} is below minimum ${c}`),t.set(o,{min:c,max:d})}return t.has("*")&&t.size>1&&k(e,"wildcard '*' cannot be combined with named tags"),t}function Wa(r,e){if(r===null)return null;typeof r!="string"&&k(e,"must be string or null");let t=new Set;for(let n of r.split(",")){let i=n.trim();i&&((!Va.test(i)||t.has(i))&&k(e,`invalid or duplicate parent '${n}'`),t.add(i))}return t}function zf(r,e,t){if(r===null)return null;Le(r,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=r.parameters??[];Array.isArray(n)||k(e,"parameters must be an array"),r={parameters:n,accepts_var_keyword:n.some(l=>l.kind==="var_keyword"),accepts_var_positional:n.some(l=>l.kind==="var_positional"),...r},(!Array.isArray(r.parameters)||typeof r.accepts_var_keyword!="boolean"||typeof r.accepts_var_positional!="boolean")&&k(e,"invalid signature descriptor");let i=new Set,s=!1,o=!1,a=r.parameters.map((l,u)=>{let c=`${e}.parameters[${u}]`;return Le(l,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof l.name!="string"||!Va.test(l.name)||i.has(l.name))&&k(c,"invalid or duplicate parameter name"),i.add(l.name),(!$f.has(l.kind)||!Pf.has(l.role)||typeof l.has_default!="boolean")&&k(c,"invalid kind, role, or has_default"),l.has_default!==Object.hasOwn(l,"default")&&k(c,"default presence must equal has_default"),l.has_default&&yt(l.default,`${c}.default`),s||=l.kind==="var_keyword",o||=l.kind==="var_positional",{...l,annotation:_t(l.annotation,`${c}.annotation`,!1,t)}});return(s!==r.accepts_var_keyword||o!==r.accepts_var_positional)&&k(e,"variadic summary flags do not match parameters"),{...r,parameters:a}}function za(r,e,t,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...t?["node_label","collection_key"]:[],"_meta"];Le(r,i,[],e),r={...Object.fromEntries(i.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"&&k(e,`${s} must be string or null`);return r._meta!==null&&(wt(r._meta)||k(e,"_meta must be object or null"),yt(r._meta,`${e}._meta`)),Ha(r.sub_tags,`${e}.sub_tags`),Wa(r.parent_tags,`${e}.parent_tags`),{...r,attributes:zf(r.attributes,`${e}.attributes`,n)}}function Ga(r){return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function Xa(r,e){let t={...e};for(let[n,i]of Object.entries(r))n==="inherits_from"||n.startsWith("_")||t[n]||(t[n]=i);return t._meta={...r._meta||{},...e._meta||{}},t}function Ya(r){let e={...r};return e._subSpec=Object.hasOwn(e,"sub_tags")?Ha(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?Wa(e.parent_tags,"resolved.parent_tags"):null,e}function Za(r,e,t,n){if(t.get(r)===1&&k(n,`inheritance cycle at '${r}'`),t.get(r)===2)return e[r];let i=e[r];i||k(n,`unknown abstract '${r}'`),t.set(r,1);let s={...i};for(let o of Ga(i.inherits_from))s=Xa(Za(o,e,t,n),s);return s=Ya(s),t.set(r,2),e[r]=s,s}function cs({abstracts:r={},elements:e={}}){let t={...r},n=new Map;for(let s of Object.keys(t))Za(s,t,n,`abstracts.${s}.inherits_from`);let i={};for(let[s,o]of Object.entries(e)){let a={...o};for(let l of Ga(o.inherits_from)){let u=t[l];u||k(`elements.${s}.inherits_from`,`unknown abstract '${l}'`),a=Xa(u,a)}i[s]=Ya(a)}return{abstracts:t,elements:i}}function ds(r){Le(r,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Le(r.document_format,["name","version"],["name","version"],"document_format"),(r.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(r.document_format.version))&&k("document_format","expected builder_grammar version 1.1 or 1.2"),Le(r.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof r.grammar.name!="string"||!r.grammar.name)&&k("grammar.name","must be non-empty string");for(let i of["version","title","description"])r.grammar[i]!==null&&typeof r.grammar[i]!="string"&&k(`grammar.${i}`,"must be string or null");(!wt(r.abstracts)||!wt(r.elements))&&k("grammar document","abstracts/elements must be objects"),Object.hasOwn(r,"custom_types")&&r.document_format.version!=="1.2"&&k("custom_types","requires version 1.2");let e=Mn.fromJSON(r.custom_types??{}),t={};for(let[i,s]of Object.entries(r.abstracts))(!i||i.startsWith("_"))&&k("abstracts",`invalid public name '${i}'`),t[i]=za(s,`abstracts.${i}`,!1,e);let n={};for(let[i,s]of Object.entries(r.elements))(!i||i.startsWith("_"))&&k("elements",`invalid public name '${i}'`),n[i]=za(s,`elements.${i}`,!0,e);return{grammar:structuredClone(r.grammar),abstracts:t,elements:n}}function Ka(r,e,t,n){let i=e.attributes;if(!i)return;let s={...n};t!=null&&(s.node_value=t);let o=new Set(i.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),a=new Set(["node_label","node_position","nodeId","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!i.accepts_var_keyword)for(let u of Object.keys(n))!o.has(u)&&!a.has(u)&&k(r,`unknown attribute '${u}'`);let l=e._meta?.component?i.parameters.find(u=>u.role!=="framework"&&["positional_only","positional_or_keyword"].includes(u.kind))?.name:null;for(let u of i.parameters){if(u.name===l||u.role==="framework"||u.kind.startsWith("var_"))continue;let c=Object.hasOwn(s,u.name);!c&&!u.has_default&&k(r,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(s[u.name]))&&k(r,`invalid value for ${u.role} '${u.name}'`)}}var Mn=class r{#e=new Map;#t=new Map;register(e,t,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),s=i.has(t)?{kind:"type",module:"builtins",name:i.get(t)}:t;return this.#i(e,{kind:"annotated",base:s,metadata:[n]})}#i(e,t){(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||e in this||["to_dict","from_dict"].includes(e)||Vf.has(e))&&k("custom_types",`invalid, reserved or duplicate name '${e}'`),Le(t,["kind","base","metadata"],["kind","base","metadata"],`custom_types.${e}`),(t.kind!=="annotated"||!Array.isArray(t.metadata)||t.metadata.length!==1||!["regex","range"].includes(t.metadata[0]?.kind))&&k(`custom_types.${e}`,"requires an annotated base with one Regex or Range validator");let n=t.metadata[0].kind==="regex"?["str"]:["int","float"];(t.base?.kind!=="type"||t.base.module!=="builtins"||!n.includes(t.base.name))&&k(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),yt(t,`custom_types.${e}`);let i=structuredClone(t),s=_t(i,`custom_types.${e}`),o=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:o,enumerable:!0}),this.#e.set(e,i),this.#t.set(e,{...o,inputConstraint:!0,test:s.test}),o}resolve(e,t="custom_types"){return this.#t.has(e)||k(t,`unknown custom type '${e}'`),{...this.#t.get(e)}}validate(e,t){return this.resolve(e).test(t)||k(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){wt(e)||k("custom_types","must be an object");let t=new r;for(let[n,i]of Object.entries(e))t.#i(n,i);return t}},Vf=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".split(" "));function Ja(r,e,t,n){let i=e?.attributes;if(i)for(let s of i.parameters){if(!s.annotation?.inputConstraint||s.role==="framework"||["var_keyword","var_positional"].includes(s.kind))continue;let o=s.role==="value"?t:n[s.name];o!==void 0&&(s.annotation.test(o)||k(r,`invalid input for '${s.name}' (custom type)`))}}function Qa(r,e,t=[]){if(e===null)return structuredClone(r);if(t.length===2&&t[0]==="custom_types"&&r!==void 0){if(!fs(r,e))throw new TypeError(`conflicting custom type '${t[1]}'`);return structuredClone(r)}if(t.length===2&&["abstracts","elements"].includes(t[0]))return structuredClone(e);if(He(r)&&He(e)){let n=structuredClone(r);for(let[i,s]of Object.entries(e))s!==null&&Object.defineProperty(n,i,{value:Qa(n[i],s,[...t,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function fs(r,e){return Object.is(r,e)?!0:Array.isArray(r)&&Array.isArray(e)?r.length===e.length&&r.every((t,n)=>fs(t,e[n])):He(r)&&He(e)?Object.keys(r).length===Object.keys(e).length&&Object.keys(r).every(t=>Object.hasOwn(e,t)&&fs(r[t],e[t])):!1}function He(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&Object.getPrototypeOf(r)===Object.prototype}function hs(r){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r)){r.forEach(hs);return}if(He(r)){Object.values(r).forEach(hs);return}throw new TypeError("collection must contain only finite JSON values")}}var We=class r{#e;constructor(e){hs(e);let t=["document_format","grammar","abstracts","elements"];if(!He(e)||Object.keys(e).some(i=>![...t,"custom_types"].includes(i))||t.some(i=>!Object.hasOwn(e,i)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!He(n)||Object.keys(n).length!==2||n.name!=="builder_grammar"||!["1.1","1.2"].includes(n.version))throw new TypeError("expected builder_grammar version 1.1 or 1.2");for(let i of["grammar","abstracts","elements"])if(!He(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!He(e.custom_types)))throw new TypeError("custom_types requires an object catalog and version 1.2");this.#e=structuredClone(e)}update(e){let t=new r(e),n=Qa(this.#e,t.#e);return(this.#e.document_format.version==="1.2"||t.#e.document_format.version==="1.2")&&(n.document_format.version="1.2"),this.#e=n,this}toDocument(){return structuredClone(this.#e)}};var vt=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,[i,s]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,s,t);let o=this.getRender(n),a;return[a,s]=o._handleMeta(e,s),e._getMeta("subbuilder")||(s=o.adaptAttrs(s)),e.value instanceof X&&(i=this.renderChildren(e.value,t)),o.renderedItem(e,i,s,{tag:a,...t})}renderChildren(e,t={}){let n=[];for(let i of e.getNodes()){let s=this.render(i,t);s!==null&&(Array.isArray(s)?n.push(...s):n.push(s))}return n}_renderComponent(e,t,n){let[i,s,o,a]=this._expansionInputs(e,t);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,o,a,n);if(s==null)return[];if(!(s instanceof ne))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${s?.constructor?.name||typeof s}`);return s.getNodes().map(l=>this._expandBlock(e,i,o,{node_label:l.label},n))}_expansionInputs(e,t){let n=e.builder,i=n.componentMethod(e.nodeTag),s=i&&n[i];if(typeof s!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let o=t.iterate;delete t.iterate,delete t.store;let a=e.getAttr("iterate")||e.getAttr("store");a!=null?(e.pointerType(a)&&(a=a.slice(1)),a.startsWith(".")&&(a=e._composeRelativeDatapath(a,a))):a=null;for(let l of Object.keys(t)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(t[l]=`^${e.absDatapath(u)}`)}return[s,o,a,t]}_expandBlock(e,t,n,i,s){let o=e.builder._expansionRoot(n);t.call(e.builder,us(o),i);let a=o.getNodes();if(a.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${a.length} root nodes`);let l={...s,depthOffset:this._nodeDepth(e,s.depthOffset||0)};return this.render(a[0],l)}preprocess(e){return e}renderedItem(e,t,n,i){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,t){let[n,i]=e._getMeta("render_tag,render_attributes"),s=as(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!s)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(t={...t,...i}),[s,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 i=this._composeStringFragments(e);if(t==null)return i;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(i),null;if(typeof t.write=="function")return t.write(i),null;if(typeof t=="function")return t(i),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 i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+t}};var kt=class extends vt{static mode="xml";renderedItem(e,t,n,{tag:i,pretty:s=!1,depthOffset:o=0}={}){let a=this._formatAttrs(n),l=s?" ".repeat(this._nodeDepth(e,o)):"",u=s?`
|
|
21
21
|
`:"";if(Array.isArray(t)){let c=this._composeStringFragments(t);return`${l}<${i}${a}>${u}${c}${l}</${i}>${u}`}return t==null?`${l}<${i}${a}></${i}>${u}`:`${l}<${i}${a}>${this._escapeText(t)}</${i}>${u}`}finalize(e,t=null,{docHeader:n=null}={}){let i=this._composeStringFragments(e);return n===!0?i=`<?xml version='1.0' encoding='UTF-8'?>${i}`:typeof n=="string"&&(i=n+i),super.finalize(i,t)}_formatAttrs(e){return Object.entries(e||{}).map(([t,n])=>` ${t.startsWith("xmlns_")?`xmlns:${t.slice(6)}`:t}="${this._escapeAttr(n)}"`).join("")}};var el={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 tl(r){let e=[];for(;r&&r!==Function.prototype;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function Wf(r){let e=Object.create(null),t=(n,i)=>{let s=n.toLowerCase(),o=e[s];if(o!==void 0&&o!==i)throw new Error(`container '${n}' is already tied to implementation method '${o}' (cannot rebind to '${i}')`);e[s]=i};for(let n of tl(r))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])t(i,i);return e}function Mr(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 Lr="_root_",ps="_root_",rl=new Set(["destination","func","value","_on_start"]),Fe=class r{static _sourceClass=X;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 ne,this._dataroot.setBackref(),this._dataroot.setItem(ps,new ne),this.data=this._dataroot.getItem(ps),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(Lr,new t(null,this)),this.source=this._sourceroot.getItem(Lr)}wrapSource(e){if(e=Rr(e),!(e instanceof X)&&!(e instanceof Xt))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let t=this._sourceHandles.get(e);return t||(t=ja(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 We(t.toDocument()).update(e):new We(e),i=ds(n.toDocument()),s=cs(i),o=Mr(s.elements);this._classCollection=n,this._classSchema=s.elements,this._abstracts=s.abstracts,this._tagNames=o}static{this.defineGrammar(el)}get _containers(){return Wf(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??=Mr(this.schema):this.constructor._tagNames??=Mr(this.schema)}schemaTag(e){let t=e.toLowerCase(),n=this.schemaTagNames[t];if(n)return n;let i=`${this.constructor._name}_`;return t.startsWith(i)&&this.schemaTagNames[t.slice(i.length)]||null}loadGrammar(e,{replace:t=!1}={}){let n=this._collection||this.constructor._classCollection,i=t?new We(e):new We(n.toDocument()).update(e),s=ds(i.toDocument()),o=cs(s),a=Mr(o.elements);return this._collection=i,this._schemaOverride=o.elements,this._tagNamesOverride=a,this}validateCustomTypes(e){let t=e.parentBag?.parentNode?.builder||e.parentBag?._builder,n=t&&t!==this&&t.schema[e.nodeTag]?._meta?.subbuilder?t:this;Ja(e.nodeTag,n.schema[e.nodeTag],e.value,e.getAttr()||{})}validateNodeValues(e,t,n={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);return Ka(i,this.schema[i],t,n),!0}validateNode(e,{value:t,attrs:n,childTags:i}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let s=t!==void 0?t:e.value instanceof X?null:e.value;this.validateNodeValues(e.nodeTag,s,n||e.getAttr?.()||{});let o=this.schema[this.schemaTag(e.nodeTag)],a=i||(e.value instanceof X?e.value.getNodes().map(l=>l.nodeTag):null);return a&&this._validateChildren(e.nodeTag,o,a,!1),!0}validateChildren(e,t,{includeMinimum:n=!1}={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);if(!Array.isArray(t)||t.some(s=>typeof s!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(i,this.schema[i],t,n)}validateParent(e,t=null){let n=this.schemaTag(e);if(!n)throw new Error(`unknown element '${e}'`);let i=this.schema[n];if(!this._countsForGrammar(i))return!0;let s=i._parentSpec;if(s==null||s.has("*"))return!0;if(t===null)throw new Error(`'${n}' requires a declared parent`);let o=this.schemaTag(t);if(!o)throw new Error(`unknown parent element '${t}'`);return this._validateParent(n,i,o),!0}bagCall(e,t,n,i){return this.setChild(e,t,n,i)}commandOnNode(e,t,n,i){if(e=Rr(e),e.value instanceof X)return this.setChild(e.value,t,n,i);let s=e.value,o=new e.parentBag.constructor(null,e.builder||this),a=this.setChild(o,t,n,i,e);return this.promoteNodeValue(e,s,o),a}promoteNodeValue(e,t,n){e.setValue(n)}setChild(e,t,n,i,s=null){let o={...i},a=this.schema[t];if(!a)throw new Error(`unknown element '${t}'`);this.validateNodeValues(t,n,o);let l=a._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,o,t))||this,d=n instanceof X?n._builderBindingPlan(c):null,f=s?.rootBuilder||e.root._builder||this;if(o.nodeId!=null&&f.source.getNodeByAttr("nodeId",o.nodeId))throw new Error(`Duplicate nodeId '${o.nodeId}'`);n instanceof X&&this._validateChildren(t,a,n.getNodes().map(w=>w.nodeTag),!1);let h=s||e.parentNode,p=h?.nodeTag?this.schema[h.nodeTag]:null;if(p&&!h._getMeta("subbuilder")&&this._countsForGrammar(a))this._validateParent(t,a,h.nodeTag),this._validateChildren(h.nodeTag,p,[...e.getNodes().map(w=>w.nodeTag),t],!1);else if(!p&&!h?._getMeta("subbuilder")&&a._parentSpec!=null&&this._countsForGrammar(a))throw new Error(`'${t}' requires a declared parent`);a._meta&&!("_meta"in o)&&(o._meta=a._meta),a.ns&&!("ns"in o)&&(o.ns=a.ns);let m=o.node_position;delete o.node_position;let g=o.node_label;delete o.node_label;let _;if(p?.collection_key){if(g!=null)throw new Error(`'${t}': node_label is not allowed in a collection`);_=this._collectionLabel(p.collection_key,t,o)}else{let w=p?._subSpec?.get(t);if(w&&w.max===1){if(g!=null)throw new Error(`'${t}': node_label is not allowed on a singleton`);_=t}else _=g||a.node_label||this._autoLabel(e,t)}if(e.node(_)!=null)throw new Error(`duplicate node label '${_}'`);return e._setBuilderItem(c,d,_,n,o,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 i=t._parentSpec;if(!(i==null||i.has("*")||!this._countsForGrammar(t))&&!i.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,t,n,i){let s=t._subSpec;if(s==null||s.has("*")||t._meta?.subbuilder)return[];let o=new Map;for(let a of n){let l=this.schema[a];if(l&&!this._countsForGrammar(l))continue;let u=s.get(a);if(!u)throw new Error(`'${a}' not allowed as child of '${e}'`);let c=(o.get(a)||0)+1;if(o.set(a,c),c>u.max)throw new Error(`too many '${a}' in '${e}'`)}return i?[...s].filter(([a,l])=>(o.get(a)||0)<l.min).map(([a])=>a):[]}_collectionLabel(e,t,n){let i=s=>{if(n[s]===null||n[s]===void 0)throw new Error(`'${t}': collection key needs attribute '${s}'`);return String(n[s])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(s,o)=>i(o)):i(e)}validateSource(){let e=[],t=(n,i="")=>{for(let s of n.getNodes()){let o=i?`${i}.${s.label}`:s.label,a=s.builder;a.validateCustomTypes(s);let l=a.schema[s.nodeTag];if(l&&!s._getMeta("data_element,subbuilder,component").some(Boolean)){let u=s.value instanceof X?s.value.getNodes().map(d=>d.nodeTag):[],c=a._validateChildren(s.nodeTag,l,u,!0);c.length&&e.push([o,c])}s.value instanceof X&&t(s.value,o)}};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("nodeId",e);if(t==null)throw new Error(`nodeId not found: ${e}`);return t.builder.wrapSource(t)}runtimeValues(e){e.builder.validateCustomTypes(e);let t=new Map,n={},i=e.runtimeToEvaluate(),s=new Set(i.keys()),o=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,d]of[...i])if(!(typeof c!="string"||!ot(d)))for(let f of ts(e,d))i.has(f)||i.set(f,o.get(f));let a=e._getMeta("data_element");for(let[c,d]of i){if(d instanceof re){t.set(c,d.resolve());continue}let f=typeof c=="string"?ot(d)?.pointer??d:d;if(!e.pointerType(f)){t.set(c,typeof c=="string"&&typeof d=="string"&&d.startsWith("==")?null:d);continue}let h=e.absDatapath(f);if(t.set(c,this.data.getItem(h)),!a&&!h.includes("?")&&c===Yt){let p=this.data.getNode(h);p&&Object.assign(n,p.getAttr("_wdg"))}}let l=Sa(i,t,(c,d,f,h)=>this.evaluatePointerExpression(e,c,d,f,h)),u=l.get(Yt);l.delete(Yt);for(let c of l.keys())s.has(c)||l.delete(c);return[u,{...Object.fromEntries(l),...n}]}evaluatePointerExpression(e,t,n,i,s){return null}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 i=(typeof t=="function"?t:t.constructor)[e];if(typeof i=="function")return i}throw new Error(`data-element func '${e}' not found on any data_logic source`)}_bindings(e){let[,t]=this.runtimeValues(e),n={};for(let[i,s]of Object.entries(t))rl.has(i)||(n[i]=s);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[i,s]of Object.entries(t))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=s);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 i of n.getNodes())i._getMeta("data_element")&&e.push(i),i.value instanceof X&&t(i.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 a of tl(this.constructor))if(Object.hasOwn(a,"components"))for(let l of a.components||[])e[l]=l;if(!Object.keys(e).length)return;let t={...this.schema},n={};for(let[a,l]of Object.entries(e))t[a]={sub_tags:"",_meta:{component:!0}},n[a.toLowerCase()]=l;let i=Mr(t),s=this._collection||this.constructor._classCollection,o=s.toDocument();o.abstracts={},o.elements=Object.fromEntries(Object.keys(e).map(a=>[a,t[a]])),this._collection=new We(s.toDocument()).update(o),this._schemaOverride=t,this._componentMap=n,this._tagNamesOverride=i}_expansionRoot(e=null){let t=this.constructor._sourceClass,n=new t(null,this);return n.setBackref(),n.setItem(Lr,new t(null,this),e?{datapath:e}:null),n.getItem(Lr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new kt(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),i=n.renderChildren(n.preprocess(this.source),t);return this.materialized[e]=i,i}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 i=this.getRenderer(e);if(t===!1&&i.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let s=t===!1?null:t||this._defaultTargets.get(i.mode)||null,o={...s?.renderOpts,...n};return i.finalize(this.materialize(e,o),s,o)}};Fe._registry=new Map;var Gf=new Set(["short","medium","long","full"]),Xf=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function Yf(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||be(r).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(t))throw new RangeError(`Unsupported temporal dtype: ${t}`);return t}function Zf(r,e,t,n){let i=e.match(Xf)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let s=(c,d=2)=>String(c).padStart(d,"0"),o=c=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...c}).format(r),u={...n==="H"?{}:{y:()=>String(r.getUTCFullYear()),yy:()=>s(r.getUTCFullYear()%100),yyyy:()=>s(r.getUTCFullYear(),4),M:()=>String(r.getUTCMonth()+1),MM:()=>s(r.getUTCMonth()+1),MMM:()=>o({month:"short"}),MMMM:()=>o({month:"long"}),d:()=>String(r.getUTCDate()),dd:()=>s(r.getUTCDate()),EEE:()=>o({weekday:"short"}),EEEE:()=>o({weekday:"long"})},...n==="D"?{}:{H:()=>String(r.getUTCHours()),HH:()=>s(r.getUTCHours()),h:()=>String(r.getUTCHours()%12||12),hh:()=>s(r.getUTCHours()%12||12),m:()=>String(r.getUTCMinutes()),mm:()=>s(r.getUTCMinutes()),s:()=>String(r.getUTCSeconds()),ss:()=>s(r.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(r).find(c=>c.type==="dayPeriod").value}};return i.map(c=>{if(c.startsWith("'"))return c==="''"?"'":c.slice(1,-1).replaceAll("''","'");if(!/^[a-zA-Z]/.test(c))return c;if(!u[c])throw new RangeError(`Unsupported date format token: ${c}`);return u[c]()}).join("")}function nl(r,{format:e,mask:t,locale:n,dtype:i,places:s}={}){let o=r==null?"":String(r);if(r!=null&&r!==""&&(e!=null&&e!==""||s!=null))if(typeof r=="number"||F(r))o=Jf(r,{format:e,locale:n,places:s});else{let a=Yf(r,i);if(Gf.has(e)){let l={timeZone:"UTC"};a!=="H"&&(l.dateStyle=e),a!=="D"&&(l.timeStyle=e),o=new Intl.DateTimeFormat(n||void 0,l).format(r)}else o=Zf(r,String(e),n||void 0,a)}return t==null?o:String(t).replaceAll("%s",()=>o)}function Kf({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 Jf(r,e={}){if(typeof r!="number"&&!F(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,Kf(e));if(F(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(F(r)?r.toString():r)}var Qf=new Set(["style","script"]),eh=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"]),il=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"]),Fr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),sl=r=>r===!0?"true":r===!1?"false":String(r),Ln=r=>typeof r=="number"&&Number.isFinite(r)?`${r}px`:String(r);function th(r){if(il.has(r))return!0;for(let e of il)if(r.startsWith(`${e}_`))return!0;return!1}function rh(r){let e=new Map;if(!r)return e;let t=[],n=0,i=null,s=!1,o=!1,a=0,l=String(r);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(o){c==="*"&&d==="/"&&(o=!1,u+=1);continue}if(s){s=!1;continue}if(c==="\\"){s=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&d==="*"?(o=!0,u+=1):"([{".includes(c)?a+=1:")]}".includes(c)&&a>0?a-=1:c===";"&&a===0&&(t.push(l.slice(n,u)),n=u+1)}t.push(l.slice(n));for(let u of t){let c=u.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 $r=class extends vt{static mode="html";renderedItem(e,t,n,{tag:i,xml:s=!0,pretty:o=!1,depthOffset:a=0,includeDatapath:l=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:h,dtype:p,...m}=n;!Array.isArray(t)&&(c!=null||d!=null||h!=null)&&(t=nl(t,{format:c,mask:d,places:h,dtype:p,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(l){if(!Object.hasOwn(n,"id")){let E=this.builder.targetId(e);E!==null&&(g+=` id="${this._htmlAttrValue(E)}"`)}for(let[E,T]of Object.entries(e.getAttr()))e.pointerType(T)&&(g+=` data-${this.adapt(E)}-pointer="${this._htmlAttrValue(e.absDatapath(T))}"`)}let _=o?" ".repeat(this._nodeDepth(e,a)):"",v=o?`
|
|
22
|
-
`:"";if(e._getMeta("void"))return`${_}<${i}${g}${s?"/":""}>${v}`;if(Array.isArray(t)){let E=this._composeStringFragments(t);return`${_}<${i}${g}>${v}${E}${_}</${i}>${v}`}if(t==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):Qf.has(i)?String(t):this._escapeText(t);return`${_}<${i}${g}>${w}</${i}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let i=n.getAttr("locale");if(i==null)continue;let s=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(s)return s}}adaptAttrs(e){let t={},n={};for(let[s,o]of Object.entries(e||{}))if(s.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(s)]=o;else if(s==="dtype")t.dtype=o;else{if(this.builder.constructor.retainedAttrPrefixes.some(a=>s.startsWith(a)))continue;this._isStyleContribution(s)?n[s]=o:t[s]=o}let i=this._adaptStyle(n);return i&&(t.style=i),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Fr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Fr.has(t)||th(e)}_adaptStyle(e){let t=rh(e.style),n=new Map,i=new Map;for(let[s,o]of Object.entries(e))if(s!=="style")if(s.startsWith("style_"))t.set(s.slice(6).replaceAll("_","-"),sl(o));else if(Fr.has(s))n.set(s,o);else{let a=s.indexOf("_"),l=a<0?s:s.slice(0,a);a>=0&&Fr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[s.slice(a+1)]=o):t.set(s.replaceAll("_","-"),sl(o))}for(let s of Fr)(n.has(s)||i.has(s))&&this[`_macro_${s}`](n.get(s),i.get(s)||{},t);return[...t].map(([s,o])=>`${s}: ${o}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,i]of Object.entries(e||{}))eh.has(n)?i&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(i)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,t,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[s,o]of Object.entries(t))if(s==="top"||s==="bottom")i[`${s}_left`]=o,i[`${s}_right`]=o;else if(s==="left"||s==="right")i[`top_${s}`]=o,i[`bottom_${s}`]=o;else if(["top_left","top_right","bottom_left","bottom_right"].includes(s))i[s]=o;else throw new TypeError(`rounded: unknown sub-kwarg '${s}'`);for(let[s,o]of Object.entries(i))n.set(`border-${s.replaceAll("_","-")}-radius`,Ln(o))}_macro_transform(e,t,n){let i=e===void 0?[]:[String(e)];for(let[s,o]of Object.entries(t))s==="rotate"?i.push(`rotate(${o}deg)`):s==="scale"||s==="translate"?i.push(`${s}(${o})`):s==="translate_x"?i.push(`translateX(${Ln(o)})`):s==="translate_y"?i.push(`translateY(${Ln(o)})`):s==="skew_x"?i.push(`skewX(${o}deg)`):s==="skew_y"?i.push(`skewY(${o}deg)`):i.push(`${s.replaceAll("_","-")}(${o})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,t,n){let i=e===void 0?[]:[String(e)];for(let[s,o]of Object.entries(t))s==="rotate"?i.push(`hue-rotate(${o}deg)`):s==="blur"?i.push(`blur(${Ln(o)})`):s==="drop_shadow"?i.push(`drop-shadow(${o})`):i.push(`${s.replaceAll("_","-")}(${o})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[i,s]of Object.entries(t))n.set(`transition-${i.replaceAll("_","-")}`,String(s))}_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[i,s]of Object.entries(t))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(s))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var nh=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 ol(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[nh.has(e)?e.replaceAll("_","-"):e,t]))}var Pr=class extends kt{static mode="svg";adaptAttrs(e){return ol(e)}};var al={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 Fn=class extends Fe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(al)}get renderer_html(){return new $r(this)}};Fe.registerBuilder(Fn);var ll={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 $n=class extends Fe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(ll)}get renderer_svg(){return new Pr(this)}};Fe.registerBuilder($n);var xe="http://www.w3.org/2000/svg";function Pn(){return Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join("")}var qn=class{#e;#t;#i;#n=[];#r;#a;#o;#l=null;#s=null;#c;#x;#v;#y;#d;#b=!1;#f=[];#h;#E=[];#k=!1;#_=!1;constructor(e,t){this.#e=e,this.#t=t;let n=this.#o=e.ownerDocument.createElement("div");n.className="column-filter-panel",n.setAttribute("popover","auto"),n.setAttribute("role","dialog");let i=e.ownerDocument.createElement("slot");i.name="column-filter",n.append(i),n.addEventListener("toggle",s=>{s.newState==="closed"&&!n.matches(":popover-open")&&this.#S()}),e.addEventListener("keydown",s=>{this.#l&&s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),this.close())}),e.shadowRoot.append(n)}setSourceContext(e){this.#a=e;let t=e.sourceNode,n=t.rootBuilder;t.staticValue===null&&t.setValue(new n.source.constructor(null,n),!1),e.sourceNode.rootBuilder.binding.bindingFor(e.sourceNode).track(()=>this.dispose())}#p(){if(this.#d)return;let e=this.#a.sourceNode,t=e.rootBuilder;this.#y=`_gramlot.grid.${Pn()}.columnFilter`,this.#d=new ul({rows:new ul,checked:"",title:"",summary:"",from:null,to:null,hideRange:!0,rangeError:""}),e.setRelativeData(this.#y,this.#d);let n=t.wrapSource(e).div({node_label:`column_filter_${Pn()}`,slot:"column-filter",display:"flex",flex_direction:"column",gap:"8px",padding:"10px",style:"font-size:12px;--gramlot-grid-row-height:28px;--gramlot-grid-font-size:12px;--gramlot-grid-cell-padding:4px 7px;--gramlot-menu-item-padding:4px 7px"});this.#c=Zt(n),this.#c.setAttr({datapath:this.#y});let i=new t.source.constructor(null,t),s=t.wrapSource(i);s.div("^.title",{font_weight:"600",padding:"0 2px"});let o=s.div({display:"flex",gap:"8px",hidden:"^.hideRange"});this.#f=[Zt(o.dateTextBox({value:"^.from",period_to:".to",lbl:"From",width:"136px"})),Zt(o.dateTextBox({value:"^.to",lbl:"To",width:"136px"}))],s.div("^.rangeError",{role:"alert",color:"var(--gramlot-error)"});let a=s.frameGrid({storepath:".rows",rowMode:"attributes",height:"270px",width:"100%"});this.#x=Zt(a),this.#v=Zt(a.toolbar.menuline({group:!0,class:"gramlot-grid-search"}).searchBox({searchOn:"Value:caption",searchLiteral:!0}));let l=a.grid;l.setAttr({sortedBy:"caption:a"});let u=l.struct();u.column({field:"selected",name:"\u2713",title:"Selected values",width:"32px",align:"center",check:"multiple",checked:"^.checked",checkedField:"id"}),u.column({field:"caption",name:"Value",width:"170px"}),u.column({field:"count",name:"Rows",dtype:"L",width:"64px",align:"end"});let c=s.menu({presentation:"bar",aria_label:"Column filter actions"});Object.defineProperty(Zt(c),"gridColumnFilters",{value:this,configurable:!0});for(let[f,h]of[["All","selectAll"],["None","selectNone"],["Reset","reset"]])c.menuline({caption:f,action:`this.parentBag.parentNode.gridColumnFilters.${h}()`});s.div("^.summary",{color:"var(--gramlot-text-secondary)",font_size:"11px",padding:"0 2px"});let d=t.binding.gramlot.src.prepareSource(i);t.binding.renderer.validateCandidate(d),this.#c.setValue(d),this.#A()}#A(){if(!this.#d||this.#E.length)return;let e=this.#a.sourceNode.rootBuilder.binding.router;this.#E.push(e.register({path:this.#y+".checked",recipient:{receive:()=>this.#w()}}));for(let t of["from","to"])this.#E.push(e.register({path:this.#y+"."+t,recipient:{receive:()=>this.#D()}}))}#w(){if(this.#_||this.#s===null)return;let e=","+this.#d.getItem("checked")+",",t=this.#d.getItem("rows").getNodes(),n=t.filter(i=>e.includes(","+i.label+",")).map(i=>i.getAttr("value"));this.#i.applyColumnFilter(this.#s,this.#i.columnRange(this.#s)&&n.length===t.length?null:n)}#D(){this.#_||this.#b||this.#s===null||(this.#b=!0,queueMicrotask(()=>{this.#b=!1,this.#s!==null&&this.#k&&this.#B()}))}#B(){let e=this.#n.find(o=>o.field===this.#s);if(!["D","DH","DHZ"].includes(e.dtype))return;let t=this.#d.getItem("from"),n=this.#d.getItem("to"),i=this.#i.columnRange(this.#s);if(i?.from&&!t&&(n=null,this.#_=!0,this.#d.setItem("to",null),this.#_=!1),t&&n&&t>n){this.#d.setItem("rangeError","From must not be after To.");return}if(this.#d.setItem("rangeError",""),+t==+(i?.from??null)&&+n==+(i?.to??null))return;let s=!t&&!n?this.#i.columnFacets(this.#s).filter(o=>o.selected).map(o=>o.value):null;this.#i.applyColumnFilter(this.#s,s,{from:t,to:n,dtype:e.dtype,timeZone:this.#a.timeZone})}selectAll(){this.#i.applyColumnFilter(this.#s,this.#i.columnRange(this.#s)?null:this.#i.columnFacets(this.#s).map(e=>e.value))}selectNone(){this.#i.applyColumnFilter(this.#s,[])}reset(){this.#_=!0;try{this.#d.setItem("from",null),this.#d.setItem("to",null),this.#d.setItem("rangeError","");let e=this.#a.sourceNode.rootBuilder.binding.renderer;for(let t of this.#f)e.getDomNode(t).restoreFormValue(null)}finally{this.#_=!1}this.#i.applyColumnFilter(this.#s,null,null)}button(e){let t=this.#e.ownerDocument,n=t.createElement("button");n.type="button",n.className="column-filter",n.dataset.field=e.field,n.setAttribute("aria-label",`Filter ${e.title??e.name}`),n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-expanded","false"),n.title=`Filter ${e.title??e.name}`;let i=t.createElementNS(xe,"svg");i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("aria-hidden","true");let s=t.createElementNS(xe,"path");return s.setAttribute("d","M3 5h18l-7 8v6l-4 2v-8z"),i.append(s),n.append(i),n}update(e,t,n,i){e!==this.#i&&(this.close(),this.#h?.(),this.#h=null,this.#i=e),this.#n=t,this.#r=i,(!n||this.#l&&!this.#l.isConnected)&&this.close(),this.#k&&!this.#h&&(this.#h=e.subscribe(this.refresh)),this.refresh()}#N=e=>{let t=e.target.closest(".column-filter");if(!t)return;if(e.stopPropagation(),t===this.#l){this.close();return}this.close(),this.#p(),this.#l=t,this.#s=t.dataset.field,this.#_=!0;let n=this.#i.columnRange(this.#s);this.#d.setItem("from",n?.from??null),this.#d.setItem("to",n?.to??null),this.#d.setItem("rangeError","");let i=this.#n.find(o=>o.field===this.#s);this.#d.setItem("hideRange",!["D","DH","DHZ"].includes(i.dtype));let s=this.#a.sourceNode.rootBuilder.binding.renderer;for(let[o,a]of["from","to"].entries())s.getDomNode(this.#f[o]).restoreFormValue(this.#d.getItem(a));this.#d.getItem("rows").clear(),this.#d.setItem("checked",""),s.getDomNode(this.#v).clear(),this.#_=!1,this.refresh(),this.#o.showPopover(),t.setAttribute("aria-expanded","true"),this.#u(),this.#a.sourceNode.rootBuilder.binding.renderer.getDomNode(this.#v).focus()};refresh=()=>{if(!this.#i)return;for(let a of this.#t.querySelectorAll(".column-filter")){let l=this.#i.columnFilter(a.dataset.field)!==null||this.#i.columnRange(a.dataset.field)!==null;a.classList.toggle("active",l),a.closest("th").classList.toggle("column-filtered",l),a.setAttribute("aria-pressed",String(l))}if(this.#s===null)return;let e=this.#n.find(a=>a.field===this.#s);if(!e){this.close();return}let t=e.title??e.name;this.#o.setAttribute("aria-label",`Filter ${t}`);let n=this.#i.columnFacets(this.#s),i=this.#d.getItem("rows");this.#x.setAttr({height:`${76+28*Math.max(1,Math.min(n.length,8))}px`});let s=new Map(i.getNodes().map(a=>[a.getAttr("key"),a])),o=[];this.#_=!0;try{this.#d.setItem("title",t);for(let l of n){let u=l.value===null?"Empty":Nr(l.value,e,this.#r),c={key:l.key,value:l.value,caption:u,count:l.count},d=s.get(l.key);if(d)s.delete(l.key),d.setAttr(c);else{let f=`v_${Pn()}`;i.setItem(f,null,{...c,id:f}),d=i.getNode(f)}l.selected&&o.push(d.label)}for(let l of s.values())i.popNode(l.label);let a=o.join(",");this.#d.getItem("checked")!==a&&this.#d.setItem("checked",a),this.#d.setItem("summary",`${o.length} of ${n.length} values selected`)}finally{this.#_=!1}this.#u()};#u=()=>{this.#l&&Wr(this.#o,this.#l,{align:"start"})};#S(){this.#l?.setAttribute("aria-expanded","false"),this.#l=null,this.#s=null}close(){if(!this.#l)return;let e=this.#l;this.#o.hidePopover(),this.#S(),e.isConnected&&e.focus({preventScroll:!0})}connect(){this.#k||(this.#k=!0,this.#A(),this.#t.addEventListener("click",this.#N),this.#e.ownerDocument.defaultView.addEventListener("resize",this.#u),this.#e.ownerDocument.defaultView.addEventListener("scroll",this.#u,!0))}disconnect(){this.close(),this.#k=!1,this.#h?.(),this.#h=null;for(let e of this.#E)e.close();this.#E=[],this.#t.removeEventListener("click",this.#N),this.#e.ownerDocument.defaultView.removeEventListener("resize",this.#u),this.#e.ownerDocument.defaultView.removeEventListener("scroll",this.#u,!0)}dispose(){this.disconnect(),this.#y&&this.#a.sourceNode.data.popNode(this.#y)}};import{Bag as Es}from"@gramlot/gramlot";var _e={};Ts(_e,{defineCollection:()=>ah});Jt(_e,Cb);import*as Cb from"@gramlot/gramlot/components";import{defineCollection as oh}from"@gramlot/gramlot/components";function ah(r){if(r.name!=="grid")throw new Error("Unexpected bundled collection");let e=[],t={writeExcelFileLicense:Et["assets/files/8cf9b31947daf7adb4a7a00a037459e58241af050cd0a603bfcf1756e533f75e-write-excel-file.txt"],fflateLicense:Et["assets/files/0a1df3a083d0c010560aa342e87959c8c1070e6fd54545741f083f22d0c8b551-fflate.txt"]};r.css?.forEach((n,i)=>{n.href=e[i].href});for(let[n,i]of Object.entries(r.assets??{}))i.href=t[n].href;return oh({...r,css:e,assets:t})}function cl(r,e){return r.parameters=lh(r.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([t])=>!Object.hasOwn(r.parameters,t)))}function lh(r,e){return Object.fromEntries(Object.entries(r.parameters).map(([t,n])=>[t,Object.hasOwn(e,t)?e[t]:n.default]))}function qr(r){return class extends r{constructor(){super();let e=this.attachShadow({mode:"open"}),t=this.ownerDocument.createElement("style");t.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
22
|
+
`:"";if(e._getMeta("void"))return`${_}<${i}${g}${s?"/":""}>${v}`;if(Array.isArray(t)){let E=this._composeStringFragments(t);return`${_}<${i}${g}>${v}${E}${_}</${i}>${v}`}if(t==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):Qf.has(i)?String(t):this._escapeText(t);return`${_}<${i}${g}>${w}</${i}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let i=n.getAttr("locale");if(i==null)continue;let s=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(s)return s}}adaptAttrs(e){let t={},n={};for(let[s,o]of Object.entries(e||{}))if(s.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(s)]=o;else if(s==="dtype")t.dtype=o;else{if(this.builder.constructor.retainedAttrPrefixes.some(a=>s.startsWith(a)))continue;this._isStyleContribution(s)?n[s]=o:t[s]=o}let i=this._adaptStyle(n);return i&&(t.style=i),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Fr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Fr.has(t)||th(e)}_adaptStyle(e){let t=rh(e.style),n=new Map,i=new Map;for(let[s,o]of Object.entries(e))if(s!=="style")if(s.startsWith("style_"))t.set(s.slice(6).replaceAll("_","-"),sl(o));else if(Fr.has(s))n.set(s,o);else{let a=s.indexOf("_"),l=a<0?s:s.slice(0,a);a>=0&&Fr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[s.slice(a+1)]=o):t.set(s.replaceAll("_","-"),sl(o))}for(let s of Fr)(n.has(s)||i.has(s))&&this[`_macro_${s}`](n.get(s),i.get(s)||{},t);return[...t].map(([s,o])=>`${s}: ${o}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,i]of Object.entries(e||{}))eh.has(n)?i&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(i)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,t,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[s,o]of Object.entries(t))if(s==="top"||s==="bottom")i[`${s}_left`]=o,i[`${s}_right`]=o;else if(s==="left"||s==="right")i[`top_${s}`]=o,i[`bottom_${s}`]=o;else if(["top_left","top_right","bottom_left","bottom_right"].includes(s))i[s]=o;else throw new TypeError(`rounded: unknown sub-kwarg '${s}'`);for(let[s,o]of Object.entries(i))n.set(`border-${s.replaceAll("_","-")}-radius`,Ln(o))}_macro_transform(e,t,n){let i=e===void 0?[]:[String(e)];for(let[s,o]of Object.entries(t))s==="rotate"?i.push(`rotate(${o}deg)`):s==="scale"||s==="translate"?i.push(`${s}(${o})`):s==="translate_x"?i.push(`translateX(${Ln(o)})`):s==="translate_y"?i.push(`translateY(${Ln(o)})`):s==="skew_x"?i.push(`skewX(${o}deg)`):s==="skew_y"?i.push(`skewY(${o}deg)`):i.push(`${s.replaceAll("_","-")}(${o})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,t,n){let i=e===void 0?[]:[String(e)];for(let[s,o]of Object.entries(t))s==="rotate"?i.push(`hue-rotate(${o}deg)`):s==="blur"?i.push(`blur(${Ln(o)})`):s==="drop_shadow"?i.push(`drop-shadow(${o})`):i.push(`${s.replaceAll("_","-")}(${o})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[i,s]of Object.entries(t))n.set(`transition-${i.replaceAll("_","-")}`,String(s))}_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[i,s]of Object.entries(t))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(s))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var nh=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 ol(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[nh.has(e)?e.replaceAll("_","-"):e,t]))}var Pr=class extends kt{static mode="svg";adaptAttrs(e){return ol(e)}};var al={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 Fn=class extends Fe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(al)}get renderer_html(){return new $r(this)}};Fe.registerBuilder(Fn);var ll={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 $n=class extends Fe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(ll)}get renderer_svg(){return new Pr(this)}};Fe.registerBuilder($n);var xe="http://www.w3.org/2000/svg";function Pn(){return Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join("")}var qn=class{#e;#t;#i;#n=[];#r;#l;#s;#a=null;#o=null;#c;#x;#v;#y;#d;#b=!1;#f=[];#h;#E=[];#k=!1;#_=!1;constructor(e,t){this.#e=e,this.#t=t;let n=this.#s=e.ownerDocument.createElement("div");n.className="column-filter-panel",n.setAttribute("popover","auto"),n.setAttribute("role","dialog");let i=e.ownerDocument.createElement("slot");i.name="column-filter",n.append(i),n.addEventListener("toggle",s=>{s.newState==="closed"&&!n.matches(":popover-open")&&this.#S()}),e.addEventListener("keydown",s=>{this.#a&&s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),this.close())}),e.shadowRoot.append(n)}setSourceContext(e){this.#l=e;let t=e.sourceNode,n=t.rootBuilder;t.staticValue===null&&t.setValue(new n.source.constructor(null,n),!1),e.sourceNode.rootBuilder.binding.bindingFor(e.sourceNode).track(()=>this.dispose())}#p(){if(this.#d)return;let e=this.#l.sourceNode,t=e.rootBuilder;this.#y=`_gramlot.grid.${Pn()}.columnFilter`,this.#d=new ul({rows:new ul,checked:"",title:"",summary:"",from:null,to:null,hideRange:!0,rangeError:""}),e.setRelativeData(this.#y,this.#d);let n=t.wrapSource(e).div({node_label:`column_filter_${Pn()}`,slot:"column-filter",display:"flex",flex_direction:"column",gap:"8px",padding:"10px",style:"font-size:12px;--gramlot-grid-row-height:28px;--gramlot-grid-font-size:12px;--gramlot-grid-cell-padding:4px 7px;--gramlot-menu-item-padding:4px 7px"});this.#c=Zt(n),this.#c.setAttr({datapath:this.#y});let i=new t.source.constructor(null,t),s=t.wrapSource(i);s.div("^.title",{font_weight:"600",padding:"0 2px"});let o=s.div({display:"flex",gap:"8px",hidden:"^.hideRange"});this.#f=[Zt(o.dateTextBox({value:"^.from",period_to:".to",lbl:"From",width:"136px"})),Zt(o.dateTextBox({value:"^.to",lbl:"To",width:"136px"}))],s.div("^.rangeError",{role:"alert",color:"var(--gramlot-error)"});let a=s.frameGrid({storepath:".rows",rowMode:"attributes",height:"270px",width:"100%"});this.#x=Zt(a),this.#v=Zt(a.toolbar.menuline({group:!0,class:"gramlot-grid-search"}).searchBox({searchOn:"Value:caption",searchLiteral:!0}));let l=a.grid;l.setAttr({sortedBy:"caption:a"});let u=l.struct();u.column({field:"selected",name:"\u2713",title:"Selected values",width:"32px",align:"center",check:"multiple",checked:"^.checked",checkedField:"id"}),u.column({field:"caption",name:"Value",width:"170px"}),u.column({field:"count",name:"Rows",dtype:"L",width:"64px",align:"end"});let c=s.menu({presentation:"bar",aria_label:"Column filter actions"});Object.defineProperty(Zt(c),"gridColumnFilters",{value:this,configurable:!0});for(let[f,h]of[["All","selectAll"],["None","selectNone"],["Reset","reset"]])c.menuline({caption:f,action:`this.parentBag.parentNode.gridColumnFilters.${h}()`});s.div("^.summary",{color:"var(--gramlot-text-secondary)",font_size:"11px",padding:"0 2px"});let d=t.binding.gramlot.src.prepareSource(i);t.binding.renderer.validateCandidate(d),this.#c.setValue(d),this.#A()}#A(){if(!this.#d||this.#E.length)return;let e=this.#l.sourceNode.rootBuilder.binding.router;this.#E.push(e.register({path:this.#y+".checked",recipient:{receive:()=>this.#w()}}));for(let t of["from","to"])this.#E.push(e.register({path:this.#y+"."+t,recipient:{receive:()=>this.#D()}}))}#w(){if(this.#_||this.#o===null)return;let e=","+this.#d.getItem("checked")+",",t=this.#d.getItem("rows").getNodes(),n=t.filter(i=>e.includes(","+i.label+",")).map(i=>i.getAttr("value"));this.#i.applyColumnFilter(this.#o,this.#i.columnRange(this.#o)&&n.length===t.length?null:n)}#D(){this.#_||this.#b||this.#o===null||(this.#b=!0,queueMicrotask(()=>{this.#b=!1,this.#o!==null&&this.#k&&this.#B()}))}#B(){let e=this.#n.find(o=>o.field===this.#o);if(!["D","DH","DHZ"].includes(e.dtype))return;let t=this.#d.getItem("from"),n=this.#d.getItem("to"),i=this.#i.columnRange(this.#o);if(i?.from&&!t&&(n=null,this.#_=!0,this.#d.setItem("to",null),this.#_=!1),t&&n&&t>n){this.#d.setItem("rangeError","From must not be after To.");return}if(this.#d.setItem("rangeError",""),+t==+(i?.from??null)&&+n==+(i?.to??null))return;let s=!t&&!n?this.#i.columnFacets(this.#o).filter(o=>o.selected).map(o=>o.value):null;this.#i.applyColumnFilter(this.#o,s,{from:t,to:n,dtype:e.dtype,timeZone:this.#l.timeZone})}selectAll(){this.#i.applyColumnFilter(this.#o,this.#i.columnRange(this.#o)?null:this.#i.columnFacets(this.#o).map(e=>e.value))}selectNone(){this.#i.applyColumnFilter(this.#o,[])}reset(){this.#_=!0;try{this.#d.setItem("from",null),this.#d.setItem("to",null),this.#d.setItem("rangeError","");let e=this.#l.sourceNode.rootBuilder.binding.renderer;for(let t of this.#f)e.getDomNode(t).restoreFormValue(null)}finally{this.#_=!1}this.#i.applyColumnFilter(this.#o,null,null)}button(e){let t=this.#e.ownerDocument,n=t.createElement("button");n.type="button",n.className="column-filter",n.dataset.field=e.field,n.setAttribute("aria-label",`Filter ${e.title??e.name}`),n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-expanded","false"),n.title=`Filter ${e.title??e.name}`;let i=t.createElementNS(xe,"svg");i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("aria-hidden","true");let s=t.createElementNS(xe,"path");return s.setAttribute("d","M3 5h18l-7 8v6l-4 2v-8z"),i.append(s),n.append(i),n}update(e,t,n,i){e!==this.#i&&(this.close(),this.#h?.(),this.#h=null,this.#i=e),this.#n=t,this.#r=i,(!n||this.#a&&!this.#a.isConnected)&&this.close(),this.#k&&!this.#h&&(this.#h=e.subscribe(this.refresh)),this.refresh()}#N=e=>{let t=e.target.closest(".column-filter");if(!t)return;if(e.stopPropagation(),t===this.#a){this.close();return}this.close(),this.#p(),this.#a=t,this.#o=t.dataset.field,this.#_=!0;let n=this.#i.columnRange(this.#o);this.#d.setItem("from",n?.from??null),this.#d.setItem("to",n?.to??null),this.#d.setItem("rangeError","");let i=this.#n.find(o=>o.field===this.#o);this.#d.setItem("hideRange",!["D","DH","DHZ"].includes(i.dtype));let s=this.#l.sourceNode.rootBuilder.binding.renderer;for(let[o,a]of["from","to"].entries())s.getDomNode(this.#f[o]).restoreFormValue(this.#d.getItem(a));this.#d.getItem("rows").clear(),this.#d.setItem("checked",""),s.getDomNode(this.#v).clear(),this.#_=!1,this.refresh(),this.#s.showPopover(),t.setAttribute("aria-expanded","true"),this.#u(),this.#l.sourceNode.rootBuilder.binding.renderer.getDomNode(this.#v).focus()};refresh=()=>{if(!this.#i)return;for(let a of this.#t.querySelectorAll(".column-filter")){let l=this.#i.columnFilter(a.dataset.field)!==null||this.#i.columnRange(a.dataset.field)!==null;a.classList.toggle("active",l),a.closest("th").classList.toggle("column-filtered",l),a.setAttribute("aria-pressed",String(l))}if(this.#o===null)return;let e=this.#n.find(a=>a.field===this.#o);if(!e){this.close();return}let t=e.title??e.name;this.#s.setAttribute("aria-label",`Filter ${t}`);let n=this.#i.columnFacets(this.#o),i=this.#d.getItem("rows");this.#x.setAttr({height:`${76+28*Math.max(1,Math.min(n.length,8))}px`});let s=new Map(i.getNodes().map(a=>[a.getAttr("key"),a])),o=[];this.#_=!0;try{this.#d.setItem("title",t);for(let l of n){let u=l.value===null?"Empty":Nr(l.value,e,this.#r),c={key:l.key,value:l.value,caption:u,count:l.count},d=s.get(l.key);if(d)s.delete(l.key),d.setAttr(c);else{let f=`v_${Pn()}`;i.setItem(f,null,{...c,id:f}),d=i.getNode(f)}l.selected&&o.push(d.label)}for(let l of s.values())i.popNode(l.label);let a=o.join(",");this.#d.getItem("checked")!==a&&this.#d.setItem("checked",a),this.#d.setItem("summary",`${o.length} of ${n.length} values selected`)}finally{this.#_=!1}this.#u()};#u=()=>{this.#a&&Wr(this.#s,this.#a,{align:"start"})};#S(){this.#a?.setAttribute("aria-expanded","false"),this.#a=null,this.#o=null}close(){if(!this.#a)return;let e=this.#a;this.#s.hidePopover(),this.#S(),e.isConnected&&e.focus({preventScroll:!0})}connect(){this.#k||(this.#k=!0,this.#A(),this.#t.addEventListener("click",this.#N),this.#e.ownerDocument.defaultView.addEventListener("resize",this.#u),this.#e.ownerDocument.defaultView.addEventListener("scroll",this.#u,!0))}disconnect(){this.close(),this.#k=!1,this.#h?.(),this.#h=null;for(let e of this.#E)e.close();this.#E=[],this.#t.removeEventListener("click",this.#N),this.#e.ownerDocument.defaultView.removeEventListener("resize",this.#u),this.#e.ownerDocument.defaultView.removeEventListener("scroll",this.#u,!0)}dispose(){this.disconnect(),this.#y&&this.#l.sourceNode.data.popNode(this.#y)}};import{Bag as Es}from"@gramlot/gramlot";var _e={};Ts(_e,{defineCollection:()=>ah});Jt(_e,Cb);import*as Cb from"@gramlot/gramlot/components";import{defineCollection as oh}from"@gramlot/gramlot/components";function ah(r){if(r.name!=="grid")throw new Error("Unexpected bundled collection");let e=[],t={writeExcelFileLicense:Et["assets/files/8cf9b31947daf7adb4a7a00a037459e58241af050cd0a603bfcf1756e533f75e-write-excel-file.txt"],fflateLicense:Et["assets/files/0a1df3a083d0c010560aa342e87959c8c1070e6fd54545741f083f22d0c8b551-fflate.txt"]};r.css?.forEach((n,i)=>{n.href=e[i].href});for(let[n,i]of Object.entries(r.assets??{}))i.href=t[n].href;return oh({...r,css:e,assets:t})}function cl(r,e){return r.parameters=lh(r.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([t])=>!Object.hasOwn(r.parameters,t)))}function lh(r,e){return Object.fromEntries(Object.entries(r.parameters).map(([t,n])=>[t,Object.hasOwn(e,t)?e[t]:n.default]))}function qr(r){return class extends r{constructor(){super();let e=this.attachShadow({mode:"open"}),t=this.ownerDocument.createElement("style");t.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
23
23
|
*,*::before,*::after{box-sizing:border-box}.control-box{min-width:0}slot{display:contents}
|
|
24
24
|
::slotted(*){min-width:0;max-width:100%}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",this.control=this.controlBox,this.control.id="control",this.control.append(this.ownerDocument.createElement("slot")),e.append(t,this.controlBox)}projectAttributes(e){return cl(this,e)}}}qr.parameters={};function ms(r,e){return(","+r+",").includes(","+e+",")}function gs(r){if(typeof r!="string")throw new TypeError("grid checked must refer to a string (empty string for an empty set)");return r}function Un(r){if(typeof r!="string"||!r||r.includes(","))throw new TypeError("grid checkedField requires nonempty text IDs without commas");return r}function bs(r){if(typeof r!="string")throw new TypeError("collection view sortedBy must be a string");if(r==="")return[];let e=new Set;return r.split(",").map(t=>{let n=/^([^,:]+):([ad])$/.exec(t);if(!n||e.has(n[1]))throw new TypeError(`Invalid collection view sort criterion: ${t}`);return e.add(n[1]),{field:n[1],direction:n[2]}})}import Nh from"@gramlot/collections/inputs";import{sourceTarget as jn,toTytx as ch}from"@gramlot/gramlot";var zn=class{constructor(e,t,n,i,s,o,a){this.grid=e,this.context=t,this.cellFor=n,this.store=i,this.renderedRows=s,this.navigate=o,this.focusField=a,this.retained=new Map,this.declarations=new Map,this.checking=new Set,this.columns=[],this.layer=e.ownerDocument.createElement("div"),this.layer.className="cell-editor",this.layer.hidden=!0;let l=e.ownerDocument.createElement("slot");l.name="cell-editor",this.layer.append(l),e.control.append(this.layer),this.keydown=u=>{if(!(!this.active||u.isComposing)){if(u.key==="Escape"){u.preventDefault();let c=this.cellFor(this.active.row,this.active.column.field);this.session.clearDraft(this.active.source),this.close(),c?.focus({preventScroll:!0})}else if(u.key==="Enter"||u.key==="Tab"){if(u.key==="Enter"&&this.active.element.control.localName==="textarea"&&!u.ctrlKey&&!u.metaKey)return;u.preventDefault();let c=this.active;this.session.commitField(c.path);let d=this.cellFor(c.row,c.column.field);this.close(),d?.focus({preventScroll:!0}),u.key==="Tab"&&this.navigate(c.row,c.column.field,u.shiftKey?-1:1)}}},this.arrowKeydown=u=>{if(!this.active||u.isComposing||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(u.key)||u.altKey||u.ctrlKey||u.metaKey||u.shiftKey)return;let c=this.active.element.control;if(c.localName==="textarea"||["range","date","time","datetime-local"].includes(c.type)||["gramlot-date-text-box","gramlot-time-text-box","gramlot-date-calendar"].includes(this.active.element.localName)||c.getAttribute("aria-expanded")==="true"||u.key==="ArrowDown"&&c.getAttribute("role")==="combobox")return;let d=u.key==="ArrowLeft"||u.key==="ArrowRight",f=u.key==="ArrowLeft"||u.key==="ArrowUp";if(d&&(typeof c.selectionStart!="number"||c.selectionStart!==c.selectionEnd||c.selectionStart!==(f?0:c.value.length)))return;u.preventDefault(),u.stopPropagation();let h=this.active;if(this.session.commitField(h.path),this.navigate(h.row,h.column.field,d?f?-1:1:{row:f?-1:1}),d&&this.active&&this.active!==h){let p=this.active.element.control;if(typeof p.selectionStart=="number"){let m=f?p.value.length:0;p.setSelectionRange(m,m)}}},this.connect(),t.sourceNode.rootBuilder.binding.bindingFor(t.sourceNode).track(()=>this.dispose())}connect(){this.grid.addEventListener("keydown",this.keydown),this.grid.addEventListener("keydown",this.arrowKeydown,!0),this.session&&!this.releaseNavigator&&(this.releaseNavigator=this.session.registerNavigator(this.focusField))}disconnect(){this.close(),this.grid.removeEventListener("keydown",this.keydown),this.grid.removeEventListener("keydown",this.arrowKeydown,!0),this.releaseNavigator?.(),this.releaseNavigator=null}path(e,t){let{mode:n}=this.store();return this.context.sourceNode.absDatapath(this.context.sourceNode.getAttr("storepath"))+"."+e.label+(n==="attributes"?"?":".")+t}configure(e){let t=e.filter(i=>i.edit);if(t.length){if(this.store().window!==null)throw new Error("Editing requires a fully resident Bag; remote windows are read-only.");let i=this.context.sourceNode;this.session=i.editCollection(i.absDatapath(i.getAttr("storepath")))}let n=ch(t.map(({field:i,dtype:s,edit:o})=>({field:i,dtype:s,edit:o})));if(n!==this.validationSignature){this.validationSignature=n,this.columns=t;for(let[i,s]of this.declarations){let o=t.find(a=>a.field===s.field);if(!o)this.active?.path===i&&this.close(),this.releaseField(i);else{let{tag:a,options:l}=this.definition(o);a!==s.tag?(this.active?.path===i&&this.close(),this.releaseField(i)):(s.source.setAttr({...Object.fromEntries(Object.keys(s.options).map(u=>[u,null])),...l}),s.options=l)}}if(!t.length){this.releaseValidation?.(),this.releaseValidation=null;return}this.releaseStatus||(this.releaseStatus=this.session.subscribe(()=>this.refresh())),this.releaseNavigator||(this.releaseNavigator=this.session.registerNavigator(this.focusField)),this.releaseValidation?this.session.invalidateValidation():this.releaseValidation=this.session.registerValidationSource(()=>this.validationFields())}}definition(e){let t=e.edit===!0?{}:{...e.edit},n=t.tag??{L:"numberTextBox",R:"numberTextBox",N:"numberTextBox",D:"dateTextBox",H:"timeTextBox",B:"checkBox"}[e.dtype]??"textbox";if(e.dtype==="DHZ"&&!t.tag)throw new Error("A datetime column requires an explicitly declared supported editor.");return delete t.tag,{tag:n,options:{...t,dtype:e.dtype??"T"}}}*validationFields(){let e=this.context.sourceNode;this.session.trackValidationDependency(e.absDatapath(e.getAttr("structpath")));let t=this.store().bag;for(let n of t.getNodes())for(let i of this.columns){if(n.parentBag!==t)continue;let s=this.path(n,i.field);this.checking.add(s);try{yield{node:this.declare(n,i,!1).source,release:()=>{this.checking.delete(s),s!==this.active?.path&&this.releaseCleanField(s)}}}catch(o){throw this.checking.delete(s),this.releaseCleanField(s),o}}}open(e,t,n){if(this.store().window!==null)throw new Error("Editing requires a fully resident Bag; remote windows are read-only.");if(this.active?.row===e&&this.active.column.field===t.field){this.active.element.control.focus();return}this.close();let i=this.path(e,t.field),s=this.declare(e,t,!0),o=this.grid.ownerDocument.getElementById(s.id);this.active={row:e,column:t,path:i,...s,element:o},this.layer.hidden=!1,this.position(n),o.control.focus()}declare(e,t,n){let i=this.context.sourceNode,s=this.path(e,t.field);this.retained.has(s)||(this.session.retainField(s),this.retained.set(s,e));let o=this.declarations.get(s);if(o)n&&i.rootBuilder.binding.renderer.mountView(o.container);else{let{tag:a,options:l}=this.definition(t);if(!i.rootBuilder.schemaTag(a))throw new Error(`Grid editor requires the ${a} input collection.`);let u=i.rootBuilder,c=`grid-cell-${crypto.randomUUID()}`,d=u.wrapSource(i).div({node_label:c,slot:"cell-editor"});n||u.binding.renderer.unmountView(jn(d));try{let f=d[a]({...l,value:"^"+s,id:c,width:"100%",margin:"0"});o={container:jn(d),source:jn(f),id:c,tag:a,options:l,field:t.field};let h=this.grid.ownerDocument.defaultView.customElements.get(o.source._getMeta("render_tag"));this.session.registerField(o.source,h,n),this.declarations.set(s,o)}catch(f){let h=jn(d);throw h.parentBag.popNode(h.label),this.releaseCleanField(s),f}}return o}close(){let e=this.active;this.active=null,this.layer.hidden=!0,e&&(this.context.sourceNode.rootBuilder.binding.renderer.unmountView(e.container),this.releaseCleanField(e.path))}releaseCleanField(e){if(this.checking.has(e))return;let t=this.session.fieldStatus(e);t.error===null&&t.pending===null&&t.draft===null&&this.retained.has(e)&&this.releaseField(e)}releaseField(e){let t=this.declarations.get(e);this.declarations.delete(e),t?.container.parentBag&&t.container.parentBag.popNode(t.container.label),this.session.releaseField(e),this.retained.delete(e)}position(e=null){if(!this.active)return;if(e??=this.cellFor(this.active.row,this.active.column.field),!e){this.close();return}let t=e.getBoundingClientRect(),n=this.grid.control.getBoundingClientRect(),i=this.grid.shadowRoot.querySelector(".body-viewport").getBoundingClientRect();Object.assign(this.layer.style,{left:`${t.left-n.left-this.grid.control.clientLeft}px`,top:`${t.top-n.top-this.grid.control.clientTop}px`,width:`${t.width}px`}),this.layer.style.setProperty("--grid-editor-height",`${t.height}px`);let s=e.style.getPropertyValue("--grid-cell-max-height");s?this.layer.style.setProperty("--grid-cell-max-height",s):this.layer.style.removeProperty("--grid-cell-max-height");let o=this.layer.getBoundingClientRect();i.height&&(o.top<i.top||o.bottom>i.bottom||o.right<=i.left||o.left>=i.right)&&this.close()}decorate(e,t){if(this.session)for(let n of e.querySelectorAll("td[data-field]")){let i=this.session.fieldStatus(this.path(t,n.dataset.field));n.classList.toggle("invalid-cell",!!i.error),n.classList.toggle("draft-cell",i.draft!==null),i.error?(n.setAttribute("aria-invalid","true"),n.title=i.error.getNodes().map(s=>s.value).join(`
|
|
25
|
-
`)):(n.removeAttribute("aria-invalid"),n.removeAttribute("title"))}}refresh(){let e=this.store().bag;for(let[t,n]of this.retained)n.parentBag!==e&&(this.releaseField(t),this.active?.row===n&&this.close());for(let t of this.retained.keys())t!==this.active?.path&&this.releaseCleanField(t);for(let[t,n]of this.renderedRows())this.decorate(n,t)}replaceData(){if(this.close(),this.session){for(let e of this.retained.keys())this.releaseField(e);this.retained.clear()}}dispose(){this.releaseValidation?.(),this.releaseValidation=null,this.disconnect(),this.replaceData(),this.releaseStatus?.(),this.layer.remove()}};function dl(r){return typeof r=="number"&&Number.isFinite(r)?r:Un(r)}var Vn=class{#e=[];#t=!1;constructor(e,t,n,i,s,o,a){this.source=e,this.body=t,this.columns=n,this.rowFor=i,this.read=s,this.selection=o,this.view=a}path(e){return this.source.absDatapath(e.checked.slice(1))}value(e){let t=this.source.getRelativeData(e.checked.slice(1));return e.check==="single"?t==null||t===""?t:dl(t):gs(t)}id(e,t){let n=this.read(e,t.checkedField);return t.check==="single"?dl(n):Un(n)}contains(e,t,n){return e.check==="single"?t===n:ms(t,n)}filter(){let e=this.selection(),t=e===""?null:e.split(",").map(n=>{let i=this.columns().find(s=>s.field===n&&s.check==="multiple");if(!i)throw new TypeError(`Unknown external check column: ${n}`);return{field:i.checkedField,value:this.value(i)}});this.view().applySetFilter(t)}project(e,t,n){let i=this.id(t,n),s=this.value(n),o=e.querySelector("input.grid-set-check");o||(o=e.ownerDocument.createElement("input"),o.className="grid-set-check",e.replaceChildren(o)),o.type=n.check==="single"?"radio":"checkbox",n.check==="single"?o.name=n.field:o.removeAttribute("name"),o.setAttribute("aria-label",`${n.title??n.name}: ${i}`),o.checked=this.contains(n,s,i)}refresh=()=>{this.filter();for(let e of this.body.querySelectorAll("input.grid-set-check")){let t=e.closest("td[data-field]"),n=this.columns().find(s=>s.field===t.dataset.field),i=this.rowFor(t.parentElement);n?.check&&i&&this.project(e.parentElement,i,n)}};change=e=>{let t=e.target;if(!t.matches("input.grid-set-check"))return;let n=t.closest("td[data-field]"),i=this.columns().find(c=>c.field===n.dataset.field),s=this.rowFor(n.parentElement),o=this.id(s,i),a=this.value(i),l=this.contains(i,a,o);if(t.checked===l)return;if(i.check==="single"){t.checked?this.source.setRelativeData(i.checked.slice(1),o):this.project(t.parentElement,s,i);return}let u=t.checked?a?a+","+o:o:(","+a+",").replace(","+o+",",",").slice(1,-1);this.source.setRelativeData(i.checked.slice(1),u)};configure(){for(let e of this.#e)e.close();if(this.#e=[],!!this.#t){this.filter();for(let e of this.columns().filter(t=>t.check))this.#e.push(this.source.rootBuilder.binding.router.register({path:this.path(e),recipient:{receive:this.refresh}}))}}connect(){this.#t||(this.#t=!0,this.body.addEventListener("change",this.change))}disconnect(){this.body.removeEventListener("change",this.change),this.#t=!1,this.configure()}};import{Bag as pl}from"@gramlot/gramlot";var dh="#",fh=/[A-Za-z_$][\w$]*/g;function Wn(r){let e=new Map;for(let u of r){if(u.formula==null)continue;let c=u.formula.trim(),d=c===dh?{kind:"index",field:null}:c.startsWith("+=")?{kind:"running",field:c.slice(2).trim()}:c.startsWith("%=")?{kind:"percent",field:c.slice(2).trim()}:null;if(d&&d.kind!=="index"&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(d.field))throw new TypeError(`grid formula '${c}' requires a field`);let f=new Map;for(let[m,g]of Object.entries(u))m.startsWith("formula_")&&f.set(m.slice(8),g);let h=null;if(!d)try{h=hh(c)}catch{}let p=d?new Set(d.field?[d.field]:[]):new Set(c.match(fh)??[]);e.set(u.field,{field:u.field,formula:u.formula,special:d,arithmetic:h,parameters:f,references:p,calculated:u.calculated===!0,column:u})}let t=new Map;for(let u of e.values())for(let c of u.references)t.has(c)||t.set(c,new Set),t.get(c).add(u.field);let n=new Set,i=new Set,s=[],o=u=>{if(!i.has(u)){if(n.has(u))throw new TypeError(`grid formula dependency cycle at '${u}'`);n.add(u);for(let c of e.get(u).references)e.has(c)&&o(c);n.delete(u),i.add(u),s.push(u)}};for(let u of e.keys())o(u);let a=new Set;for(let u of s){let c=e.get(u);(["index","running"].includes(c.special?.kind)||[...c.references].some(d=>a.has(d)))&&a.add(u)}let l=new Map([...e].map(([u,c])=>[u,Object.freeze({...c,view:a.has(u)})]));return Object.freeze({definitions:l,triggered:t,order:Object.freeze(s),viewFields:a})}function hh(r){let e=ph(r),t=0,n=()=>e[t],i=u=>{if(n().value!==u)throw new SyntaxError(`expected '${u}' in arithmetic formula`);return e[t++]},s={"+":1,"-":1,"*":2,"/":2,"%":2,"**":3},o=()=>{let u=n();if(u.type==="number")return t++,{kind:"number",value:u.value};if(u.type==="name")return t++,{kind:"name",value:u.value};if(u.value==="("){t++;let c=a(0);return i(")"),c}if(u.value==="+"||u.value==="-")return t++,{kind:"unary",operator:u.value,child:o()};throw new SyntaxError(`unexpected '${u.value||"end"}' in arithmetic formula`)},a=u=>{let c=o();for(;s[n().value]>=u;){let d=e[t++].value,f=a(s[d]+(d==="**"?0:1));c={kind:"binary",operator:d,left:c,right:f}}return c},l=a(0);if(n().type!=="eof")throw new SyntaxError(`unexpected '${n().value}' in arithmetic formula`);return l}function ph(r){let e=[],t=0;for(;t<r.length;){let n=r.slice(t),i=/^\s+/.exec(n);if(i){t+=i[0].length;continue}let s=/^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(n);if(s){e.push({type:"number",value:s[0]}),t+=s[0].length;continue}let o=/^[A-Za-z_$][\w$]*/.exec(n);if(o){e.push({type:"name",value:o[0]}),t+=o[0].length;continue}let a=/^(?:\*\*|[()+\-*/%])/.exec(n);if(a){e.push({type:"operator",value:a[0]}),t+=a[0].length;continue}throw new SyntaxError(`unsupported arithmetic formula token at ${t}`)}return e.push({type:"eof",value:""}),e}function fl(){if(Ki()==="number")throw new Error("A Decimal backend is required for exact grid formulas")}function jr(r,e){if(F(r))return r;if(r==null||r==="")return null;if(typeof r!="number"&&typeof r!="string")throw new TypeError("Decimal arithmetic requires numeric values");return new e(String(r))}var mh={"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e,"**":(r,e)=>r**e};function Ur(r,e){if(r.kind==="number")return Number(r.value);if(r.kind==="name"){if(!Object.hasOwn(e,r.value))throw new ReferenceError(`${r.value} is not defined`);return e[r.value]}return r.kind==="unary"?r.operator==="-"?-Ur(r.child,e):+Ur(r.child,e):mh[r.operator](Ur(r.left,e),Ur(r.right,e))}function Hn(r,e,t){if(r.kind==="number")return new t(r.value);if(r.kind==="name"){if(!Object.hasOwn(e,r.value))throw new ReferenceError(`${r.value} is not defined`);return jr(e[r.value],t)}if(r.kind==="unary"){let o=Hn(r.child,e,t);return o==null?null:r.operator==="-"?o.neg():o}let n=Hn(r.left,e,t),i=Hn(r.right,e,t);if(n==null||i==null)return null;if(r.operator==="**")return n.pow(Number(i.toString()));let s={"+":"plus","-":"minus","*":"times","/":"div","%":"mod"}[r.operator];return n[s](i)}function _s(r,e){return Object.is(r,e)?!0:F(r)&&F(e)&&r.eq(e)}function Gn(r,e){if(e==null||e==="")return r;if(F(r)||F(e)){fl();let t=F(r)?r.constructor:e.constructor;return jr(r,t).plus(jr(e,t))}if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Grid aggregate formulas require numeric values");return r+e}function gh(r,e){let t=F(e)?e.eq(0):Object.is(e,0);if(r==null||r===""||e==null||t)return null;if(F(r)||F(e)){let n=F(r)?r.constructor:e.constructor;return jr(r,n).div(jr(e,n)).times(new n(100))}if(typeof r!="number"||typeof e!="number")throw new TypeError("Percentage formulas require numeric values");return r/e*100}var Xn=class{#e;#t=Wn([]);#i=new Set;#n=null;#r=null;#a=[];#o=[];#l=!1;#s=new Map;#c=null;constructor(e){this.#e=e}get source(){return this.#e}get runtime(){return this.source.rootBuilder.binding}get errors(){return new Map(this.#s)}get formulas(){return this.#t}get dataFields(){return new Set(this.formulas.order.filter(e=>!this.viewFields.has(e)))}get viewFields(){return this.formulas.viewFields}configure(e,t,n){if(!(e.formulas===this.#t&&n===this.#n&&t===this.#r&&this.#a.length)&&(this.disconnect(),this.#t=e.formulas,this.#i=new Set(e.fields),this.#n=n,this.#r=t,this.#s.clear(),!!this.formulas.definitions.size)){this.#a=[n.subscribe(i=>this.#y(i)),t.subscribe(()=>{this.#c=null})];for(let i of this.formulas.definitions.values())for(let s of i.parameters.values()){if(typeof s!="string"||!s.startsWith("^"))continue;let[o,a=null]=this.source.absDatapath(s).split("?");this.#o.push(this.runtime.router.register({path:o,attr:a,recipient:{receive:()=>{this.#c=null,this.recalculate(this.#v([i.field]))}}}))}this.recalculate(this.#v(this.#x(i=>i.calculated)))}}disconnect(){for(let e of this.#a)e();for(let e of this.#o)e.close();this.#a=[],this.#o=[],this.#n=null,this.#r=null,this.#c=null,this.#t=Wn([])}value(e,t){if(!this.viewFields.has(t))return this.#n.value(e,t);let n=this.#E().get(e);return n===void 0?null:n[t]}#x(e){return[...this.formulas.definitions.values()].filter(e).map(t=>t.field)}#v(e){let t=new Set(e),n=[...e];for(;n.length;)for(let i of this.formulas.triggered.get(n.shift())??[])t.has(i)||(t.add(i),n.push(i));return t}#y({full:e,rows:t,event:n,field:i}){if(this.#c=null,this.#l)return;if(e){this.recalculate(this.#v(this.#x(c=>c.calculated||c.special)));return}let[s]=t,o;i!==null?o=[i]:n.node===s?o=n.evt==="upd_attrs"?Object.keys(n.attrs_diff):[...this.formulas.triggered.keys()]:o=(Array.isArray(n.node)?n.node:[n.node]).map(c=>c.label);let a=new Set;for(let c of o)for(let d of this.formulas.triggered.get(c)??[])a.add(d);let l=this.#v(a),u=[...l].some(c=>this.formulas.definitions.get(c).special?.kind==="percent");this.recalculate(l,u?null:[s])}#d(e){let t={};for(let[n,i]of e.parameters)t[n]=typeof i=="string"&&(i.startsWith("^")||i.startsWith("="))?this.source.getRelativeData(i):i;return t}#b(e,t,n,i,s){if(e.special?.kind==="index")return n;if(e.special?.kind==="running")return Gn(i,s(t,e.special.field));if(e.special?.kind==="percent")return gh(s(t,e.special.field),i);let o=this.#d(e),a={};for(let d of e.references)Object.hasOwn(o,d)?a[d]=o[d]:(this.#i.has(d)||this.#f(t).has(d))&&(a[d]=s(t,d)??null);if(Object.values(a).some(d=>d==null))return null;let l=Object.values(a).find(F);if(e.arithmetic)return l===void 0?Ur(e.arithmetic,a):(fl(),Hn(e.arithmetic,a,l.constructor));if(l!==void 0)throw new Error("Decimal grid formulas support arithmetic expressions only");let u=[...Object.keys(a),"_currcell","_rowNode"];return this.runtime.inlineCompiler.compile(this.source,`struct.${e.field}.formula`,e.formula,u,`return (${e.formula}
|
|
26
|
-
);`)({...a,_currcell:e.column,_rowNode:t})}#f(e){return this.#n.rowMode==="attributes"?new Set(Object.keys(e.getAttr())):new Set(e.staticValue.keys())}#h(e,t,n){_s(this.#n.value(e,t),n)||(this.#n.rowMode==="attributes"?e.setAttr({[t]:n}):e.staticValue.setItem(t,n))}recalculate(e,t=null){if(this.#l||!e.size||this.#n===null)return;this.#l=!0;let n=(i,s)=>this.#n.value(i,s);try{let i=this.#n.getRows();for(let s of this.formulas.order){let o=this.formulas.definitions.get(s);if(!e.has(s)||o.view)continue;let a=null,l=null;if(o.special?.kind==="percent")try{a=0;for(let u of i)a=Gn(a,n(u,o.special.field))}catch(u){a=null,l=u}for(let u of t??i){let c=null;try{c=this.#b(o,u,null,a,n)}catch(d){l=d}this.#h(u,s,c)}l?this.#s.set(s,l):this.#s.delete(s)}}finally{this.#l=!1}}#E(){if(this.#c!==null)return this.#c;let e=this.#r.getRows(),t=new Map(e.map(i=>[i,{}])),n=(i,s)=>this.viewFields.has(s)?t.get(i)[s]:this.#n.value(i,s);for(let i of this.formulas.order){let s=this.formulas.definitions.get(i);if(!s.view)continue;let o=0,a=null;for(let[l,u]of e.entries()){let c=null;try{c=this.#b(s,u,l+1,o,n),s.special?.kind==="running"&&(o=c)}catch(d){a=d}t.get(u)[i]=c}a?this.#s.set(i,a):this.#s.delete(i)}return this.#c=t,t}};var bh=new Set(["T","B","L","R","N","D","H","DHZ"]),_h=new Set(["tag","field","name","title","dtype","width","align","format","columnset","white_space","max_height","edit","check","checked","checkedField","formula","calculated","hidden","totalize","footer_value","footer_format"]),wh=/^formula_[A-Za-z_$][\w$]*$/,yh=new Set(["tag","code","name","background","color"]),Zn=class{#e=new Map;constructor(e){if(!(e instanceof pl))throw new TypeError("grid structpath must resolve to a Bag");let t=Yn(e,"view_0"),n=Yn(e,"info"),i=Yn(t,"rows_0"),s=Yn(n,"columnsets"),o=new Set,a=new Map;for(let u of s.getNodes()){let c=u.getAttr();if(hl(c,yh),ws(c.code,"colgroup code"),c.tag!=="columnset"||u.resolver||u.staticValue!=null||u.label!==c.code)throw new TypeError("grid columnset requires a scalar definition labelled by code");if(a.has(c.code))throw new TypeError(`Duplicate grid colgroup: ${c.code}`);if(c.name!=null&&typeof c.name!="string")throw new TypeError("grid group name must be text");for(let d of["background","color"])if(c[d]!=null&&typeof c[d]!="string")throw new TypeError(`grid ${d} must be text`);a.set(c.code,{...c,name:c.name??c.code})}this.columns=[],this.groups=[];let l=[];for(let u of i.getNodes()){let c=u.getAttr();if(hl(c,_h,wh),c.tag!=="cell"||u.staticValue!=null||u.resolver)throw new TypeError("grid cell must be a scalar declaration");if(ws(c.field,"field"),o.has(c.field))throw new TypeError(`Duplicate grid field: ${c.field}`);if(o.add(c.field),this.#e.set(c.field,u),c.columnset!=null&&!a.has(c.columnset))throw new TypeError(`Unknown grid columnset: ${c.columnset}`);if(c.dtype!=null&&!bh.has(c.dtype))throw new TypeError(`Unsupported grid dtype: ${c.dtype}`);if(c.align!=null&&!["start","center","end"].includes(c.align))throw new TypeError("grid align requires start, center or end");if(c.width!=null&&(typeof c.width!="string"||!/^(?:\d+(?:\.\d+)?)(?:px|em|rem|ch|%)$/.test(c.width)))throw new TypeError("grid width requires a nonnegative CSS length (px, em, rem, ch or %)");if(c.max_height!=null&&(typeof c.max_height!="string"||!/^(?:\d+(?:\.\d+)?)(?:px|em|rem)$/.test(c.max_height)))throw new TypeError("grid max_height requires a nonnegative CSS length (px, em or rem)");if(c.white_space!=null&&!["normal","nowrap","pre-wrap"].includes(c.white_space))throw new TypeError("grid white_space requires normal, nowrap or pre-wrap");for(let p of["name","title","format"])if(c[p]!=null&&typeof c[p]!="string")throw new TypeError(`grid ${p} must be text`);if(c.edit!=null&&typeof c.edit!="boolean"&&(typeof c.edit!="object"||Array.isArray(c.edit)))throw new TypeError("grid edit requires a boolean or editor options");if(c.check!=null||c.checked!=null||c.checkedField!=null){if(!["multiple","single"].includes(c.check)||typeof c.checked!="string"||!c.checked.startsWith("^")||c.checked.length<2||c.checked.includes("?"))throw new TypeError("grid check requires single or multiple and checked=^DataPath");if(ws(c.checkedField,"checkedField"),c.edit)throw new TypeError("external check sets cannot edit row fields")}vh(c);let d=Object.freeze({...c,name:c.name??c.field,align:c.align??(["L","R","N"].includes(c.dtype)?"end":"start")});if(l.push(d),c.hidden)continue;this.columns.push(d);let f=c.columnset??null,h=this.groups.at(-1);(!h||h.code!==f)&&(h={code:f,...f===null?{name:null}:a.get(f),columns:[]},this.groups.push(h)),h.columns.push(d)}if(!this.columns.length)throw new TypeError("grid struct requires at least one column");this.fields=Object.freeze([...o]),this.formulas=Wn(l);for(let u of this.groups)Object.freeze(u.columns),Object.freeze(u);Object.freeze(this.columns),Object.freeze(this.groups),Object.freeze(this)}columnNode(e){return this.#e.get(e)}moveColumn(e,t,n=!1){let i=this.#e.get(e),s=this.#e.get(t);if(!i||!s||i===s)return;let o=i.parentBag,a=o.getNodes(),l=a.indexOf(i),u=a.indexOf(s),c=u+Number(n)-+(l<u);c!==l&&o.move(l,c)}setColumnWidth(e,t){if(!Number.isFinite(t)||t<=0)throw new TypeError("grid resized width must be positive pixels");this.#e.get(e).setAttr({width:`${Math.round(t)}px`})}};function Yn(r,e){let t=r.getNode(e);if(!t||t.resolver||!(t.staticValue instanceof pl))throw new TypeError(`grid struct requires Bag ${e}`);return t.staticValue}function hl(r,e,t=null){for(let n of Object.keys(r))if(!e.has(n)&&!t?.test(n))throw new TypeError(`Unsupported grid struct attribute: ${n}`)}function vh(r){if(r.formula!=null&&(typeof r.formula!="string"||!r.formula.trim()))throw new TypeError("grid formula must be nonempty text");if(r.formula==null&&(r.calculated!=null||Object.keys(r).some(e=>e.startsWith("formula_"))))throw new TypeError(`grid ${r.field}: calculated and formula_<name> require a formula`);for(let e of["calculated","hidden"])if(r[e]!=null&&typeof r[e]!="boolean")throw new TypeError(`grid ${e} must be a boolean`);if(r.totalize!=null&&typeof r.totalize!="boolean"&&(typeof r.totalize!="string"||!r.totalize))throw new TypeError("grid totalize requires a boolean or a Data path");for(let e of["footer_value","footer_format"])if(r[e]!=null&&typeof r[e]!="string")throw new TypeError(`grid ${e} must be text`)}function ws(r,e){if(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r))throw new TypeError(`grid ${e} requires a simple field identifier`)}var Kn=class{#e;#t;#i;#n;#r;#a;#o;#l=[];#s=!1;#c=new Map;constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;let i=n.ownerDocument;this.#n=i.createElement("div"),this.#n.className="footer-frame",this.#n.setAttribute("part","footer"),this.#r=i.createElement("div"),this.#r.className="footer-viewport",this.#a=i.createElement("table"),this.#a.setAttribute("role","presentation");let s=i.createElement("tfoot");s.setAttribute("role","rowgroup"),this.#o=i.createElement("tr"),this.#o.setAttribute("role","row"),s.append(this.#o),this.#a.append(s),this.#r.append(this.#a),this.#n.append(this.#r)}get source(){return this.#e}get frame(){return this.#n}get table(){return this.#a}get viewport(){return this.#r}get errors(){return new Map(this.#c)}cell(e){return this.#o.querySelector(`td[data-field="${e}"]`)}configure(e,t,n){this.#s=e,this.#l=t,e===!1?this.#n.remove():this.#i.after(this.#n);let i=this.#o.ownerDocument,s=[];if(n){let o=i.createElement("th");o.className="row-heading",o.setAttribute("role","rowheader"),s.push(o)}for(let[o,a]of t.entries()){let l=i.createElement("td");l.dataset.field=a.field,l.setAttribute("role","cell"),l.setAttribute("part","footer-cell"),l.setAttribute("aria-colindex",String(o+1+Number(n))),l.style.textAlign=a.totalize?"end":a.align,l.classList.toggle("numeric",!!a.totalize),s.push(l)}this.#o.replaceChildren(...s)}update(e,t){for(let[n,i]of this.#l.entries()){let s=this.cell(i.field),o=i.footer_value??"",a=null;if(i.totalize){let l=0;try{for(let u of t){let c=e.value(u,i.field);l=Gn(l,typeof c=="boolean"?Number(c):c)}this.#c.delete(i.field)}catch(u){l=null,this.#c.set(i.field,u)}this.#x(i,l),l===null?(o="\u2014",a=this.#c.get(i.field).message):o=Nr(l,{...i,dtype:i.dtype==="B"?"L":i.dtype,format:i.footer_format??i.format},this.#t)}else n===0&&o===""&&(o=this.#s===!0?"Total":this.#s);s.textContent!==o&&(s.textContent=o),a===null?(s.removeAttribute("title"),s.removeAttribute("aria-invalid")):(s.title=a,s.setAttribute("aria-invalid","true"))}}totalPaths(){return this.#l.filter(e=>e.totalize).map(e=>this.source.absDatapath(e.totalize===!0?`.totalize.${e.field}`:e.totalize))}#x(e,t){let n=e.totalize===!0?`.totalize.${e.field}`:e.totalize;_s(this.source.getRelativeData(n),t)||this.source.setRelativeData(n,t)}};import{Bag as Kt}from"@gramlot/gramlot";var ml=Object.freeze({csv:{caption:"CSV",extension:"csv",type:"text/csv"},json:{caption:"JSON",extension:"json",type:"application/json"},tytx:{caption:"TYTX",extension:"tytx",type:"text/plain"},xml:{caption:"XML",extension:"xml",type:"application/xml"},xlsx:{caption:"Excel",extension:"xlsx",type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}),kh=null,Eh=Object.freeze({export:{label:"Export",publish:"export",icon:"\u21E9",tooltip:"Export the visible rows"},printRows:{label:"Print",publish:"printRows",icon:"\u2399",tooltip:"Print the visible rows"},lineNumbers:{label:"Line numbers",publish:"lineNumbers",tooltip:"Show or hide the row numbers"},addrow:{label:"Add row",publish:"addrow",icon:"+",tooltip:"Add a row"},duprow:{label:"Duplicate",publish:"duprow",icon:"\u29C9",tooltip:"Duplicate the selected rows"},delrow:{label:"Delete",publish:"delrow",icon:"\u2212",tooltip:"Delete the selected rows"}}),xh=new Set(["grid:addrow","grid:duprow","grid:delrow"]),Ah=new Set(["grid:duprow","grid:delrow"]);function gl(r){let e=r.commands.registerGroup("grid",{description:"Grid toolbar tools"});for(let[t,n]of Object.entries(Eh))e.register(t,n)}function Dh(r){return/[",\r\n]/.test(r)?`"${r.replaceAll('"','""')}"`:r}var Jn=class{#e;#t;#i=[];constructor(e,t){this.#e=e,this.#t=t}get source(){return this.#e.sourceNode}get runtime(){return this.source.rootBuilder.binding}connect(){if(this.#i.length)return;let e=this.runtime.subscriptions,t={export:n=>this.exportRows(n.parameters.format),printRows:()=>this.printRows(),lineNumbers:()=>this.toggleLineNumbers(),addrow:n=>this.addRow(n.parameters.defaults??{}),duprow:()=>this.duplicateRows(),delrow:()=>this.deleteRows()};for(let[n,i]of Object.entries(t))this.#i.push(e.subscribe(e.topicFor(this.source,n),async s=>{try{await i(s)}catch(o){this.#e.reportError(o,"Grid tool")}}))}disconnect(){for(let e of this.#i)this.runtime.subscriptions.unsubscribe(e);this.#i=[]}#n(){let e=this.#t.columns().filter(n=>!n.check),t=new bt(this.#t.reader(),this.#e.format).read(e,this.#t.rows());return{captions:e.map(n=>n.name),cells:t.map(n=>n.cells)}}csv(){let{captions:e,cells:t}=this.#n();return[e,...t].map(n=>n.map(Dh).join(",")).join(`\r
|
|
25
|
+
`)):(n.removeAttribute("aria-invalid"),n.removeAttribute("title"))}}refresh(){let e=this.store().bag;for(let[t,n]of this.retained)n.parentBag!==e&&(this.releaseField(t),this.active?.row===n&&this.close());for(let t of this.retained.keys())t!==this.active?.path&&this.releaseCleanField(t);for(let[t,n]of this.renderedRows())this.decorate(n,t)}replaceData(){if(this.close(),this.session){for(let e of this.retained.keys())this.releaseField(e);this.retained.clear()}}dispose(){this.releaseValidation?.(),this.releaseValidation=null,this.disconnect(),this.replaceData(),this.releaseStatus?.(),this.layer.remove()}};function dl(r){return typeof r=="number"&&Number.isFinite(r)?r:Un(r)}var Vn=class{#e=[];#t=!1;constructor(e,t,n,i,s,o,a){this.source=e,this.body=t,this.columns=n,this.rowFor=i,this.read=s,this.selection=o,this.view=a}path(e){return this.source.absDatapath(e.checked.slice(1))}value(e){let t=this.source.getRelativeData(e.checked.slice(1));return e.check==="single"?t==null||t===""?t:dl(t):gs(t)}id(e,t){let n=this.read(e,t.checkedField);return t.check==="single"?dl(n):Un(n)}contains(e,t,n){return e.check==="single"?t===n:ms(t,n)}filter(){let e=this.selection(),t=e===""?null:e.split(",").map(n=>{let i=this.columns().find(s=>s.field===n&&s.check==="multiple");if(!i)throw new TypeError(`Unknown external check column: ${n}`);return{field:i.checkedField,value:this.value(i)}});this.view().applySetFilter(t)}project(e,t,n){let i=this.id(t,n),s=this.value(n),o=e.querySelector("input.grid-set-check");o||(o=e.ownerDocument.createElement("input"),o.className="grid-set-check",e.replaceChildren(o)),o.type=n.check==="single"?"radio":"checkbox",n.check==="single"?o.name=n.field:o.removeAttribute("name"),o.setAttribute("aria-label",`${n.title??n.name}: ${i}`),o.checked=this.contains(n,s,i)}refresh=()=>{this.filter();for(let e of this.body.querySelectorAll("input.grid-set-check")){let t=e.closest("td[data-field]"),n=this.columns().find(s=>s.field===t.dataset.field),i=this.rowFor(t.parentElement);n?.check&&i&&this.project(e.parentElement,i,n)}};change=e=>{let t=e.target;if(!t.matches("input.grid-set-check"))return;let n=t.closest("td[data-field]"),i=this.columns().find(c=>c.field===n.dataset.field),s=this.rowFor(n.parentElement),o=this.id(s,i),a=this.value(i),l=this.contains(i,a,o);if(t.checked===l)return;if(i.check==="single"){t.checked?this.source.setRelativeData(i.checked.slice(1),o):this.project(t.parentElement,s,i);return}let u=t.checked?a?a+","+o:o:(","+a+",").replace(","+o+",",",").slice(1,-1);this.source.setRelativeData(i.checked.slice(1),u)};configure(){for(let e of this.#e)e.close();if(this.#e=[],!!this.#t){this.filter();for(let e of this.columns().filter(t=>t.check))this.#e.push(this.source.rootBuilder.binding.router.register({path:this.path(e),recipient:{receive:this.refresh}}))}}connect(){this.#t||(this.#t=!0,this.body.addEventListener("change",this.change))}disconnect(){this.body.removeEventListener("change",this.change),this.#t=!1,this.configure()}};import{Bag as pl}from"@gramlot/gramlot";var dh="#",fh=/[A-Za-z_$][\w$]*/g;function Wn(r){let e=new Map;for(let u of r){if(u.formula==null)continue;let c=u.formula.trim(),d=c===dh?{kind:"index",field:null}:c.startsWith("+=")?{kind:"running",field:c.slice(2).trim()}:c.startsWith("%=")?{kind:"percent",field:c.slice(2).trim()}:null;if(d&&d.kind!=="index"&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(d.field))throw new TypeError(`grid formula '${c}' requires a field`);let f=new Map;for(let[m,g]of Object.entries(u))m.startsWith("formula_")&&f.set(m.slice(8),g);let h=null;if(!d)try{h=hh(c)}catch{}let p=d?new Set(d.field?[d.field]:[]):new Set(c.match(fh)??[]);e.set(u.field,{field:u.field,formula:u.formula,special:d,arithmetic:h,parameters:f,references:p,calculated:u.calculated===!0,column:u})}let t=new Map;for(let u of e.values())for(let c of u.references)t.has(c)||t.set(c,new Set),t.get(c).add(u.field);let n=new Set,i=new Set,s=[],o=u=>{if(!i.has(u)){if(n.has(u))throw new TypeError(`grid formula dependency cycle at '${u}'`);n.add(u);for(let c of e.get(u).references)e.has(c)&&o(c);n.delete(u),i.add(u),s.push(u)}};for(let u of e.keys())o(u);let a=new Set;for(let u of s){let c=e.get(u);(["index","running"].includes(c.special?.kind)||[...c.references].some(d=>a.has(d)))&&a.add(u)}let l=new Map([...e].map(([u,c])=>[u,Object.freeze({...c,view:a.has(u)})]));return Object.freeze({definitions:l,triggered:t,order:Object.freeze(s),viewFields:a})}function hh(r){let e=ph(r),t=0,n=()=>e[t],i=u=>{if(n().value!==u)throw new SyntaxError(`expected '${u}' in arithmetic formula`);return e[t++]},s={"+":1,"-":1,"*":2,"/":2,"%":2,"**":3},o=()=>{let u=n();if(u.type==="number")return t++,{kind:"number",value:u.value};if(u.type==="name")return t++,{kind:"name",value:u.value};if(u.value==="("){t++;let c=a(0);return i(")"),c}if(u.value==="+"||u.value==="-")return t++,{kind:"unary",operator:u.value,child:o()};throw new SyntaxError(`unexpected '${u.value||"end"}' in arithmetic formula`)},a=u=>{let c=o();for(;s[n().value]>=u;){let d=e[t++].value,f=a(s[d]+(d==="**"?0:1));c={kind:"binary",operator:d,left:c,right:f}}return c},l=a(0);if(n().type!=="eof")throw new SyntaxError(`unexpected '${n().value}' in arithmetic formula`);return l}function ph(r){let e=[],t=0;for(;t<r.length;){let n=r.slice(t),i=/^\s+/.exec(n);if(i){t+=i[0].length;continue}let s=/^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(n);if(s){e.push({type:"number",value:s[0]}),t+=s[0].length;continue}let o=/^[A-Za-z_$][\w$]*/.exec(n);if(o){e.push({type:"name",value:o[0]}),t+=o[0].length;continue}let a=/^(?:\*\*|[()+\-*/%])/.exec(n);if(a){e.push({type:"operator",value:a[0]}),t+=a[0].length;continue}throw new SyntaxError(`unsupported arithmetic formula token at ${t}`)}return e.push({type:"eof",value:""}),e}function fl(){if(Ki()==="number")throw new Error("A Decimal backend is required for exact grid formulas")}function jr(r,e){if(F(r))return r;if(r==null||r==="")return null;if(typeof r!="number"&&typeof r!="string")throw new TypeError("Decimal arithmetic requires numeric values");return new e(String(r))}var mh={"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e,"**":(r,e)=>r**e};function Ur(r,e){if(r.kind==="number")return Number(r.value);if(r.kind==="name"){if(!Object.hasOwn(e,r.value))throw new ReferenceError(`${r.value} is not defined`);return e[r.value]}return r.kind==="unary"?r.operator==="-"?-Ur(r.child,e):+Ur(r.child,e):mh[r.operator](Ur(r.left,e),Ur(r.right,e))}function Hn(r,e,t){if(r.kind==="number")return new t(r.value);if(r.kind==="name"){if(!Object.hasOwn(e,r.value))throw new ReferenceError(`${r.value} is not defined`);return jr(e[r.value],t)}if(r.kind==="unary"){let o=Hn(r.child,e,t);return o==null?null:r.operator==="-"?o.neg():o}let n=Hn(r.left,e,t),i=Hn(r.right,e,t);if(n==null||i==null)return null;if(r.operator==="**")return n.pow(Number(i.toString()));let s={"+":"plus","-":"minus","*":"times","/":"div","%":"mod"}[r.operator];return n[s](i)}function _s(r,e){return Object.is(r,e)?!0:F(r)&&F(e)&&r.eq(e)}function Gn(r,e){if(e==null||e==="")return r;if(F(r)||F(e)){fl();let t=F(r)?r.constructor:e.constructor;return jr(r,t).plus(jr(e,t))}if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Grid aggregate formulas require numeric values");return r+e}function gh(r,e){let t=F(e)?e.eq(0):Object.is(e,0);if(r==null||r===""||e==null||t)return null;if(F(r)||F(e)){let n=F(r)?r.constructor:e.constructor;return jr(r,n).div(jr(e,n)).times(new n(100))}if(typeof r!="number"||typeof e!="number")throw new TypeError("Percentage formulas require numeric values");return r/e*100}var Xn=class{#e;#t=Wn([]);#i=new Set;#n=null;#r=null;#l=[];#s=[];#a=!1;#o=new Map;#c=null;constructor(e){this.#e=e}get source(){return this.#e}get runtime(){return this.source.rootBuilder.binding}get errors(){return new Map(this.#o)}get formulas(){return this.#t}get dataFields(){return new Set(this.formulas.order.filter(e=>!this.viewFields.has(e)))}get viewFields(){return this.formulas.viewFields}configure(e,t,n){if(!(e.formulas===this.#t&&n===this.#n&&t===this.#r&&this.#l.length)&&(this.disconnect(),this.#t=e.formulas,this.#i=new Set(e.fields),this.#n=n,this.#r=t,this.#o.clear(),!!this.formulas.definitions.size)){this.#l=[n.subscribe(i=>this.#y(i)),t.subscribe(()=>{this.#c=null})];for(let i of this.formulas.definitions.values())for(let s of i.parameters.values()){if(typeof s!="string"||!s.startsWith("^"))continue;let[o,a=null]=this.source.absDatapath(s).split("?");this.#s.push(this.runtime.router.register({path:o,attr:a,recipient:{receive:()=>{this.#c=null,this.recalculate(this.#v([i.field]))}}}))}this.recalculate(this.#v(this.#x(i=>i.calculated)))}}disconnect(){for(let e of this.#l)e();for(let e of this.#s)e.close();this.#l=[],this.#s=[],this.#n=null,this.#r=null,this.#c=null,this.#t=Wn([])}value(e,t){if(!this.viewFields.has(t))return this.#n.value(e,t);let n=this.#E().get(e);return n===void 0?null:n[t]}#x(e){return[...this.formulas.definitions.values()].filter(e).map(t=>t.field)}#v(e){let t=new Set(e),n=[...e];for(;n.length;)for(let i of this.formulas.triggered.get(n.shift())??[])t.has(i)||(t.add(i),n.push(i));return t}#y({full:e,rows:t,event:n,field:i}){if(this.#c=null,this.#a)return;if(e){this.recalculate(this.#v(this.#x(c=>c.calculated||c.special)));return}let[s]=t,o;i!==null?o=[i]:n.node===s?o=n.evt==="upd_attrs"?Object.keys(n.attrs_diff):[...this.formulas.triggered.keys()]:o=(Array.isArray(n.node)?n.node:[n.node]).map(c=>c.label);let a=new Set;for(let c of o)for(let d of this.formulas.triggered.get(c)??[])a.add(d);let l=this.#v(a),u=[...l].some(c=>this.formulas.definitions.get(c).special?.kind==="percent");this.recalculate(l,u?null:[s])}#d(e){let t={};for(let[n,i]of e.parameters)t[n]=typeof i=="string"&&(i.startsWith("^")||i.startsWith("="))?this.source.getRelativeData(i):i;return t}#b(e,t,n,i,s){if(e.special?.kind==="index")return n;if(e.special?.kind==="running")return Gn(i,s(t,e.special.field));if(e.special?.kind==="percent")return gh(s(t,e.special.field),i);let o=this.#d(e),a={};for(let d of e.references)Object.hasOwn(o,d)?a[d]=o[d]:(this.#i.has(d)||this.#f(t).has(d))&&(a[d]=s(t,d)??null);if(Object.values(a).some(d=>d==null))return null;let l=Object.values(a).find(F);if(e.arithmetic)return l===void 0?Ur(e.arithmetic,a):(fl(),Hn(e.arithmetic,a,l.constructor));if(l!==void 0)throw new Error("Decimal grid formulas support arithmetic expressions only");let u=[...Object.keys(a),"_currcell","_rowNode"];return this.runtime.inlineCompiler.compile(this.source,`struct.${e.field}.formula`,e.formula,u,`return (${e.formula}
|
|
26
|
+
);`)({...a,_currcell:e.column,_rowNode:t})}#f(e){return this.#n.rowMode==="attributes"?new Set(Object.keys(e.getAttr())):new Set(e.staticValue.keys())}#h(e,t,n){_s(this.#n.value(e,t),n)||(this.#n.rowMode==="attributes"?e.setAttr({[t]:n}):e.staticValue.setItem(t,n))}recalculate(e,t=null){if(this.#a||!e.size||this.#n===null)return;this.#a=!0;let n=(i,s)=>this.#n.value(i,s);try{let i=this.#n.getRows();for(let s of this.formulas.order){let o=this.formulas.definitions.get(s);if(!e.has(s)||o.view)continue;let a=null,l=null;if(o.special?.kind==="percent")try{a=0;for(let u of i)a=Gn(a,n(u,o.special.field))}catch(u){a=null,l=u}for(let u of t??i){let c=null;try{c=this.#b(o,u,null,a,n)}catch(d){l=d}this.#h(u,s,c)}l?this.#o.set(s,l):this.#o.delete(s)}}finally{this.#a=!1}}#E(){if(this.#c!==null)return this.#c;let e=this.#r.getRows(),t=new Map(e.map(i=>[i,{}])),n=(i,s)=>this.viewFields.has(s)?t.get(i)[s]:this.#n.value(i,s);for(let i of this.formulas.order){let s=this.formulas.definitions.get(i);if(!s.view)continue;let o=0,a=null;for(let[l,u]of e.entries()){let c=null;try{c=this.#b(s,u,l+1,o,n),s.special?.kind==="running"&&(o=c)}catch(d){a=d}t.get(u)[i]=c}a?this.#o.set(i,a):this.#o.delete(i)}return this.#c=t,t}};var bh=new Set(["T","B","L","R","N","D","H","DHZ"]),_h=new Set(["tag","field","name","title","dtype","width","align","format","columnset","white_space","max_height","edit","check","checked","checkedField","formula","calculated","hidden","totalize","footer_value","footer_format"]),wh=/^formula_[A-Za-z_$][\w$]*$/,yh=new Set(["tag","code","name","background","color"]),Zn=class{#e=new Map;constructor(e){if(!(e instanceof pl))throw new TypeError("grid structpath must resolve to a Bag");let t=Yn(e,"view_0"),n=Yn(e,"info"),i=Yn(t,"rows_0"),s=Yn(n,"columnsets"),o=new Set,a=new Map;for(let u of s.getNodes()){let c=u.getAttr();if(hl(c,yh),ws(c.code,"colgroup code"),c.tag!=="columnset"||u.resolver||u.staticValue!=null||u.label!==c.code)throw new TypeError("grid columnset requires a scalar definition labelled by code");if(a.has(c.code))throw new TypeError(`Duplicate grid colgroup: ${c.code}`);if(c.name!=null&&typeof c.name!="string")throw new TypeError("grid group name must be text");for(let d of["background","color"])if(c[d]!=null&&typeof c[d]!="string")throw new TypeError(`grid ${d} must be text`);a.set(c.code,{...c,name:c.name??c.code})}this.columns=[],this.groups=[];let l=[];for(let u of i.getNodes()){let c=u.getAttr();if(hl(c,_h,wh),c.tag!=="cell"||u.staticValue!=null||u.resolver)throw new TypeError("grid cell must be a scalar declaration");if(ws(c.field,"field"),o.has(c.field))throw new TypeError(`Duplicate grid field: ${c.field}`);if(o.add(c.field),this.#e.set(c.field,u),c.columnset!=null&&!a.has(c.columnset))throw new TypeError(`Unknown grid columnset: ${c.columnset}`);if(c.dtype!=null&&!bh.has(c.dtype))throw new TypeError(`Unsupported grid dtype: ${c.dtype}`);if(c.align!=null&&!["start","center","end"].includes(c.align))throw new TypeError("grid align requires start, center or end");if(c.width!=null&&(typeof c.width!="string"||!/^(?:\d+(?:\.\d+)?)(?:px|em|rem|ch|%)$/.test(c.width)))throw new TypeError("grid width requires a nonnegative CSS length (px, em, rem, ch or %)");if(c.max_height!=null&&(typeof c.max_height!="string"||!/^(?:\d+(?:\.\d+)?)(?:px|em|rem)$/.test(c.max_height)))throw new TypeError("grid max_height requires a nonnegative CSS length (px, em or rem)");if(c.white_space!=null&&!["normal","nowrap","pre-wrap"].includes(c.white_space))throw new TypeError("grid white_space requires normal, nowrap or pre-wrap");for(let p of["name","title","format"])if(c[p]!=null&&typeof c[p]!="string")throw new TypeError(`grid ${p} must be text`);if(c.edit!=null&&typeof c.edit!="boolean"&&(typeof c.edit!="object"||Array.isArray(c.edit)))throw new TypeError("grid edit requires a boolean or editor options");if(c.check!=null||c.checked!=null||c.checkedField!=null){if(!["multiple","single"].includes(c.check)||typeof c.checked!="string"||!c.checked.startsWith("^")||c.checked.length<2||c.checked.includes("?"))throw new TypeError("grid check requires single or multiple and checked=^DataPath");if(ws(c.checkedField,"checkedField"),c.edit)throw new TypeError("external check sets cannot edit row fields")}vh(c);let d=Object.freeze({...c,name:c.name??c.field,align:c.align??(["L","R","N"].includes(c.dtype)?"end":"start")});if(l.push(d),c.hidden)continue;this.columns.push(d);let f=c.columnset??null,h=this.groups.at(-1);(!h||h.code!==f)&&(h={code:f,...f===null?{name:null}:a.get(f),columns:[]},this.groups.push(h)),h.columns.push(d)}if(!this.columns.length)throw new TypeError("grid struct requires at least one column");this.fields=Object.freeze([...o]),this.formulas=Wn(l);for(let u of this.groups)Object.freeze(u.columns),Object.freeze(u);Object.freeze(this.columns),Object.freeze(this.groups),Object.freeze(this)}columnNode(e){return this.#e.get(e)}moveColumn(e,t,n=!1){let i=this.#e.get(e),s=this.#e.get(t);if(!i||!s||i===s)return;let o=i.parentBag,a=o.getNodes(),l=a.indexOf(i),u=a.indexOf(s),c=u+Number(n)-+(l<u);c!==l&&o.move(l,c)}setColumnWidth(e,t){if(!Number.isFinite(t)||t<=0)throw new TypeError("grid resized width must be positive pixels");this.#e.get(e).setAttr({width:`${Math.round(t)}px`})}};function Yn(r,e){let t=r.getNode(e);if(!t||t.resolver||!(t.staticValue instanceof pl))throw new TypeError(`grid struct requires Bag ${e}`);return t.staticValue}function hl(r,e,t=null){for(let n of Object.keys(r))if(!e.has(n)&&!t?.test(n))throw new TypeError(`Unsupported grid struct attribute: ${n}`)}function vh(r){if(r.formula!=null&&(typeof r.formula!="string"||!r.formula.trim()))throw new TypeError("grid formula must be nonempty text");if(r.formula==null&&(r.calculated!=null||Object.keys(r).some(e=>e.startsWith("formula_"))))throw new TypeError(`grid ${r.field}: calculated and formula_<name> require a formula`);for(let e of["calculated","hidden"])if(r[e]!=null&&typeof r[e]!="boolean")throw new TypeError(`grid ${e} must be a boolean`);if(r.totalize!=null&&typeof r.totalize!="boolean"&&(typeof r.totalize!="string"||!r.totalize))throw new TypeError("grid totalize requires a boolean or a Data path");for(let e of["footer_value","footer_format"])if(r[e]!=null&&typeof r[e]!="string")throw new TypeError(`grid ${e} must be text`)}function ws(r,e){if(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r))throw new TypeError(`grid ${e} requires a simple field identifier`)}var Kn=class{#e;#t;#i;#n;#r;#l;#s;#a=[];#o=!1;#c=new Map;constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;let i=n.ownerDocument;this.#n=i.createElement("div"),this.#n.className="footer-frame",this.#n.setAttribute("part","footer"),this.#r=i.createElement("div"),this.#r.className="footer-viewport",this.#l=i.createElement("table"),this.#l.setAttribute("role","presentation");let s=i.createElement("tfoot");s.setAttribute("role","rowgroup"),this.#s=i.createElement("tr"),this.#s.setAttribute("role","row"),s.append(this.#s),this.#l.append(s),this.#r.append(this.#l),this.#n.append(this.#r)}get source(){return this.#e}get frame(){return this.#n}get table(){return this.#l}get viewport(){return this.#r}get errors(){return new Map(this.#c)}cell(e){return this.#s.querySelector(`td[data-field="${e}"]`)}configure(e,t,n){this.#o=e,this.#a=t,e===!1?this.#n.remove():this.#i.after(this.#n);let i=this.#s.ownerDocument,s=[];if(n){let o=i.createElement("th");o.className="row-heading",o.setAttribute("role","rowheader"),s.push(o)}for(let[o,a]of t.entries()){let l=i.createElement("td");l.dataset.field=a.field,l.setAttribute("role","cell"),l.setAttribute("part","footer-cell"),l.setAttribute("aria-colindex",String(o+1+Number(n))),l.style.textAlign=a.totalize?"end":a.align,l.classList.toggle("numeric",!!a.totalize),s.push(l)}this.#s.replaceChildren(...s)}update(e,t){for(let[n,i]of this.#a.entries()){let s=this.cell(i.field),o=i.footer_value??"",a=null;if(i.totalize){let l=0;try{for(let u of t){let c=e.value(u,i.field);l=Gn(l,typeof c=="boolean"?Number(c):c)}this.#c.delete(i.field)}catch(u){l=null,this.#c.set(i.field,u)}this.#x(i,l),l===null?(o="\u2014",a=this.#c.get(i.field).message):o=Nr(l,{...i,dtype:i.dtype==="B"?"L":i.dtype,format:i.footer_format??i.format},this.#t)}else n===0&&o===""&&(o=this.#o===!0?"Total":this.#o);s.textContent!==o&&(s.textContent=o),a===null?(s.removeAttribute("title"),s.removeAttribute("aria-invalid")):(s.title=a,s.setAttribute("aria-invalid","true"))}}totalPaths(){return this.#a.filter(e=>e.totalize).map(e=>this.source.absDatapath(e.totalize===!0?`.totalize.${e.field}`:e.totalize))}#x(e,t){let n=e.totalize===!0?`.totalize.${e.field}`:e.totalize;_s(this.source.getRelativeData(n),t)||this.source.setRelativeData(n,t)}};import{Bag as Kt}from"@gramlot/gramlot";var ml=Object.freeze({csv:{caption:"CSV",extension:"csv",type:"text/csv"},json:{caption:"JSON",extension:"json",type:"application/json"},tytx:{caption:"TYTX",extension:"tytx",type:"text/plain"},xml:{caption:"XML",extension:"xml",type:"application/xml"},xlsx:{caption:"Excel",extension:"xlsx",type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}),kh=null,Eh=Object.freeze({export:{label:"Export",publish:"export",icon:"\u21E9",tooltip:"Export the visible rows"},printRows:{label:"Print",publish:"printRows",icon:"\u2399",tooltip:"Print the visible rows"},lineNumbers:{label:"Line numbers",publish:"lineNumbers",tooltip:"Show or hide the row numbers"},addrow:{label:"Add row",publish:"addrow",icon:"+",tooltip:"Add a row"},duprow:{label:"Duplicate",publish:"duprow",icon:"\u29C9",tooltip:"Duplicate the selected rows"},delrow:{label:"Delete",publish:"delrow",icon:"\u2212",tooltip:"Delete the selected rows"}}),xh=new Set(["grid:addrow","grid:duprow","grid:delrow"]),Ah=new Set(["grid:duprow","grid:delrow"]);function gl(r){let e=r.commands.registerGroup("grid",{description:"Grid toolbar tools"});for(let[t,n]of Object.entries(Eh))e.register(t,n)}function Dh(r){return/[",\r\n]/.test(r)?`"${r.replaceAll('"','""')}"`:r}var Jn=class{#e;#t;#i=[];constructor(e,t){this.#e=e,this.#t=t}get source(){return this.#e.sourceNode}get runtime(){return this.source.rootBuilder.binding}connect(){if(this.#i.length)return;let e=this.runtime.subscriptions,t={export:n=>this.exportRows(n.parameters.format),printRows:()=>this.printRows(),lineNumbers:()=>this.toggleLineNumbers(),addrow:n=>this.addRow(n.parameters.defaults??{}),duprow:()=>this.duplicateRows(),delrow:()=>this.deleteRows()};for(let[n,i]of Object.entries(t))this.#i.push(e.subscribe(e.topicFor(this.source,n),async s=>{try{await i(s)}catch(o){this.#e.reportError(o,"Grid tool")}}))}disconnect(){for(let e of this.#i)this.runtime.subscriptions.unsubscribe(e);this.#i=[]}#n(){let e=this.#t.columns().filter(n=>!n.check),t=new bt(this.#t.reader(),this.#e.format).read(e,this.#t.rows());return{captions:e.map(n=>n.name),cells:t.map(n=>n.cells)}}csv(){let{captions:e,cells:t}=this.#n();return[e,...t].map(n=>n.map(Dh).join(",")).join(`\r
|
|
27
27
|
`)+`\r
|
|
28
|
-
`}#r(){let e=this.#t.columns().filter(n=>!n.check),t=this.#t.reader();return{columns:e,rows:this.#t.rows().map(n=>[n,e.map(i=>t.value(n,i.field)??null)])}}rowsBag(){let{columns:e,rows:t}=this.#r(),n=new Kt,i=this.#t.store().mode==="values";for(let[s,o]of t){let a=Object.fromEntries(e.map((l,u)=>[l.field,o[u]]));i?n.setItem(s.label,new Kt(a)):n.setItem(s.label,null,a)}return n}xml(){let e=new Kt;return e.setItem("GenRoBag",this.rowsBag()),e.toXml({docHeader:!0})}json(){let{columns:e,rows:t}=this.#r();return JSON.stringify(t.map(([,n])=>new Kt(Object.fromEntries(e.map((i,s)=>[i.field,n[s]]))).asDict(!1,!1,!0)),null,2)}async xlsx(){let{columns:e,rows:t}=this.#r(),n=(await(kh??=import("./modules/browser-LVJHKBBV.js"))).default,i=(a,l)=>a===null?null:F(a)?Number(a.toString()):a instanceof Date?{value:a,type:Date,format:["DH","DHZ"].includes(l.dtype)?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd"}:["number","boolean","string"].includes(typeof a)?a:String(a),o=[e.map(a=>({value:a.name,fontWeight:"bold"})),...t.map(([,a])=>a.map((l,u)=>i(l,e[u])))];return n(o,{sheet:this.source.label,stickyRowsCount:1}).toBlob()}async exportRows(e){let t=ml[e];if(!t)throw new TypeError(`grid export format must be one of ${Object.keys(ml).join(", ")}`);let n=e==="csv"?this.csv():e==="json"?this.json():e==="tytx"?this.rowsBag().toTytx():e==="xml"?this.xml():await this.xlsx();this.runtime.gramlot.utl.inout.saveText(n,`${this.source.label}.${t.extension}`,t.type)}printRows(){let e=this.#t.document,{captions:t,cells:n}=this.#n(),i=e.createElement("iframe");i.className="gramlot-grid-print",i.setAttribute("aria-hidden","true"),i.style.cssText="position:fixed;inset-inline-start:-10000px;inline-size:1px;block-size:1px;border:0",e.body.append(i);let s=i.contentDocument,o=s.createElement("table"),a=s.createElement("thead"),l=s.createElement("tbody"),u=(d,f,h)=>{let p=s.createElement("tr");for(let m of f){let g=s.createElement(h);g.textContent=m,p.append(g)}d.append(p)};u(a,t,"th");for(let d of n)u(l,d,"td");o.append(a,l);let c=s.createElement("style");c.textContent="table{border-collapse:collapse;font:12px sans-serif}th,td{border:1px solid #888;padding:2px 6px;text-align:start}",s.head.append(c),s.body.append(o),i.contentWindow.addEventListener("afterprint",()=>i.remove()),i.contentWindow.print()}toggleLineNumbers(){let e=!this.#t.parameters().rowHeaders;this.source.pointerType(this.source.getAttr("rowHeaders"))?this.#e.writeParameter("rowHeaders",e):this.source.setAttr({rowHeaders:e})}addRow(e){let{bag:t,mode:n}=this.#t.store(),i=`r_${crypto.randomUUID().replaceAll("-","")}`;return n==="values"?t.setItem(i,new Kt(e)):t.setItem(i,null,e),t.getNode(i)}duplicateRows(){let{bag:e,mode:t}=this.#t.store();for(let n of this.#t.selected()){let i=`r_${crypto.randomUUID().replaceAll("-","")}`;t==="values"?e.setItem(i,n.staticValue.deepcopy()):e.setItem(i,null,{...n.getAttr()})}}deleteRows(){let{bag:e}=this.#t.store();for(let t of this.#t.selected())e.popNode(t.label)}requireEditableTools(e){let t=e.some(o=>o.edit),n=this.#t.selectionMode()!=="none";if(t&&n)return;let i=this.source.parentNode;for(;i&&i.nodeTag!=="framePane";)i=i.parentNode;if(!i)return;let s=o=>{if(o.nodeTag==="framePane")return;let a=o.nodeTag==="menuline"?o.getAttr("command"):null;if(!t&&xh.has(a))throw new TypeError(`grid tool '${a}' requires an editable column`);if(!n&&Ah.has(a))throw new TypeError(`grid tool '${a}' requires selectionMode single or multi`);if(!t&&o.nodeTag==="editingStatus")throw new TypeError("grid editing status requires an editable column");if(o.value instanceof Kt)for(let l of o.value.getNodes())s(l)};for(let o of i.value.getNodes())s(o)}};import{Bag as bl}from"@gramlot/gramlot";var wl=Object.freeze(["none","single","multi"]),_l=["selectedId","selectedIndex","selectedLabel","selectedPkeys","selectedRowidx","selectedNodes","selectedRowData"],Qn=class{#e;#t;#i=new Set;#n=null;#r=null;constructor(e,t){this.#e=e,this.#t=t}get source(){return this.#e.sourceNode}get mode(){return this.#t.mode()}get current(){return this.#n}isSelected(e){return this.#i.has(e)}get nodes(){return this.#t.view().getRows().filter(e=>this.#i.has(e))}select(e,{toggle:t=!1,range:n=!1}={}){if(this.mode==="none")return;let i=this.#t.view().getRows();if(this.mode==="multi"&&n&&this.#r!==null&&i.includes(this.#r)){let[s,o]=[i.indexOf(this.#r),i.indexOf(e)].sort((a,l)=>a-l);this.#a(new Set(i.slice(s,o+1)),e,this.#r)}else if(this.mode==="multi"&&t){let s=new Set(this.#i);s.has(e)?s.delete(e):s.add(e),this.#a(s,s.has(e)?e:this.nodes.find(o=>s.has(o))??null,e)}else this.#a(new Set([e]),e,e)}move(e,t=!1){if(this.mode==="none")return null;let n=this.#t.view().getRows();if(!n.length)return null;let i=this.#n===null?e>0?-1:n.length:n.indexOf(this.#n),s=n[Math.max(0,Math.min(n.length-1,i+e))];return this.select(s,{range:t}),s}selectAll(){if(this.mode!=="multi")return;let e=this.#t.view().getRows();this.#a(new Set(e),this.#n??e[0]??null,this.#r??e[0]??null)}prune(){let e=new Set(this.mode==="none"?[]:this.#t.view().getRows());if([...this.#i].every(n=>e.has(n))&&(this.#n===null||e.has(this.#n)))return;let t=new Set([...this.#i].filter(n=>e.has(n)));this.#a(t,e.has(this.#n)?this.#n:null,e.has(this.#r)?this.#r:null)}paths(){let e=Object.keys(this.source.getAttr()).filter(t=>_l.includes(t)||t.startsWith("selected_"));return[this.source.absDatapath(".selectionLength"),...e.map(t=>this.source.absDatapath(this.source.getAttr(t)))]}#a(e,t,n){this.#i=e,this.#n=t,this.#r=n,this.publish()}publish(){let e=this.#t.store(),t=this.#t.view(),n=this.nodes,i=this.#n,s=i===null?-1:t.getRows().indexOf(i),o=i===null?null:i.label,a=n.map(c=>c.label),l=e.getRows(),u={selectedId:o,selectedIndex:s<0?null:s,selectedLabel:o,selectedPkeys:a,selectedRowidx:n.map(c=>l.indexOf(c)).join(","),selectedNodes:()=>{let c=new bl;for(let d of n)c.setItem(d.label,null,this.#t.rowData(d));return c},selectedRowData:()=>i===null?null:new bl(this.#t.rowData(i))};for(let c of _l){if(this.source.getAttr(c)==null)continue;let d=typeof u[c]=="function"?u[c]():u[c];this.#e.writeParameter(c,d),c==="selectedNodes"&&this.source.rootBuilder.binding.data.getNode(this.source.absDatapath(this.source.getAttr(c))).setAttr({count:n.length})}for(let c of Object.keys(this.source.getAttr())){if(!c.startsWith("selected_"))continue;let d=c.slice(9);this.#e.writeParameter(c,[...new Set(n.map(f=>e.value(f,d)))].join(","))}this.source.getRelativeData(".selectionLength")!==n.length&&this.source.setRelativeData(".selectionLength",n.length),this.#e.publish("onSelectedRow",{idx:s,selectedId:o,selectedPkeys:a})}};var ei=class{#e;#t;#i;#n;#r;#a;#o=!1;#l=null;#s=null;constructor(e,t,n,i,s,o){this.#e=e,this.#t=t,this.#i=n,this.#n=i,this.#r=s,this.#a=o}connect(){this.#e.addEventListener("click",this.#c),this.#e.addEventListener("pointerdown",this.#E),this.#e.addEventListener("pointermove",this.#k),this.#e.addEventListener("pointerup",this.#_),this.#e.addEventListener("pointercancel",this.#w),this.#e.addEventListener("lostpointercapture",this.#w),this.#e.addEventListener("keydown",this.#p),this.#e.addEventListener("dragstart",this.#x),this.#e.addEventListener("dragover",this.#y),this.#e.addEventListener("drop",this.#d),this.#e.addEventListener("dragend",this.#b)}disconnect(){this.cancel(),this.#e.removeEventListener("click",this.#c),this.#e.removeEventListener("pointerdown",this.#E),this.#e.removeEventListener("pointermove",this.#k),this.#e.removeEventListener("pointerup",this.#_),this.#e.removeEventListener("pointercancel",this.#w),this.#e.removeEventListener("lostpointercapture",this.#w),this.#e.removeEventListener("keydown",this.#p),this.#e.removeEventListener("dragstart",this.#x),this.#e.removeEventListener("dragover",this.#y),this.#e.removeEventListener("drop",this.#d),this.#e.removeEventListener("dragend",this.#b)}#c=e=>{if(this.#o){this.#o=!1;return}if(e.target.closest(".column-resize, .column-filter"))return;let t=e.target.closest("th[data-field]");t&&this.#n(t.dataset.field,e.shiftKey)};#x=e=>{if(e.target.closest(".column-filter")){e.preventDefault();return}let t=e.target.closest("th[data-field]");if(!t||this.#l){e.preventDefault();return}this.#o=!0,this.#s={field:t.dataset.field,node:this.#i().columnNode(t.dataset.field)},e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.textContent),t.classList.add("column-dragging")};#v(e){let t=e.target.closest("th[data-field]");if(!this.#s||!t)return null;let n=this.#i().columnNode(t.dataset.field);return this.#i().columnNode(this.#s.field)!==this.#s.node||n===this.#s.node||n.parentBag!==this.#s.node.parentBag?null:{header:t,field:t.dataset.field,after:e.clientX>t.getBoundingClientRect().left+t.getBoundingClientRect().width/2}}#y=e=>{let t=this.#v(e);for(let n of this.#e.querySelectorAll("[data-drop]"))n.removeAttribute("data-drop");t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",t.header.dataset.drop=t.after?"after":"before")};#d=e=>{let t=this.#v(e);if(!t)return;e.preventDefault();let n=this.#s.field;this.#b(),this.#i().moveColumn(n,t.field,t.after),this.#e.querySelector(`th[data-field="${n}"]`).focus({preventScroll:!0})};#b=()=>{this.#s=null;for(let e of this.#e.querySelectorAll("th"))e.classList.remove("column-dragging"),e.removeAttribute("data-drop")};#f(e){let t=e.dataset.field;if(t===void 0){let s=this.#r();return{identity:s,width:s.headerWidth,setWidth:o=>{s.setHeaderWidth(o),this.#a()}}}let n=this.#i(),i=n.columnNode(t);return{identity:i,width:i.getAttr("width"),setWidth:s=>n.setColumnWidth(t,s)}}#h(e){return e.classList.contains("row-heading")?Math.max(40,Math.ceil(e.querySelector(".row-number-measure").getBoundingClientRect().width)):Number.parseFloat(this.#t.ownerDocument.defaultView.getComputedStyle(this.#t).getPropertyValue("--gramlot-grid-column-min-width"))||40}#E=e=>{this.#o=!1;let t=e.target.closest(".column-resize");if(!t||e.button!==0||this.#l)return;let n=t.closest("th"),i=n.dataset.field,s=this.#f(n),o=[...this.#t.querySelectorAll("table")],a=[...this.#e.querySelectorAll("th[scope=col]")],l=a.map(u=>u.getBoundingClientRect().width);this.#l={pointerId:e.pointerId,field:i,header:n,identity:s.identity,originalWidth:s.width,x:e.clientX,index:a.indexOf(n),widths:l,width:n.getBoundingClientRect().width,tables:o.map(u=>({table:u,width:u.style.width,columns:[...u.querySelectorAll("col")].map(c=>({col:c,width:c.style.width}))}))},this.#e.setPointerCapture(e.pointerId),this.#t.classList.add("resizing"),e.preventDefault()};#k=e=>{let t=this.#l;if(!t||t.pointerId!==e.pointerId)return;t.width=Math.max(this.#h(t.header),Math.round(t.widths[t.index]+e.clientX-t.x));let n=t.widths.map((i,s)=>s===t.index?t.width:i);for(let{table:i,columns:s}of t.tables)i.style.width=`${n.reduce((o,a)=>o+a,0)}px`,s.forEach(({col:o},a)=>{o.style.width=`${n[a]}px`})};#_=e=>{let t=this.#l;if(!t||t.pointerId!==e.pointerId)return;this.#k(e);let n=this.#f(t.header);this.#o=!0,this.cancel(),!(n.identity!==t.identity||n.width!==t.originalWidth)&&(n.setWidth(t.width),this.#A(t.field))};#p=e=>{if(e.target.closest(".column-filter"))return;if(e.key==="Escape"&&this.#l){this.cancel(),e.preventDefault();return}let t=e.target.closest(".column-resize");if(!t&&["Enter"," "].includes(e.key)){let s=e.target.closest("th[data-field]");s&&(e.preventDefault(),this.#n(s.dataset.field,e.shiftKey));return}if(!["ArrowLeft","ArrowRight"].includes(e.key))return;if(!t){let s=e.target.closest("th[data-field]");if(!s||!e.altKey)return;let o=s.dataset.field,a=this.#i(),l=a.columnNode(o),u=l.parentBag.getNodes(),c=u[u.indexOf(l)+(e.key==="ArrowRight"?1:-1)];c?.getAttr("tag")==="cell"&&(a.moveColumn(o,c.getAttr("field"),e.key==="ArrowRight"),this.#e.querySelector(`th[data-field="${o}"]`).focus({preventScroll:!0})),e.preventDefault();return}let n=t.closest("th"),i=(e.key==="ArrowRight"?1:-1)*(e.shiftKey?1:10);this.#f(n).setWidth(Math.max(this.#h(n),Math.round(n.getBoundingClientRect().width+i))),this.#A(n.dataset.field),e.preventDefault()};#A(e){this.#e.querySelector(e===void 0?".row-heading .column-resize":`th[data-field="${e}"] .column-resize`).focus({preventScroll:!0})}#w=()=>{this.#l&&this.cancel()};cancel(){this.#b();let e=this.#l;if(e){this.#l=null;for(let{table:t,width:n,columns:i}of e.tables){t.style.width=n;for(let{col:s,width:o}of i)s.style.width=o}this.#t.classList.remove("resizing"),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId)}}};var ti=class{#e;#t=null;setWindow(e){if(e!==null&&(!Number.isSafeInteger(e.start)||e.start<0||!Number.isSafeInteger(e.total)||e.total<e.start))throw new TypeError("Invalid grid window");this.#t=e,this.#l=!0}#i=null;get headerWidth(){return this.#i}setHeaderWidth(e){if(!Number.isFinite(e)||e<=0)throw new TypeError("Grid row header width must be positive pixels");this.#i=Math.round(e)}#n=new Map;#r=new Map;#a=[];#o=[0];#l=!0;#s=32;bindStore(e){e!==this.#e&&(this.#n.clear(),this.resetMeasurements(),this.#e=e)}retain(e){let t=new Set(e);for(let n of[this.#n,this.#r])for(let i of n.keys())t.has(i)||n.delete(i);this.#l=!0}height(e){return this.#n.get(e)??null}setHeight(e,t){if(e.parentBag===this.#e){if(t===null)this.#n.delete(e);else{if(!Number.isFinite(t)||t<=0)throw new TypeError("Grid row height must be positive pixels");this.#n.set(e,Math.round(t))}this.forget(e)}}setRows(e){this.#a=e,this.#l=!0}resetMeasurements(){this.#r.clear(),this.#l=!0}forget(e){this.#r.delete(e),this.#l=!0}measure(e,t){return t<=0||this.#r.get(e)===t?!1:(this.#r.set(e,t),this.#l=!0,!0)}#c(){if(!this.#l)return;let e=1/0;for(let[t,n]of this.#r)this.#n.has(t)||(e=Math.min(e,n));e!==1/0&&(this.#s=e),this.#o=[0];for(let t of this.#a)this.#o.push(this.#o.at(-1)+(this.#r.get(t)??Math.max(this.#n.get(t)??0,this.#s)));this.#l=!1}offset(e){if(this.#c(),!this.#t)return this.#o[e];let t=e-this.#t.start;return t<=0?e*this.#s:t<=this.#a.length?this.#t.start*this.#s+this.#o[t]:e*this.#s+this.#o.at(-1)-this.#a.length*this.#s}get count(){return this.#t?.total??this.#a.length}get totalHeight(){return this.offset(this.count)}indexAt(e){this.#c();let t=0,n=this.count;for(;t<n;){let i=t+n>>>1;this.offset(i+1)<=e?t=i+1:n=i}return Math.min(t,Math.max(0,this.count-1))}window(e,t){this.#c();let n=Math.max(t,this.#s*8);return{start:this.indexAt(Math.max(0,e-n)),end:Math.min(this.count,this.indexAt(e+t+n)+1)}}};var ri=class{#e;#t;#i;#n;#r=null;#a=null;#o;#l;#s;constructor(e,t,n,i,s,o,a){this.#e=e,this.#t=t,this.#i=n,this.#n=i,this.#o=s,this.#l=o,this.#s=a}get resizing(){return this.#r!==null}connect(){this.#e.addEventListener("pointerdown",this.#k),this.#e.addEventListener("pointermove",this.#_),this.#e.addEventListener("pointerup",this.#p),this.#e.addEventListener("pointercancel",this.#D),this.#e.addEventListener("lostpointercapture",this.#D),this.#e.addEventListener("keydown",this.#A),this.#e.addEventListener("dblclick",this.#w),this.#e.addEventListener("dragstart",this.#c),this.#e.addEventListener("dragover",this.#y),this.#e.addEventListener("dragleave",this.#d),this.#e.addEventListener("drop",this.#b),this.#e.addEventListener("dragend",this.#f)}disconnect(){this.cancel(),this.cancelDrag(),this.#e.removeEventListener("pointerdown",this.#k),this.#e.removeEventListener("pointermove",this.#_),this.#e.removeEventListener("pointerup",this.#p),this.#e.removeEventListener("pointercancel",this.#D),this.#e.removeEventListener("lostpointercapture",this.#D),this.#e.removeEventListener("keydown",this.#A),this.#e.removeEventListener("dblclick",this.#w),this.#e.removeEventListener("dragstart",this.#c),this.#e.removeEventListener("dragover",this.#y),this.#e.removeEventListener("dragleave",this.#d),this.#e.removeEventListener("drop",this.#b),this.#e.removeEventListener("dragend",this.#f)}#c=e=>{let t=e.target.closest("tr"),n=this.#n(t);if(!this.#l()||!n||this.#r||e.target.closest(".row-height-handle")){e.preventDefault();return}this.#a={node:n,bag:this.#o().bag},e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",n.label),t.classList.add("row-dragging")};#x(e){if(!this.#a||!this.#l())return null;let{node:t,bag:n}=this.#a,i=e.target.closest("tr"),s=this.#n(i);if(!s||s===t||this.#o().bag!==n||t.parentBag!==n||s.parentBag!==n)return null;let o=i.getBoundingClientRect();return{row:i,target:s,after:e.clientY>o.top+o.height/2}}#v(){for(let e of this.#e.querySelectorAll("[data-row-drop]"))e.removeAttribute("data-row-drop")}#y=e=>{this.#v();let t=this.#x(e);t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",t.row.dataset.rowDrop=t.after?"after":"before")};#d=e=>{this.#e.contains(e.relatedTarget)||this.#v()};#b=e=>{let t=this.#x(e);if(!t)return;e.preventDefault(),e.stopPropagation();let{node:n}=this.#a;this.cancelDrag(),this.#o().moveRow(n,t.target,t.after)};#f=()=>{this.cancelDrag()};cancelDrag(){this.#a=null,this.#v();for(let e of this.#e.querySelectorAll(".row-dragging"))e.classList.remove("row-dragging")}#h(e){let t=e.target.closest(".row-height-handle");if(!t)return null;let n=t.closest("tr"),i=this.#n(n);return i?{handle:t,row:n,node:i}:null}project(e,t){let n=this.#i().height(t);e.style.height=n===null?"":`${n}px`}#E(e){let t=e.querySelector(".row-height-handle");t&&t.setAttribute("aria-valuenow",String(Math.round(e.getBoundingClientRect().height))),this.#s()}#k=e=>{let t=this.#h(e);if(!t||e.button!==0||this.#r)return;let{row:n}=t,i=n.getBoundingClientRect().height,s=n.style.height;n.style.height="";let o=n.getBoundingClientRect().height;n.style.height=s,this.#r={...t,pointerId:e.pointerId,y:e.clientY,height:i,minimum:o,preview:i},t.handle.focus({preventScroll:!0}),t.handle.setPointerCapture(e.pointerId),this.#t.classList.add("resizing-row"),e.preventDefault()};#_=e=>{let t=this.#r;!t||t.pointerId!==e.pointerId||(t.preview=Math.max(t.minimum,Math.round(t.height+e.clientY-t.y)),t.row.style.height=`${t.preview}px`,this.#E(t.row))};#p=e=>{let t=this.#r;!t||t.pointerId!==e.pointerId||(this.#_(e),this.cancel(),!(this.#n(t.row)!==t.node||t.preview===t.height)&&(this.#i().setHeight(t.node,t.preview),this.project(t.row,t.node),this.#E(t.row)))};#A=e=>{if(e.key==="Escape"&&(this.#r||this.#a)){this.cancel(),this.cancelDrag(),e.preventDefault();return}let t=this.#h(e);if(!t||!["ArrowUp","ArrowDown","Home"].includes(e.key))return;this.cancel();let n=null;if(e.key!=="Home"){let i=t.row.getBoundingClientRect().height;t.row.style.height="";let s=t.row.getBoundingClientRect().height;n=Math.max(s,i+(e.key==="ArrowDown"?10:-10))}this.#i().setHeight(t.node,n),this.project(t.row,t.node),this.#E(t.row),e.preventDefault()};#w=e=>{let t=this.#h(e);t&&(this.cancel(),this.#i().setHeight(t.node,null),this.project(t.row,t.node),this.#E(t.row),e.preventDefault())};#D=()=>{this.cancel()};cancel(){let e=this.#r;e&&(this.#r=null,this.project(e.row,e.node),this.#t.classList.remove("resizing-row"),e.handle.hasPointerCapture(e.pointerId)&&e.handle.releasePointerCapture(e.pointerId))}};var yl=`
|
|
28
|
+
`}#r(){let e=this.#t.columns().filter(n=>!n.check),t=this.#t.reader();return{columns:e,rows:this.#t.rows().map(n=>[n,e.map(i=>t.value(n,i.field)??null)])}}rowsBag(){let{columns:e,rows:t}=this.#r(),n=new Kt,i=this.#t.store().mode==="values";for(let[s,o]of t){let a=Object.fromEntries(e.map((l,u)=>[l.field,o[u]]));i?n.setItem(s.label,new Kt(a)):n.setItem(s.label,null,a)}return n}xml(){let e=new Kt;return e.setItem("GenRoBag",this.rowsBag()),e.toXml({docHeader:!0})}json(){let{columns:e,rows:t}=this.#r();return JSON.stringify(t.map(([,n])=>new Kt(Object.fromEntries(e.map((i,s)=>[i.field,n[s]]))).asDict(!1,!1,!0)),null,2)}async xlsx(){let{columns:e,rows:t}=this.#r(),n=(await(kh??=import("./modules/browser-LVJHKBBV.js"))).default,i=(a,l)=>a===null?null:F(a)?Number(a.toString()):a instanceof Date?{value:a,type:Date,format:["DH","DHZ"].includes(l.dtype)?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd"}:["number","boolean","string"].includes(typeof a)?a:String(a),o=[e.map(a=>({value:a.name,fontWeight:"bold"})),...t.map(([,a])=>a.map((l,u)=>i(l,e[u])))];return n(o,{sheet:this.source.label,stickyRowsCount:1}).toBlob()}async exportRows(e){let t=ml[e];if(!t)throw new TypeError(`grid export format must be one of ${Object.keys(ml).join(", ")}`);let n=e==="csv"?this.csv():e==="json"?this.json():e==="tytx"?this.rowsBag().toTytx():e==="xml"?this.xml():await this.xlsx();this.runtime.gramlot.utl.inout.saveText(n,`${this.source.label}.${t.extension}`,t.type)}printRows(){let e=this.#t.document,{captions:t,cells:n}=this.#n(),i=e.createElement("iframe");i.className="gramlot-grid-print",i.setAttribute("aria-hidden","true"),i.style.cssText="position:fixed;inset-inline-start:-10000px;inline-size:1px;block-size:1px;border:0",e.body.append(i);let s=i.contentDocument,o=s.createElement("table"),a=s.createElement("thead"),l=s.createElement("tbody"),u=(d,f,h)=>{let p=s.createElement("tr");for(let m of f){let g=s.createElement(h);g.textContent=m,p.append(g)}d.append(p)};u(a,t,"th");for(let d of n)u(l,d,"td");o.append(a,l);let c=s.createElement("style");c.textContent="table{border-collapse:collapse;font:12px sans-serif}th,td{border:1px solid #888;padding:2px 6px;text-align:start}",s.head.append(c),s.body.append(o),i.contentWindow.addEventListener("afterprint",()=>i.remove()),i.contentWindow.print()}toggleLineNumbers(){let e=!this.#t.parameters().rowHeaders;this.source.pointerType(this.source.getAttr("rowHeaders"))?this.#e.writeParameter("rowHeaders",e):this.source.setAttr({rowHeaders:e})}addRow(e){let{bag:t,mode:n}=this.#t.store(),i=`r_${crypto.randomUUID().replaceAll("-","")}`;return n==="values"?t.setItem(i,new Kt(e)):t.setItem(i,null,e),t.getNode(i)}duplicateRows(){let{bag:e,mode:t}=this.#t.store();for(let n of this.#t.selected()){let i=`r_${crypto.randomUUID().replaceAll("-","")}`;t==="values"?e.setItem(i,n.staticValue.deepcopy()):e.setItem(i,null,{...n.getAttr()})}}deleteRows(){let{bag:e}=this.#t.store();for(let t of this.#t.selected())e.popNode(t.label)}requireEditableTools(e){let t=e.some(o=>o.edit),n=this.#t.selectionMode()!=="none";if(t&&n)return;let i=this.source.parentNode;for(;i&&i.nodeTag!=="framePane";)i=i.parentNode;if(!i)return;let s=o=>{if(o.nodeTag==="framePane")return;let a=o.nodeTag==="menuline"?o.getAttr("command"):null;if(!t&&xh.has(a))throw new TypeError(`grid tool '${a}' requires an editable column`);if(!n&&Ah.has(a))throw new TypeError(`grid tool '${a}' requires selectionMode single or multi`);if(!t&&o.nodeTag==="editingStatus")throw new TypeError("grid editing status requires an editable column");if(o.value instanceof Kt)for(let l of o.value.getNodes())s(l)};for(let o of i.value.getNodes())s(o)}};import{Bag as bl}from"@gramlot/gramlot";var wl=Object.freeze(["none","single","multi"]),_l=["selectedId","selectedIndex","selectedLabel","selectedPkeys","selectedRowidx","selectedNodes","selectedRowData"],Qn=class{#e;#t;#i=new Set;#n=null;#r=null;constructor(e,t){this.#e=e,this.#t=t}get source(){return this.#e.sourceNode}get mode(){return this.#t.mode()}get current(){return this.#n}isSelected(e){return this.#i.has(e)}get nodes(){return this.#t.view().getRows().filter(e=>this.#i.has(e))}select(e,{toggle:t=!1,range:n=!1}={}){if(this.mode==="none")return;let i=this.#t.view().getRows();if(this.mode==="multi"&&n&&this.#r!==null&&i.includes(this.#r)){let[s,o]=[i.indexOf(this.#r),i.indexOf(e)].sort((a,l)=>a-l);this.#s(new Set(i.slice(s,o+1)),e,this.#r)}else if(this.mode==="multi"&&t){let s=new Set(this.#i);s.has(e)?s.delete(e):s.add(e),this.#s(s,s.has(e)?e:this.nodes.find(o=>s.has(o))??null,e)}else this.#s(new Set([e]),e,e)}move(e,t=!1){if(this.mode==="none")return null;let n=this.#t.view().getRows();if(!n.length)return null;let i=this.#n===null?e>0?-1:n.length:n.indexOf(this.#n),s=n[Math.max(0,Math.min(n.length-1,i+e))];return this.select(s,{range:t}),s}selectAll(){if(this.mode!=="multi")return;let e=this.#t.view().getRows();this.#s(new Set(e),this.#n??e[0]??null,this.#r??e[0]??null)}prune(){let e=new Set(this.mode==="none"?[]:this.#t.view().getRows());if([...this.#i].every(n=>e.has(n))&&(this.#n===null||e.has(this.#n)))return;let t=new Set([...this.#i].filter(n=>e.has(n)));this.#s(t,e.has(this.#n)?this.#n:null,e.has(this.#r)?this.#r:null)}get#l(){return this.source.attributeOwnerNode("datapath")!==null}paths(){let t=Object.keys(this.source.getAttr()).filter(n=>_l.includes(n)||n.startsWith("selected_")).map(n=>this.source.absDatapath(this.source.getAttr(n)));return this.#l?[this.source.absDatapath(".selectionLength"),...t]:t}#s(e,t,n){this.#i=e,this.#n=t,this.#r=n,this.publish()}publish(){let e=this.#t.store(),t=this.#t.view(),n=this.nodes,i=this.#n,s=i===null?-1:t.getRows().indexOf(i),o=i===null?null:i.label,a=n.map(c=>c.label),l=e.getRows(),u={selectedId:o,selectedIndex:s<0?null:s,selectedLabel:o,selectedPkeys:a,selectedRowidx:n.map(c=>l.indexOf(c)).join(","),selectedNodes:()=>{let c=new bl;for(let d of n)c.setItem(d.label,null,this.#t.rowData(d));return c},selectedRowData:()=>i===null?null:new bl(this.#t.rowData(i))};for(let c of _l){if(this.source.getAttr(c)==null)continue;let d=typeof u[c]=="function"?u[c]():u[c];this.#e.writeParameter(c,d),c==="selectedNodes"&&this.source.rootBuilder.binding.data.getNode(this.source.absDatapath(this.source.getAttr(c))).setAttr({count:n.length})}for(let c of Object.keys(this.source.getAttr())){if(!c.startsWith("selected_"))continue;let d=c.slice(9);this.#e.writeParameter(c,[...new Set(n.map(f=>e.value(f,d)))].join(","))}this.#l&&this.source.getRelativeData(".selectionLength")!==n.length&&this.source.setRelativeData(".selectionLength",n.length),this.#e.publish("onSelectedRow",{idx:s,selectedId:o,selectedPkeys:a})}};var ei=class{#e;#t;#i;#n;#r;#l;#s=!1;#a=null;#o=null;constructor(e,t,n,i,s,o){this.#e=e,this.#t=t,this.#i=n,this.#n=i,this.#r=s,this.#l=o}connect(){this.#e.addEventListener("click",this.#c),this.#e.addEventListener("pointerdown",this.#E),this.#e.addEventListener("pointermove",this.#k),this.#e.addEventListener("pointerup",this.#_),this.#e.addEventListener("pointercancel",this.#w),this.#e.addEventListener("lostpointercapture",this.#w),this.#e.addEventListener("keydown",this.#p),this.#e.addEventListener("dragstart",this.#x),this.#e.addEventListener("dragover",this.#y),this.#e.addEventListener("drop",this.#d),this.#e.addEventListener("dragend",this.#b)}disconnect(){this.cancel(),this.#e.removeEventListener("click",this.#c),this.#e.removeEventListener("pointerdown",this.#E),this.#e.removeEventListener("pointermove",this.#k),this.#e.removeEventListener("pointerup",this.#_),this.#e.removeEventListener("pointercancel",this.#w),this.#e.removeEventListener("lostpointercapture",this.#w),this.#e.removeEventListener("keydown",this.#p),this.#e.removeEventListener("dragstart",this.#x),this.#e.removeEventListener("dragover",this.#y),this.#e.removeEventListener("drop",this.#d),this.#e.removeEventListener("dragend",this.#b)}#c=e=>{if(this.#s){this.#s=!1;return}if(e.target.closest(".column-resize, .column-filter"))return;let t=e.target.closest("th[data-field]");t&&this.#n(t.dataset.field,e.shiftKey)};#x=e=>{if(e.target.closest(".column-filter")){e.preventDefault();return}let t=e.target.closest("th[data-field]");if(!t||this.#a){e.preventDefault();return}this.#s=!0,this.#o={field:t.dataset.field,node:this.#i().columnNode(t.dataset.field)},e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.textContent),t.classList.add("column-dragging")};#v(e){let t=e.target.closest("th[data-field]");if(!this.#o||!t)return null;let n=this.#i().columnNode(t.dataset.field);return this.#i().columnNode(this.#o.field)!==this.#o.node||n===this.#o.node||n.parentBag!==this.#o.node.parentBag?null:{header:t,field:t.dataset.field,after:e.clientX>t.getBoundingClientRect().left+t.getBoundingClientRect().width/2}}#y=e=>{let t=this.#v(e);for(let n of this.#e.querySelectorAll("[data-drop]"))n.removeAttribute("data-drop");t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",t.header.dataset.drop=t.after?"after":"before")};#d=e=>{let t=this.#v(e);if(!t)return;e.preventDefault();let n=this.#o.field;this.#b(),this.#i().moveColumn(n,t.field,t.after),this.#e.querySelector(`th[data-field="${n}"]`).focus({preventScroll:!0})};#b=()=>{this.#o=null;for(let e of this.#e.querySelectorAll("th"))e.classList.remove("column-dragging"),e.removeAttribute("data-drop")};#f(e){let t=e.dataset.field;if(t===void 0){let s=this.#r();return{identity:s,width:s.headerWidth,setWidth:o=>{s.setHeaderWidth(o),this.#l()}}}let n=this.#i(),i=n.columnNode(t);return{identity:i,width:i.getAttr("width"),setWidth:s=>n.setColumnWidth(t,s)}}#h(e){return e.classList.contains("row-heading")?Math.max(40,Math.ceil(e.querySelector(".row-number-measure").getBoundingClientRect().width)):Number.parseFloat(this.#t.ownerDocument.defaultView.getComputedStyle(this.#t).getPropertyValue("--gramlot-grid-column-min-width"))||40}#E=e=>{this.#s=!1;let t=e.target.closest(".column-resize");if(!t||e.button!==0||this.#a)return;let n=t.closest("th"),i=n.dataset.field,s=this.#f(n),o=[...this.#t.querySelectorAll("table")],a=[...this.#e.querySelectorAll("th[scope=col]")],l=a.map(u=>u.getBoundingClientRect().width);this.#a={pointerId:e.pointerId,field:i,header:n,identity:s.identity,originalWidth:s.width,x:e.clientX,index:a.indexOf(n),widths:l,width:n.getBoundingClientRect().width,tables:o.map(u=>({table:u,width:u.style.width,columns:[...u.querySelectorAll("col")].map(c=>({col:c,width:c.style.width}))}))},this.#e.setPointerCapture(e.pointerId),this.#t.classList.add("resizing"),e.preventDefault()};#k=e=>{let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;t.width=Math.max(this.#h(t.header),Math.round(t.widths[t.index]+e.clientX-t.x));let n=t.widths.map((i,s)=>s===t.index?t.width:i);for(let{table:i,columns:s}of t.tables)i.style.width=`${n.reduce((o,a)=>o+a,0)}px`,s.forEach(({col:o},a)=>{o.style.width=`${n[a]}px`})};#_=e=>{let t=this.#a;if(!t||t.pointerId!==e.pointerId)return;this.#k(e);let n=this.#f(t.header);this.#s=!0,this.cancel(),!(n.identity!==t.identity||n.width!==t.originalWidth)&&(n.setWidth(t.width),this.#A(t.field))};#p=e=>{if(e.target.closest(".column-filter"))return;if(e.key==="Escape"&&this.#a){this.cancel(),e.preventDefault();return}let t=e.target.closest(".column-resize");if(!t&&["Enter"," "].includes(e.key)){let s=e.target.closest("th[data-field]");s&&(e.preventDefault(),this.#n(s.dataset.field,e.shiftKey));return}if(!["ArrowLeft","ArrowRight"].includes(e.key))return;if(!t){let s=e.target.closest("th[data-field]");if(!s||!e.altKey)return;let o=s.dataset.field,a=this.#i(),l=a.columnNode(o),u=l.parentBag.getNodes(),c=u[u.indexOf(l)+(e.key==="ArrowRight"?1:-1)];c?.getAttr("tag")==="cell"&&(a.moveColumn(o,c.getAttr("field"),e.key==="ArrowRight"),this.#e.querySelector(`th[data-field="${o}"]`).focus({preventScroll:!0})),e.preventDefault();return}let n=t.closest("th"),i=(e.key==="ArrowRight"?1:-1)*(e.shiftKey?1:10);this.#f(n).setWidth(Math.max(this.#h(n),Math.round(n.getBoundingClientRect().width+i))),this.#A(n.dataset.field),e.preventDefault()};#A(e){this.#e.querySelector(e===void 0?".row-heading .column-resize":`th[data-field="${e}"] .column-resize`).focus({preventScroll:!0})}#w=()=>{this.#a&&this.cancel()};cancel(){this.#b();let e=this.#a;if(e){this.#a=null;for(let{table:t,width:n,columns:i}of e.tables){t.style.width=n;for(let{col:s,width:o}of i)s.style.width=o}this.#t.classList.remove("resizing"),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId)}}};var ti=class{#e;#t=null;setWindow(e){if(e!==null&&(!Number.isSafeInteger(e.start)||e.start<0||!Number.isSafeInteger(e.total)||e.total<e.start))throw new TypeError("Invalid grid window");this.#t=e,this.#a=!0}#i=null;get headerWidth(){return this.#i}setHeaderWidth(e){if(!Number.isFinite(e)||e<=0)throw new TypeError("Grid row header width must be positive pixels");this.#i=Math.round(e)}#n=new Map;#r=new Map;#l=[];#s=[0];#a=!0;#o=32;bindStore(e){e!==this.#e&&(this.#n.clear(),this.resetMeasurements(),this.#e=e)}retain(e){let t=new Set(e);for(let n of[this.#n,this.#r])for(let i of n.keys())t.has(i)||n.delete(i);this.#a=!0}height(e){return this.#n.get(e)??null}setHeight(e,t){if(e.parentBag===this.#e){if(t===null)this.#n.delete(e);else{if(!Number.isFinite(t)||t<=0)throw new TypeError("Grid row height must be positive pixels");this.#n.set(e,Math.round(t))}this.forget(e)}}setRows(e){this.#l=e,this.#a=!0}resetMeasurements(){this.#r.clear(),this.#a=!0}forget(e){this.#r.delete(e),this.#a=!0}measure(e,t){return t<=0||this.#r.get(e)===t?!1:(this.#r.set(e,t),this.#a=!0,!0)}#c(){if(!this.#a)return;let e=1/0;for(let[t,n]of this.#r)this.#n.has(t)||(e=Math.min(e,n));e!==1/0&&(this.#o=e),this.#s=[0];for(let t of this.#l)this.#s.push(this.#s.at(-1)+(this.#r.get(t)??Math.max(this.#n.get(t)??0,this.#o)));this.#a=!1}offset(e){if(this.#c(),!this.#t)return this.#s[e];let t=e-this.#t.start;return t<=0?e*this.#o:t<=this.#l.length?this.#t.start*this.#o+this.#s[t]:e*this.#o+this.#s.at(-1)-this.#l.length*this.#o}get count(){return this.#t?.total??this.#l.length}get totalHeight(){return this.offset(this.count)}indexAt(e){this.#c();let t=0,n=this.count;for(;t<n;){let i=t+n>>>1;this.offset(i+1)<=e?t=i+1:n=i}return Math.min(t,Math.max(0,this.count-1))}window(e,t){this.#c();let n=Math.max(t,this.#o*8);return{start:this.indexAt(Math.max(0,e-n)),end:Math.min(this.count,this.indexAt(e+t+n)+1)}}};var ri=class{#e;#t;#i;#n;#r=null;#l=null;#s;#a;#o;constructor(e,t,n,i,s,o,a){this.#e=e,this.#t=t,this.#i=n,this.#n=i,this.#s=s,this.#a=o,this.#o=a}get resizing(){return this.#r!==null}connect(){this.#e.addEventListener("pointerdown",this.#k),this.#e.addEventListener("pointermove",this.#_),this.#e.addEventListener("pointerup",this.#p),this.#e.addEventListener("pointercancel",this.#D),this.#e.addEventListener("lostpointercapture",this.#D),this.#e.addEventListener("keydown",this.#A),this.#e.addEventListener("dblclick",this.#w),this.#e.addEventListener("dragstart",this.#c),this.#e.addEventListener("dragover",this.#y),this.#e.addEventListener("dragleave",this.#d),this.#e.addEventListener("drop",this.#b),this.#e.addEventListener("dragend",this.#f)}disconnect(){this.cancel(),this.cancelDrag(),this.#e.removeEventListener("pointerdown",this.#k),this.#e.removeEventListener("pointermove",this.#_),this.#e.removeEventListener("pointerup",this.#p),this.#e.removeEventListener("pointercancel",this.#D),this.#e.removeEventListener("lostpointercapture",this.#D),this.#e.removeEventListener("keydown",this.#A),this.#e.removeEventListener("dblclick",this.#w),this.#e.removeEventListener("dragstart",this.#c),this.#e.removeEventListener("dragover",this.#y),this.#e.removeEventListener("dragleave",this.#d),this.#e.removeEventListener("drop",this.#b),this.#e.removeEventListener("dragend",this.#f)}#c=e=>{let t=e.target.closest("tr"),n=this.#n(t);if(!this.#a()||!n||this.#r||e.target.closest(".row-height-handle")){e.preventDefault();return}this.#l={node:n,bag:this.#s().bag},e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",n.label),t.classList.add("row-dragging")};#x(e){if(!this.#l||!this.#a())return null;let{node:t,bag:n}=this.#l,i=e.target.closest("tr"),s=this.#n(i);if(!s||s===t||this.#s().bag!==n||t.parentBag!==n||s.parentBag!==n)return null;let o=i.getBoundingClientRect();return{row:i,target:s,after:e.clientY>o.top+o.height/2}}#v(){for(let e of this.#e.querySelectorAll("[data-row-drop]"))e.removeAttribute("data-row-drop")}#y=e=>{this.#v();let t=this.#x(e);t&&(e.preventDefault(),e.dataTransfer.dropEffect="move",t.row.dataset.rowDrop=t.after?"after":"before")};#d=e=>{this.#e.contains(e.relatedTarget)||this.#v()};#b=e=>{let t=this.#x(e);if(!t)return;e.preventDefault(),e.stopPropagation();let{node:n}=this.#l;this.cancelDrag(),this.#s().moveRow(n,t.target,t.after)};#f=()=>{this.cancelDrag()};cancelDrag(){this.#l=null,this.#v();for(let e of this.#e.querySelectorAll(".row-dragging"))e.classList.remove("row-dragging")}#h(e){let t=e.target.closest(".row-height-handle");if(!t)return null;let n=t.closest("tr"),i=this.#n(n);return i?{handle:t,row:n,node:i}:null}project(e,t){let n=this.#i().height(t);e.style.height=n===null?"":`${n}px`}#E(e){let t=e.querySelector(".row-height-handle");t&&t.setAttribute("aria-valuenow",String(Math.round(e.getBoundingClientRect().height))),this.#o()}#k=e=>{let t=this.#h(e);if(!t||e.button!==0||this.#r)return;let{row:n}=t,i=n.getBoundingClientRect().height,s=n.style.height;n.style.height="";let o=n.getBoundingClientRect().height;n.style.height=s,this.#r={...t,pointerId:e.pointerId,y:e.clientY,height:i,minimum:o,preview:i},t.handle.focus({preventScroll:!0}),t.handle.setPointerCapture(e.pointerId),this.#t.classList.add("resizing-row"),e.preventDefault()};#_=e=>{let t=this.#r;!t||t.pointerId!==e.pointerId||(t.preview=Math.max(t.minimum,Math.round(t.height+e.clientY-t.y)),t.row.style.height=`${t.preview}px`,this.#E(t.row))};#p=e=>{let t=this.#r;!t||t.pointerId!==e.pointerId||(this.#_(e),this.cancel(),!(this.#n(t.row)!==t.node||t.preview===t.height)&&(this.#i().setHeight(t.node,t.preview),this.project(t.row,t.node),this.#E(t.row)))};#A=e=>{if(e.key==="Escape"&&(this.#r||this.#l)){this.cancel(),this.cancelDrag(),e.preventDefault();return}let t=this.#h(e);if(!t||!["ArrowUp","ArrowDown","Home"].includes(e.key))return;this.cancel();let n=null;if(e.key!=="Home"){let i=t.row.getBoundingClientRect().height;t.row.style.height="";let s=t.row.getBoundingClientRect().height;n=Math.max(s,i+(e.key==="ArrowDown"?10:-10))}this.#i().setHeight(t.node,n),this.project(t.row,t.node),this.#E(t.row),e.preventDefault()};#w=e=>{let t=this.#h(e);t&&(this.cancel(),this.#i().setHeight(t.node,null),this.project(t.row,t.node),this.#E(t.row),e.preventDefault())};#D=()=>{this.cancel()};cancel(){let e=this.#r;e&&(this.#r=null,this.project(e.row,e.node),this.#t.classList.remove("resizing-row"),e.handle.hasPointerCapture(e.pointerId)&&e.handle.releasePointerCapture(e.pointerId))}};var yl=`
|
|
29
29
|
.column-filter{position:absolute;inset-inline-end:8px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:inherit;cursor:pointer;padding:2px;margin-inline-start:4px;vertical-align:middle;line-height:0;opacity:.6}
|
|
30
30
|
th:has(.column-filter){padding-inline-end:28px}
|
|
31
31
|
.column-filter svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.5}
|
|
@@ -305,4 +305,4 @@ svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-width:1.7;stroke
|
|
|
305
305
|
box-shadow:var(--gramlot-shadow,0 3px 12px #0002);font:inherit;font-size:inherit;line-height:1.5}
|
|
306
306
|
.search-help p{margin:.6rem 0 0}.search-help p:last-child{color:var(--gramlot-text-secondary,GrayText)}
|
|
307
307
|
@media(prefers-reduced-motion:reduce){.control-box{transition:none}}
|
|
308
|
-
`;var Al=(0,_e.defineComponent)({name:"searchBox",tag:"gramlot-search-box",base:qr,sourceContext:!0,mixins:[ni],parameters:{lbl_position:{dtype:"T",default:"L",binding:"read"},searchLiteral:{dtype:"B",default:!1,binding:"read"},searchHelp:{dtype:"B",default:!1,binding:"read"},searchOn:{dtype:["B","T"],default:!0,binding:"read"},searchTime:{dtype:"R",nullable:!0,default:null,binding:"write"}},implementation:r=>class extends r{#e;#t;#i;#n;#r;#a=null;#o;#l;#s;#c;#x;#v;#y;constructor(){super();let e=this.ownerDocument,t=e.createElement("style");t.textContent=xl;let n=d=>{let f=e.createElementNS(xe,"svg");f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("aria-hidden","true");let h=e.createElementNS(xe,"path");return h.setAttribute("d",d),f.append(h),f};this.#o=e.createElement("input"),this.#o.type="text",this.#o.setAttribute("role","searchbox"),this.#o.setAttribute("aria-label","Filter rows"),this.#o.setAttribute("aria-describedby","search-error"),this.#o.placeholder=" ";let i=e.createElement("button");i.type="button",i.title="Clear filter",i.setAttribute("aria-label","Clear filter"),i.append(n("M6 6L18 18M18 6L6 18")),this.#l=e.createElement("span"),this.#l.id="search-error",this.#l.className="error",this.#l.setAttribute("role","alert");let s=e.createElement("span");s.className="search-entry";let o=n("M21 21L16 16M18 10A8 8 0 1 1 2 10A8 8 0 0 1 18 10");o.classList.add("search-lens"),i.className="clear";let a=this.#s=e.createElement("button");a.type="button",a.className="info",a.hidden=!0,a.setAttribute("aria-label","Search instructions"),a.title="Search instructions",a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls","search-help"),a.append(n("M21 12A9 9 0 1 1 3 12A9 9 0 0 1 21 12M12 11V17M12 7V7.1"));let l=this.#c=e.createElement("div");l.id="search-help",l.className="search-help",l.setAttribute("popover","auto"),l.setAttribute("role","dialog"),l.setAttribute("aria-label","Search instructions");let u=e.createElement("strong");u.textContent="Search instructions",this.#x=e.createElement("p");let c=e.createElement("p");c.textContent="Clear with \xD7 or Escape. Changing column clears the query. An incomplete expression keeps the last valid result.",l.append(u,this.#x,c),this.shadowRoot.append(l),a.addEventListener("click",()=>{l.matches(":popover-open")?l.hidePopover():(l.showPopover(),Wr(l,a,{align:"end"}))}),l.addEventListener("toggle",()=>a.setAttribute("aria-expanded",String(l.matches(":popover-open")))),s.append(o,this.#o,i,a),this.control.replaceChildren(s,this.#l),this.shadowRoot.append(t),this.#o.addEventListener("input",()=>{this.#d(),this.#a=e.defaultView.setTimeout(()=>{this.#a=null,this.#p()},100)}),this.#o.addEventListener("keydown",d=>{d.isComposing||(d.key==="Enter"&&(d.preventDefault(),this.#d(),this.#p()),d.key==="Escape"&&(d.preventDefault(),this.#_()))}),i.addEventListener("click",()=>{this.#_(),this.#o.focus()})}setLabelbox(e){super.setLabelbox(e),e.box.classList.add("gramlot-search-labelbox");let t=this.ownerDocument.createElement("style");t.textContent=El,e.box.prepend(t)}focus(e){this.#o.focus(e)}clear(){this.#_()}setSourceContext(e){this.#e=e;let t=e.frameRecipient();if(t?.nodeTag!=="grid")throw new TypeError("searchBox requires a FrameGrid target");this.#t=zr(t)}projectAttributes(e,t){let n=this.parameters?.lbl_value,i=super.projectAttributes(e,t),s=!this.#s.hidden;return this.#s.hidden=!this.parameters.searchHelp,s&&this.#s.hidden&&this.#c.matches(":popover-open")&&this.#c.hidePopover(),this.isConnected&&(this.#b(),n!=null&&n!==this.parameters.lbl_value&&this.#r?.filter?.columns.join("+")!==this.parameters.lbl_value&&this.#_()),i}connectedCallback(){this.#i=this.#t.subscribe(()=>this.#b()),this.#b()}disconnectedCallback(){this.#d(),this.#i?.(),this.#n?.(),this.#i=this.#n=null}#d(){this.#a!==null&&this.ownerDocument.defaultView.clearTimeout(this.#a),this.#a=null}#b(){try{this.#f()}catch(e){this.#o.disabled=!0,this.#l.textContent=e.message}}#f(){if(!this.#t.view)return;(this.#r!==this.#t.view||this.#y!==this.#t.view.bag||!this.#n)&&(this.#d(),this.#n?.(),this.#r=this.#t.view,this.#y=this.#r.bag,this.#v=void 0,this.#n=this.#r.subscribe(()=>this.#h()));let e=vl(this.parameters.searchOn,this.#t.columns),t=this.#e.sourceNode,n=e.map(({field:s,name:o})=>`${s}:${o}`).join(","),i=e.some(s=>s.field===this.parameters.lbl_value)?this.parameters.lbl_value:e[0]?.field??"";t.getAttr("lbl_values")!==n&&t.setAttr({lbl_values:n}),this.parameters.lbl_value!==i&&this.box.labelbox.choose(i),this.#o.disabled=!e.length,this.#h(),this.#k()}#h(){let e=this.#r.filter,t=JSON.stringify(e);this.#v!==t&&(this.#v=t,this.#d(),this.#o.value=e?.value??"",e&&this.parameters.lbl_value!==e.columns.join("+")&&this.box.labelbox.choose(e.columns.join("+")),this.#l.textContent="",this.#o.removeAttribute("aria-invalid"),this.#k())}#E(){let e=this.#t.columns.find(t=>t.field===this.parameters.lbl_value);return["L","R","N","D"].includes(e?.dtype)?e.dtype:"T"}#k(){let e=this.#E();this.#x.textContent=e==="T"?this.parameters.searchLiteral?"Type literal text to find it anywhere. Matching is case-insensitive.":"Type a word to find it anywhere. Text is case-insensitive. You can also use expressions: lamp|desk matches either word; ^lamp matches the start.":e==="D"?"Compare dates: = 2026-10-15, >= 2026-10-15 or < 2026-10-15. ISO dates and your browser\u2019s local date notation are accepted.":"Compare numbers: = 12, > 100, <= 50 or ! 0 (not equal). Decimal punctuation follows your browser locale."}#_(){this.#d(),this.#o.value="",this.#p(),this.#k()}#p(){if(this.#r)try{let e=this.#o.value,t=performance.now();this.#r.applyFilter(e.trim()?{value:e,columns:this.parameters.lbl_value.split("+"),dtype:this.#E(),...this.parameters.searchLiteral?{literal:!0}:{},locale:this.#e.locale,timeZone:this.#e.timeZone}:null),this.#e.writeParameter("searchTime",performance.now()-t),this.#l.textContent="",this.#o.removeAttribute("aria-invalid")}catch(e){this.#l.textContent=e.message,this.#o.setAttribute("aria-invalid","true")}}}});var Dl={elements:{struct:{doc:null,sub_tags:"column,colgroup",parent_tags:"grid",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[],accepts_var_keyword:!1,accepts_var_positional:!1},_meta:{data_element:!0,gridStruct:!0}},column:{doc:null,sub_tags:"",parent_tags:"struct,colgroup",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[{name:"field",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",flags:0}]},has_default:!1},{name:"name",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"dtype",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(T|B|L|R|N|D|H|DHZ)$",flags:0}]},has_default:!0,default:null},{name:"width",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[0-9]+([.][0-9]+)?(px|em|rem|ch|%)$",flags:0}]},has_default:!0,default:null},{name:"max_height",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[0-9]+([.][0-9]+)?(px|em|rem)$",flags:0}]},has_default:!0,default:null},{name:"align",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(start|center|end)$",flags:0}]},has_default:!0,default:null},{name:"format",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"white_space",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(normal|nowrap|pre-wrap)$",flags:0}]},has_default:!0,default:null},{name:"edit",kind:"keyword_only",role:"attribute",annotation:{kind:"union",items:[{kind:"dtype",dtype:"B"},{kind:"type",module:"builtins",name:"dict"}]},has_default:!0,default:!1},{name:"check",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"checked",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"checkedField",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"title",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"formula",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"calculated",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"B"},has_default:!0,default:null},{name:"hidden",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"B"},has_default:!0,default:null},{name:"totalize",kind:"keyword_only",role:"attribute",annotation:{kind:"union",items:[{kind:"dtype",dtype:"B"},{kind:"dtype",dtype:"T"}]},has_default:!0,default:null},{name:"footer_value",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"footer_format",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},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},_meta:{data_element:!0,keywordPattern:"^formula_[A-Za-z_$][A-Za-z0-9_$]*$"}},colgroup:{doc:null,sub_tags:"column",parent_tags:"struct",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[{name:"code",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",flags:0}]},has_default:!1},{name:"name",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"background",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"color",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null}],accepts_var_keyword:!1,accepts_var_positional:!1},_meta:{data_element:!0}}}};var Sh=(0,_e.defineComponent)({name:"grid",tag:"gramlot-grid",base:qr,bagStore:!0,bagStruct:!0,sourceContext:!0,subTags:"struct,div",parameters:{columnFilters:{dtype:"B",default:!1,binding:"read"},setFilter:{dtype:"T",default:"",binding:"read"},windowInfo:{dtype:"X",nullable:!0,default:null,binding:"read"},loading:{dtype:"B",default:!1,binding:"read"},viewport:{dtype:"X",nullable:!0,default:null,binding:"write"},sortRequest:{dtype:"T",default:"",binding:"write"},storepath:{dtype:"T"},structpath:{dtype:"T"},rowMode:{dtype:"T"},rowHeaders:{dtype:"B",default:!1,binding:"read"},footer:{dtype:["B","T"],default:!1,binding:"read"},selectionMode:{dtype:"T",default:"multi",binding:"read"},selectedId:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedIndex:{dtype:"L",nullable:!0,default:null,binding:"write"},selectedLabel:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedPkeys:{dtype:"X",nullable:!0,default:null,binding:"write"},selectedRowidx:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedNodes:{dtype:"X",nullable:!0,default:null,binding:"write"},selectedRowData:{dtype:"X",nullable:!0,default:null,binding:"write"},rowResize:{dtype:"B",default:!1,binding:"read"},selfDragRows:{dtype:"B",default:!1,binding:"read"},sortedBy:{dtype:"T",default:"",binding:"read"},filter:{annotation:{kind:"type",module:"builtins",name:"dict"},nullable:!0,default:null,binding:"read"}},implementation:r=>class extends r{#e;#t;#i;#n;#r;#a;#o;#l=null;#s=null;#c;#x=e=>{let t=e.target.closest("tr[data-row]"),n=t&&[...this.#p].find(([,i])=>i===t)?.[0];if(!(!n||this.#c.mode==="none"))try{this.#c.select(n,{toggle:e.ctrlKey||e.metaKey,range:e.shiftKey}),this.#Q()}catch(i){this.#f.reportError(i,"Grid selection")}};#v=e=>{if(this.#c.mode==="none"||e.altKey)return;let t=(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="a",n={ArrowUp:-1,ArrowDown:1}[e.key];if(!(!t&&(n===void 0||e.ctrlKey||e.metaKey))){e.preventDefault();try{if(t)this.#c.selectAll();else{let i=e.target.closest?.("td[data-field]")?.dataset.field,s=this.#c.move(n,e.shiftKey);s&&this.#ye(s,i)}this.#Q()}catch(i){this.#f.reportError(i,"Grid selection")}}};#y=e=>{if(e.type==="keydown"&&!["Enter","F2"].includes(e.key))return;let t=e.target.closest("td[data-field]");if(!t||!this.#h)return;let n=[...this.#p].find(([,s])=>s===t.parentElement)?.[0],i=this.#h.columns.find(s=>s.field===t.dataset.field);if(n&&i.edit){e.preventDefault();try{this.#n.open(n,i,t)}catch(s){this.#f.reportError(s,"Grid editor")}}};#d;#b;#f;#h;#E;#k=!0;#_;#p=new Map;#A;#w;#D;#B;#N;#u;#S;#j;#L=null;#F=1;#T=!1;#z;#I;#m;#g;#te;#re;#$;#P=null;#q=!1;#U=new Set;#V=[];#X=-1;#Y=-1;#H;#W;#ne;#M=!1;#Z=null;#ie=e=>{e.target!==this.#u||!["Home","End"].includes(e.key)||!this.#h||(e.preventDefault(),this.#M=e.key==="End",this.#O(this.#M?Math.max(0,this.#m.totalHeight-this.#u.clientHeight):0),this.#R())};#se=()=>{let e=this.#u;e.scrollTop!==this.#Z&&(this.#M=e.scrollTop>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1),this.#Z=null,this.#N.scrollLeft=this.#u.scrollLeft,this.#a&&(this.#a.viewport.scrollLeft=this.#u.scrollLeft),this.#R()};constructor(){super();let e=this.ownerDocument,t=e.createElement("style");t.textContent=yl,this.control.setAttribute("role","table"),this.control.setAttribute("aria-label","Grid"),this.control.setAttribute("part","table");let n=e.createElement("div");n.className="header-frame",n.setAttribute("part","header"),this.#N=e.createElement("div"),this.#N.className="header-viewport",this.#N.setAttribute("part","header-viewport"),this.#u=e.createElement("div"),this.#u.className="body-viewport",this.#u.setAttribute("part","body-viewport"),this.#u.tabIndex=0,this.#u.setAttribute("role","rowgroup"),this.#D=e.createElement("table"),this.#B=e.createElement("table");for(let l of[this.#D,this.#B])l.setAttribute("role","presentation");this.#A=e.createElement("thead"),this.#A.setAttribute("role","rowgroup"),this.#w=e.createElement("tbody"),this.#w.setAttribute("role","presentation"),this.#D.append(this.#A),this.#B.append(this.#w),this.#N.append(this.#D),n.append(this.#N),this.#H=e.createElement("div"),this.#W=e.createElement("div");for(let l of[this.#H,this.#W])l.className="row-space",l.setAttribute("aria-hidden","true");this.#u.append(this.#H,this.#B,this.#W);let i=e.createElement("div");i.className="body-frame",this.#S=e.createElement("div"),this.#S.className="loading-status",this.#S.setAttribute("role","status"),this.#S.setAttribute("aria-label","Loading\u2026"),this.#S.hidden=!0;let s=e.createElementNS(xe,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("aria-hidden","true");let o=e.createElementNS(xe,"circle");o.setAttribute("cx","12"),o.setAttribute("cy","12"),o.setAttribute("r","9"),o.setAttribute("opacity",".2");let a=e.createElementNS(xe,"path");a.setAttribute("d","M12 3a9 9 0 0 1 9 9"),s.append(o,a),this.#S.append(s),i.append(this.#u,this.#S),this.control.replaceChildren(n,i),this.shadowRoot.append(t),this.#i=new qn(this,this.#A),this.#z=new ei(this.#A,this.control,()=>this.#h,(l,u)=>this.#ke(l,u),()=>this.#m,()=>this.#R()),this.#I=new ri(this.#w,this.control,()=>this.#m,l=>{for(let[u,c]of this.#p)if(c===l)return u;return null},()=>this.#g,()=>this.parameters.selfDragRows,()=>this.#R()),this.#j=new e.defaultView.ResizeObserver(()=>this.#R())}connectedCallback(){this.#w.addEventListener("dblclick",this.#y),this.#w.addEventListener("keydown",this.#y),this.#w.addEventListener("click",this.#x),this.#u.addEventListener("keydown",this.#v),this.#n?.connect(),this.#t?.connect(),this.#o?.connect(),this.#i.connect(),this.#ce(),this.#g&&this.#K({full:!0,rows:[]}),this.#z.connect(),this.#I.connect(),this.#u.addEventListener("scroll",this.#se,{passive:!0}),this.#u.addEventListener("keydown",this.#ie),this.#j.observe(this.#u),this.#j.observe(this.#B),this.#R()}disconnectedCallback(){this.#w.removeEventListener("dblclick",this.#y),this.#w.removeEventListener("keydown",this.#y),this.#w.removeEventListener("click",this.#x),this.#u.removeEventListener("keydown",this.#v),this.#n?.disconnect(),this.#t?.disconnect(),this.#o.disconnect(),this.#s?.(),this.#s=null,this.#l=null,this.#i.disconnect(),this.#r.disconnect(),this.#de(),zr(this.#f.sourceNode).detach(this.#g),this.#g?.disconnect(),this.#$?.(),this.#$=null,this.#z.disconnect(),this.#I.disconnect(),this.#u.removeEventListener("scroll",this.#se),this.#u.removeEventListener("keydown",this.#ie),this.#j.disconnect(),this.#L!==null&&this.ownerDocument.defaultView.cancelAnimationFrame(this.#L),this.#L=null}#R(){!this.isConnected||this.#L!==null||(this.#L=this.ownerDocument.defaultView.requestAnimationFrame(()=>{this.#L=null;let t=`${this.#u.offsetWidth-this.#u.clientWidth}px`;this.control.style.getPropertyValue("--grid-scrollbar-width")!==t&&this.control.style.setProperty("--grid-scrollbar-width",t),this.#oe();for(let n of this.#A.querySelectorAll("th[scope=col]"))n.querySelector(".column-resize").setAttribute("aria-valuenow",String(Math.round(n.getBoundingClientRect().width)));for(let n of this.#p.values()){let i=n.querySelector(".row-height-handle");i&&i.setAttribute("aria-valuenow",String(Math.round(n.getBoundingClientRect().height)))}if(this.#N.scrollLeft=this.#u.scrollLeft,this.#a.viewport.scrollLeft=this.#u.scrollLeft,!!this.#h)try{this.#ae(),this.#n.position()}catch(n){this.#f.reportError(n,"Grid viewport")}}))}#oe(){if(!this.#T)return;let e=this.#A.querySelector(".row-number-measure");e.textContent=String(Math.max(1,this.#m.count));let t=Math.ceil(e.getBoundingClientRect().width);this.control.style.setProperty("--grid-row-header-min-width",`${t}px`),this.#m.headerWidth===null?this.control.style.removeProperty("--grid-row-header-width"):this.control.style.setProperty("--grid-row-header-width",`${this.#m.headerWidth}px`),this.#A.querySelector(".row-heading .column-resize").setAttribute("aria-valuemin",String(Math.max(40,t)))}#ae(){let e=this.#u,t=this.#m.indexAt(e.scrollTop),n=e.scrollTop-this.#m.offset(t),i=!1,s=this.#p.values().next().value;if(s){let o=this.ownerDocument.defaultView.getComputedStyle(s.querySelector("td")),a=JSON.stringify([this.#B.getBoundingClientRect().width,o.font,o.lineHeight,o.padding,o.getPropertyValue("--gramlot-grid-row-height")]);a!==this.#ne&&(this.#m.resetMeasurements(),this.#ne=a,i=!0)}for(let[o,a]of this.#p)i=this.#m.measure(o,a.getBoundingClientRect().height)||i;if(i&&this.#V.length){let o=this.#m.offset(t)+n;this.#le(),this.#O(this.#M?Math.max(0,this.#m.totalHeight-e.clientHeight):o)}this.#I.resizing||this.#G()}#le(){let e=Math.max(0,this.#X),t=Math.max(e,this.#Y);this.#H.style.height=`${this.#m.offset(e)}px`,this.#W.style.height=`${Math.max(0,this.#m.totalHeight-this.#m.offset(t))}px`}#O(e){this.#u.scrollTop!==e&&(this.#u.scrollTop=e,this.#Z=this.#u.scrollTop)}#G(e=!1){let t=this.#u,n=Math.max(0,this.#m.totalHeight-t.clientHeight),i=this.#M?n:Math.min(t.scrollTop,n),{start:s,end:o}=this.#m.window(i,t.clientHeight),a=this.#C();if(a){let u=a.start+this.#V.length;if(s<a.start||o>u){let c=Math.max(200,o-s),d=Math.max(0,Math.min(Math.max(0,a.total-c),s)),f=JSON.stringify([a.revision,d,c]);f!==this.#b&&(this.#b=f,this.#f.writeParameter("viewport",{start:d,count:c}))}else this.#b=null;s=Math.max(s,a.start),o=Math.max(s,Math.min(o,u))}a||(this.#b=null);let l=this.parameters.loading||this.#b!==null;if(this.#S.hidden=!l,l?this.control.setAttribute("aria-busy","true"):this.control.removeAttribute("aria-busy"),e||s!==this.#X||o!==this.#Y){let u=new bt(this.#r,this.#f.format).read(this.#h.columns,this.#V.slice(s-(a?.start??0),o-(a?.start??0)));this.#Ae(u,this.#h.columns,s),this.#X=s,this.#Y=o,this.#R()}this.#le(),this.#O(i)}#C(){let e=this.parameters.windowInfo;if(e===null)return null;if(!(e instanceof Es))throw new TypeError("Grid windowInfo requires a Bag");return Object.fromEntries(["start","total","revision","sortedBy"].map(t=>[t,e.getItem(t)]))}#he(e,t,n){let i=this.#g.getRows(),s=this.#h.columns.filter(a=>a.edit),o=i.indexOf(e)*s.length+s.findIndex(a=>a.field===t)+(typeof n=="object"?n.row*s.length:n);o<0||o>=i.length*s.length||this.#ue(Math.floor(o/s.length),s[o%s.length])}#ue(e,t){let n=this.#g.getRows()[e];this.#M=!1;let i=this.#m.offset(e),s=this.#m.offset(e+1);i<this.#u.scrollTop?this.#O(i):s>this.#u.scrollTop+this.#u.clientHeight&&this.#O(Math.max(0,s-this.#u.clientHeight)),this.#G(!0),this.#ae();let o=this.#p.get(n).querySelector(`td[data-field="${t.field}"]`),a=o.getBoundingClientRect(),l=this.#u.getBoundingClientRect();a.top<l.top?this.#O(Math.floor(this.#u.scrollTop+a.top-l.top)):a.bottom>l.bottom&&this.#O(Math.ceil(this.#u.scrollTop+Math.min(a.top-l.top,a.bottom-l.bottom))),a.left<l.left?this.#u.scrollLeft+=a.left-l.left:a.right>l.right&&(this.#u.scrollLeft+=Math.min(a.left-l.left,a.right-l.right)),this.#N.scrollLeft=this.#u.scrollLeft,this.#n.open(n,t,o)}#pe(e){let t=this.#f.sourceNode.absDatapath(this.parameters.storepath)+".";if(!e.startsWith(t))return!1;let n=e.slice(t.length),i=this.parameters.rowMode==="attributes"?"?":".",s=n.indexOf(i);if(s<0)return!1;let o=this.#e.getNode(n.slice(0,s)),a=this.#h.columns.find(u=>u.field===n.slice(s+1)&&u.edit),l=this.#g.getRows().indexOf(o);return!a||l<0?!1:(this.#ue(l,a),!0)}get formulaErrors(){return this.#r.errors}get totalErrors(){return this.#a.errors}setSourceContext(e){this.#f=e,this.#r=new Xn(e.sourceNode),this.#a=new Kn(e.sourceNode,e.format,this.#u.parentElement),this.#c=new Qn(e,{view:()=>this.#g,store:()=>this.#ee(),mode:()=>this.#J(),rowData:n=>this.#we(n)}),this.#o=new Jn(e,{columns:()=>this.#h.columns,rows:()=>this.#g.getRows(),selected:()=>this.#c.nodes,selectionMode:()=>this.#J(),reader:()=>this.#r,store:()=>({bag:this.#e,mode:this.parameters.rowMode}),parameters:()=>this.parameters,document:this.ownerDocument}),this.isConnected&&this.#o.connect(),this.#i.setSourceContext(e),this.#t=new Vn(e.sourceNode,this.#w,()=>this.#h?.columns??[],n=>[...this.#p].find(([,i])=>i===n)?.[0],(n,i)=>this.#g.value(n,i),()=>this.parameters.setFilter,()=>this.#g),this.isConnected&&this.#t.connect(),this.#n=new zn(this,e,(n,i)=>this.#p.get(n)?.querySelector(`td[data-field="${i}"]`),()=>({bag:this.#e,mode:this.parameters.rowMode,window:this.parameters.windowInfo}),()=>this.#p,(n,i,s)=>this.#he(n,i,s),n=>this.#pe(n));let t=e.sourceNode;Object.hasOwn(t,"gridRowLayout")||Object.defineProperty(t,"gridRowLayout",{value:new ti,configurable:!0}),this.#m=t.gridRowLayout}setStoreBag(e){if(!(e instanceof Es))throw new TypeError("grid storepath must resolve to a Bag");e!==this.#e&&this.#n?.replaceData(),this.#e=e,this.#m.bindStore(e)}setStructBag(e){this.#E=e,this.#k=!0}projectAttributes(e,t){let n=super.projectAttributes(e,t);if(this.#C()&&(this.parameters.columnFilters||this.#g?.filterContributions.some(([a])=>a.startsWith("column:"))))throw new TypeError("grid columnFilters requires a complete resident store");if(this.#C()&&this.parameters.setFilter!=="")throw new TypeError("grid setFilter requires a complete resident store");let i=this.#f.collectionView(this.#e,this.parameters.rowMode);this.#g!==i&&(this.#de(),this.#$?.(),this.#$=null,this.#g=i,this.#ce()),!this.#C()&&this.#te!==this.parameters.sortedBy&&(this.#g.sort(this.parameters.sortedBy),this.#te=this.parameters.sortedBy);let s=this.parameters.filter,o=JSON.stringify(s);return!this.#C()&&this.#re!==o&&(this.#g.applyFilter(s===null?null:{locale:this.#f.locale,timeZone:this.#f.timeZone,...s},"base"),this.#re=o),this.#K({full:!0,rows:[]}),n}#ce(){this.isConnected&&this.#g&&!this.#$&&(this.#g.connect(),this.#$=this.#g.subscribe(e=>this.#K(e)))}#de(){this.#P!==null&&this.ownerDocument.defaultView.clearTimeout(this.#P),this.#P=null,this.#q=!1,this.#U.clear()}#K({full:e,rows:t}){if(this.#q||=e,this.#q)this.#U.clear();else for(let n of t)this.#U.add(n);!this.isConnected||this.#P!==null||(this.#P=this.ownerDocument.defaultView.setTimeout(()=>{let n=this.#q,i=[...this.#U];this.#P=null,this.#q=!1,this.#U.clear();try{n?this.#ge():this.#me(this.#r.viewFields.size?[...this.#p.keys()]:i)}catch(s){this.#q=!0,this.#f.reportError(s,"Grid refresh")}},0))}#me(e){for(let n of e)this.#m.forget(n);this.#a.update(this.#r,this.#ee().getRows());let t=new bt(this.#r,this.#f.format).read(this.#h.columns,e.filter(n=>this.#p.has(n)));this.#I.cancel();for(let{node:n,cells:i}of t)this.#fe(this.#p.get(n),i,n);this.#R()}#ge(){let e=this.#k?new Zn(this.#E):this.#h,t=this.#ee();this.#r.configure(e,this.#g,t),this.#ve(),this.#o.requireEditableTools(e.columns),this.#c.prune();let n=this.#k;this.#n.configure(e.columns),this.#h=e,this.#t.configure();let i=this.#g.getRows();this.#I.cancel(),this.#I.cancelDrag(),this.#m.retain(this.#e.getNodes()),this.#k&&this.#m.resetMeasurements();let s=this.#C();this.#m.setWindow(s),this.#m.setRows(i),this.#V=i,s&&this.#d!==s.revision&&(this.#M=!1,this.#O(0),this.#b=null),this.#d=s?.revision,this.#k=!1,zr(this.#f.sourceNode).update(this.#g,e.columns.filter(l=>!l.check&&!this.#r.viewFields.has(l.field)));let o=this.parameters.rowHeaders||this.parameters.rowResize,a=JSON.stringify([e.groups,o,this.parameters.columnFilters,this.parameters.footer]);this.#T=o,a!==this.#_&&(this.#a.configure(this.parameters.footer,e.columns,o),this.#xe(e),this.#_=a),this.#a.update(this.#r,t.getRows()),this.#be(n),this.#i.update(this.#g,e.columns,this.parameters.columnFilters,this.#f.format),this.#Ee(),this.#G(!0),this.#Q(),this.control.setAttribute("aria-colcount",String(e.columns.length+Number(this.#T))),this.control.setAttribute("aria-rowcount",String(this.#F+Math.max(this.#m.count,1))),this.#R()}#be(e){let t=this.#f.sourceNode.formState;if(t===this.#l){e&&t?.updateChanges();return}this.#s?.(),this.#l=t,this.#s=t===null?null:t.registerDerived(n=>this.#_e(n))}#_e(e){let t=this.#l.path,n=a=>a===t?"":a.startsWith(t+".")?a.slice(t.length+1):null;if(this.#a.totalPaths().some(a=>n(a)===e)||this.#c.paths().some(a=>{let l=n(a);return l!==null&&(e===l||e.startsWith(l+".")||e.startsWith(l+"?"))}))return!0;let i=n(this.#f.sourceNode.absDatapath(this.parameters.storepath));if(i===null||i!==""&&!e.startsWith(i+"."))return!1;let s=i===""?e:e.slice(i.length+1),o=(this.parameters.rowMode==="attributes"?/^[^.?]+\?([^.?]+)$/:/^[^.?]+\.([^.?]+)$/).exec(s)?.[1];return o!==void 0&&this.#r.dataFields.has(o)}#J(){let e=this.parameters.selectionMode;if(!wl.includes(e))throw new TypeError("grid selectionMode requires none, single or multi");return e}#we(e){return this.parameters.rowMode==="attributes"?{...e.getAttr()}:Object.fromEntries(e.staticValue.getNodes().filter(t=>!(t.staticValue instanceof Es)).map(t=>[t.label,t.staticValue]))}#Q(){let e=this.#J();e==="multi"?this.control.setAttribute("aria-multiselectable","true"):this.control.removeAttribute("aria-multiselectable");for(let[t,n]of this.#p){let i=this.#c.isSelected(t);e==="none"?n.removeAttribute("aria-selected"):n.setAttribute("aria-selected",String(i)),n.setAttribute("part",i?"row selected-row":"row")}}#ye(e,t){let n=this.#g.getRows().indexOf(e);this.#M=!1;let i=this.#m.offset(n),s=this.#m.offset(n+1);i<this.#u.scrollTop?this.#O(i):s>this.#u.scrollTop+this.#u.clientHeight&&this.#O(Math.max(0,s-this.#u.clientHeight)),this.#G(!0),t&&this.#p.get(e)?.querySelector(`td[data-field="${t}"]`)?.focus({preventScroll:!0})}#ee(){return this.#f.sourceNode.rootBuilder.binding.collectionStore(this.#e,this.parameters.rowMode)}#ve(){let e=this.#g,t=this.#r.viewFields,n=[...e.criteria.map(({field:o})=>["sort by",o]),...e.filterContributions.flatMap(([o,{definition:a}])=>o.startsWith("column:")?[["filter",o.slice(7)]]:o==="sets"?[]:a.columns.map(l=>["search",l]))],[i,s]=n.find(([,o])=>t.has(o))??[];if(s!==void 0)throw new TypeError(`grid cannot ${i} the view value '${s}'`)}#ke(e,t){if(!this.#h.columns.find(n=>n.field===e)?.check)try{if(this.#r.viewFields.has(e))throw new TypeError(`grid cannot sort by the view value '${e}'`);let n=this.#C()?bs(this.#C().sortedBy):this.#g.criteria,i=n.find(l=>l.field===e),s=i?.direction==="a"?"d":"a",o=t?n.filter(l=>l.field!==e):[];t&&i?o.splice(n.indexOf(i),0,{field:e,direction:s}):o.push({field:e,direction:s});let a=o.map(l=>`${l.field}:${l.direction}`).join(",");this.#C()?this.#f.writeParameter("sortRequest",a):this.#g.sort(a)}catch(n){this.#f.reportError(n,"Grid sort")}}#Ee(){let e=this.#C()?bs(this.#C().sortedBy):this.#g.criteria;this.#oe();for(let t of this.#A.querySelectorAll("th[scope=col]")){let n=e.findIndex(i=>i.field===t.dataset.field);if(t.removeAttribute("aria-sort"),n<0)delete t.dataset.sortDirection,delete t.dataset.sortPriority,t.removeAttribute("aria-label");else{let i=e[n].direction==="a"?"ascending":"descending";t.dataset.sortDirection=i,t.dataset.sortPriority=String(n+1),n===0&&t.setAttribute("aria-sort",i),t.setAttribute("aria-label",`${t.textContent}, sort ${n+1}, ${i}`)}}}#xe(e){this.#z.cancel();let t=this.shadowRoot.activeElement,n=t?.closest("th[data-field]")?.dataset.field,i=t?.classList.contains("column-resize"),s=this.ownerDocument,o=e.groups.some(h=>h.name!==null);this.#F=o?2:1;let a=s.createElement("tr"),l=s.createElement("tr");for(let[h,p]of[a,l].entries())p.setAttribute("role","row"),p.setAttribute("aria-rowindex",String(h+1));let u=(h,p,m,g,_,v="start")=>{let w=s.createElement("th");if(w.textContent=h,w.colSpan=p,w.rowSpan=m,w.scope=g,w.setAttribute("role","columnheader"),w.setAttribute("part",g==="colgroup"?"group-header":"column-header"),w.setAttribute("aria-colindex",String(_+1+Number(this.#T))),w.setAttribute("aria-colspan",String(p)),w.setAttribute("aria-rowspan",String(m)),w.style.textAlign=v,g==="col"){let E=s.createElement("span");E.className="column-caption",E.textContent=h,w.replaceChildren(E);let T=e.columns[_];w.dataset.field=T.field,w.draggable=!0,w.tabIndex=0,w.setAttribute("aria-label",T.title??T.name),w.title=T.check?(T.title??T.name)+" \xB7 Drag to reorder":"Click: ascending / descending \xB7 Shift-click: add or reverse this column without changing the others \xB7 Numbers show sort priority \xB7 Drag to reorder";let I=s.createElementNS(xe,"svg");I.classList.add("sort-indicator"),I.setAttribute("viewBox","0 0 16 16"),I.setAttribute("aria-hidden","true");let z=s.createElementNS(xe,"path");z.setAttribute("d","M4 10L8 6L12 10"),I.append(z),w.append(I),this.parameters.columnFilters&&!T.check&&!this.#r.viewFields.has(T.field)&&w.append(this.#i.button(T));let q=s.createElement("span");q.className="column-resize",q.tabIndex=0,q.setAttribute("role","separator"),q.setAttribute("aria-orientation","vertical"),q.setAttribute("aria-valuemin","40"),q.setAttribute("aria-label",`Resize ${T.name}`),q.title="Drag to resize \xB7 Arrow keys adjust width",w.append(q)}return w};if(this.#T){let h=s.createElement("th");h.textContent="#",h.scope="col",h.className="row-heading",h.rowSpan=this.#F,h.setAttribute("role","columnheader"),h.setAttribute("aria-colindex","1"),h.setAttribute("aria-rowspan",String(this.#F)),h.setAttribute("part","row-header");let p=s.createElement("span");p.className="row-number-measure",p.setAttribute("aria-hidden","true");let m=s.createElement("span");m.className="column-resize",m.tabIndex=0,m.setAttribute("role","separator"),m.setAttribute("aria-orientation","vertical"),m.setAttribute("aria-label","Resize row numbers"),m.title="Drag to resize \xB7 Arrow keys adjust width",h.append(p,m),a.append(h)}let c=0;for(let h of e.groups)if(o&&h.name!==null){let p=u(h.name,h.columns.length,1,"colgroup",c,"center");p.style.background=h.background??"",p.style.color=h.color??"",a.append(p);for(let m of h.columns)l.append(u(m.name,1,1,"col",c++,m.align))}else for(let p of h.columns){if(o){let m=s.createElement("td");m.className="group-spacer",m.setAttribute("aria-hidden","true"),a.append(m)}(o?l:a).append(u(p.name,1,1,"col",c++,p.align))}this.#A.replaceChildren(a,...o?[l]:[]),n&&this.#A.querySelector(`th[data-field="${n}"]${i?" .column-resize":""}`)?.focus({preventScroll:!0});let d=e.columns.map(h=>h.width??"var(--gramlot-grid-column-width, 10rem)");this.#T&&d.unshift("max(var(--grid-row-header-min-width, 0px), var(--grid-row-header-width, var(--gramlot-grid-row-header-width, 44px)))"),this.control.style.setProperty("--grid-columns-width",`calc(${d.join(" + ")})`);let f=this.parameters.footer===!1?[]:[this.#a.table];for(let h of[this.#D,this.#B,...f]){for(let p of h.querySelectorAll(":scope > colgroup"))p.remove();if(h.prepend(...e.groups.map(p=>{let m=s.createElement("colgroup");for(let g of p.columns){let _=s.createElement("col");_.style.width=g.width??"var(--gramlot-grid-column-width, 10rem)",m.append(_)}return m})),this.#T){let p=s.createElement("colgroup"),m=s.createElement("col");m.style.width="max(var(--grid-row-header-min-width, 0px), var(--grid-row-header-width, var(--gramlot-grid-row-header-width, 44px)))",p.append(m),h.prepend(p)}}}#Ae(e,t,n){this.#I.cancel();let i=new Set,s=null;this.#w.querySelector(".empty")?.parentElement.remove();for(let{node:o,cells:a}of e){let l=this.#p.get(o);l||(l=this.ownerDocument.createElement("tr"),l.setAttribute("part","row"),l.setAttribute("role","row"),l.dataset.row=o.label,this.#p.set(o,l)),l.classList.toggle("alternate",(n+i.size)%2===1),l.setAttribute("part",this.#c.isSelected(o)?"row selected-row":"row"),this.#c.mode==="none"?l.removeAttribute("aria-selected"):l.setAttribute("aria-selected",String(this.#c.isSelected(o)));let u=this.#g.isFiltered();l.draggable=this.parameters.selfDragRows;let c=l.querySelector("th[scope=row]");if(this.#T){if(!c){c=this.ownerDocument.createElement("th"),c.scope="row",c.className="row-heading",c.setAttribute("role","rowheader"),c.setAttribute("part","row-header"),c.setAttribute("aria-colindex","1");let m=this.ownerDocument.createElement("span");m.className="row-number",c.append(m),l.prepend(c)}c.querySelector(".row-number").textContent=String(n+i.size+1),c.classList.toggle("filtered-numbering",u);let p=c.querySelector(".row-height-handle");this.parameters.rowResize?(p||(p=this.ownerDocument.createElement("span"),p.className="row-height-handle",p.tabIndex=0,p.setAttribute("role","separator"),p.setAttribute("aria-orientation","horizontal"),p.title="Drag to resize row \xB7 Double-click or Home resets \xB7 Arrow keys adjust height",c.append(p)),p.setAttribute("aria-label",`Resize row ${n+i.size+1}`)):p?.remove()}else c?.remove();let d=Number(this.#T),f=new Map([...l.querySelectorAll("td[data-field]")].map(p=>[p.dataset.field,p]));for(let[p,m]of t.entries()){let g=f.get(m.field);if(!g){g=this.ownerDocument.createElement("td"),g.setAttribute("part","cell"),g.dataset.field=m.field,g.setAttribute("role","cell");let w=this.ownerDocument.createElement("div");w.className="cell-content",w.setAttribute("part","cell-content"),g.append(w)}m.edit?g.tabIndex=0:g.removeAttribute("tabindex"),g.classList.toggle("filtered-numbering",u&&this.#r.viewFields.has(m.field));let _=g.firstElementChild,v=m.max_height!=null;v?g.style.setProperty("--grid-cell-max-height",m.max_height):g.style.removeProperty("--grid-cell-max-height"),_.classList.toggle("cell-scroll",v),v?_.tabIndex=0:_.removeAttribute("tabindex"),g.style.textAlign=m.align,g.style.whiteSpace=m.white_space??"",g.style.overflowWrap=m.white_space==="pre-wrap"||m.white_space==="normal"?"anywhere":"",g.setAttribute("aria-colindex",String(p+1+d)),g.classList.toggle("numeric",["L","R","N"].includes(m.dtype)),l.cells[p+d]!==g&&l.insertBefore(g,l.cells[p+d]??null),f.delete(m.field)}for(let p of f.values())p.remove();l.setAttribute("aria-rowindex",String(this.#F+n+i.size+1)),this.#fe(l,a,o),this.#n.decorate(l,o);let h=s?s.nextSibling:this.#w.firstChild;h!==l&&this.#w.insertBefore(l,h),this.#I.project(l,o),s=l,i.add(o)}for(let[o,a]of this.#p)i.has(o)||(a.remove(),this.#p.delete(o));if(!e.length&&this.#m.count===0&&!this.parameters.loading){let o=this.ownerDocument.createElement("tr"),a=this.ownerDocument.createElement("td");o.setAttribute("role","row"),o.setAttribute("aria-rowindex",String(this.#F+1)),a.setAttribute("role","cell"),a.setAttribute("aria-colspan",String(t.length+Number(this.#T))),a.className="empty",a.colSpan=t.length+Number(this.#T),a.textContent="No rows",o.append(a),this.#w.append(o)}}#fe(e,t,n){let i=Number(this.#T);t.forEach((s,o)=>{let a=e.cells[o+i].firstElementChild,l=this.#h.columns[o];if(a.parentElement.classList.toggle("check-cell",!!l.check),l.check){this.#t.project(a,n,l);return}if(l.edit?.tag==="colorpicker"){let c=a.querySelector(".cell-color-swatch");c||(c=this.ownerDocument.createElement("span"),c.className="cell-color-swatch",c.setAttribute("role","img"),a.replaceChildren(c)),c.hidden=s==="",c.style.backgroundColor=s,c.title=s,c.setAttribute("aria-label",s)}else(a.firstElementChild||a.textContent!==s)&&(a.textContent=s)})}}}),xs=class extends _e.ComponentCollection{toDocument(){let e=super.toDocument(),t=e.elements.grid.attributes.parameters;for(let n of["storepath","rowMode"]){let i=t.find(s=>s.name===n);i.has_default=!1,delete i.default,n==="rowMode"&&(i.annotation={kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(values|attributes)$",flags:0}]})}return Object.assign(e.elements,structuredClone(Dl.elements)),e.elements.grid._meta.parameterPattern="^selected_[A-Za-z_][A-Za-z0-9_]*$",e}},Rw=new xs({name:"grid",components:[Sh,Al],dependencies:[Nh],registerCommands:gl,assets:{writeExcelFileLicense:Et["assets/files/8cf9b31947daf7adb4a7a00a037459e58241af050cd0a603bfcf1756e533f75e-write-excel-file.txt"],fflateLicense:Et["assets/files/0a1df3a083d0c010560aa342e87959c8c1070e6fd54545741f083f22d0c8b551-fflate.txt"]}});export{Sh as Grid,Rw as default};
|
|
308
|
+
`;var Al=(0,_e.defineComponent)({name:"searchBox",tag:"gramlot-search-box",base:qr,sourceContext:!0,mixins:[ni],parameters:{lbl_position:{dtype:"T",default:"L",binding:"read"},searchLiteral:{dtype:"B",default:!1,binding:"read"},searchHelp:{dtype:"B",default:!1,binding:"read"},searchOn:{dtype:["B","T"],default:!0,binding:"read"},searchTime:{dtype:"R",nullable:!0,default:null,binding:"write"}},implementation:r=>class extends r{#e;#t;#i;#n;#r;#l=null;#s;#a;#o;#c;#x;#v;#y;constructor(){super();let e=this.ownerDocument,t=e.createElement("style");t.textContent=xl;let n=d=>{let f=e.createElementNS(xe,"svg");f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("aria-hidden","true");let h=e.createElementNS(xe,"path");return h.setAttribute("d",d),f.append(h),f};this.#s=e.createElement("input"),this.#s.type="text",this.#s.setAttribute("role","searchbox"),this.#s.setAttribute("aria-label","Filter rows"),this.#s.setAttribute("aria-describedby","search-error"),this.#s.placeholder=" ";let i=e.createElement("button");i.type="button",i.title="Clear filter",i.setAttribute("aria-label","Clear filter"),i.append(n("M6 6L18 18M18 6L6 18")),this.#a=e.createElement("span"),this.#a.id="search-error",this.#a.className="error",this.#a.setAttribute("role","alert");let s=e.createElement("span");s.className="search-entry";let o=n("M21 21L16 16M18 10A8 8 0 1 1 2 10A8 8 0 0 1 18 10");o.classList.add("search-lens"),i.className="clear";let a=this.#o=e.createElement("button");a.type="button",a.className="info",a.hidden=!0,a.setAttribute("aria-label","Search instructions"),a.title="Search instructions",a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls","search-help"),a.append(n("M21 12A9 9 0 1 1 3 12A9 9 0 0 1 21 12M12 11V17M12 7V7.1"));let l=this.#c=e.createElement("div");l.id="search-help",l.className="search-help",l.setAttribute("popover","auto"),l.setAttribute("role","dialog"),l.setAttribute("aria-label","Search instructions");let u=e.createElement("strong");u.textContent="Search instructions",this.#x=e.createElement("p");let c=e.createElement("p");c.textContent="Clear with \xD7 or Escape. Changing column clears the query. An incomplete expression keeps the last valid result.",l.append(u,this.#x,c),this.shadowRoot.append(l),a.addEventListener("click",()=>{l.matches(":popover-open")?l.hidePopover():(l.showPopover(),Wr(l,a,{align:"end"}))}),l.addEventListener("toggle",()=>a.setAttribute("aria-expanded",String(l.matches(":popover-open")))),s.append(o,this.#s,i,a),this.control.replaceChildren(s,this.#a),this.shadowRoot.append(t),this.#s.addEventListener("input",()=>{this.#d(),this.#l=e.defaultView.setTimeout(()=>{this.#l=null,this.#p()},100)}),this.#s.addEventListener("keydown",d=>{d.isComposing||(d.key==="Enter"&&(d.preventDefault(),this.#d(),this.#p()),d.key==="Escape"&&(d.preventDefault(),this.#_()))}),i.addEventListener("click",()=>{this.#_(),this.#s.focus()})}setLabelbox(e){super.setLabelbox(e),e.box.classList.add("gramlot-search-labelbox");let t=this.ownerDocument.createElement("style");t.textContent=El,e.box.prepend(t)}focus(e){this.#s.focus(e)}clear(){this.#_()}setSourceContext(e){this.#e=e;let t=e.frameRecipient();if(t?.nodeTag!=="grid")throw new TypeError("searchBox requires a FrameGrid target");this.#t=zr(t)}projectAttributes(e,t){let n=this.parameters?.lbl_value,i=super.projectAttributes(e,t),s=!this.#o.hidden;return this.#o.hidden=!this.parameters.searchHelp,s&&this.#o.hidden&&this.#c.matches(":popover-open")&&this.#c.hidePopover(),this.isConnected&&(this.#b(),n!=null&&n!==this.parameters.lbl_value&&this.#r?.filter?.columns.join("+")!==this.parameters.lbl_value&&this.#_()),i}connectedCallback(){this.#i=this.#t.subscribe(()=>this.#b()),this.#b()}disconnectedCallback(){this.#d(),this.#i?.(),this.#n?.(),this.#i=this.#n=null}#d(){this.#l!==null&&this.ownerDocument.defaultView.clearTimeout(this.#l),this.#l=null}#b(){try{this.#f()}catch(e){this.#s.disabled=!0,this.#a.textContent=e.message}}#f(){if(!this.#t.view)return;(this.#r!==this.#t.view||this.#y!==this.#t.view.bag||!this.#n)&&(this.#d(),this.#n?.(),this.#r=this.#t.view,this.#y=this.#r.bag,this.#v=void 0,this.#n=this.#r.subscribe(()=>this.#h()));let e=vl(this.parameters.searchOn,this.#t.columns),t=this.#e.sourceNode,n=e.map(({field:s,name:o})=>`${s}:${o}`).join(","),i=e.some(s=>s.field===this.parameters.lbl_value)?this.parameters.lbl_value:e[0]?.field??"";t.getAttr("lbl_values")!==n&&t.setAttr({lbl_values:n}),this.parameters.lbl_value!==i&&this.box.labelbox.choose(i),this.#s.disabled=!e.length,this.#h(),this.#k()}#h(){let e=this.#r.filter,t=JSON.stringify(e);this.#v!==t&&(this.#v=t,this.#d(),this.#s.value=e?.value??"",e&&this.parameters.lbl_value!==e.columns.join("+")&&this.box.labelbox.choose(e.columns.join("+")),this.#a.textContent="",this.#s.removeAttribute("aria-invalid"),this.#k())}#E(){let e=this.#t.columns.find(t=>t.field===this.parameters.lbl_value);return["L","R","N","D"].includes(e?.dtype)?e.dtype:"T"}#k(){let e=this.#E();this.#x.textContent=e==="T"?this.parameters.searchLiteral?"Type literal text to find it anywhere. Matching is case-insensitive.":"Type a word to find it anywhere. Text is case-insensitive. You can also use expressions: lamp|desk matches either word; ^lamp matches the start.":e==="D"?"Compare dates: = 2026-10-15, >= 2026-10-15 or < 2026-10-15. ISO dates and your browser\u2019s local date notation are accepted.":"Compare numbers: = 12, > 100, <= 50 or ! 0 (not equal). Decimal punctuation follows your browser locale."}#_(){this.#d(),this.#s.value="",this.#p(),this.#k()}#p(){if(this.#r)try{let e=this.#s.value,t=performance.now();this.#r.applyFilter(e.trim()?{value:e,columns:this.parameters.lbl_value.split("+"),dtype:this.#E(),...this.parameters.searchLiteral?{literal:!0}:{},locale:this.#e.locale,timeZone:this.#e.timeZone}:null),this.#e.writeParameter("searchTime",performance.now()-t),this.#a.textContent="",this.#s.removeAttribute("aria-invalid")}catch(e){this.#a.textContent=e.message,this.#s.setAttribute("aria-invalid","true")}}}});var Dl={elements:{struct:{doc:null,sub_tags:"column,colgroup",parent_tags:"grid",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[],accepts_var_keyword:!1,accepts_var_positional:!1},_meta:{data_element:!0,gridStruct:!0}},column:{doc:null,sub_tags:"",parent_tags:"struct,colgroup",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[{name:"field",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",flags:0}]},has_default:!1},{name:"name",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"dtype",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(T|B|L|R|N|D|H|DHZ)$",flags:0}]},has_default:!0,default:null},{name:"width",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[0-9]+([.][0-9]+)?(px|em|rem|ch|%)$",flags:0}]},has_default:!0,default:null},{name:"max_height",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[0-9]+([.][0-9]+)?(px|em|rem)$",flags:0}]},has_default:!0,default:null},{name:"align",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(start|center|end)$",flags:0}]},has_default:!0,default:null},{name:"format",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"white_space",kind:"keyword_only",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(normal|nowrap|pre-wrap)$",flags:0}]},has_default:!0,default:null},{name:"edit",kind:"keyword_only",role:"attribute",annotation:{kind:"union",items:[{kind:"dtype",dtype:"B"},{kind:"type",module:"builtins",name:"dict"}]},has_default:!0,default:!1},{name:"check",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"checked",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"checkedField",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"title",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"formula",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"calculated",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"B"},has_default:!0,default:null},{name:"hidden",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"B"},has_default:!0,default:null},{name:"totalize",kind:"keyword_only",role:"attribute",annotation:{kind:"union",items:[{kind:"dtype",dtype:"B"},{kind:"dtype",dtype:"T"}]},has_default:!0,default:null},{name:"footer_value",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"footer_format",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},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},_meta:{data_element:!0,keywordPattern:"^formula_[A-Za-z_$][A-Za-z0-9_$]*$"}},colgroup:{doc:null,sub_tags:"column",parent_tags:"struct",inherits_from:null,ns:null,node_label:null,collection_key:null,attributes:{parameters:[{name:"code",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",flags:0}]},has_default:!1},{name:"name",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"background",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null},{name:"color",kind:"keyword_only",role:"attribute",annotation:{kind:"dtype",dtype:"T"},has_default:!0,default:null}],accepts_var_keyword:!1,accepts_var_positional:!1},_meta:{data_element:!0}}}};var Sh=(0,_e.defineComponent)({name:"grid",tag:"gramlot-grid",base:qr,bagStore:!0,bagStruct:!0,sourceContext:!0,subTags:"struct,div",parameters:{columnFilters:{dtype:"B",default:!1,binding:"read"},setFilter:{dtype:"T",default:"",binding:"read"},windowInfo:{dtype:"X",nullable:!0,default:null,binding:"read"},loading:{dtype:"B",default:!1,binding:"read"},viewport:{dtype:"X",nullable:!0,default:null,binding:"write"},sortRequest:{dtype:"T",default:"",binding:"write"},storepath:{dtype:"T"},structpath:{dtype:"T"},rowMode:{dtype:"T"},rowHeaders:{dtype:"B",default:!1,binding:"read"},footer:{dtype:["B","T"],default:!1,binding:"read"},selectionMode:{dtype:"T",default:"multi",binding:"read"},selectedId:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedIndex:{dtype:"L",nullable:!0,default:null,binding:"write"},selectedLabel:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedPkeys:{dtype:"X",nullable:!0,default:null,binding:"write"},selectedRowidx:{dtype:"T",nullable:!0,default:null,binding:"write"},selectedNodes:{dtype:"X",nullable:!0,default:null,binding:"write"},selectedRowData:{dtype:"X",nullable:!0,default:null,binding:"write"},rowResize:{dtype:"B",default:!1,binding:"read"},selfDragRows:{dtype:"B",default:!1,binding:"read"},sortedBy:{dtype:"T",default:"",binding:"read"},filter:{annotation:{kind:"type",module:"builtins",name:"dict"},nullable:!0,default:null,binding:"read"}},implementation:r=>class extends r{#e;#t;#i;#n;#r;#l;#s;#a=null;#o=null;#c;#x=e=>{let t=e.target.closest("tr[data-row]"),n=t&&[...this.#p].find(([,i])=>i===t)?.[0];if(!(!n||this.#c.mode==="none"))try{this.#c.select(n,{toggle:e.ctrlKey||e.metaKey,range:e.shiftKey}),this.#Q()}catch(i){this.#f.reportError(i,"Grid selection")}};#v=e=>{if(this.#c.mode==="none"||e.altKey)return;let t=(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="a",n={ArrowUp:-1,ArrowDown:1}[e.key];if(!(!t&&(n===void 0||e.ctrlKey||e.metaKey))){e.preventDefault();try{if(t)this.#c.selectAll();else{let i=e.target.closest?.("td[data-field]")?.dataset.field,s=this.#c.move(n,e.shiftKey);s&&this.#ye(s,i)}this.#Q()}catch(i){this.#f.reportError(i,"Grid selection")}}};#y=e=>{if(e.type==="keydown"&&!["Enter","F2"].includes(e.key))return;let t=e.target.closest("td[data-field]");if(!t||!this.#h)return;let n=[...this.#p].find(([,s])=>s===t.parentElement)?.[0],i=this.#h.columns.find(s=>s.field===t.dataset.field);if(n&&i.edit){e.preventDefault();try{this.#n.open(n,i,t)}catch(s){this.#f.reportError(s,"Grid editor")}}};#d;#b;#f;#h;#E;#k=!0;#_;#p=new Map;#A;#w;#D;#B;#N;#u;#S;#j;#L=null;#F=1;#T=!1;#z;#I;#m;#g;#te;#re;#$;#P=null;#q=!1;#U=new Set;#V=[];#X=-1;#Y=-1;#H;#W;#ne;#M=!1;#Z=null;#ie=e=>{e.target!==this.#u||!["Home","End"].includes(e.key)||!this.#h||(e.preventDefault(),this.#M=e.key==="End",this.#O(this.#M?Math.max(0,this.#m.totalHeight-this.#u.clientHeight):0),this.#R())};#se=()=>{let e=this.#u;e.scrollTop!==this.#Z&&(this.#M=e.scrollTop>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1),this.#Z=null,this.#N.scrollLeft=this.#u.scrollLeft,this.#l&&(this.#l.viewport.scrollLeft=this.#u.scrollLeft),this.#R()};constructor(){super();let e=this.ownerDocument,t=e.createElement("style");t.textContent=yl,this.control.setAttribute("role","table"),this.control.setAttribute("aria-label","Grid"),this.control.setAttribute("part","table");let n=e.createElement("div");n.className="header-frame",n.setAttribute("part","header"),this.#N=e.createElement("div"),this.#N.className="header-viewport",this.#N.setAttribute("part","header-viewport"),this.#u=e.createElement("div"),this.#u.className="body-viewport",this.#u.setAttribute("part","body-viewport"),this.#u.tabIndex=0,this.#u.setAttribute("role","rowgroup"),this.#D=e.createElement("table"),this.#B=e.createElement("table");for(let l of[this.#D,this.#B])l.setAttribute("role","presentation");this.#A=e.createElement("thead"),this.#A.setAttribute("role","rowgroup"),this.#w=e.createElement("tbody"),this.#w.setAttribute("role","presentation"),this.#D.append(this.#A),this.#B.append(this.#w),this.#N.append(this.#D),n.append(this.#N),this.#H=e.createElement("div"),this.#W=e.createElement("div");for(let l of[this.#H,this.#W])l.className="row-space",l.setAttribute("aria-hidden","true");this.#u.append(this.#H,this.#B,this.#W);let i=e.createElement("div");i.className="body-frame",this.#S=e.createElement("div"),this.#S.className="loading-status",this.#S.setAttribute("role","status"),this.#S.setAttribute("aria-label","Loading\u2026"),this.#S.hidden=!0;let s=e.createElementNS(xe,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("aria-hidden","true");let o=e.createElementNS(xe,"circle");o.setAttribute("cx","12"),o.setAttribute("cy","12"),o.setAttribute("r","9"),o.setAttribute("opacity",".2");let a=e.createElementNS(xe,"path");a.setAttribute("d","M12 3a9 9 0 0 1 9 9"),s.append(o,a),this.#S.append(s),i.append(this.#u,this.#S),this.control.replaceChildren(n,i),this.shadowRoot.append(t),this.#i=new qn(this,this.#A),this.#z=new ei(this.#A,this.control,()=>this.#h,(l,u)=>this.#ke(l,u),()=>this.#m,()=>this.#R()),this.#I=new ri(this.#w,this.control,()=>this.#m,l=>{for(let[u,c]of this.#p)if(c===l)return u;return null},()=>this.#g,()=>this.parameters.selfDragRows,()=>this.#R()),this.#j=new e.defaultView.ResizeObserver(()=>this.#R())}connectedCallback(){this.#w.addEventListener("dblclick",this.#y),this.#w.addEventListener("keydown",this.#y),this.#w.addEventListener("click",this.#x),this.#u.addEventListener("keydown",this.#v),this.#n?.connect(),this.#t?.connect(),this.#s?.connect(),this.#i.connect(),this.#ce(),this.#g&&this.#K({full:!0,rows:[]}),this.#z.connect(),this.#I.connect(),this.#u.addEventListener("scroll",this.#se,{passive:!0}),this.#u.addEventListener("keydown",this.#ie),this.#j.observe(this.#u),this.#j.observe(this.#B),this.#R()}disconnectedCallback(){this.#w.removeEventListener("dblclick",this.#y),this.#w.removeEventListener("keydown",this.#y),this.#w.removeEventListener("click",this.#x),this.#u.removeEventListener("keydown",this.#v),this.#n?.disconnect(),this.#t?.disconnect(),this.#s.disconnect(),this.#o?.(),this.#o=null,this.#a=null,this.#i.disconnect(),this.#r.disconnect(),this.#de(),zr(this.#f.sourceNode).detach(this.#g),this.#g?.disconnect(),this.#$?.(),this.#$=null,this.#z.disconnect(),this.#I.disconnect(),this.#u.removeEventListener("scroll",this.#se),this.#u.removeEventListener("keydown",this.#ie),this.#j.disconnect(),this.#L!==null&&this.ownerDocument.defaultView.cancelAnimationFrame(this.#L),this.#L=null}#R(){!this.isConnected||this.#L!==null||(this.#L=this.ownerDocument.defaultView.requestAnimationFrame(()=>{this.#L=null;let t=`${this.#u.offsetWidth-this.#u.clientWidth}px`;this.control.style.getPropertyValue("--grid-scrollbar-width")!==t&&this.control.style.setProperty("--grid-scrollbar-width",t),this.#oe();for(let n of this.#A.querySelectorAll("th[scope=col]"))n.querySelector(".column-resize").setAttribute("aria-valuenow",String(Math.round(n.getBoundingClientRect().width)));for(let n of this.#p.values()){let i=n.querySelector(".row-height-handle");i&&i.setAttribute("aria-valuenow",String(Math.round(n.getBoundingClientRect().height)))}if(this.#N.scrollLeft=this.#u.scrollLeft,this.#l.viewport.scrollLeft=this.#u.scrollLeft,!!this.#h)try{this.#ae(),this.#n.position()}catch(n){this.#f.reportError(n,"Grid viewport")}}))}#oe(){if(!this.#T)return;let e=this.#A.querySelector(".row-number-measure");e.textContent=String(Math.max(1,this.#m.count));let t=Math.ceil(e.getBoundingClientRect().width);this.control.style.setProperty("--grid-row-header-min-width",`${t}px`),this.#m.headerWidth===null?this.control.style.removeProperty("--grid-row-header-width"):this.control.style.setProperty("--grid-row-header-width",`${this.#m.headerWidth}px`),this.#A.querySelector(".row-heading .column-resize").setAttribute("aria-valuemin",String(Math.max(40,t)))}#ae(){let e=this.#u,t=this.#m.indexAt(e.scrollTop),n=e.scrollTop-this.#m.offset(t),i=!1,s=this.#p.values().next().value;if(s){let o=this.ownerDocument.defaultView.getComputedStyle(s.querySelector("td")),a=JSON.stringify([this.#B.getBoundingClientRect().width,o.font,o.lineHeight,o.padding,o.getPropertyValue("--gramlot-grid-row-height")]);a!==this.#ne&&(this.#m.resetMeasurements(),this.#ne=a,i=!0)}for(let[o,a]of this.#p)i=this.#m.measure(o,a.getBoundingClientRect().height)||i;if(i&&this.#V.length){let o=this.#m.offset(t)+n;this.#le(),this.#O(this.#M?Math.max(0,this.#m.totalHeight-e.clientHeight):o)}this.#I.resizing||this.#G()}#le(){let e=Math.max(0,this.#X),t=Math.max(e,this.#Y);this.#H.style.height=`${this.#m.offset(e)}px`,this.#W.style.height=`${Math.max(0,this.#m.totalHeight-this.#m.offset(t))}px`}#O(e){this.#u.scrollTop!==e&&(this.#u.scrollTop=e,this.#Z=this.#u.scrollTop)}#G(e=!1){let t=this.#u,n=Math.max(0,this.#m.totalHeight-t.clientHeight),i=this.#M?n:Math.min(t.scrollTop,n),{start:s,end:o}=this.#m.window(i,t.clientHeight),a=this.#C();if(a){let u=a.start+this.#V.length;if(s<a.start||o>u){let c=Math.max(200,o-s),d=Math.max(0,Math.min(Math.max(0,a.total-c),s)),f=JSON.stringify([a.revision,d,c]);f!==this.#b&&(this.#b=f,this.#f.writeParameter("viewport",{start:d,count:c}))}else this.#b=null;s=Math.max(s,a.start),o=Math.max(s,Math.min(o,u))}a||(this.#b=null);let l=this.parameters.loading||this.#b!==null;if(this.#S.hidden=!l,l?this.control.setAttribute("aria-busy","true"):this.control.removeAttribute("aria-busy"),e||s!==this.#X||o!==this.#Y){let u=new bt(this.#r,this.#f.format).read(this.#h.columns,this.#V.slice(s-(a?.start??0),o-(a?.start??0)));this.#Ae(u,this.#h.columns,s),this.#X=s,this.#Y=o,this.#R()}this.#le(),this.#O(i)}#C(){let e=this.parameters.windowInfo;if(e===null)return null;if(!(e instanceof Es))throw new TypeError("Grid windowInfo requires a Bag");return Object.fromEntries(["start","total","revision","sortedBy"].map(t=>[t,e.getItem(t)]))}#he(e,t,n){let i=this.#g.getRows(),s=this.#h.columns.filter(a=>a.edit),o=i.indexOf(e)*s.length+s.findIndex(a=>a.field===t)+(typeof n=="object"?n.row*s.length:n);o<0||o>=i.length*s.length||this.#ue(Math.floor(o/s.length),s[o%s.length])}#ue(e,t){let n=this.#g.getRows()[e];this.#M=!1;let i=this.#m.offset(e),s=this.#m.offset(e+1);i<this.#u.scrollTop?this.#O(i):s>this.#u.scrollTop+this.#u.clientHeight&&this.#O(Math.max(0,s-this.#u.clientHeight)),this.#G(!0),this.#ae();let o=this.#p.get(n).querySelector(`td[data-field="${t.field}"]`),a=o.getBoundingClientRect(),l=this.#u.getBoundingClientRect();a.top<l.top?this.#O(Math.floor(this.#u.scrollTop+a.top-l.top)):a.bottom>l.bottom&&this.#O(Math.ceil(this.#u.scrollTop+Math.min(a.top-l.top,a.bottom-l.bottom))),a.left<l.left?this.#u.scrollLeft+=a.left-l.left:a.right>l.right&&(this.#u.scrollLeft+=Math.min(a.left-l.left,a.right-l.right)),this.#N.scrollLeft=this.#u.scrollLeft,this.#n.open(n,t,o)}#pe(e){let t=this.#f.sourceNode.absDatapath(this.parameters.storepath)+".";if(!e.startsWith(t))return!1;let n=e.slice(t.length),i=this.parameters.rowMode==="attributes"?"?":".",s=n.indexOf(i);if(s<0)return!1;let o=this.#e.getNode(n.slice(0,s)),a=this.#h.columns.find(u=>u.field===n.slice(s+1)&&u.edit),l=this.#g.getRows().indexOf(o);return!a||l<0?!1:(this.#ue(l,a),!0)}get formulaErrors(){return this.#r.errors}get totalErrors(){return this.#l.errors}setSourceContext(e){this.#f=e,this.#r=new Xn(e.sourceNode),this.#l=new Kn(e.sourceNode,e.format,this.#u.parentElement),this.#c=new Qn(e,{view:()=>this.#g,store:()=>this.#ee(),mode:()=>this.#J(),rowData:n=>this.#we(n)}),this.#s=new Jn(e,{columns:()=>this.#h.columns,rows:()=>this.#g.getRows(),selected:()=>this.#c.nodes,selectionMode:()=>this.#J(),reader:()=>this.#r,store:()=>({bag:this.#e,mode:this.parameters.rowMode}),parameters:()=>this.parameters,document:this.ownerDocument}),this.isConnected&&this.#s.connect(),this.#i.setSourceContext(e),this.#t=new Vn(e.sourceNode,this.#w,()=>this.#h?.columns??[],n=>[...this.#p].find(([,i])=>i===n)?.[0],(n,i)=>this.#g.value(n,i),()=>this.parameters.setFilter,()=>this.#g),this.isConnected&&this.#t.connect(),this.#n=new zn(this,e,(n,i)=>this.#p.get(n)?.querySelector(`td[data-field="${i}"]`),()=>({bag:this.#e,mode:this.parameters.rowMode,window:this.parameters.windowInfo}),()=>this.#p,(n,i,s)=>this.#he(n,i,s),n=>this.#pe(n));let t=e.sourceNode;Object.hasOwn(t,"gridRowLayout")||Object.defineProperty(t,"gridRowLayout",{value:new ti,configurable:!0}),this.#m=t.gridRowLayout}setStoreBag(e){if(!(e instanceof Es))throw new TypeError("grid storepath must resolve to a Bag");e!==this.#e&&this.#n?.replaceData(),this.#e=e,this.#m.bindStore(e)}setStructBag(e){this.#E=e,this.#k=!0}projectAttributes(e,t){let n=super.projectAttributes(e,t);if(this.#C()&&(this.parameters.columnFilters||this.#g?.filterContributions.some(([a])=>a.startsWith("column:"))))throw new TypeError("grid columnFilters requires a complete resident store");if(this.#C()&&this.parameters.setFilter!=="")throw new TypeError("grid setFilter requires a complete resident store");let i=this.#f.collectionView(this.#e,this.parameters.rowMode);this.#g!==i&&(this.#de(),this.#$?.(),this.#$=null,this.#g=i,this.#ce()),!this.#C()&&this.#te!==this.parameters.sortedBy&&(this.#g.sort(this.parameters.sortedBy),this.#te=this.parameters.sortedBy);let s=this.parameters.filter,o=JSON.stringify(s);return!this.#C()&&this.#re!==o&&(this.#g.applyFilter(s===null?null:{locale:this.#f.locale,timeZone:this.#f.timeZone,...s},"base"),this.#re=o),this.#K({full:!0,rows:[]}),n}#ce(){this.isConnected&&this.#g&&!this.#$&&(this.#g.connect(),this.#$=this.#g.subscribe(e=>this.#K(e)))}#de(){this.#P!==null&&this.ownerDocument.defaultView.clearTimeout(this.#P),this.#P=null,this.#q=!1,this.#U.clear()}#K({full:e,rows:t}){if(this.#q||=e,this.#q)this.#U.clear();else for(let n of t)this.#U.add(n);!this.isConnected||this.#P!==null||(this.#P=this.ownerDocument.defaultView.setTimeout(()=>{let n=this.#q,i=[...this.#U];this.#P=null,this.#q=!1,this.#U.clear();try{n?this.#ge():this.#me(this.#r.viewFields.size?[...this.#p.keys()]:i)}catch(s){this.#q=!0,this.#f.reportError(s,"Grid refresh")}},0))}#me(e){for(let n of e)this.#m.forget(n);this.#l.update(this.#r,this.#ee().getRows());let t=new bt(this.#r,this.#f.format).read(this.#h.columns,e.filter(n=>this.#p.has(n)));this.#I.cancel();for(let{node:n,cells:i}of t)this.#fe(this.#p.get(n),i,n);this.#R()}#ge(){let e=this.#k?new Zn(this.#E):this.#h,t=this.#ee();this.#r.configure(e,this.#g,t),this.#ve(),this.#s.requireEditableTools(e.columns),this.#c.prune();let n=this.#k;this.#n.configure(e.columns),this.#h=e,this.#t.configure();let i=this.#g.getRows();this.#I.cancel(),this.#I.cancelDrag(),this.#m.retain(this.#e.getNodes()),this.#k&&this.#m.resetMeasurements();let s=this.#C();this.#m.setWindow(s),this.#m.setRows(i),this.#V=i,s&&this.#d!==s.revision&&(this.#M=!1,this.#O(0),this.#b=null),this.#d=s?.revision,this.#k=!1,zr(this.#f.sourceNode).update(this.#g,e.columns.filter(l=>!l.check&&!this.#r.viewFields.has(l.field)));let o=this.parameters.rowHeaders||this.parameters.rowResize,a=JSON.stringify([e.groups,o,this.parameters.columnFilters,this.parameters.footer]);this.#T=o,a!==this.#_&&(this.#l.configure(this.parameters.footer,e.columns,o),this.#xe(e),this.#_=a),this.#l.update(this.#r,t.getRows()),this.#be(n),this.#i.update(this.#g,e.columns,this.parameters.columnFilters,this.#f.format),this.#Ee(),this.#G(!0),this.#Q(),this.control.setAttribute("aria-colcount",String(e.columns.length+Number(this.#T))),this.control.setAttribute("aria-rowcount",String(this.#F+Math.max(this.#m.count,1))),this.#R()}#be(e){let t=this.#f.sourceNode.formState;if(t===this.#a){e&&t?.updateChanges();return}this.#o?.(),this.#a=t,this.#o=t===null?null:t.registerDerived(n=>this.#_e(n))}#_e(e){let t=this.#a.path,n=a=>a===t?"":a.startsWith(t+".")?a.slice(t.length+1):null;if(this.#l.totalPaths().some(a=>n(a)===e)||this.#c.paths().some(a=>{let l=n(a);return l!==null&&(e===l||e.startsWith(l+".")||e.startsWith(l+"?"))}))return!0;let i=n(this.#f.sourceNode.absDatapath(this.parameters.storepath));if(i===null||i!==""&&!e.startsWith(i+"."))return!1;let s=i===""?e:e.slice(i.length+1),o=(this.parameters.rowMode==="attributes"?/^[^.?]+\?([^.?]+)$/:/^[^.?]+\.([^.?]+)$/).exec(s)?.[1];return o!==void 0&&this.#r.dataFields.has(o)}#J(){let e=this.parameters.selectionMode;if(!wl.includes(e))throw new TypeError("grid selectionMode requires none, single or multi");return e}#we(e){return this.parameters.rowMode==="attributes"?{...e.getAttr()}:Object.fromEntries(e.staticValue.getNodes().filter(t=>!(t.staticValue instanceof Es)).map(t=>[t.label,t.staticValue]))}#Q(){let e=this.#J();e==="multi"?this.control.setAttribute("aria-multiselectable","true"):this.control.removeAttribute("aria-multiselectable");for(let[t,n]of this.#p){let i=this.#c.isSelected(t);e==="none"?n.removeAttribute("aria-selected"):n.setAttribute("aria-selected",String(i)),n.setAttribute("part",i?"row selected-row":"row")}}#ye(e,t){let n=this.#g.getRows().indexOf(e);this.#M=!1;let i=this.#m.offset(n),s=this.#m.offset(n+1);i<this.#u.scrollTop?this.#O(i):s>this.#u.scrollTop+this.#u.clientHeight&&this.#O(Math.max(0,s-this.#u.clientHeight)),this.#G(!0),t&&this.#p.get(e)?.querySelector(`td[data-field="${t}"]`)?.focus({preventScroll:!0})}#ee(){return this.#f.sourceNode.rootBuilder.binding.collectionStore(this.#e,this.parameters.rowMode)}#ve(){let e=this.#g,t=this.#r.viewFields,n=[...e.criteria.map(({field:o})=>["sort by",o]),...e.filterContributions.flatMap(([o,{definition:a}])=>o.startsWith("column:")?[["filter",o.slice(7)]]:o==="sets"?[]:a.columns.map(l=>["search",l]))],[i,s]=n.find(([,o])=>t.has(o))??[];if(s!==void 0)throw new TypeError(`grid cannot ${i} the view value '${s}'`)}#ke(e,t){if(!this.#h.columns.find(n=>n.field===e)?.check)try{if(this.#r.viewFields.has(e))throw new TypeError(`grid cannot sort by the view value '${e}'`);let n=this.#C()?bs(this.#C().sortedBy):this.#g.criteria,i=n.find(l=>l.field===e),s=i?.direction==="a"?"d":"a",o=t?n.filter(l=>l.field!==e):[];t&&i?o.splice(n.indexOf(i),0,{field:e,direction:s}):o.push({field:e,direction:s});let a=o.map(l=>`${l.field}:${l.direction}`).join(",");this.#C()?this.#f.writeParameter("sortRequest",a):this.#g.sort(a)}catch(n){this.#f.reportError(n,"Grid sort")}}#Ee(){let e=this.#C()?bs(this.#C().sortedBy):this.#g.criteria;this.#oe();for(let t of this.#A.querySelectorAll("th[scope=col]")){let n=e.findIndex(i=>i.field===t.dataset.field);if(t.removeAttribute("aria-sort"),n<0)delete t.dataset.sortDirection,delete t.dataset.sortPriority,t.removeAttribute("aria-label");else{let i=e[n].direction==="a"?"ascending":"descending";t.dataset.sortDirection=i,t.dataset.sortPriority=String(n+1),n===0&&t.setAttribute("aria-sort",i),t.setAttribute("aria-label",`${t.textContent}, sort ${n+1}, ${i}`)}}}#xe(e){this.#z.cancel();let t=this.shadowRoot.activeElement,n=t?.closest("th[data-field]")?.dataset.field,i=t?.classList.contains("column-resize"),s=this.ownerDocument,o=e.groups.some(h=>h.name!==null);this.#F=o?2:1;let a=s.createElement("tr"),l=s.createElement("tr");for(let[h,p]of[a,l].entries())p.setAttribute("role","row"),p.setAttribute("aria-rowindex",String(h+1));let u=(h,p,m,g,_,v="start")=>{let w=s.createElement("th");if(w.textContent=h,w.colSpan=p,w.rowSpan=m,w.scope=g,w.setAttribute("role","columnheader"),w.setAttribute("part",g==="colgroup"?"group-header":"column-header"),w.setAttribute("aria-colindex",String(_+1+Number(this.#T))),w.setAttribute("aria-colspan",String(p)),w.setAttribute("aria-rowspan",String(m)),w.style.textAlign=v,g==="col"){let E=s.createElement("span");E.className="column-caption",E.textContent=h,w.replaceChildren(E);let T=e.columns[_];w.dataset.field=T.field,w.draggable=!0,w.tabIndex=0,w.setAttribute("aria-label",T.title??T.name),w.title=T.check?(T.title??T.name)+" \xB7 Drag to reorder":"Click: ascending / descending \xB7 Shift-click: add or reverse this column without changing the others \xB7 Numbers show sort priority \xB7 Drag to reorder";let I=s.createElementNS(xe,"svg");I.classList.add("sort-indicator"),I.setAttribute("viewBox","0 0 16 16"),I.setAttribute("aria-hidden","true");let z=s.createElementNS(xe,"path");z.setAttribute("d","M4 10L8 6L12 10"),I.append(z),w.append(I),this.parameters.columnFilters&&!T.check&&!this.#r.viewFields.has(T.field)&&w.append(this.#i.button(T));let q=s.createElement("span");q.className="column-resize",q.tabIndex=0,q.setAttribute("role","separator"),q.setAttribute("aria-orientation","vertical"),q.setAttribute("aria-valuemin","40"),q.setAttribute("aria-label",`Resize ${T.name}`),q.title="Drag to resize \xB7 Arrow keys adjust width",w.append(q)}return w};if(this.#T){let h=s.createElement("th");h.textContent="#",h.scope="col",h.className="row-heading",h.rowSpan=this.#F,h.setAttribute("role","columnheader"),h.setAttribute("aria-colindex","1"),h.setAttribute("aria-rowspan",String(this.#F)),h.setAttribute("part","row-header");let p=s.createElement("span");p.className="row-number-measure",p.setAttribute("aria-hidden","true");let m=s.createElement("span");m.className="column-resize",m.tabIndex=0,m.setAttribute("role","separator"),m.setAttribute("aria-orientation","vertical"),m.setAttribute("aria-label","Resize row numbers"),m.title="Drag to resize \xB7 Arrow keys adjust width",h.append(p,m),a.append(h)}let c=0;for(let h of e.groups)if(o&&h.name!==null){let p=u(h.name,h.columns.length,1,"colgroup",c,"center");p.style.background=h.background??"",p.style.color=h.color??"",a.append(p);for(let m of h.columns)l.append(u(m.name,1,1,"col",c++,m.align))}else for(let p of h.columns){if(o){let m=s.createElement("td");m.className="group-spacer",m.setAttribute("aria-hidden","true"),a.append(m)}(o?l:a).append(u(p.name,1,1,"col",c++,p.align))}this.#A.replaceChildren(a,...o?[l]:[]),n&&this.#A.querySelector(`th[data-field="${n}"]${i?" .column-resize":""}`)?.focus({preventScroll:!0});let d=e.columns.map(h=>h.width??"var(--gramlot-grid-column-width, 10rem)");this.#T&&d.unshift("max(var(--grid-row-header-min-width, 0px), var(--grid-row-header-width, var(--gramlot-grid-row-header-width, 44px)))"),this.control.style.setProperty("--grid-columns-width",`calc(${d.join(" + ")})`);let f=this.parameters.footer===!1?[]:[this.#l.table];for(let h of[this.#D,this.#B,...f]){for(let p of h.querySelectorAll(":scope > colgroup"))p.remove();if(h.prepend(...e.groups.map(p=>{let m=s.createElement("colgroup");for(let g of p.columns){let _=s.createElement("col");_.style.width=g.width??"var(--gramlot-grid-column-width, 10rem)",m.append(_)}return m})),this.#T){let p=s.createElement("colgroup"),m=s.createElement("col");m.style.width="max(var(--grid-row-header-min-width, 0px), var(--grid-row-header-width, var(--gramlot-grid-row-header-width, 44px)))",p.append(m),h.prepend(p)}}}#Ae(e,t,n){this.#I.cancel();let i=new Set,s=null;this.#w.querySelector(".empty")?.parentElement.remove();for(let{node:o,cells:a}of e){let l=this.#p.get(o);l||(l=this.ownerDocument.createElement("tr"),l.setAttribute("part","row"),l.setAttribute("role","row"),l.dataset.row=o.label,this.#p.set(o,l)),l.classList.toggle("alternate",(n+i.size)%2===1),l.setAttribute("part",this.#c.isSelected(o)?"row selected-row":"row"),this.#c.mode==="none"?l.removeAttribute("aria-selected"):l.setAttribute("aria-selected",String(this.#c.isSelected(o)));let u=this.#g.isFiltered();l.draggable=this.parameters.selfDragRows;let c=l.querySelector("th[scope=row]");if(this.#T){if(!c){c=this.ownerDocument.createElement("th"),c.scope="row",c.className="row-heading",c.setAttribute("role","rowheader"),c.setAttribute("part","row-header"),c.setAttribute("aria-colindex","1");let m=this.ownerDocument.createElement("span");m.className="row-number",c.append(m),l.prepend(c)}c.querySelector(".row-number").textContent=String(n+i.size+1),c.classList.toggle("filtered-numbering",u);let p=c.querySelector(".row-height-handle");this.parameters.rowResize?(p||(p=this.ownerDocument.createElement("span"),p.className="row-height-handle",p.tabIndex=0,p.setAttribute("role","separator"),p.setAttribute("aria-orientation","horizontal"),p.title="Drag to resize row \xB7 Double-click or Home resets \xB7 Arrow keys adjust height",c.append(p)),p.setAttribute("aria-label",`Resize row ${n+i.size+1}`)):p?.remove()}else c?.remove();let d=Number(this.#T),f=new Map([...l.querySelectorAll("td[data-field]")].map(p=>[p.dataset.field,p]));for(let[p,m]of t.entries()){let g=f.get(m.field);if(!g){g=this.ownerDocument.createElement("td"),g.setAttribute("part","cell"),g.dataset.field=m.field,g.setAttribute("role","cell");let w=this.ownerDocument.createElement("div");w.className="cell-content",w.setAttribute("part","cell-content"),g.append(w)}m.edit?g.tabIndex=0:g.removeAttribute("tabindex"),g.classList.toggle("filtered-numbering",u&&this.#r.viewFields.has(m.field));let _=g.firstElementChild,v=m.max_height!=null;v?g.style.setProperty("--grid-cell-max-height",m.max_height):g.style.removeProperty("--grid-cell-max-height"),_.classList.toggle("cell-scroll",v),v?_.tabIndex=0:_.removeAttribute("tabindex"),g.style.textAlign=m.align,g.style.whiteSpace=m.white_space??"",g.style.overflowWrap=m.white_space==="pre-wrap"||m.white_space==="normal"?"anywhere":"",g.setAttribute("aria-colindex",String(p+1+d)),g.classList.toggle("numeric",["L","R","N"].includes(m.dtype)),l.cells[p+d]!==g&&l.insertBefore(g,l.cells[p+d]??null),f.delete(m.field)}for(let p of f.values())p.remove();l.setAttribute("aria-rowindex",String(this.#F+n+i.size+1)),this.#fe(l,a,o),this.#n.decorate(l,o);let h=s?s.nextSibling:this.#w.firstChild;h!==l&&this.#w.insertBefore(l,h),this.#I.project(l,o),s=l,i.add(o)}for(let[o,a]of this.#p)i.has(o)||(a.remove(),this.#p.delete(o));if(!e.length&&this.#m.count===0&&!this.parameters.loading){let o=this.ownerDocument.createElement("tr"),a=this.ownerDocument.createElement("td");o.setAttribute("role","row"),o.setAttribute("aria-rowindex",String(this.#F+1)),a.setAttribute("role","cell"),a.setAttribute("aria-colspan",String(t.length+Number(this.#T))),a.className="empty",a.colSpan=t.length+Number(this.#T),a.textContent="No rows",o.append(a),this.#w.append(o)}}#fe(e,t,n){let i=Number(this.#T);t.forEach((s,o)=>{let a=e.cells[o+i].firstElementChild,l=this.#h.columns[o];if(a.parentElement.classList.toggle("check-cell",!!l.check),l.check){this.#t.project(a,n,l);return}if(l.edit?.tag==="colorpicker"){let c=a.querySelector(".cell-color-swatch");c||(c=this.ownerDocument.createElement("span"),c.className="cell-color-swatch",c.setAttribute("role","img"),a.replaceChildren(c)),c.hidden=s==="",c.style.backgroundColor=s,c.title=s,c.setAttribute("aria-label",s)}else(a.firstElementChild||a.textContent!==s)&&(a.textContent=s)})}}}),xs=class extends _e.ComponentCollection{toDocument(){let e=super.toDocument(),t=e.elements.grid.attributes.parameters;for(let n of["storepath","rowMode"]){let i=t.find(s=>s.name===n);i.has_default=!1,delete i.default,n==="rowMode"&&(i.annotation={kind:"annotated",base:{kind:"dtype",dtype:"T"},metadata:[{kind:"regex",pattern:"^(values|attributes)$",flags:0}]})}return Object.assign(e.elements,structuredClone(Dl.elements)),e.elements.grid._meta.parameterPattern="^selected_[A-Za-z_][A-Za-z0-9_]*$",e}},Rw=new xs({name:"grid",components:[Sh,Al],dependencies:[Nh],registerCommands:gl,assets:{writeExcelFileLicense:Et["assets/files/8cf9b31947daf7adb4a7a00a037459e58241af050cd0a603bfcf1756e533f75e-write-excel-file.txt"],fflateLicense:Et["assets/files/0a1df3a083d0c010560aa342e87959c8c1070e6fd54545741f083f22d0c8b551-fflate.txt"]}});export{Sh as Grid,Rw as default};
|