@gramlot/gramlot 0.3.26 → 0.3.30
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/assets/icons/chart.svg +1 -0
- package/dist/components/audio/__init__.py +13 -0
- package/dist/components/audio/assets/collection.js +3 -0
- package/dist/components/audio/assets/index.js +3 -0
- package/dist/components/audio/commands.json +7 -0
- package/dist/components/audio/grammar.json +335 -0
- package/dist/components/charts/__init__.py +13 -0
- package/dist/components/charts/assets/collection.js +47 -0
- package/dist/components/charts/assets/files/55ea01207028f76d844678511f29fc800f8a1e67a8a0fe80470128677847ad32-echarts-gl.txt +29 -0
- package/dist/components/charts/assets/files/63727832aaf62004a2b249c933e327f3c90caf49e41a72f4bf436edf632cbda8-vega.txt +27 -0
- package/dist/components/charts/assets/files/8c45d9eaf50c2f72dd9c7ab9ef440788ba58a3538484b5c51c1f17d5128752e7-plotly.txt +21 -0
- package/dist/components/charts/assets/files/8f989229699b4fe2f1a0432d0e9edc338a8a911e250e2d1b01ecd770a5f5b1bd-uplot.txt +21 -0
- package/dist/components/charts/assets/files/c8fa058cba98f7f288b5d8fa4116f441d6dacb25b96da859e518c973fff41d0c-claygl.txt +23 -0
- package/dist/components/charts/assets/index.js +3 -0
- package/dist/components/charts/assets/modules/chunk-2CCTLZE7.js +76 -0
- package/dist/components/charts/assets/modules/chunk-RMRBEYTI.js +1 -0
- package/dist/components/charts/assets/modules/echarts-gl-CXVTZA6G.js +4409 -0
- package/dist/components/charts/assets/modules/plotly.min-4LB7HE7P.js +3596 -0
- package/dist/components/charts/assets/modules/uPlot.esm-5JJNHHRF.js +3 -0
- package/dist/components/charts/assets/modules/uPlot.min-N3E3FA74.js +1 -0
- package/dist/components/charts/assets/modules/vega.module-2QCOVQ3A.js +13 -0
- package/dist/components/charts/commands.json +7 -0
- package/dist/components/charts/grammar.json +1113 -0
- package/dist/components/chat/__init__.py +1 -1
- package/dist/components/chat/assets/collection.js +3 -3
- package/dist/components/chat/assets/index.js +1 -1
- package/dist/components/drawing/__init__.py +15 -0
- package/dist/components/drawing/assets/collection.js +28 -0
- package/dist/components/drawing/assets/index.js +3 -0
- package/dist/components/drawing/commands.json +7 -0
- package/dist/components/drawing/grammar.json +110 -0
- package/dist/components/editors/__init__.py +2 -2
- package/dist/components/editors/assets/collection.js +18 -18
- package/dist/components/editors/assets/index.js +1 -1
- package/dist/components/editors/assets/modules/{prose-mirror-engine-GMZPJPNN.js → prose-mirror-engine-DQEAEIMV.js} +2 -2
- package/dist/components/editors/grammar.json +150 -0
- package/dist/components/grid/__init__.py +1 -1
- package/dist/components/grid/assets/collection.js +63 -33
- package/dist/components/grid/assets/index.js +1 -1
- package/dist/components/grid/grammar.json +279 -0
- package/dist/components/grouplets/__init__.py +1 -1
- package/dist/components/grouplets/assets/collection.js +3 -3
- package/dist/components/grouplets/assets/index.js +1 -1
- package/dist/components/inputs/__init__.py +3 -2
- package/dist/components/inputs/assets/collection.js +38 -23
- package/dist/components/inputs/assets/index.js +1 -1
- package/dist/components/inputs/grammar.json +1533 -321
- package/dist/components/layout/__init__.py +1 -1
- package/dist/components/layout/assets/collection.js +27 -23
- package/dist/components/layout/assets/index.js +1 -1
- package/dist/components/layout/grammar.json +85 -0
- package/dist/components/selection_trial/__init__.py +1 -1
- package/dist/components/selection_trial/assets/collection.js +3 -3
- package/dist/components/selection_trial/assets/index.js +1 -1
- package/dist/components/tree/__init__.py +1 -1
- package/dist/components/tree/assets/collection.js +12 -12
- package/dist/components/tree/assets/index.js +1 -1
- package/dist/components/tree/grammar.json +126 -0
- package/dist/components/typst/__init__.py +1 -1
- package/dist/components/typst/assets/collection.js +3 -3
- package/dist/components/typst/assets/index.js +1 -1
- package/dist/components/uploads/__init__.py +1 -1
- package/dist/components/uploads/assets/collection.js +9 -9
- package/dist/components/uploads/assets/index.js +1 -1
- package/dist/components/vizabi/__init__.py +13 -0
- package/dist/components/vizabi/assets/collection.js +22 -0
- package/dist/components/vizabi/assets/index.js +3 -0
- package/dist/components/vizabi/commands.json +7 -0
- package/dist/components/vizabi/grammar.json +128 -0
- package/dist/gramlot.js +1190 -256
- package/dist/gramlot.min.js +85 -52
- package/dist/standard-collections.js +2 -0
- package/package.json +12 -4
- package/src/binding/grid-struct.js +2 -2
- package/src/binding/runtime.js +10 -0
- package/src/binding/validation-context.js +2 -1
- package/src/bootstrap.js +1 -1
- package/src/builder/gramlot-builder.d.ts +15 -2
- package/src/builder/gramlot-builder.js +22 -3
- package/src/builder/source.js +24 -1
- package/src/components/audio-analysis-session.js +65 -0
- package/src/components/audio.js +44 -0
- package/src/components/bases.js +11 -7
- package/src/components/border-container.js +6 -3
- package/src/components/buttons.js +47 -3
- package/src/components/chart-bar3d-options.js +30 -0
- package/src/components/chart-controls.js +83 -0
- package/src/components/chart-data-view.js +52 -0
- package/src/components/chart-data.js +42 -0
- package/src/components/chart-domains.js +46 -0
- package/src/components/chart-engines/echarts-options.js +50 -0
- package/src/components/chart-engines/echarts.js +82 -0
- package/src/components/chart-engines/index.js +22 -0
- package/src/components/chart-engines/plotly-map.js +34 -0
- package/src/components/chart-engines/plotly-spatial.js +35 -0
- package/src/components/chart-engines/plotly.js +138 -0
- package/src/components/chart-engines/uplot.js +57 -0
- package/src/components/chart-engines/vega.js +101 -0
- package/src/components/chart-fields.js +110 -0
- package/src/components/chart-geographic-options.js +47 -0
- package/src/components/chart-geojson.js +60 -0
- package/src/components/chart-geometry.js +11 -0
- package/src/components/chart-map-anchors.js +24 -0
- package/src/components/chart-map-bar3d-options.js +41 -0
- package/src/components/chart-map-data.js +25 -0
- package/src/components/chart-map-labels.js +8 -0
- package/src/components/chart-map-options.js +20 -0
- package/src/components/chart-pane.js +91 -0
- package/src/components/chart-renderer.js +58 -0
- package/src/components/chart-sample-view.js +32 -0
- package/src/components/chart-spatial-options.js +40 -0
- package/src/components/chart-time.js +84 -0
- package/src/components/chart-timeline.js +70 -0
- package/src/components/chart-types/area.js +2 -0
- package/src/components/chart-types/bar.js +2 -0
- package/src/components/chart-types/bar3D.js +2 -0
- package/src/components/chart-types/donut.js +2 -0
- package/src/components/chart-types/horizontalBar.js +2 -0
- package/src/components/chart-types/index.js +26 -0
- package/src/components/chart-types/line.js +2 -0
- package/src/components/chart-types/line3D.js +2 -0
- package/src/components/chart-types/lines3D.js +2 -0
- package/src/components/chart-types/map.js +2 -0
- package/src/components/chart-types/map3D.js +2 -0
- package/src/components/chart-types/mapBar3D.js +2 -0
- package/src/components/chart-types/pie.js +2 -0
- package/src/components/chart-types/polygons3D.js +2 -0
- package/src/components/chart-types/scatter.js +2 -0
- package/src/components/chart-types/scatter3D.js +2 -0
- package/src/components/chart-types/stackedArea.js +2 -0
- package/src/components/chart-types/stackedBar.js +2 -0
- package/src/components/chart-types/surface.js +2 -0
- package/src/components/charts.js +152 -0
- package/src/components/check-box-text-editor.js +88 -0
- package/src/components/check-box-text.js +193 -0
- package/src/components/check-box-tree.js +62 -0
- package/src/components/choice-editor.js +35 -18
- package/src/components/choice-field-styles.js +14 -0
- package/src/components/choices.js +5 -0
- package/src/components/database-choices.js +9 -6
- package/src/components/drawing.js +199 -0
- package/src/components/field-state.js +8 -1
- package/src/components/grid-cell-editor.js +83 -19
- package/src/components/grid-check-sets.js +98 -0
- package/src/components/grid-column-filters.js +198 -0
- package/src/components/grid-grammar.json +65 -0
- package/src/components/grid-header-interaction.js +3 -1
- package/src/components/grid-rows.js +2 -2
- package/src/components/grid-search-box.js +38 -22
- package/src/components/grid-search-styles.js +13 -14
- package/src/components/grid-search.js +8 -1
- package/src/components/grid-structure.js +13 -2
- package/src/components/grid-styles.js +34 -2
- package/src/components/grid.js +67 -10
- package/src/components/image-uploader.js +2 -2
- package/src/components/inputs.js +21 -12
- package/src/components/labelbox.js +5 -1
- package/src/components/licenses/claygl.txt +23 -0
- package/src/components/licenses/echarts-gl.txt +29 -0
- package/src/components/licenses/plotly.txt +21 -0
- package/src/components/licenses/uplot.txt +21 -0
- package/src/components/licenses/vega.txt +27 -0
- package/src/components/menus.js +19 -11
- package/src/components/parameters.js +6 -2
- package/src/components/toolbar-overflow.js +12 -8
- package/src/components/tree.js +31 -8
- package/src/components/typed-editor.js +18 -7
- package/src/components/validation.js +1 -1
- package/src/components/vizabi-session.js +66 -0
- package/src/components/vizabi.js +66 -0
- package/src/components/window-surface.js +20 -9
- package/src/components/windows.js +1 -1
- package/src/editing-session.d.ts +1 -0
- package/src/editing-session.js +113 -15
- package/src/editor-values.js +57 -0
- package/src/gramlot.d.ts +2 -0
- package/src/gramlot.js +9 -4
- package/src/handlers/device-handler.js +32 -32
- package/src/handlers/source-handler.d.ts +2 -2
- package/src/ide-documents.js +19 -3
- package/src/ide-runtime.d.ts +1 -0
- package/src/ide-runtime.js +45 -31
- package/src/index.d.ts +2 -1
- package/src/renderer/drag-drop.js +1 -0
- package/src/renderer/gramlot-renderer.d.ts +3 -0
- package/src/renderer/gramlot-renderer.js +16 -4
- package/src/server/assets.d.ts +3 -0
- package/src/server/assets.js +9 -0
- package/src/server/gramlot-server.d.ts +1 -1
- package/src/server/gramlot-server.js +2 -1
- package/src/server/index.d.ts +1 -1
- package/src/server/index.js +1 -1
- package/src/server/source-import.d.ts +1 -1
- package/src/server/source-import.js +5 -1
- package/src/server/visual-editor.d.ts +1 -1
- package/src/server/visual-editor.js +44 -34
- package/src/source-picker.d.ts +1 -1
- package/src/source-picker.js +1 -2
- package/src/stores/bag-collection-view.js +79 -17
- package/src/stores/collection-filter.js +2 -1
- package/src/stores/column-filter.js +49 -0
- package/src/stores/id-set.js +10 -0
- package/src/view/controls.js +8 -0
- package/src/view/html.js +10 -1
- package/src/view/label-menu.js +61 -0
- package/src/view/labelbox.js +15 -2
- package/src/visual-editor-canvas.js +29 -0
- package/src/visual-editor-catalogue.js +34 -0
- package/src/visual-editor.d.ts +5 -0
- package/src/visual-editor.js +244 -26
- package/themes/gramlot-base/theme.css +84 -36
- package/tools/gramlot-tools-inspector.js +170 -506
- package/tools/inspector-agent.js +1 -1
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
var Rl=Object.create;var ui=Object.defineProperty;var Ll=Object.getOwnPropertyDescriptor;var Pl=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,Ul=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ia=(t,e)=>{for(var r in e)ui(t,r,{get:e[r],enumerable:!0})},li=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pl(e))!Ul.call(t,i)&&i!==r&&ui(t,i,{get:()=>e[i],enumerable:!(n=Ll(e,i))||n.enumerable});return t},nn=(t,e,r)=>(li(t,e,"default"),r&&li(r,e,"default")),Ma=(t,e,r)=>(r=t!=null?Rl($l(t)):{},li(e||!t||!t.__esModule?ui(r,"default",{value:t,enumerable:!0}):r,t));var _t=Je(le=>{"use strict";function uc(t,e,r){if(r===void 0&&(r=Array.prototype),t&&typeof r.find=="function")return r.find.call(t,e);for(var n=0;n<t.length;n++)if(bt(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function Lt(t,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&typeof e.freeze=="function"?e.freeze(t):t}function bt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function cc(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)bt(e,r)&&(t[r]=e[r]);return t}var ms=Lt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function dc(t){return bt(ms,t.toLowerCase())}var gs=Lt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fc(t){return bt(gs,t.toLowerCase())}var hr=Lt({script:!1,style:!1,textarea:!0,title:!0});function pc(t){var e=t.toLowerCase();return bt(hr,e)&&!hr[e]}function hc(t){var e=t.toLowerCase();return bt(hr,e)&&hr[e]}function bs(t){return t===mr.HTML}function mc(t){return bs(t)||t===mr.XML_XHTML_APPLICATION}var mr=Lt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),gc=Object.keys(mr).map(function(t){return mr[t]});function bc(t){return gc.indexOf(t)>-1}var _c=Lt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});le.assign=cc;le.find=uc;le.freeze=Lt;le.HTML_BOOLEAN_ATTRIBUTES=ms;le.HTML_RAW_TEXT_ELEMENTS=hr;le.HTML_VOID_ELEMENTS=gs;le.hasDefaultHTMLNamespace=mc;le.hasOwn=bt;le.isHTMLBooleanAttribute=dc;le.isHTMLRawTextElement=pc;le.isHTMLEscapableRawTextElement=hc;le.isHTMLMimeType=bs;le.isHTMLVoidElement=fc;le.isValidMimeType=bc;le.MIME_TYPE=mr;le.NAMESPACE=_c});var yr=Je(wr=>{"use strict";var wc=_t();function ws(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var br=wc.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),ys=Object.keys(br);function vs(t){return typeof t=="number"&&t>=1&&t<=25}function yc(t){return typeof t=="string"&&t.substring(t.length-br.Error.length)===br.Error}function _r(t,e){vs(t)?(this.name=ys[t],this.message=e||""):(this.message=t,this.name=yc(e)?e:br.Error),Error.captureStackTrace&&Error.captureStackTrace(this,_r)}ws(_r,!0);Object.defineProperties(_r.prototype,{code:{enumerable:!0,get:function(){var t=ys.indexOf(this.name);return vs(t)?t:0}}});var ks={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},Si=Object.entries(ks);for(gr=0;gr<Si.length;gr++)_s=Si[gr][0],_r[_s]=Si[gr][1];var _s,gr;function Oi(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,Oi)}ws(Oi);wr.DOMException=_r;wr.DOMExceptionName=br;wr.ExceptionCode=ks;wr.ParseError=Oi});var $i=Je(C=>{"use strict";function Cs(t){try{typeof t!="function"&&(t=RegExp);var e=new t("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var Ut=Cs();function it(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function Pt(t,e){if(t.source[0]!=="[")throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(t.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+t.source+"/");if(e==="-"&&t.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),Ut?"u":"")}function O(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&e===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),Ut?"u":"")}function A(t){if(arguments.length===0)throw new Error("no parameters provided");return O.apply(A,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var vc="\uFFFD",at=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Ut&&(at=O("[",it(at),"\\u{10000}-\\u{10FFFF}","]"));var kc=new RegExp("[^"+it(at)+"]",Ut?"u":""),vn=/[\x20\x09\x0D\x0A]/,Ec=it(vn),U=O(vn,"+"),j=O(vn,"*"),vr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Ut&&(vr=O("[",it(vr),"\\u{10000}-\\u{10FFFF}","]"));var xc=it(vr),Mi=O("[",xc,it(/[-.0-9\xB7]/),it(/[\u0300-\u036F\u203F-\u2040]/),"]"),ye=O(vr,Mi,"*"),Dc=O("^",ye,"$"),Es=O(Mi,"+"),Ac=O("&",ye,";"),Tc=A(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),kr=A(Ac,"|",Tc),Er=O("%",ye,";"),Ri=A(O('"',A(/[^%&"]/,"|",Er,"|",kr),"*",'"'),"|",O("'",A(/[^%&']/,"|",Er,"|",kr),"*","'")),Cc=A('"',A(/[^<&"]/,"|",kr),"*",'"',"|","'",A(/[^<&']/,"|",kr),"*","'"),Nc=Pt(vr,":"),Sc=Pt(Mi,":"),Bi=O(Nc,Sc,"*"),Oc=O("^",Bi,"$"),xr=O(Bi,A(":",Bi),"?"),Bc=O("^",xr,"$"),Ic=O("(",xr,")"),$t=A(/"[^"]*"|'[^']*'/),Mc=O(/^<\?/,"(",ye,")",A(U,"(?!",vn,")(",at,"*?)"),"?",/\?>/),xs=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Dr=A('"',xs,'*"',"|","'",Pt(xs,"'"),"*'"),Ns="<!--",Ss="-->",Rc=O(Ns,A(Pt(at,"-"),"|",O("-",Pt(at,"-"))),"*",Ss),Ds="#PCDATA",Lc=A(O(/\(/,j,Ds,A(j,/\|/,j,xr),"*",j,/\)\*/),"|",O(/\(/,j,Ds,j,/\)/)),Pc=/[?*+]?/,$c=O(/\([^>]+\)/,Pc),Uc=A("EMPTY","|","ANY","|",Lc,"|",$c),Fc="<!ELEMENT",qc=O(Fc,U,A(xr,"|",Er),U,A(Uc,"|",Er),j,">"),jc=O("NOTATION",U,/\(/,j,ye,A(j,/\|/,j,ye),"*",j,/\)/),Vc=O(/\(/,j,Es,A(j,/\|/,j,Es),"*",j,/\)/),zc=A(jc,"|",Vc),Hc=A(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",zc),Wc=A(/#REQUIRED|#IMPLIED/,"|",A(A("#FIXED",U),"?",Cc)),Gc=A(U,ye,U,Hc,U,Wc),Yc="<!ATTLIST",Xc=O(Yc,U,ye,Gc,"*",j,">"),Ii="about:legacy-compat",Zc=A('"'+Ii+'"',"|","'"+Ii+"'"),Li="SYSTEM",kn="PUBLIC",En=A(A(Li,U,$t),"|",A(kn,U,Dr,U,$t)),Jc=O("^",A(A(Li,U,"(?<SystemLiteralOnly>",$t,")"),"|",A(kn,U,"(?<PubidLiteral>",Dr,")",U,"(?<SystemLiteral>",$t,")"))),Kc=O("^",Dr,"$"),Qc=O("^",$t,"$"),ed=A(U,"NDATA",U,ye),td=A(Ri,"|",A(En,ed,"?")),Os="<!ENTITY",rd=O(Os,U,ye,U,td,j,">"),nd=A(Ri,"|",En),id=O(Os,U,"%",U,ye,U,nd,j,">"),ad=A(rd,"|",id),sd=O(kn,U,Dr),od=O("<!NOTATION",U,ye,U,A(En,"|",sd),j,">"),Pi=O(j,"=",j),As=/1[.]\d+/,ld=O(U,"version",Pi,A("'",As,"'","|",'"',As,'"')),Ts=/[A-Za-z][-A-Za-z0-9._]*/,ud=A(U,"encoding",Pi,A('"',Ts,'"',"|","'",Ts,"'")),cd=A(U,"standalone",Pi,A("'",A("yes","|","no"),"'","|",'"',A("yes","|","no"),'"')),dd=O(/^<\?xml/,ld,ud,"?",cd,"?",j,/\?>/),fd="<!DOCTYPE",pd="<![CDATA[",hd="]]>",md=/<!\[CDATA\[/,gd=/\]\]>/,bd=O(at,"*?",gd),_d=O(md,bd);C.chars=it;C.chars_without=Pt;C.detectUnicodeSupport=Cs;C.reg=O;C.regg=A;C.ABOUT_LEGACY_COMPAT=Ii;C.ABOUT_LEGACY_COMPAT_SystemLiteral=Zc;C.AttlistDecl=Xc;C.CDATA_START=pd;C.CDATA_END=hd;C.CDSect=_d;C.Char=at;C.Comment=Rc;C.COMMENT_START=Ns;C.COMMENT_END=Ss;C.DOCTYPE_DECL_START=fd;C.elementdecl=qc;C.EntityDecl=ad;C.EntityValue=Ri;C.ExternalID=En;C.ExternalID_match=Jc;C.Name=ye;C.Name_exact=Dc;C.NCName_exact=Oc;C.NotationDecl=od;C.Reference=kr;C.PEReference=Er;C.PI=Mc;C.PUBLIC=kn;C.PubidLiteral=Dr;C.PubidLiteral_match=Kc;C.QName=xr;C.QName_exact=Bc;C.QName_group=Ic;C.S=U;C.SChar_s=Ec;C.S_OPT=j;C.SYSTEM=Li;C.SystemLiteral=$t;C.SystemLiteral_match=Qc;C.InvalidChar=kc;C.UNICODE_REPLACEMENT_CHARACTER=vc;C.UNICODE_SUPPORT=Ut;C.XMLDecl=dd});var Yi=Je(H=>{"use strict";var Ae=_t(),Le=Ae.find,wd=Ae.hasDefaultHTMLNamespace,qt=Ae.hasOwn,yd=Ae.isHTMLMimeType,vd=Ae.isHTMLRawTextElement,kd=Ae.isHTMLVoidElement,Ar=Ae.MIME_TYPE,Pe=Ae.NAMESPACE,me=Symbol(),$s=yr(),y=$s.DOMException,fe=$s.DOMExceptionName,z=$i();function be(t){if(t!==me)throw new TypeError("Illegal constructor")}function Ed(t){return t!==""}function xd(t){return t?t.split(/[\t\n\f\r ]+/).filter(Ed):[]}function Dd(t,e){return qt(t,e)||(t[e]=!0),t}function Bs(t){if(!t)return[];var e=xd(t);return Object.keys(e.reduce(Dd,{}))}function Ad(t){return function(e){return t&&t.indexOf(e)!==-1}}function Us(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function Fi(t,e){Us(e),t=t||null;var r=null,n=e;if(e.indexOf(":")>=0){var i=e.split(":");r=i[0],n=i[1]}if(r!==null&&t===null)throw new y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==Ae.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==Ae.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===Ae.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function zt(t,e){for(var r in t)qt(t,r)&&(e[r]=t[r])}function _e(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,zt(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var we={},De=we.ELEMENT_NODE=1,jt=we.ATTRIBUTE_NODE=2,Tr=we.TEXT_NODE=3,Fs=we.CDATA_SECTION_NODE=4,qs=we.ENTITY_REFERENCE_NODE=5,Td=we.ENTITY_NODE=6,qi=we.PROCESSING_INSTRUCTION_NODE=7,ji=we.COMMENT_NODE=8,Ft=we.DOCUMENT_NODE=9,js=we.DOCUMENT_TYPE_NODE=10,st=we.DOCUMENT_FRAGMENT_NODE=11,Cd=we.NOTATION_NODE=12,V=Ae.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Vs(t,e){if(e.length<t.length)return Vs(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function Is(t){return t.guid||(t.guid=Math.random()),t.guid}function ee(){}ee.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)Gi(this[n],r,null,e);return r.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};ee.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Re(t,e){this._node=t,this._refresh=e,Tn(this)}function Tn(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(eo(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)qt(t,n)&&delete t[n];zt(r,t),t._inc=e}}Re.prototype.item=function(t){return Tn(this),this[t]||null};_e(Re,ee);function Vt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function zs(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function Vi(t,e,r){if(!e)return t._noNsIndex;var n=t._nsIndex[e];return!n&&r&&(n=t._nsIndex[e]=Object.create(null)),n}function Nd(t,e,r){var n=Vi(t,e,!1),i=n&&n[r];return i||null}function Sd(t,e){Vi(t,e.namespaceURI,!0)[e.localName]=e}function Od(t,e){var r=Vi(t,e.namespaceURI,!1);r&&delete r[e.localName]}function Bd(t,e,r,n){if(n?e[zs(e,n)]=r:(e[e.length]=r,e.length++),Sd(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&Gs(i,t,n),Id(i,t,r))}}function Ms(t,e,r){var n=zs(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,Od(e,r),t){var a=t.ownerDocument;a&&Gs(a,t,r),r.ownerElement=null}}}Vt.prototype={length:0,item:ee.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var r=this[e];if(r.nodeName===t)return r;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new y(y.INUSE_ATTRIBUTE_ERR);var r=Nd(this,t.namespaceURI,t.localName);return r===t?t:(Bd(this._ownerElement,this,t,r),r)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new y(y.NOT_FOUND_ERR,t);return Ms(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new y(y.NOT_FOUND_ERR,t?t+" : "+e:e);return Ms(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){t||(t=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===e&&n.namespaceURI===t)return n;r++}return null}};Vt.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Hs(){}Hs.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=Ar.XML_APPLICATION;t===Pe.HTML?n=Ar.XML_XHTML_APPLICATION:t===Pe.SVG&&(n=Ar.XML_SVG_IMAGE);var i=new He(me,{contentType:n});if(i.implementation=this,i.childNodes=new ee,i.doctype=r||null,r&&i.appendChild(r),e){var a=i.createElementNS(t,e);i.appendChild(a)}return i},createDocumentType:function(t,e,r,n){Us(t);var i=new Sn(me);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new ee,i},createHTMLDocument:function(t){var e=new He(me,{contentType:Ar.HTML});if(e.implementation=this,e.childNodes=new ee,t!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var r=e.createElement("html");e.appendChild(r);var n=e.createElement("head");if(r.appendChild(n),typeof t=="string"){var i=e.createElement("title");i.appendChild(e.createTextNode(t)),n.appendChild(i)}r.appendChild(e.createElement("body"))}return e}};function I(t){be(t)}I.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;for(var e=[{node:this,other:t}];e.length>0;){var r=e.pop(),n=r.node,i=r.other;if(n.nodeType!==i.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==i.name||n.publicId!==i.publicId||n.systemId!==i.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==i.namespaceURI||n.prefix!==i.prefix||n.localName!==i.localName||n.attributes.length!==i.attributes.length)return!1;for(var a=0;a<n.attributes.length;a++){var s=n.attributes.item(a),o=i.getAttributeNodeNS(s.namespaceURI,s.localName);if(!o)return!1;e.push({node:s,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==i.namespaceURI||n.localName!==i.localName||n.value!==i.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==i.target||n.data!==i.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==i.data)return!1;break}if(n.childNodes.length!==i.childNodes.length)return!1;for(var a=n.childNodes.length-1;a>=0;a--)e.push({node:n.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return An(this,t,e)},replaceChild:function(t,e){An(this,t,e,Zs),e&&this.removeChild(e)},removeChild:function(t){return Ys(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return Qs(this.ownerDocument||this,this,t)},normalize:function(){ue(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===Tr&&e.nodeType===Tr){for(var n=[],i=r;i!==null&&i.nodeType===Tr;)n.push(i.data),i=i.nextSibling;for(var a=e.nextSibling;a!==i;){var s=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=s}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),zi(t.ownerDocument,t),e=i}else e=r}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r){for(var n in r)if(qt(r,n)&&r[n]===t)return n}e=e.nodeType==jt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&qt(r,t))return r[t];e=e.nodeType==jt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,r=this,n=null,i=null;if(e instanceof wt&&(n=e,e=n.ownerElement),r instanceof wt&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var a=0,s;s=r.attributes[a];a++){if(s===n)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_PRECEDING;if(s===i)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return V.DOCUMENT_POSITION_DISCONNECTED+V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Is(r.ownerDocument)>Is(e.ownerDocument)?V.DOCUMENT_POSITION_FOLLOWING:V.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!i&&l===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],c=r.parentNode;c;){if(!n&&c===e)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;u.push(c),c=c.parentNode}u.reverse();var d=Vs(o,u);for(var f in d.childNodes){var p=d.childNodes[f];if(p===r)return V.DOCUMENT_POSITION_FOLLOWING;if(p===e)return V.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return V.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return V.DOCUMENT_POSITION_PRECEDING}return 0}};function Ws(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}zt(we,I);zt(we,I.prototype);zt(V,I);zt(V,I.prototype);function Dn(t,e){ue(t,null,{enter:function(r){return e(r)?ue.STOP:!0}})}function ue(t,e,r){for(var n=[{node:t,context:e,phase:ue.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ue.ENTER){var a=r.enter(i.node,i.context);if(a===ue.STOP)return ue.STOP;if(n.push({node:i.node,context:a,phase:ue.EXIT}),a==null)continue;for(var s=i.node.lastChild;s;)n.push({node:s,context:a,phase:ue.ENTER}),s=s.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ue.STOP=Symbol("walkDOM.STOP");ue.ENTER=0;ue.EXIT=1;function He(t,e){be(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||Ar.XML_APPLICATION,this.type=yd(this.contentType)?"html":"xml"}function Id(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===Pe.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function Gs(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===Pe.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function zi(t,e,r){if(t&&t._inc){t._inc++;var n=e.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var i=e.firstChild,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function Ys(t,e){if(t!==e.parentNode)throw new y(y.NOT_FOUND_ERR,"child's parent is not parent");var r=e.previousSibling,n=e.nextSibling;return r?r.nextSibling=n:t.firstChild=n,n?n.previousSibling=r:t.lastChild=r,zi(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function Md(t){return t&&(t.nodeType===I.DOCUMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.ELEMENT_NODE)}function Rd(t){return t&&(t.nodeType===I.CDATA_SECTION_NODE||t.nodeType===I.COMMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.DOCUMENT_TYPE_NODE||t.nodeType===I.ELEMENT_NODE||t.nodeType===I.PROCESSING_INSTRUCTION_NODE||t.nodeType===I.TEXT_NODE)}function ot(t){return t&&t.nodeType===I.DOCUMENT_TYPE_NODE}function ze(t){return t&&t.nodeType===I.ELEMENT_NODE}function Xs(t){return t&&t.nodeType===I.TEXT_NODE}function Rs(t,e){var r=t.childNodes||[];if(Le(r,ze)||ot(e))return!1;var n=Le(r,ot);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Ls(t,e){var r=t.childNodes||[];function n(a){return ze(a)&&a!==e}if(Le(r,n))return!1;var i=Le(r,ot);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function Ld(t,e,r){if(!Md(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!Rd(e)||ot(e)&&t.nodeType!==I.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Pd(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Rs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Rs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,ot))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Zs(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,function(l){return ot(l)&&l!==r}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function An(t,e,r,n){Ld(t,e,r),t.nodeType===I.DOCUMENT_NODE&&(n||Pd)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===st){var a=e.firstChild;if(a==null)return e;var s=e.lastChild}else a=s=e;var o=r?r.previousSibling:t.lastChild;a.previousSibling=o,s.nextSibling=r,o?o.nextSibling=a:t.firstChild=a,r==null?t.lastChild=s:r.previousSibling=s;do a.parentNode=t;while(a!==s&&(a=a.nextSibling));return zi(t.ownerDocument||t,t,e),e.nodeType==st&&(e.firstChild=e.lastChild=null),e}He.prototype={implementation:null,nodeName:"#document",nodeType:Ft,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===st){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return An(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===De&&(this.documentElement=t),t},removeChild:function(t){var e=Ys(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){An(this,t,e,Zs),t.ownerDocument=this,e&&this.removeChild(e),ze(t)&&(this.documentElement=t)},importNode:function(t,e){return $d(this,t,e)},getElementById:function(t){var e=null;return Dn(this.documentElement,function(r){if(r.nodeType==De&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new We(me);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),wd(this.contentType)&&(e.namespaceURI=Pe.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new ee;var r=e.attributes=new Vt;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new Ht(me);return t.ownerDocument=this,t.childNodes=new ee,t},createTextNode:function(t){var e=new Cr(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createComment:function(t){var e=new Cn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new Nn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new Bn(me);return r.ownerDocument=this,r.childNodes=new ee,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new wt(me);return e.ownerDocument=this,e.childNodes=new ee,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!z.Name_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new y("document is an html document",fe.NotSupportedError);var e=new On(me);return e.ownerDocument=this,e.childNodes=new ee,e.nodeName=t,e},createElementNS:function(t,e){var r=Fi(t,e),n=new We(me),i=n.attributes=new Vt;return n.childNodes=new ee,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],i._ownerElement=n,n},createAttributeNS:function(t,e){var r=Fi(t,e),n=new wt(me);return n.ownerDocument=this,n.childNodes=new ee,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};_e(He,I);function We(t){be(t),this._nsMap=Object.create(null)}We.prototype={nodeType:De,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Pe.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var r=this.getAttributeNode(t);r?r.value=r.nodeValue=""+e:(r=this.ownerDocument._createAttribute(t),r.value=r.nodeValue=""+e,this.setAttributeNode(r))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r?r.value:null},setAttributeNS:function(t,e,r){var n=Fi(t,e),i=n[2],a=this.getAttributeNodeNS(t,i);a?a.value=a.nodeValue=""+r:(a=this.ownerDocument.createAttributeNS(t,e),a.value=a.nodeValue=""+r,this.setAttributeNode(a))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=Bs(t);return new Re(this,function(r){var n=[];return e.length>0&&Dn(r,function(i){if(i!==r&&i.nodeType===De){var a=i.getAttribute("class");if(a){var s=t===a;if(!s){var o=Bs(a);s=e.every(Ad(o))}s&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===Ft?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Re(this,function(n){var i=[];return Dn(n,function(a){if(!(a===n||a.nodeType!==De))if(t==="*")i.push(a);else{var s=a.getQualifiedName(),o=e&&a.namespaceURI===Pe.HTML?r:t;s===o&&i.push(a)}}),i})},getElementsByTagNameNS:function(t,e){return new Re(this,function(r){var n=[];return Dn(r,function(i){i!==r&&i.nodeType===De&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};He.prototype.getElementsByClassName=We.prototype.getElementsByClassName;He.prototype.getElementsByTagName=We.prototype.getElementsByTagName;He.prototype.getElementsByTagNameNS=We.prototype.getElementsByTagNameNS;_e(We,I);function wt(t){be(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}wt.prototype.nodeType=jt;_e(wt,I);function lt(t){be(t)}lt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){var n=this.data.substring(0,t),i=this.data.substring(t+e);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};_e(lt,I);function Cr(t){be(t)}Cr.prototype={nodeName:"#text",nodeType:Tr,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};_e(Cr,lt);function Cn(t){be(t)}Cn.prototype={nodeName:"#comment",nodeType:ji};_e(Cn,lt);function Nn(t){be(t)}Nn.prototype={nodeName:"#cdata-section",nodeType:Fs};_e(Nn,Cr);function Sn(t){be(t)}Sn.prototype.nodeType=js;_e(Sn,I);function Hi(t){be(t)}Hi.prototype.nodeType=Cd;_e(Hi,I);function Wi(t){be(t)}Wi.prototype.nodeType=Td;_e(Wi,I);function On(t){be(t)}On.prototype.nodeType=qs;_e(On,I);function Ht(t){be(t)}Ht.prototype.nodeName="#document-fragment";Ht.prototype.nodeType=st;_e(Ht,I);function Bn(t){be(t)}Bn.prototype.nodeType=qi;_e(Bn,lt);function Js(){}Js.prototype.serializeToString=function(t,e){return Ks.call(t,e)};I.prototype.toString=Ks;function Ks(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t!=null?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var r=[],n=this.nodeType===Ft&&this.documentElement||this,i=n.prefix,a=n.namespaceURI;if(a&&i==null){var i=n.lookupPrefix(a);if(i==null)var s=[{namespace:a,prefix:null}]}return Gi(this,r,s,e),r.join("")}function Ps(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===Pe.XML||i===Pe.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===n)return s.namespace!==i}return!0}function xn(t,e,r,n){if(n&&!z.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',fe.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,Ws),'"')}function Gi(t,e,r,n){r||(r=[]);var i=n.nodeFilter,a=n.requireWellFormed,s=n.splitCDATASections,o=t.nodeType===Ft?t:t.ownerDocument,l=o.type==="html";ue(t,{ns:r},{enter:function(u,c){var d=c.ns;if(i)if(u=i(u),u){if(typeof u=="string")return e.push(u),null}else return null;switch(u.nodeType){case De:var f=u.attributes,p=f.length,h=u.tagName,m=h;if(!l&&!u.prefix&&u.namespaceURI){for(var g,_=0;_<f.length;_++)if(f.item(_).name==="xmlns"){g=f.item(_).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===u.namespaceURI){g=w.namespace;break}}if(g!==u.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===u.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(a&&!z.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',fe.InvalidStateError);e.push("<",m);for(var x=d.slice(),B=0;B<p;B++){var L=f.item(B);L.prefix=="xmlns"?x.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&x.push({prefix:"",namespace:L.value})}for(var B=0;B<p;B++){var L=f.item(B);if(Ps(L,l,x)){var Z=L.prefix||"",ie=L.namespaceURI;xn(e,Z?"xmlns:"+Z:"xmlns",ie,a),x.push({prefix:Z,namespace:ie})}var ae=i?i(L):L;ae&&(typeof ae=="string"?e.push(ae):xn(e,ae.name,ae.value,a))}if(h===m&&Ps(u,l,x)){var je=u.prefix||"",ie=u.namespaceURI;xn(e,je?"xmlns:"+je:"xmlns",ie,a),x.push({prefix:je,namespace:ie})}var K=!u.firstChild;if(K&&(l||u.namespaceURI===Pe.HTML)&&(K=kd(h)),K)return e.push("/>"),null;if(e.push(">"),l&&vd(h)){for(var he=u.firstChild;he;)he.data?e.push(he.data):Gi(he,e,x.slice(),n),he=he.nextSibling;return e.push("</",m,">"),null}return{ns:x,tag:m};case Ft:case st:if(a&&u.nodeType===Ft&&u.documentElement==null)throw new y("The Document has no documentElement",fe.InvalidStateError);return{ns:d};case jt:return xn(e,u.name,u.value,a),null;case Tr:if(a&&z.InvalidChar.test(u.data))throw new y("The Text node data contains characters outside the XML Char production",fe.InvalidStateError);return e.push(u.data.replace(/[<&>]/g,Ws)),null;case Fs:if(a&&u.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',fe.InvalidStateError);return s?e.push(z.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),z.CDATA_END):e.push(z.CDATA_START,u.data,z.CDATA_END),null;case ji:if(a){if(z.InvalidChar.test(u.data))throw new y("The comment node data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',fe.InvalidStateError)}return e.push(z.COMMENT_START,u.data,z.COMMENT_END),null;case js:var Ee=u.publicId,F=u.systemId;if(a){if(!z.Name_exact.test(u.name))throw new y('The doctype name "'+u.name+'" is not a valid XML Name',fe.InvalidStateError);if(Ee&&!z.PubidLiteral_match.test(Ee))throw new y("DocumentType publicId is not a valid PubidLiteral",fe.InvalidStateError);if(F&&F!=="."&&!z.SystemLiteral_match.test(F))throw new y("DocumentType systemId is not a valid SystemLiteral",fe.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',fe.InvalidStateError)}return e.push(z.DOCTYPE_DECL_START," ",u.name),Ee?(e.push(" ",z.PUBLIC," ",Ee),F&&F!=="."&&e.push(" ",F)):F&&F!=="."&&e.push(" ",z.SYSTEM," ",F),u.internalSubset&&e.push(" [",u.internalSubset,"]"),e.push(">"),null;case qi:if(a){if(!z.NCName_exact.test(u.target)||u.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+u.target+'" is not a valid XML NCName or is reserved',fe.InvalidStateError);if(z.InvalidChar.test(u.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',fe.InvalidStateError)}return e.push("<?",u.target," ",u.data,"?>"),null;case qs:if(a&&!z.Name_exact.test(u.nodeName))throw new y('The entity reference name "'+u.nodeName+'" is not a valid XML Name',fe.InvalidStateError);return e.push("&",u.nodeName,";"),null;default:return e.push("??",u.nodeName),null}},exit:function(u,c){c&&c.tag&&e.push("</",c.tag,">")}})}function $d(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=i.cloneNode(!1);s.ownerDocument=t,s.parentNode=null,a===null?n=s:a.appendChild(s);var o=i.nodeType===jt||r;return o?s:null}}),n}function Qs(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=new i.constructor(me);for(var o in i)if(qt(i,o)){var l=i[o];typeof l!="object"&&l!=s[o]&&(s[o]=l)}i.childNodes&&(s.childNodes=new ee),s.ownerDocument=t;var u=r;switch(s.nodeType){case De:var c=i.attributes,d=s.attributes=new Vt,f=c.length;d._ownerElement=s;for(var p=0;p<f;p++)s.setAttributeNode(Qs(t,c.item(p),!0));break;case jt:u=!0}return a!==null?a.appendChild(s):n=s,u?s:null}}),n}function eo(t,e,r){t[e]=r}function Ui(t){for(var e=[],r=t.firstChild;r;)r.nodeType===De&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Re.prototype,"length",{get:function(){return Tn(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){if(this.nodeType===De||this.nodeType===st){var t=[];return ue(this,null,{enter:function(e){if(e.nodeType===De||e.nodeType===st)return!0;if(e.nodeType===qi||e.nodeType===ji)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case De:case st:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Object.defineProperty(lt.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(t){this._data=t,this.length=typeof t=="string"?t.length:0}}),Object.defineProperty(lt.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"children",{get:function(){return new Re(this,Ui)}}),Object.defineProperty(He.prototype,"children",{get:function(){return new Re(this,Ui)}}),Object.defineProperty(Ht.prototype,"children",{get:function(){return new Re(this,Ui)}}),eo=function(t,e,r){t["$$"+e]=r})}catch{}H._updateLiveList=Tn;H.Attr=wt;H.CDATASection=Nn;H.CharacterData=lt;H.Comment=Cn;H.Document=He;H.DocumentFragment=Ht;H.DocumentType=Sn;H.DOMImplementation=Hs;H.Element=We;H.Entity=Wi;H.EntityReference=On;H.LiveNodeList=Re;H.NamedNodeMap=Vt;H.Node=I;H.NodeList=ee;H.Notation=Hi;H.Text=Cr;H.ProcessingInstruction=Bn;H.walkDOM=ue;H.XMLSerializer=Js});var ro=Je(Nr=>{"use strict";var to=_t().freeze;Nr.XML_ENTITIES=to({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Nr.HTML_ENTITIES=to({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Nr.entityMap=Nr.HTML_ENTITIES});var fo=Je(Mn=>{"use strict";var Zt=_t(),N=$i(),so=yr(),Ud=Zt.isHTMLEscapableRawTextElement,Fd=Zt.isHTMLMimeType,qd=Zt.isHTMLRawTextElement,Br=Zt.hasOwn,no=Zt.NAMESPACE,jd=so.ParseError,Vd=so.DOMException,Wt=0,ut=1,Gt=2,Sr=3,Yt=4,Xt=5,Or=6,In=7;function oo(){}oo.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),Gd(e,e=Object.create(null)),zd(t,e,r,n,this.errorHandler),n.endDocument()}};var Xi=/&#?\w+;?/g;function zd(t,e,r,n,i){var a=Fd(n.mimeType);t.indexOf(N.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function s(R){if(R>65535){R-=65536;var xe=55296+(R>>10),tn=56320+(R&1023);return String.fromCharCode(xe,tn)}else return String.fromCharCode(R)}function o(R){var xe=R[R.length-1]===";"?R:R+";";if(!a&&xe!==R)return i.error("EntityRef: expecting ;"),R;var tn=N.Reference.exec(xe);if(!tn||tn[0].length!==xe.length)return i.error("entity not matching Reference production: "+R),R;var rn=xe.slice(1,-1);return Br(r,rn)?r[rn]:rn.charAt(0)==="#"?s(parseInt(rn.substring(1).replace("x","0x"))):(i.error("entity not found:"+R),R)}function l(R){if(R>g){var xe=t.substring(g,R).replace(Xi,o);f&&p(g),n.characters(xe,0,R-g),g=R}}var u=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p(R,xe){for(;R>=c&&(xe=d.exec(t));)u=c,c=xe.index+xe[0].length,f.lineNumber++;f.columnNumber=R-u+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var _=t.indexOf("<",g);if(_<0){if(!a&&m.length>0)return i.fatalError("unclosed xml tag(s): "+m.join(", "));if(!t.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(t.substring(g));if(v.documentElement)return i.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(_>g){var x=t.substring(g,_);!a&&m.length===0&&(x=x.replace(new RegExp(N.S_OPT.source,"g"),""),x&&i.error("Unexpected content outside root element: '"+x+"'")),l(_)}switch(t.charAt(_+1)){case"/":var S=t.indexOf(">",_+2),B=t.substring(_+2,S>0?S:void 0);if(!B)return i.fatalError("end tag name missing");var L=N.reg("^",N.QName_group,N.S_OPT,"$"),Z=S>0&&L.exec(B);if(!Z){var ie=S>0&&N.reg("^",N.QName_group).exec(B);if(a&&ie)i.warning('end tag name contains invalid trailing characters: "'+B+'"'),Z=ie;else if(ie&&new RegExp(L.source,L.flags+"m").test(B))i.error('end tag name is followed by a line break and trailing content: "'+B+'"'),Z=ie;else return i.fatalError('end tag name contains invalid characters: "'+B+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var ae=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(ae!==Z[1]){var je=Z[1].toLowerCase();if(!a||ae.toLowerCase()!==je)return i.fatalError('Opening and ending tag mismatch: "'+ae+'" != "'+B+'"')}var K=h.pop();m.pop();var he=K.localNSMap;if(n.endElement(K.uri,K.localName,ae),he)for(var Ee in he)Br(he,Ee)&&n.endPrefixMapping(Ee);S++;break;case"?":f&&p(_),S=Xd(t,_,n,i);break;case"!":f&&p(_),S=uo(t,_,n,i,a);break;default:f&&p(_);var F=new co,J=h[h.length-1].currentNSMap,S=Hd(t,_,F,J,o,i,a),Oa=F.length;if(F.closed||(a&&Zt.isHTMLVoidElement(F.tagName)?F.closed=!0:m.push(F.tagName)),f&&Oa){for(var Ml=io(f,{}),oi=0;oi<Oa;oi++){var Ba=F[oi];p(Ba.offset),Ba.locator=io(f,{})}n.locator=Ml,ao(F,n,J)&&h.push(F),n.locator=f}else ao(F,n,J)&&h.push(F);a&&!F.closed?S=Wd(t,S,F.tagName,o,n):S++}}catch(R){if(R instanceof jd)throw R;if(R instanceof Vd)return i.fatalError("Error constructing the DOM: "+R.name+": "+R.message,R);i.error("element parse error: "+R),S=-1}S>g?g=S:l(Math.max(_,g)+1)}}function io(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Hd(t,e,r,n,i,a,s){function o(p,h,m){if(Br(r.attributeNames,p))return a.fatalError("Attribute "+p+" redefined");if(!s&&h.indexOf("<")>=0)return a.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,h.replace(/[\t\n\r]/g," ").replace(Xi,i),m)}for(var l,u,c=++e,d=Wt;;){var f=t.charAt(c);if(d===Wt&&f==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(f){case"=":if(d===ut)l=t.slice(e,c),d=Sr;else if(d===Gt)d=Sr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===Sr||d===ut)if(d===ut&&(a.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,c=t.indexOf(f,e),c>0)u=t.slice(e,c),o(l,u,e-1),d=Xt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Yt)u=t.slice(e,c),o(l,u,e),a.warning('attribute "'+l+'" missed start quot('+f+")!!"),e=c+1,d=Xt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:d=In,r.closed=!0;case Yt:case ut:break;case Gt:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),d==Wt&&r.setTagName(t.slice(e,c)),c;case">":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:break;case Yt:case ut:u=t.slice(e,c),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Gt:d===Gt&&(u=l),d==Yt?(a.warning('attribute "'+u+'" missed quot(")!'),o(l,u,e)):(s||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Sr:if(!s)return a.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Wt:r.setTagName(t.slice(e,c)),d=Or;break;case ut:l=t.slice(e,c),d=Gt;break;case Yt:var u=t.slice(e,c);a.warning('attribute "'+u+'" missed quot(")!!'),o(l,u,e);case Xt:d=Or;break}else switch(d){case Gt:s||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=c,d=ut;break;case Xt:a.warning('attribute space is required"'+l+'"!!');case Or:d=ut,e=c;break;case Sr:d=Yt,e=c;break;case In:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function ao(t,e,r){for(var n=t.tagName,i=null,d=t.length;d--;){var a=t[d],s=a.qName,o=a.value,f=s.indexOf(":");if(f>0)var l=a.prefix=s.slice(0,f),u=s.slice(f+1),c=l==="xmlns"&&u;else u=s,l=null,c=s==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=o,a.uri=no.XMLNS,e.startPrefixMapping(c,o))}for(var d=t.length;d--;)a=t[d],a.prefix&&(a.prefix==="xml"&&(a.uri=no.XML),a.prefix!=="xmlns"&&(a.uri=r[a.prefix]));var f=n.indexOf(":");f>0?(l=t.prefix=n.slice(0,f),u=t.localName=n.slice(f+1)):(l=null,u=t.localName=n);var p=t.uri=r[l||""];if(e.startElement(p,u,n,t),t.closed){if(e.endElement(p,u,n),i)for(l in i)Br(i,l)&&e.endPrefixMapping(l)}else return t.currentNSMap=r,t.localNSMap=i,!0}function Wd(t,e,r,n,i){var a=Ud(r);if(a||qd(r)){var s=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");s.lastIndex=e;var o=s.exec(t),l=o?o.index:-1;if(l<0)return e+1;var u=t.substring(e+1,l);return a&&(u=u.replace(Xi,n)),i.characters(u,0,u.length),l}return e+1}function Gd(t,e){for(var r in t)Br(t,r)&&(e[r]=t[r])}function lo(t,e){var r=e;function n(c){return c=c||0,t.charAt(r+c)}function i(c){c=c||1,r+=c}function a(){for(var c=0;r<t.length;){var d=n();if(d!==" "&&d!==`
|
|
3
|
-
`&&d!==" "&&d!=="\r")return c;c++,i()}return-1}function s(){return t.substring(r)}function o(c){return t.substring(r,r+c.length)===c}function l(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function u(c){var d=N.reg("^",c),f=d.exec(s());return f?(i(f[0].length),f[0]):null}return{char:n,getIndex:function(){return r},getMatch:u,getSource:function(){return t},skip:i,skipBlanks:a,substringFromIndex:s,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function
|
|
1
|
+
var Hl=Object.create;var fi=Object.defineProperty;var Wl=Object.getOwnPropertyDescriptor;var Gl=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty;var Qe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ua=(t,e)=>{for(var r in e)fi(t,r,{get:e[r],enumerable:!0})},di=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Gl(e))!Xl.call(t,i)&&i!==r&&fi(t,i,{get:()=>e[i],enumerable:!(n=Wl(e,i))||n.enumerable});return t},or=(t,e,r)=>(di(t,e,"default"),r&&di(r,e,"default")),Fa=(t,e,r)=>(r=t!=null?Hl(Yl(t)):{},di(e||!t||!t.__esModule?fi(r,"default",{value:t,enumerable:!0}):r,t));var wt=Qe(le=>{"use strict";function wc(t,e,r){if(r===void 0&&(r=Array.prototype),t&&typeof r.find=="function")return r.find.call(t,e);for(var n=0;n<t.length;n++)if(_t(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function Pt(t,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&typeof e.freeze=="function"?e.freeze(t):t}function _t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yc(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)_t(e,r)&&(t[r]=e[r]);return t}var Es=Pt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function vc(t){return _t(Es,t.toLowerCase())}var Ds=Pt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kc(t){return _t(Ds,t.toLowerCase())}var gr=Pt({script:!1,style:!1,textarea:!0,title:!0});function xc(t){var e=t.toLowerCase();return _t(gr,e)&&!gr[e]}function Ec(t){var e=t.toLowerCase();return _t(gr,e)&&gr[e]}function As(t){return t===br.HTML}function Dc(t){return As(t)||t===br.XML_XHTML_APPLICATION}var br=Pt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Ac=Object.keys(br).map(function(t){return br[t]});function Cc(t){return Ac.indexOf(t)>-1}var Tc=Pt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});le.assign=yc;le.find=wc;le.freeze=Pt;le.HTML_BOOLEAN_ATTRIBUTES=Es;le.HTML_RAW_TEXT_ELEMENTS=gr;le.HTML_VOID_ELEMENTS=Ds;le.hasDefaultHTMLNamespace=Dc;le.hasOwn=_t;le.isHTMLBooleanAttribute=vc;le.isHTMLRawTextElement=xc;le.isHTMLEscapableRawTextElement=Ec;le.isHTMLMimeType=As;le.isHTMLVoidElement=kc;le.isValidMimeType=Cc;le.MIME_TYPE=br;le.NAMESPACE=Tc});var kr=Qe(vr=>{"use strict";var Nc=wt();function Ts(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var wr=Nc.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),Ns=Object.keys(wr);function Ss(t){return typeof t=="number"&&t>=1&&t<=25}function Sc(t){return typeof t=="string"&&t.substring(t.length-wr.Error.length)===wr.Error}function yr(t,e){Ss(t)?(this.name=Ns[t],this.message=e||""):(this.message=t,this.name=Sc(e)?e:wr.Error),Error.captureStackTrace&&Error.captureStackTrace(this,yr)}Ts(yr,!0);Object.defineProperties(yr.prototype,{code:{enumerable:!0,get:function(){var t=Ns.indexOf(this.name);return Ss(t)?t:0}}});var Os={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},Li=Object.entries(Os);for(_r=0;_r<Li.length;_r++)Cs=Li[_r][0],yr[Cs]=Li[_r][1];var Cs,_r;function Pi(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,Pi)}Ts(Pi);vr.DOMException=yr;vr.DOMExceptionName=wr;vr.ExceptionCode=Os;vr.ParseError=Pi});var zi=Qe(T=>{"use strict";function Ps(t){try{typeof t!="function"&&(t=RegExp);var e=new t("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var Ft=Ps();function st(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function $t(t,e){if(t.source[0]!=="[")throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(t.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+t.source+"/");if(e==="-"&&t.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),Ft?"u":"")}function O(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&e===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),Ft?"u":"")}function A(t){if(arguments.length===0)throw new Error("no parameters provided");return O.apply(A,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var Oc="\uFFFD",ot=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Ft&&(ot=O("[",st(ot),"\\u{10000}-\\u{10FFFF}","]"));var Bc=new RegExp("[^"+st(ot)+"]",Ft?"u":""),Dn=/[\x20\x09\x0D\x0A]/,Ic=st(Dn),U=O(Dn,"+"),j=O(Dn,"*"),xr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Ft&&(xr=O("[",st(xr),"\\u{10000}-\\u{10FFFF}","]"));var Mc=st(xr),Fi=O("[",Mc,st(/[-.0-9\xB7]/),st(/[\u0300-\u036F\u203F-\u2040]/),"]"),ye=O(xr,Fi,"*"),Rc=O("^",ye,"$"),Bs=O(Fi,"+"),Lc=O("&",ye,";"),Pc=A(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Er=A(Lc,"|",Pc),Dr=O("%",ye,";"),qi=A(O('"',A(/[^%&"]/,"|",Dr,"|",Er),"*",'"'),"|",O("'",A(/[^%&']/,"|",Dr,"|",Er),"*","'")),$c=A('"',A(/[^<&"]/,"|",Er),"*",'"',"|","'",A(/[^<&']/,"|",Er),"*","'"),Uc=$t(xr,":"),Fc=$t(Fi,":"),$i=O(Uc,Fc,"*"),qc=O("^",$i,"$"),Ar=O($i,A(":",$i),"?"),jc=O("^",Ar,"$"),Vc=O("(",Ar,")"),Ut=A(/"[^"]*"|'[^']*'/),zc=O(/^<\?/,"(",ye,")",A(U,"(?!",Dn,")(",ot,"*?)"),"?",/\?>/),Is=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Cr=A('"',Is,'*"',"|","'",$t(Is,"'"),"*'"),$s="<!--",Us="-->",Hc=O($s,A($t(ot,"-"),"|",O("-",$t(ot,"-"))),"*",Us),Ms="#PCDATA",Wc=A(O(/\(/,j,Ms,A(j,/\|/,j,Ar),"*",j,/\)\*/),"|",O(/\(/,j,Ms,j,/\)/)),Gc=/[?*+]?/,Yc=O(/\([^>]+\)/,Gc),Xc=A("EMPTY","|","ANY","|",Wc,"|",Yc),Zc="<!ELEMENT",Jc=O(Zc,U,A(Ar,"|",Dr),U,A(Xc,"|",Dr),j,">"),Kc=O("NOTATION",U,/\(/,j,ye,A(j,/\|/,j,ye),"*",j,/\)/),Qc=O(/\(/,j,Bs,A(j,/\|/,j,Bs),"*",j,/\)/),ed=A(Kc,"|",Qc),td=A(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",ed),rd=A(/#REQUIRED|#IMPLIED/,"|",A(A("#FIXED",U),"?",$c)),nd=A(U,ye,U,td,U,rd),id="<!ATTLIST",ad=O(id,U,ye,nd,"*",j,">"),Ui="about:legacy-compat",sd=A('"'+Ui+'"',"|","'"+Ui+"'"),ji="SYSTEM",An="PUBLIC",Cn=A(A(ji,U,Ut),"|",A(An,U,Cr,U,Ut)),od=O("^",A(A(ji,U,"(?<SystemLiteralOnly>",Ut,")"),"|",A(An,U,"(?<PubidLiteral>",Cr,")",U,"(?<SystemLiteral>",Ut,")"))),ld=O("^",Cr,"$"),ud=O("^",Ut,"$"),cd=A(U,"NDATA",U,ye),dd=A(qi,"|",A(Cn,cd,"?")),Fs="<!ENTITY",fd=O(Fs,U,ye,U,dd,j,">"),pd=A(qi,"|",Cn),hd=O(Fs,U,"%",U,ye,U,pd,j,">"),md=A(fd,"|",hd),gd=O(An,U,Cr),bd=O("<!NOTATION",U,ye,U,A(Cn,"|",gd),j,">"),Vi=O(j,"=",j),Rs=/1[.]\d+/,_d=O(U,"version",Vi,A("'",Rs,"'","|",'"',Rs,'"')),Ls=/[A-Za-z][-A-Za-z0-9._]*/,wd=A(U,"encoding",Vi,A('"',Ls,'"',"|","'",Ls,"'")),yd=A(U,"standalone",Vi,A("'",A("yes","|","no"),"'","|",'"',A("yes","|","no"),'"')),vd=O(/^<\?xml/,_d,wd,"?",yd,"?",j,/\?>/),kd="<!DOCTYPE",xd="<![CDATA[",Ed="]]>",Dd=/<!\[CDATA\[/,Ad=/\]\]>/,Cd=O(ot,"*?",Ad),Td=O(Dd,Cd);T.chars=st;T.chars_without=$t;T.detectUnicodeSupport=Ps;T.reg=O;T.regg=A;T.ABOUT_LEGACY_COMPAT=Ui;T.ABOUT_LEGACY_COMPAT_SystemLiteral=sd;T.AttlistDecl=ad;T.CDATA_START=xd;T.CDATA_END=Ed;T.CDSect=Td;T.Char=ot;T.Comment=Hc;T.COMMENT_START=$s;T.COMMENT_END=Us;T.DOCTYPE_DECL_START=kd;T.elementdecl=Jc;T.EntityDecl=md;T.EntityValue=qi;T.ExternalID=Cn;T.ExternalID_match=od;T.Name=ye;T.Name_exact=Rc;T.NCName_exact=qc;T.NotationDecl=bd;T.Reference=Er;T.PEReference=Dr;T.PI=zc;T.PUBLIC=An;T.PubidLiteral=Cr;T.PubidLiteral_match=ld;T.QName=Ar;T.QName_exact=jc;T.QName_group=Vc;T.S=U;T.SChar_s=Ic;T.S_OPT=j;T.SYSTEM=ji;T.SystemLiteral=Ut;T.SystemLiteral_match=ud;T.InvalidChar=Bc;T.UNICODE_REPLACEMENT_CHARACTER=Oc;T.UNICODE_SUPPORT=Ft;T.XMLDecl=vd});var ea=Qe(H=>{"use strict";var Ae=wt(),Pe=Ae.find,Nd=Ae.hasDefaultHTMLNamespace,jt=Ae.hasOwn,Sd=Ae.isHTMLMimeType,Od=Ae.isHTMLRawTextElement,Bd=Ae.isHTMLVoidElement,Tr=Ae.MIME_TYPE,$e=Ae.NAMESPACE,me=Symbol(),Gs=kr(),y=Gs.DOMException,fe=Gs.DOMExceptionName,z=zi();function be(t){if(t!==me)throw new TypeError("Illegal constructor")}function Id(t){return t!==""}function Md(t){return t?t.split(/[\t\n\f\r ]+/).filter(Id):[]}function Rd(t,e){return jt(t,e)||(t[e]=!0),t}function qs(t){if(!t)return[];var e=Md(t);return Object.keys(e.reduce(Rd,{}))}function Ld(t){return function(e){return t&&t.indexOf(e)!==-1}}function Ys(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function Wi(t,e){Ys(e),t=t||null;var r=null,n=e;if(e.indexOf(":")>=0){var i=e.split(":");r=i[0],n=i[1]}if(r!==null&&t===null)throw new y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==Ae.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==Ae.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===Ae.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function Ht(t,e){for(var r in t)jt(t,r)&&(e[r]=t[r])}function _e(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,Ht(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var we={},De=we.ELEMENT_NODE=1,Vt=we.ATTRIBUTE_NODE=2,Nr=we.TEXT_NODE=3,Xs=we.CDATA_SECTION_NODE=4,Zs=we.ENTITY_REFERENCE_NODE=5,Pd=we.ENTITY_NODE=6,Gi=we.PROCESSING_INSTRUCTION_NODE=7,Yi=we.COMMENT_NODE=8,qt=we.DOCUMENT_NODE=9,Js=we.DOCUMENT_TYPE_NODE=10,lt=we.DOCUMENT_FRAGMENT_NODE=11,$d=we.NOTATION_NODE=12,V=Ae.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Ks(t,e){if(e.length<t.length)return Ks(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function js(t){return t.guid||(t.guid=Math.random()),t.guid}function ee(){}ee.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)Qi(this[n],r,null,e);return r.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};ee.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Le(t,e){this._node=t,this._refresh=e,On(this)}function On(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(uo(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)jt(t,n)&&delete t[n];Ht(r,t),t._inc=e}}Le.prototype.item=function(t){return On(this),this[t]||null};_e(Le,ee);function zt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function Qs(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function Xi(t,e,r){if(!e)return t._noNsIndex;var n=t._nsIndex[e];return!n&&r&&(n=t._nsIndex[e]=Object.create(null)),n}function Ud(t,e,r){var n=Xi(t,e,!1),i=n&&n[r];return i||null}function Fd(t,e){Xi(t,e.namespaceURI,!0)[e.localName]=e}function qd(t,e){var r=Xi(t,e.namespaceURI,!1);r&&delete r[e.localName]}function jd(t,e,r,n){if(n?e[Qs(e,n)]=r:(e[e.length]=r,e.length++),Fd(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&ro(i,t,n),Vd(i,t,r))}}function Vs(t,e,r){var n=Qs(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,qd(e,r),t){var a=t.ownerDocument;a&&ro(a,t,r),r.ownerElement=null}}}zt.prototype={length:0,item:ee.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var r=this[e];if(r.nodeName===t)return r;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new y(y.INUSE_ATTRIBUTE_ERR);var r=Ud(this,t.namespaceURI,t.localName);return r===t?t:(jd(this._ownerElement,this,t,r),r)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new y(y.NOT_FOUND_ERR,t);return Vs(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new y(y.NOT_FOUND_ERR,t?t+" : "+e:e);return Vs(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){t||(t=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===e&&n.namespaceURI===t)return n;r++}return null}};zt.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function eo(){}eo.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=Tr.XML_APPLICATION;t===$e.HTML?n=Tr.XML_XHTML_APPLICATION:t===$e.SVG&&(n=Tr.XML_SVG_IMAGE);var i=new Ge(me,{contentType:n});if(i.implementation=this,i.childNodes=new ee,i.doctype=r||null,r&&i.appendChild(r),e){var a=i.createElementNS(t,e);i.appendChild(a)}return i},createDocumentType:function(t,e,r,n){Ys(t);var i=new Mn(me);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new ee,i},createHTMLDocument:function(t){var e=new Ge(me,{contentType:Tr.HTML});if(e.implementation=this,e.childNodes=new ee,t!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var r=e.createElement("html");e.appendChild(r);var n=e.createElement("head");if(r.appendChild(n),typeof t=="string"){var i=e.createElement("title");i.appendChild(e.createTextNode(t)),n.appendChild(i)}r.appendChild(e.createElement("body"))}return e}};function I(t){be(t)}I.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;for(var e=[{node:this,other:t}];e.length>0;){var r=e.pop(),n=r.node,i=r.other;if(n.nodeType!==i.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==i.name||n.publicId!==i.publicId||n.systemId!==i.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==i.namespaceURI||n.prefix!==i.prefix||n.localName!==i.localName||n.attributes.length!==i.attributes.length)return!1;for(var a=0;a<n.attributes.length;a++){var s=n.attributes.item(a),o=i.getAttributeNodeNS(s.namespaceURI,s.localName);if(!o)return!1;e.push({node:s,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==i.namespaceURI||n.localName!==i.localName||n.value!==i.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==i.target||n.data!==i.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==i.data)return!1;break}if(n.childNodes.length!==i.childNodes.length)return!1;for(var a=n.childNodes.length-1;a>=0;a--)e.push({node:n.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return Sn(this,t,e)},replaceChild:function(t,e){Sn(this,t,e,ao),e&&this.removeChild(e)},removeChild:function(t){return no(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return lo(this.ownerDocument||this,this,t)},normalize:function(){ue(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===Nr&&e.nodeType===Nr){for(var n=[],i=r;i!==null&&i.nodeType===Nr;)n.push(i.data),i=i.nextSibling;for(var a=e.nextSibling;a!==i;){var s=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=s}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),Zi(t.ownerDocument,t),e=i}else e=r}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r){for(var n in r)if(jt(r,n)&&r[n]===t)return n}e=e.nodeType==Vt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&jt(r,t))return r[t];e=e.nodeType==Vt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,r=this,n=null,i=null;if(e instanceof yt&&(n=e,e=n.ownerElement),r instanceof yt&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var a=0,s;s=r.attributes[a];a++){if(s===n)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_PRECEDING;if(s===i)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return V.DOCUMENT_POSITION_DISCONNECTED+V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(js(r.ownerDocument)>js(e.ownerDocument)?V.DOCUMENT_POSITION_FOLLOWING:V.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!i&&l===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],c=r.parentNode;c;){if(!n&&c===e)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;u.push(c),c=c.parentNode}u.reverse();var d=Ks(o,u);for(var f in d.childNodes){var p=d.childNodes[f];if(p===r)return V.DOCUMENT_POSITION_FOLLOWING;if(p===e)return V.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return V.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return V.DOCUMENT_POSITION_PRECEDING}return 0}};function to(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}Ht(we,I);Ht(we,I.prototype);Ht(V,I);Ht(V,I.prototype);function Nn(t,e){ue(t,null,{enter:function(r){return e(r)?ue.STOP:!0}})}function ue(t,e,r){for(var n=[{node:t,context:e,phase:ue.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ue.ENTER){var a=r.enter(i.node,i.context);if(a===ue.STOP)return ue.STOP;if(n.push({node:i.node,context:a,phase:ue.EXIT}),a==null)continue;for(var s=i.node.lastChild;s;)n.push({node:s,context:a,phase:ue.ENTER}),s=s.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ue.STOP=Symbol("walkDOM.STOP");ue.ENTER=0;ue.EXIT=1;function Ge(t,e){be(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||Tr.XML_APPLICATION,this.type=Sd(this.contentType)?"html":"xml"}function Vd(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===$e.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function ro(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===$e.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function Zi(t,e,r){if(t&&t._inc){t._inc++;var n=e.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var i=e.firstChild,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function no(t,e){if(t!==e.parentNode)throw new y(y.NOT_FOUND_ERR,"child's parent is not parent");var r=e.previousSibling,n=e.nextSibling;return r?r.nextSibling=n:t.firstChild=n,n?n.previousSibling=r:t.lastChild=r,Zi(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function zd(t){return t&&(t.nodeType===I.DOCUMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.ELEMENT_NODE)}function Hd(t){return t&&(t.nodeType===I.CDATA_SECTION_NODE||t.nodeType===I.COMMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.DOCUMENT_TYPE_NODE||t.nodeType===I.ELEMENT_NODE||t.nodeType===I.PROCESSING_INSTRUCTION_NODE||t.nodeType===I.TEXT_NODE)}function ut(t){return t&&t.nodeType===I.DOCUMENT_TYPE_NODE}function We(t){return t&&t.nodeType===I.ELEMENT_NODE}function io(t){return t&&t.nodeType===I.TEXT_NODE}function zs(t,e){var r=t.childNodes||[];if(Pe(r,We)||ut(e))return!1;var n=Pe(r,ut);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Hs(t,e){var r=t.childNodes||[];function n(a){return We(a)&&a!==e}if(Pe(r,n))return!1;var i=Pe(r,ut);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function Wd(t,e,r){if(!zd(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!Hd(e)||ut(e)&&t.nodeType!==I.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Gd(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(We);if(a.length>1||Pe(i,io))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!zs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(We(e)&&!zs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,ut))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Pe(n,We);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ao(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(We);if(a.length>1||Pe(i,io))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Hs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(We(e)&&!Hs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,function(l){return ut(l)&&l!==r}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Pe(n,We);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Sn(t,e,r,n){Wd(t,e,r),t.nodeType===I.DOCUMENT_NODE&&(n||Gd)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===lt){var a=e.firstChild;if(a==null)return e;var s=e.lastChild}else a=s=e;var o=r?r.previousSibling:t.lastChild;a.previousSibling=o,s.nextSibling=r,o?o.nextSibling=a:t.firstChild=a,r==null?t.lastChild=s:r.previousSibling=s;do a.parentNode=t;while(a!==s&&(a=a.nextSibling));return Zi(t.ownerDocument||t,t,e),e.nodeType==lt&&(e.firstChild=e.lastChild=null),e}Ge.prototype={implementation:null,nodeName:"#document",nodeType:qt,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===lt){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return Sn(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===De&&(this.documentElement=t),t},removeChild:function(t){var e=no(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){Sn(this,t,e,ao),t.ownerDocument=this,e&&this.removeChild(e),We(t)&&(this.documentElement=t)},importNode:function(t,e){return Yd(this,t,e)},getElementById:function(t){var e=null;return Nn(this.documentElement,function(r){if(r.nodeType==De&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new Ye(me);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),Nd(this.contentType)&&(e.namespaceURI=$e.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new ee;var r=e.attributes=new zt;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new Wt(me);return t.ownerDocument=this,t.childNodes=new ee,t},createTextNode:function(t){var e=new Sr(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createComment:function(t){var e=new Bn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new In(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new Ln(me);return r.ownerDocument=this,r.childNodes=new ee,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new yt(me);return e.ownerDocument=this,e.childNodes=new ee,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!z.Name_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new y("document is an html document",fe.NotSupportedError);var e=new Rn(me);return e.ownerDocument=this,e.childNodes=new ee,e.nodeName=t,e},createElementNS:function(t,e){var r=Wi(t,e),n=new Ye(me),i=n.attributes=new zt;return n.childNodes=new ee,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],i._ownerElement=n,n},createAttributeNS:function(t,e){var r=Wi(t,e),n=new yt(me);return n.ownerDocument=this,n.childNodes=new ee,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};_e(Ge,I);function Ye(t){be(t),this._nsMap=Object.create(null)}Ye.prototype={nodeType:De,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===$e.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var r=this.getAttributeNode(t);r?r.value=r.nodeValue=""+e:(r=this.ownerDocument._createAttribute(t),r.value=r.nodeValue=""+e,this.setAttributeNode(r))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r?r.value:null},setAttributeNS:function(t,e,r){var n=Wi(t,e),i=n[2],a=this.getAttributeNodeNS(t,i);a?a.value=a.nodeValue=""+r:(a=this.ownerDocument.createAttributeNS(t,e),a.value=a.nodeValue=""+r,this.setAttributeNode(a))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=qs(t);return new Le(this,function(r){var n=[];return e.length>0&&Nn(r,function(i){if(i!==r&&i.nodeType===De){var a=i.getAttribute("class");if(a){var s=t===a;if(!s){var o=qs(a);s=e.every(Ld(o))}s&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===qt?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Le(this,function(n){var i=[];return Nn(n,function(a){if(!(a===n||a.nodeType!==De))if(t==="*")i.push(a);else{var s=a.getQualifiedName(),o=e&&a.namespaceURI===$e.HTML?r:t;s===o&&i.push(a)}}),i})},getElementsByTagNameNS:function(t,e){return new Le(this,function(r){var n=[];return Nn(r,function(i){i!==r&&i.nodeType===De&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};Ge.prototype.getElementsByClassName=Ye.prototype.getElementsByClassName;Ge.prototype.getElementsByTagName=Ye.prototype.getElementsByTagName;Ge.prototype.getElementsByTagNameNS=Ye.prototype.getElementsByTagNameNS;_e(Ye,I);function yt(t){be(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}yt.prototype.nodeType=Vt;_e(yt,I);function ct(t){be(t)}ct.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){var n=this.data.substring(0,t),i=this.data.substring(t+e);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};_e(ct,I);function Sr(t){be(t)}Sr.prototype={nodeName:"#text",nodeType:Nr,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};_e(Sr,ct);function Bn(t){be(t)}Bn.prototype={nodeName:"#comment",nodeType:Yi};_e(Bn,ct);function In(t){be(t)}In.prototype={nodeName:"#cdata-section",nodeType:Xs};_e(In,Sr);function Mn(t){be(t)}Mn.prototype.nodeType=Js;_e(Mn,I);function Ji(t){be(t)}Ji.prototype.nodeType=$d;_e(Ji,I);function Ki(t){be(t)}Ki.prototype.nodeType=Pd;_e(Ki,I);function Rn(t){be(t)}Rn.prototype.nodeType=Zs;_e(Rn,I);function Wt(t){be(t)}Wt.prototype.nodeName="#document-fragment";Wt.prototype.nodeType=lt;_e(Wt,I);function Ln(t){be(t)}Ln.prototype.nodeType=Gi;_e(Ln,ct);function so(){}so.prototype.serializeToString=function(t,e){return oo.call(t,e)};I.prototype.toString=oo;function oo(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t!=null?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var r=[],n=this.nodeType===qt&&this.documentElement||this,i=n.prefix,a=n.namespaceURI;if(a&&i==null){var i=n.lookupPrefix(a);if(i==null)var s=[{namespace:a,prefix:null}]}return Qi(this,r,s,e),r.join("")}function Ws(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===$e.XML||i===$e.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===n)return s.namespace!==i}return!0}function Tn(t,e,r,n){if(n&&!z.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',fe.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,to),'"')}function Qi(t,e,r,n){r||(r=[]);var i=n.nodeFilter,a=n.requireWellFormed,s=n.splitCDATASections,o=t.nodeType===qt?t:t.ownerDocument,l=o.type==="html";ue(t,{ns:r},{enter:function(u,c){var d=c.ns;if(i)if(u=i(u),u){if(typeof u=="string")return e.push(u),null}else return null;switch(u.nodeType){case De:var f=u.attributes,p=f.length,h=u.tagName,m=h;if(!l&&!u.prefix&&u.namespaceURI){for(var g,_=0;_<f.length;_++)if(f.item(_).name==="xmlns"){g=f.item(_).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===u.namespaceURI){g=w.namespace;break}}if(g!==u.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===u.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(a&&!z.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',fe.InvalidStateError);e.push("<",m);for(var E=d.slice(),B=0;B<p;B++){var L=f.item(B);L.prefix=="xmlns"?E.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&E.push({prefix:"",namespace:L.value})}for(var B=0;B<p;B++){var L=f.item(B);if(Ws(L,l,E)){var Z=L.prefix||"",ie=L.namespaceURI;Tn(e,Z?"xmlns:"+Z:"xmlns",ie,a),E.push({prefix:Z,namespace:ie})}var ae=i?i(L):L;ae&&(typeof ae=="string"?e.push(ae):Tn(e,ae.name,ae.value,a))}if(h===m&&Ws(u,l,E)){var Ve=u.prefix||"",ie=u.namespaceURI;Tn(e,Ve?"xmlns:"+Ve:"xmlns",ie,a),E.push({prefix:Ve,namespace:ie})}var K=!u.firstChild;if(K&&(l||u.namespaceURI===$e.HTML)&&(K=Bd(h)),K)return e.push("/>"),null;if(e.push(">"),l&&Od(h)){for(var he=u.firstChild;he;)he.data?e.push(he.data):Qi(he,e,E.slice(),n),he=he.nextSibling;return e.push("</",m,">"),null}return{ns:E,tag:m};case qt:case lt:if(a&&u.nodeType===qt&&u.documentElement==null)throw new y("The Document has no documentElement",fe.InvalidStateError);return{ns:d};case Vt:return Tn(e,u.name,u.value,a),null;case Nr:if(a&&z.InvalidChar.test(u.data))throw new y("The Text node data contains characters outside the XML Char production",fe.InvalidStateError);return e.push(u.data.replace(/[<&>]/g,to)),null;case Xs:if(a&&u.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',fe.InvalidStateError);return s?e.push(z.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),z.CDATA_END):e.push(z.CDATA_START,u.data,z.CDATA_END),null;case Yi:if(a){if(z.InvalidChar.test(u.data))throw new y("The comment node data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',fe.InvalidStateError)}return e.push(z.COMMENT_START,u.data,z.COMMENT_END),null;case Js:var xe=u.publicId,F=u.systemId;if(a){if(!z.Name_exact.test(u.name))throw new y('The doctype name "'+u.name+'" is not a valid XML Name',fe.InvalidStateError);if(xe&&!z.PubidLiteral_match.test(xe))throw new y("DocumentType publicId is not a valid PubidLiteral",fe.InvalidStateError);if(F&&F!=="."&&!z.SystemLiteral_match.test(F))throw new y("DocumentType systemId is not a valid SystemLiteral",fe.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',fe.InvalidStateError)}return e.push(z.DOCTYPE_DECL_START," ",u.name),xe?(e.push(" ",z.PUBLIC," ",xe),F&&F!=="."&&e.push(" ",F)):F&&F!=="."&&e.push(" ",z.SYSTEM," ",F),u.internalSubset&&e.push(" [",u.internalSubset,"]"),e.push(">"),null;case Gi:if(a){if(!z.NCName_exact.test(u.target)||u.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+u.target+'" is not a valid XML NCName or is reserved',fe.InvalidStateError);if(z.InvalidChar.test(u.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',fe.InvalidStateError)}return e.push("<?",u.target," ",u.data,"?>"),null;case Zs:if(a&&!z.Name_exact.test(u.nodeName))throw new y('The entity reference name "'+u.nodeName+'" is not a valid XML Name',fe.InvalidStateError);return e.push("&",u.nodeName,";"),null;default:return e.push("??",u.nodeName),null}},exit:function(u,c){c&&c.tag&&e.push("</",c.tag,">")}})}function Yd(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=i.cloneNode(!1);s.ownerDocument=t,s.parentNode=null,a===null?n=s:a.appendChild(s);var o=i.nodeType===Vt||r;return o?s:null}}),n}function lo(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=new i.constructor(me);for(var o in i)if(jt(i,o)){var l=i[o];typeof l!="object"&&l!=s[o]&&(s[o]=l)}i.childNodes&&(s.childNodes=new ee),s.ownerDocument=t;var u=r;switch(s.nodeType){case De:var c=i.attributes,d=s.attributes=new zt,f=c.length;d._ownerElement=s;for(var p=0;p<f;p++)s.setAttributeNode(lo(t,c.item(p),!0));break;case Vt:u=!0}return a!==null?a.appendChild(s):n=s,u?s:null}}),n}function uo(t,e,r){t[e]=r}function Hi(t){for(var e=[],r=t.firstChild;r;)r.nodeType===De&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Le.prototype,"length",{get:function(){return On(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){if(this.nodeType===De||this.nodeType===lt){var t=[];return ue(this,null,{enter:function(e){if(e.nodeType===De||e.nodeType===lt)return!0;if(e.nodeType===Gi||e.nodeType===Yi)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case De:case lt:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Object.defineProperty(ct.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(t){this._data=t,this.length=typeof t=="string"?t.length:0}}),Object.defineProperty(ct.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ye.prototype,"children",{get:function(){return new Le(this,Hi)}}),Object.defineProperty(Ge.prototype,"children",{get:function(){return new Le(this,Hi)}}),Object.defineProperty(Wt.prototype,"children",{get:function(){return new Le(this,Hi)}}),uo=function(t,e,r){t["$$"+e]=r})}catch{}H._updateLiveList=On;H.Attr=yt;H.CDATASection=In;H.CharacterData=ct;H.Comment=Bn;H.Document=Ge;H.DocumentFragment=Wt;H.DocumentType=Mn;H.DOMImplementation=eo;H.Element=Ye;H.Entity=Ki;H.EntityReference=Rn;H.LiveNodeList=Le;H.NamedNodeMap=zt;H.Node=I;H.NodeList=ee;H.Notation=Ji;H.Text=Sr;H.ProcessingInstruction=Ln;H.walkDOM=ue;H.XMLSerializer=so});var fo=Qe(Or=>{"use strict";var co=wt().freeze;Or.XML_ENTITIES=co({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Or.HTML_ENTITIES=co({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Or.entityMap=Or.HTML_ENTITIES});var vo=Qe($n=>{"use strict";var Jt=wt(),N=zi(),go=kr(),Xd=Jt.isHTMLEscapableRawTextElement,Zd=Jt.isHTMLMimeType,Jd=Jt.isHTMLRawTextElement,Mr=Jt.hasOwn,po=Jt.NAMESPACE,Kd=go.ParseError,Qd=go.DOMException,Gt=0,dt=1,Yt=2,Br=3,Xt=4,Zt=5,Ir=6,Pn=7;function bo(){}bo.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),nf(e,e=Object.create(null)),ef(t,e,r,n,this.errorHandler),n.endDocument()}};var ta=/&#?\w+;?/g;function ef(t,e,r,n,i){var a=Zd(n.mimeType);t.indexOf(N.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function s(R){if(R>65535){R-=65536;var Ee=55296+(R>>10),nn=56320+(R&1023);return String.fromCharCode(Ee,nn)}else return String.fromCharCode(R)}function o(R){var Ee=R[R.length-1]===";"?R:R+";";if(!a&&Ee!==R)return i.error("EntityRef: expecting ;"),R;var nn=N.Reference.exec(Ee);if(!nn||nn[0].length!==Ee.length)return i.error("entity not matching Reference production: "+R),R;var an=Ee.slice(1,-1);return Mr(r,an)?r[an]:an.charAt(0)==="#"?s(parseInt(an.substring(1).replace("x","0x"))):(i.error("entity not found:"+R),R)}function l(R){if(R>g){var Ee=t.substring(g,R).replace(ta,o);f&&p(g),n.characters(Ee,0,R-g),g=R}}var u=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p(R,Ee){for(;R>=c&&(Ee=d.exec(t));)u=c,c=Ee.index+Ee[0].length,f.lineNumber++;f.columnNumber=R-u+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var _=t.indexOf("<",g);if(_<0){if(!a&&m.length>0)return i.fatalError("unclosed xml tag(s): "+m.join(", "));if(!t.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(t.substring(g));if(v.documentElement)return i.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(_>g){var E=t.substring(g,_);!a&&m.length===0&&(E=E.replace(new RegExp(N.S_OPT.source,"g"),""),E&&i.error("Unexpected content outside root element: '"+E+"'")),l(_)}switch(t.charAt(_+1)){case"/":var S=t.indexOf(">",_+2),B=t.substring(_+2,S>0?S:void 0);if(!B)return i.fatalError("end tag name missing");var L=N.reg("^",N.QName_group,N.S_OPT,"$"),Z=S>0&&L.exec(B);if(!Z){var ie=S>0&&N.reg("^",N.QName_group).exec(B);if(a&&ie)i.warning('end tag name contains invalid trailing characters: "'+B+'"'),Z=ie;else if(ie&&new RegExp(L.source,L.flags+"m").test(B))i.error('end tag name is followed by a line break and trailing content: "'+B+'"'),Z=ie;else return i.fatalError('end tag name contains invalid characters: "'+B+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var ae=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(ae!==Z[1]){var Ve=Z[1].toLowerCase();if(!a||ae.toLowerCase()!==Ve)return i.fatalError('Opening and ending tag mismatch: "'+ae+'" != "'+B+'"')}var K=h.pop();m.pop();var he=K.localNSMap;if(n.endElement(K.uri,K.localName,ae),he)for(var xe in he)Mr(he,xe)&&n.endPrefixMapping(xe);S++;break;case"?":f&&p(_),S=sf(t,_,n,i);break;case"!":f&&p(_),S=wo(t,_,n,i,a);break;default:f&&p(_);var F=new yo,J=h[h.length-1].currentNSMap,S=tf(t,_,F,J,o,i,a),Pa=F.length;if(F.closed||(a&&Jt.isHTMLVoidElement(F.tagName)?F.closed=!0:m.push(F.tagName)),f&&Pa){for(var zl=ho(f,{}),ci=0;ci<Pa;ci++){var $a=F[ci];p($a.offset),$a.locator=ho(f,{})}n.locator=zl,mo(F,n,J)&&h.push(F),n.locator=f}else mo(F,n,J)&&h.push(F);a&&!F.closed?S=rf(t,S,F.tagName,o,n):S++}}catch(R){if(R instanceof Kd)throw R;if(R instanceof Qd)return i.fatalError("Error constructing the DOM: "+R.name+": "+R.message,R);i.error("element parse error: "+R),S=-1}S>g?g=S:l(Math.max(_,g)+1)}}function ho(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function tf(t,e,r,n,i,a,s){function o(p,h,m){if(Mr(r.attributeNames,p))return a.fatalError("Attribute "+p+" redefined");if(!s&&h.indexOf("<")>=0)return a.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,h.replace(/[\t\n\r]/g," ").replace(ta,i),m)}for(var l,u,c=++e,d=Gt;;){var f=t.charAt(c);if(d===Gt&&f==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(f){case"=":if(d===dt)l=t.slice(e,c),d=Br;else if(d===Yt)d=Br;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===Br||d===dt)if(d===dt&&(a.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,c=t.indexOf(f,e),c>0)u=t.slice(e,c),o(l,u,e-1),d=Zt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Xt)u=t.slice(e,c),o(l,u,e),a.warning('attribute "'+l+'" missed start quot('+f+")!!"),e=c+1,d=Zt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Gt:r.setTagName(t.slice(e,c));case Zt:case Ir:case Pn:d=Pn,r.closed=!0;case Xt:case dt:break;case Yt:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),d==Gt&&r.setTagName(t.slice(e,c)),c;case">":switch(d){case Gt:r.setTagName(t.slice(e,c));case Zt:case Ir:case Pn:break;case Xt:case dt:u=t.slice(e,c),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Yt:d===Yt&&(u=l),d==Xt?(a.warning('attribute "'+u+'" missed quot(")!'),o(l,u,e)):(s||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Br:if(!s)return a.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Gt:r.setTagName(t.slice(e,c)),d=Ir;break;case dt:l=t.slice(e,c),d=Yt;break;case Xt:var u=t.slice(e,c);a.warning('attribute "'+u+'" missed quot(")!!'),o(l,u,e);case Zt:d=Ir;break}else switch(d){case Yt:s||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=c,d=dt;break;case Zt:a.warning('attribute space is required"'+l+'"!!');case Ir:d=dt,e=c;break;case Br:d=Xt,e=c;break;case Pn:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function mo(t,e,r){for(var n=t.tagName,i=null,d=t.length;d--;){var a=t[d],s=a.qName,o=a.value,f=s.indexOf(":");if(f>0)var l=a.prefix=s.slice(0,f),u=s.slice(f+1),c=l==="xmlns"&&u;else u=s,l=null,c=s==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=o,a.uri=po.XMLNS,e.startPrefixMapping(c,o))}for(var d=t.length;d--;)a=t[d],a.prefix&&(a.prefix==="xml"&&(a.uri=po.XML),a.prefix!=="xmlns"&&(a.uri=r[a.prefix]));var f=n.indexOf(":");f>0?(l=t.prefix=n.slice(0,f),u=t.localName=n.slice(f+1)):(l=null,u=t.localName=n);var p=t.uri=r[l||""];if(e.startElement(p,u,n,t),t.closed){if(e.endElement(p,u,n),i)for(l in i)Mr(i,l)&&e.endPrefixMapping(l)}else return t.currentNSMap=r,t.localNSMap=i,!0}function rf(t,e,r,n,i){var a=Xd(r);if(a||Jd(r)){var s=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");s.lastIndex=e;var o=s.exec(t),l=o?o.index:-1;if(l<0)return e+1;var u=t.substring(e+1,l);return a&&(u=u.replace(ta,n)),i.characters(u,0,u.length),l}return e+1}function nf(t,e){for(var r in t)Mr(t,r)&&(e[r]=t[r])}function _o(t,e){var r=e;function n(c){return c=c||0,t.charAt(r+c)}function i(c){c=c||1,r+=c}function a(){for(var c=0;r<t.length;){var d=n();if(d!==" "&&d!==`
|
|
3
|
+
`&&d!==" "&&d!=="\r")return c;c++,i()}return-1}function s(){return t.substring(r)}function o(c){return t.substring(r,r+c.length)===c}function l(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function u(c){var d=N.reg("^",c),f=d.exec(s());return f?(i(f[0].length),f[0]):null}return{char:n,getIndex:function(){return r},getMatch:u,getSource:function(){return t},skip:i,skipBlanks:a,substringFromIndex:s,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function af(t,e){function r(o,l){var u=N.PI.exec(o.substringFromIndex());return u?u[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(u[0].length),u[0]):l.fatalError("processing instruction is not well-formed at position "+o.getIndex())}var n=t.getSource();if(t.char()==="["){t.skip(1);for(var i=t.getIndex();t.getIndex()<n.length;){if(t.skipBlanks(),t.char()==="]"){var a=n.substring(i,t.getIndex());return t.skip(1),a}var s=null;if(t.char()==="<"&&t.char(1)==="!")switch(t.char(2)){case"E":t.char(3)==="L"?s=t.getMatch(N.elementdecl):t.char(3)==="N"&&(s=t.getMatch(N.EntityDecl));break;case"A":s=t.getMatch(N.AttlistDecl);break;case"N":s=t.getMatch(N.NotationDecl);break;case"-":s=t.getMatch(N.Comment);break}else if(t.char()==="<"&&t.char(1)==="?")s=r(t,e);else if(t.char()==="%")s=t.getMatch(N.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!s)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function wo(t,e,r,n,i){var a=_o(t,e);switch(i?a.char(2).toUpperCase():a.char(2)){case"-":var s=a.getMatch(N.Comment);return s?(r.comment(s,N.COMMENT_START.length,s.length-N.COMMENT_START.length-N.COMMENT_END.length),a.getIndex()):n.fatalError("comment is not well-formed at position "+a.getIndex());case"[":var o=a.getMatch(N.CDSect);return o?!i&&!r.currentElement?n.fatalError("CDATA outside of element"):(r.startCDATA(),r.characters(o,N.CDATA_START.length,o.length-N.CDATA_START.length-N.CDATA_END.length),r.endCDATA(),a.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+a.getIndex());if(i?!a.substringStartsWithCaseInsensitive(N.DOCTYPE_DECL_START):!a.substringStartsWith(N.DOCTYPE_DECL_START))return n.fatalError("Expected "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());if(a.skip(N.DOCTYPE_DECL_START.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=a.getMatch(N.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+a.getIndex());if(i&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+a.getIndex()),a.skipBlanks(),a.substringStartsWith(N.PUBLIC)||a.substringStartsWith(N.SYSTEM)){var u=N.ExternalID_match.exec(a.substringFromIndex());if(!u)return n.fatalError("doctype external id is not well-formed at position "+a.getIndex());u.groups.SystemLiteralOnly!==void 0?l.systemId=u.groups.SystemLiteralOnly:(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral),a.skip(u[0].length)}else if(i&&a.substringStartsWithCaseInsensitive(N.SYSTEM)){if(a.skip(N.SYSTEM.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.SYSTEM+" at position "+a.getIndex());if(l.systemId=a.getMatch(N.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+N.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+N.SYSTEM+" at position "+a.getIndex())}return i&&l.systemId&&!N.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+a.getIndex()),i||(a.skipBlanks(),l.internalSubset=af(a,n)),a.skipBlanks(),a.char()!==">"?n.fatalError("doctype not terminated with > at position "+a.getIndex()):(a.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),a.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function sf(t,e,r,n){var i=t.substring(e).match(N.PI);if(!i)return n.fatalError("Invalid processing instruction starting at position "+e);if(i[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!N.XMLDecl.test(t.substring(e)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(i[1],i[2]),e+i[0].length}function yo(){this.attributeNames=Object.create(null)}yo.prototype={setTagName:function(t){if(!N.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!N.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};$n.XMLReader=bo;$n.parseUtils=_o;$n.parseDoctypeCommentOrCData=wo});var To=Qe(Qt=>{"use strict";var vt=wt(),of=ea(),lf=kr(),ko=fo(),uf=vo(),cf=of.DOMImplementation,df=vt.hasDefaultHTMLNamespace,ff=vt.isHTMLMimeType,pf=vt.isValidMimeType,Do=vt.MIME_TYPE,ra=vt.NAMESPACE,xo=lf.ParseError,hf=uf.XMLReader;function Ao(t){return t.replace(/\r[\n\u0085]/g,`
|
|
4
4
|
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
5
|
-
`)}function
|
|
6
|
-
@#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function
|
|
5
|
+
`)}function Co(t){if(t=t||{},t.locator===void 0&&(t.locator=!0),this.assign=t.assign||vt.assign,this.domHandler=t.domHandler||Fn,this.onError=t.onError||t.errorHandler,t.errorHandler&&typeof t.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||Ao,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}Co.prototype.parseFromString=function(t,e){if(!pf(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=ko.XML_ENTITIES,i=r[""]||null;df(e)?(n=ko.HTML_ENTITIES,i=ra.HTML):e===Do.XML_SVG_IMAGE&&(i=ra.SVG),r[""]=i,r.xml=r.xml||ra.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:i,onError:this.onError}),s=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(s);var o=new hf;o.errorHandler=a,o.domBuilder=a;var l=!vt.isHTMLMimeType(e);return l&&typeof t!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(t)),r,n),a.doc.documentElement||o.errorHandler.fatalError("missing root element"),a.doc};function Fn(t){var e=t||{};this.mimeType=e.mimeType||Do.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function Kt(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Fn.prototype={startDocument:function(){var t=new cf;this.doc=ff(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,r,n){var i=this.doc,a=i.createElementNS(t,r||e),s=n.length;Un(this,a),this.currentElement=a,this.locator&&Kt(this.locator,a);for(var o=0;o<s;o++){var t=n.getURI(o),l=n.getValue(o),r=n.getQName(o),u=i.createAttributeNS(t,r);this.locator&&Kt(n.getLocator(o),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},endElement:function(t,e,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&Kt(this.locator,r),Un(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=Eo.apply(this,arguments),t){if(this.cdata)var n=this.doc.createCDATASection(t);else var n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&Kt(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,r){t=Eo.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Kt(this.locator,n),Un(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(t,e,r,n);this.locator&&Kt(this.locator,a),Un(this,a),this.doc.doctype=a}},reportError:function(t,e){if(typeof this.onError=="function")try{this.onError(t,e,this)}catch(r){throw new xo("Reporting "+t+' "'+e+'" caused '+r,this.locator)}else console.error("[xmldom "+t+"] "+e,mf(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t,e){throw this.reportError("fatalError",t),new xo(t,this.locator,e)}};function mf(t){if(t)return`
|
|
6
|
+
@#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function Eo(t,e,r){return typeof t=="string"?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){Fn.prototype[t]=function(){return null}});function Un(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}function gf(t){if(t==="error")throw"onErrorStopParsing"}function bf(){throw"onWarningStopParsing"}Qt.__DOMHandler=Fn;Qt.DOMParser=Co;Qt.normalizeLineEndings=Ao;Qt.onErrorStopParsing=gf;Qt.onWarningStopParsing=bf});var na=Qe(M=>{"use strict";var er=wt();M.assign=er.assign;M.hasDefaultHTMLNamespace=er.hasDefaultHTMLNamespace;M.isHTMLMimeType=er.isHTMLMimeType;M.isValidMimeType=er.isValidMimeType;M.MIME_TYPE=er.MIME_TYPE;M.NAMESPACE=er.NAMESPACE;var qn=kr();M.DOMException=qn.DOMException;M.DOMExceptionName=qn.DOMExceptionName;M.ExceptionCode=qn.ExceptionCode;M.ParseError=qn.ParseError;var te=ea();M.Attr=te.Attr;M.CDATASection=te.CDATASection;M.CharacterData=te.CharacterData;M.Comment=te.Comment;M.Document=te.Document;M.DocumentFragment=te.DocumentFragment;M.DocumentType=te.DocumentType;M.DOMImplementation=te.DOMImplementation;M.Element=te.Element;M.Entity=te.Entity;M.EntityReference=te.EntityReference;M.LiveNodeList=te.LiveNodeList;M.NamedNodeMap=te.NamedNodeMap;M.Node=te.Node;M.NodeList=te.NodeList;M.Notation=te.Notation;M.ProcessingInstruction=te.ProcessingInstruction;M.Text=te.Text;M.XMLSerializer=te.XMLSerializer;var jn=To();M.DOMParser=jn.DOMParser;M.normalizeLineEndings=jn.normalizeLineEndings;M.onErrorStopParsing=jn.onErrorStopParsing;M.onWarningStopParsing=jn.onWarningStopParsing});import Yp from"@gramlot/collections/tree";import{Bag as hi}from"@gramlot/gramlot";function ze(t,e=","){if(typeof e!="string"||!e)throw new TypeError("separator must be a nonempty string");if(t==="")return[];let r=new Set;return t.split(e).map(n=>{let i=n.indexOf(":"),a=i<0?n:n.slice(0,i),s=i<0?n:n.slice(i+1);if(!a||r.has(a))throw new Error("Invalid or duplicate choice code");return r.add(a),{id:a,caption:s}})}function pi(t,e,r=""){return t.find(n=>n.id===e)?.caption??r??""}function Te(t,e,{align:r="start",matchWidth:n=!1,inset:i=0,placement:a="bottom",point:s=null}={}){let o=e.ownerDocument.defaultView,l=s?{left:s.x,right:s.x,top:s.y,bottom:s.y,width:0}:e.getBoundingClientRect(),u=Math.max(0,o.innerWidth-16);t.style.setProperty("--gramlot-popup-available-width",`${u}px`),n&&(t.style.width=`${Math.min(Math.max(0,l.width-2*i),u)}px`),t.style.removeProperty("--gramlot-popup-available-height");let c=t.getBoundingClientRect();if(a==="side"){let _=Math.max(0,o.innerWidth-8-l.right-3),v=Math.max(0,l.left-8-3),w=c.width>_&&v>_;t.style.setProperty("--gramlot-popup-available-width",`${w?v:_}px`),t.style.setProperty("--gramlot-popup-available-height",`${Math.max(0,o.innerHeight-16)}px`);let E=t.getBoundingClientRect(),B=w?l.left-E.width-3:l.right+3;t.style.left=`${Math.max(8,Math.min(B,o.innerWidth-E.width-8))}px`,t.style.top=`${Math.max(8,Math.min(l.top,o.innerHeight-E.height-8))}px`;return}let d=Math.max(0,o.innerHeight-8-l.bottom-3),f=Math.max(0,l.top-8-3),p=c.height>d&&f>d;t.style.setProperty("--gramlot-popup-available-height",`${p?f:d}px`);let h=t.getBoundingClientRect(),m=r==="end"?l.right-h.width-i:l.left+i,g=p?l.top-h.height-3:l.bottom+3;t.style.left=`${Math.max(8,Math.min(m,o.innerWidth-h.width-8))}px`,t.style.top=`${Math.max(8,Math.min(g,o.innerHeight-h.height-8))}px`}import{Bag as qa}from"@gramlot/gramlot";var sn=class{#e=new Set;constructor(e,r){this.owner=e,this.element=e.ownerDocument.createElement("gramlot-tree"),this.element.setSourceContext({...r,writeParameter:(n,i)=>{if(n!=="checkedPaths"||!e.pageContext?.isActive())return;let a=this.options(),s=new Map(a.map(f=>[f.path,f.id])),o=this.#e,l=(i||"").split(",").filter(Boolean).map(f=>e.parameters.identifier?s.get(f):f).filter(f=>f!==void 0),c=(e.readControlValue()||"").split(",").filter(Boolean).filter(f=>!o.has(f)||l.includes(f));for(let f of l)c.includes(f)||c.push(f);let d=c.join(",")||null;d!==e.readControlValue()&&e.acceptTreeValue(d)}}),e.control.append(this.element)}options(){let{values:e,identifier:r,labelAttribute:n}=this.owner.parameters;if(!(e instanceof qa))throw new TypeError("hierarchical checkBoxText requires a Bag in values");let i=[],a=new Set,s=new Set,o=(l,u)=>{if(s.has(l))throw new TypeError("Hierarchical options require an acyclic Bag");s.add(l);for(let c of l.getNodes()){let d=u?`${u}.${c.label}`:c.label,f=r?c.getAttr(r):d;if(typeof f!="string"||!f||f.includes(",")||a.has(f))throw new TypeError("Hierarchical option identifiers must be unique comma-free text on every loaded node");let p=n?c.getAttr(n)??c.label:c.label;if(typeof p!="string")throw new TypeError("Hierarchical captions must be text");a.add(f),i.push({id:f,path:d,caption:p,disabled:c.attr.checked==="disabled:on"||c.attr.checked==="disabled:off"}),c.staticValue instanceof qa&&o(c.staticValue,d)}s.delete(l)};return o(e,""),i}project(e){let r=this.owner.parameters,n=new Map(this.options().map(a=>[a.id,a.path]));this.#e=new Set(n.keys());let i=e===null?null:(e||"").split(",").filter(Boolean).map(a=>r.identifier?n.get(a):a).filter(Boolean).join(",");this.element.inert=!!(r.disabled||r.readonly),this.element.setAttribute("aria-disabled",String(this.element.inert)),this.element.setStoreBag(r.values),this.element.projectAttributes({checkedPaths:i,checkChildren:r.checkChildren,labelAttribute:r.labelAttribute??null,hideValues:!0})}focus(){this.element.shadowRoot.querySelector("[role=treeitem]")?.focus()}dispose(){this.element.remove()}};var on=class{constructor(e){this.owner=e;let r=e.ownerDocument;this.input=r.createElement("input"),this.input.type="text",this.input.className="summary",this.input.placeholder="Select options",this.input.autocomplete="off",this.input.setAttribute("aria-label","Selected descriptions"),this.list=r.createElement("datalist"),this.list.id="description-options",this.input.setAttribute("list",this.list.id),this.toggle=r.createElement("button"),this.toggle.type="button",this.toggle.className="choice-toggle",this.toggle.setAttribute("aria-label","Show options"),this.element=r.createElement("div"),this.element.className="summary-row choice-field",this.element.append(this.input,this.toggle,this.list),this.toggle.addEventListener("click",()=>e.openChoices()),this.input.addEventListener("input",n=>{this.locked||(e.cancelValidation(),this.state.draft={text:this.input.value,value:e.readControlValue()},e.pageContext?.formSelectionError("Confirm the edited selection."),n.isComposing||(e.closeChoices(),this.suggest()))}),this.input.addEventListener("compositionend",()=>this.suggest()),this.input.addEventListener("change",()=>this.commit()),this.input.addEventListener("keydown",n=>{n.isComposing||this.locked||(n.key==="Enter"&&(n.preventDefault(),this.commit()),n.key==="Escape"&&(n.preventDefault(),e.cancelValidation(),this.clear(),e.closeChoices(),e.updateSummary()))}),e.control.addEventListener("change",n=>{n.target!==e.control&&this.clear()})}get state(){return this.source.checkBoxTextState}get locked(){return this.input.disabled||this.input.readOnly||!this.owner.pageContext?.isActive()}attach(e){this.source=e,e.checkBoxTextState??={draft:null}}clear(){this.source&&(this.state.draft=null),this.owner.pageContext?.formSelectionError(""),this.input.setCustomValidity(""),this.input.setAttribute("aria-invalid","false"),this.owner.error("")}project(e,r){this.source&&this.state.draft&&!Object.is(this.state.draft.value,e)&&this.clear();let n=this.source&&this.state.draft?this.state.draft.text:r??"";this.input.value!==n&&(this.input.value=n),this.toggle.disabled=this.input.disabled,this.element.hidden=this.input.hidden,this.suggest()}suggest(){let e=this.input.value,r=e.lastIndexOf(",")+1,n=e.slice(0,r),i=e.slice(r).trim().toLocaleLowerCase(),a=this.owner.textOptions(),s=new Set(n.split(",").map(o=>o.trim().toLocaleLowerCase()));this.list.replaceChildren(...a.filter(o=>!o.disabled&&!s.has(o.caption.toLocaleLowerCase())&&o.caption.toLocaleLowerCase().includes(i)).map(o=>{let l=this.owner.ownerDocument.createElement("option");return l.value=n+o.caption,l.label=o.id,l}))}candidate(){if(!this.source||!this.state.draft)return{value:this.owner.readControlValue()};let e=this.state.draft.text.trim();if(!e)return{value:null};let r=this.owner.textOptions(),n=[],i=(this.state.draft.value||"").split(",");for(let a of e.split(",").map(s=>s.trim())){let s=r.filter(o=>!o.disabled&&o.caption.toLocaleLowerCase()===a.toLocaleLowerCase());if(s.length!==1){if(a&&i.includes(a)&&!r.some(o=>o.id===a)){n.push(a);continue}return{error:s.length>1?"Ambiguous description: choose its checkbox.":"Choose a description from the options."}}n.includes(s[0].id)||n.push(s[0].id)}return{value:n.join(",")||null}}commit(){this.locked||!this.state.draft||this.owner.control.dispatchEvent(new this.owner.ownerDocument.defaultView.Event("change",{bubbles:!0}))}reject(e){this.input.setCustomValidity(e),this.input.setAttribute("aria-invalid","true"),this.owner.error(e),this.owner.pageContext?.formSelectionError(e)}};var ln=`
|
|
7
|
+
.choice-field{position:relative;min-width:0}
|
|
8
|
+
.choice-field>input{box-sizing:border-box;width:100%;padding-inline-end:calc(var(--gramlot-choice-toggle-width,1.6em) + .4em)}
|
|
9
|
+
.choice-field>.choice-toggle{position:absolute;inset-inline-end:1px;inset-block:1px;
|
|
10
|
+
width:var(--gramlot-choice-toggle-width,1.6em);min-width:0;min-height:0;
|
|
11
|
+
display:grid;place-items:center;padding:0;border:0;border-radius:0;
|
|
12
|
+
background:transparent;box-shadow:none;color:inherit;font:inherit;cursor:pointer}
|
|
13
|
+
.choice-toggle::after{content:'';width:.4em;height:.4em;border-inline-end:1.5px solid currentColor;
|
|
14
|
+
border-block-end:1.5px solid currentColor;transform:translateY(-.1em) rotate(45deg);pointer-events:none}
|
|
15
|
+
.choice-toggle:disabled{opacity:.5;cursor:default}
|
|
16
|
+
.choice-toggle:focus-visible{outline:1px solid var(--gramlot-focus-ring,Highlight);outline-offset:-3px}
|
|
17
|
+
.choice-field>input::-webkit-calendar-picker-indicator{opacity:0}
|
|
18
|
+
`;function ja(){return Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function Va(t){return class extends t{#e;#t;#n;#r;#a=!1;#i=`checkbox-options-${ja()}`;#s;#o;#u;#f=[];#c=!0;#l=!1;#d;constructor(){super();let e=this.ownerDocument;this.#t=new on(this),this.summary=this.#t.input,this.summary.hidden=!0,this.summary.className="summary",this.summary.setAttribute("aria-haspopup","dialog"),this.summary.setAttribute("aria-expanded","false"),this.panel=e.createElement("div"),this.panel.id="checkbox-options",this.panel.setAttribute("popover","manual"),this.panel.setAttribute("role","dialog"),this.panel.setAttribute("aria-label","Options"),this.panel.hidden=!0,this.summary.setAttribute("aria-controls",this.panel.id),this.optionsMessage=e.createElement("div"),this.optionsMessage.setAttribute("role","status");let r=e.createElement("style");r.textContent=ln+`.summary{min-width:0;box-sizing:border-box;font:inherit;text-align:start;width:100%;padding:var(--gramlot-field-padding,.25em .5em);min-height:var(--gramlot-field-height,28px);border:1px solid var(--gramlot-border-control,#7a8798);border-radius:var(--gramlot-radius-sm,4px);background:var(--gramlot-field-background,Canvas);color:var(--gramlot-ink,CanvasText)}
|
|
19
|
+
.summary:disabled{opacity:.6}.summary[aria-invalid=true]{border-color:var(--gramlot-error,#8c1d18)}
|
|
20
|
+
[popover]{position:fixed;inset:auto;margin:0;padding:8px;max-width:var(--gramlot-popup-available-width,100vw);max-height:min(20rem,var(--gramlot-popup-available-height,100vh));overflow:auto;border:1px solid var(--gramlot-border-control,#7a8798);border-radius:var(--gramlot-radius-sm,4px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);font:inherit}
|
|
21
|
+
[hidden]{display:none!important}`,this.controlBox.prepend(r,this.#t.element),this.controlBox.append(this.panel,this.optionsMessage),this.summary.addEventListener("click",()=>this.#l?this.closeChoices():this.openChoices()),this.summary.addEventListener("keydown",n=>{n.altKey&&["ArrowDown","ArrowUp"].includes(n.key)&&(n.preventDefault(),this.openChoices())}),this.panel.addEventListener("keydown",n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),this.closeChoices(),this.summary.focus())})}setSourceContext(e){this.#n=e,this.#t.attach(e.sourceNode)}get choiceType(){return"checkbox"}get multiple(){return!0}choiceOptions(){let{values:e,identifier:r,labelAttribute:n,dbtable:i,method:a,hierarchical:s}=this.parameters;if(s)return[];if(i||a)return this.#f;if(typeof e=="string")return ze(e);if(!(e instanceof hi))throw new TypeError("values must be text or a Bag");let o=new Set;return e.getNodes().map(l=>{let u=f=>l.staticValue instanceof hi?l.staticValue.getItem(f):l.getAttr(f),c=r?u(r):l.label,d=n?u(n):l.label;if(typeof c!="string"||!c||c.includes(",")||o.has(c)||typeof d!="string")throw new TypeError("Options require unique comma-free text codes and text captions");return o.add(c),{id:c,caption:d}})}projectAttributes(e,r){let n=this.readControlValue();this.#s=e;let i=super.projectAttributes(e,r),{values:a,popup:s,disabled:o,readonly:l,dbtable:u,method:c,hierarchical:d}=this.parameters;if(d&&(u||c))throw new TypeError("Load hierarchical values into a Bag with dataRemote, not the flat selector service");if(d&&!this.#r&&(this.#r=new sn(this,this.#n)),!d&&this.#r&&(this.#r.dispose(),this.#r=null),(u||c)&&a!=="")throw new TypeError("Remote choices and values are mutually exclusive");let f=a instanceof hi?a:null;f!==this.#e&&(this.#e?.unsubscribe(this.#i,{any:!0}),this.#e=f,f?.subscribe(this.#i,{any:()=>{this.parameters.hierarchical?this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.isConnected&&this.pageContext?.isActive()&&this.projectAttributes(this.#s)})):(this.projectAttributes(this.#s),this.writeControlValue(this.readControlValue()))}})),this.summary.hidden=!s,this.summary.disabled=!!(o||l||!this.#c);for(let g of this.control.querySelectorAll("input"))g.disabled=this.summary.disabled;(!s||this.summary.disabled)&&this.closeChoices();let p=s?this.panel:this.controlBox;this.control.parentNode!==p&&p.append(this.control),this.writeControlValue(n);let h=Object.fromEntries(Object.entries(e).filter(([g])=>["dbtable","method","caption_field","order_by","condition"].includes(g)||g.startsWith("condition_"))),m=JSON.stringify(h);m!==this.#u&&(this.#u=m,this.loadOptions(h));for(let g of Object.keys(i))g.startsWith("condition_")&&delete i[g];return i}setPageContext(e){super.setPageContext(e),this.#u=void 0,this.projectAttributes(this.#s)}async loadOptions(e){if(this.#o?.abort(),this.#o=null,!(e.dbtable||e.method)){this.#c=!0,this.optionsMessage.textContent="",this.summary.disabled=!!(this.parameters.disabled||this.parameters.readonly);for(let a of this.control.querySelectorAll("input"))a.disabled=this.summary.disabled;return}if(!this.pageContext)return;let r=new AbortController;this.#o=r,this.closeChoices(),this.#c=!1,this.summary.disabled=!0;for(let a of this.control.querySelectorAll("input"))a.disabled=!0;this.optionsMessage.textContent="Loading options\u2026",this.summary.setAttribute("aria-busy","true");let{method:n,...i}=e;try{for(let l of Object.keys(i))if(l.startsWith("condition_")){let u=l.slice(10);if(!u||u.startsWith("_")||["limit","dbtable","condition","caption_field","order_by"].includes(u))throw new TypeError("Invalid condition parameter");i[u]=i[l],delete i[l]}let a=await this.pageContext.remote(n||"dbSelect",{...i,_querystring:"",limit:null},r.signal);if(r.signal.aborted||!this.pageContext.isActive())return;if(!a||!Array.isArray(a.rows)||typeof a.identifier!="string"||typeof a.caption!="string")throw new TypeError("Options require {rows, identifier, caption}");let s=new Set;this.#f=a.rows.map(l=>{let u=l[a.identifier],c=l[a.caption];if(!(typeof u=="string"||Number.isSafeInteger(u))||u===""||String(u).includes(",")||typeof c!="string"||s.has(String(u)))throw new TypeError("Invalid or duplicate option");let d=String(u);return s.add(d),{id:d,caption:c}}),this.#c=!0;let o=this.readControlValue();this.projectAttributes(this.#s),this.writeControlValue(o),this.optionsMessage.textContent=""}catch(a){!r.signal.aborted&&this.pageContext.isActive()&&(this.optionsMessage.textContent=a.message)}finally{this.#o===r&&this.summary.setAttribute("aria-busy","false")}}acceptTreeValue(e){this.#t.clear(),super.writeControlValue(e),this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change",{bubbles:!0}))}restoreFormValue(e){this.#t.clear(),super.restoreFormValue(e)}textOptions(){return this.#r?this.#r.options():this.choiceOptions()}acceptControlValue(){let e=this.#t.candidate();return e.error?(this.#t.reject(e.error),{ok:!1}):(this.pageContext?.formSelectionError(""),this.validateCandidate(e.value,r=>{this.#t.clear(),this.writeControlValue(r)}))}writeControlValue(e){super.writeControlValue(e),this.#r?.project(e),this.updateSummary(e)}updateSummary(e=this.readControlValue()){let r=new Map(this.textOptions().map(i=>[i.id,i.caption])),n=e?e.split(",").map(i=>r.get(i)??i).join(","):null;this.#t.project(e,n),this.pageContext?.selectionDisplay(n,e)}openChoices(){if(this.#l||!this.parameters.popup||this.summary.disabled||!this.pageContext?.isActive())return;this.panel.hidden=!1,this.panel.showPopover(),this.#l=!0,this.summary.setAttribute("aria-expanded","true"),Te(this.panel,this.summary,{matchWidth:!0});let e=this.ownerDocument,r=e.defaultView,n=a=>{a.composedPath().includes(this)||this.closeChoices()},i=()=>Te(this.panel,this.summary,{matchWidth:!0});e.addEventListener("pointerdown",n),e.addEventListener("focusin",n),r.addEventListener("resize",i),r.addEventListener("scroll",i,!0),this.#d=()=>{e.removeEventListener("pointerdown",n),e.removeEventListener("focusin",n),r.removeEventListener("resize",i),r.removeEventListener("scroll",i,!0)},this.summary.focus()}closeChoices(){this.#l&&(this.#d(),this.#d=null,this.panel.hidePopover(),this.panel.hidden=!0,this.#l=!1,this.summary.setAttribute("aria-expanded","false"))}focus(e){this.parameters.popup?this.summary.focus(e):this.#r?this.#r.focus():super.focus(e)}releaseControl(){this.closeChoices(),this.#o?.abort(),this.#e?.unsubscribe(this.#i,{any:!0}),this.#e=null,this.#r?.dispose(),this.#r=null,super.releaseControl()}}}import{Bag as Sp}from"@gramlot/gramlot";var P={};Ua(P,{defineCollection:()=>mi});or(P,Rh);import*as Rh from"@gramlot/gramlot/components";import{defineCollection as Zl}from"@gramlot/gramlot/components";function mi(t){if(t.name!=="inputs")throw new Error("Unexpected bundled collection");let e=[],r={};t.css?.forEach((n,i)=>{n.href=e[i].href});for(let[n,i]of Object.entries(t.assets??{}))i.href=r[n].href;return Zl({...t,css:e,assets:r})}function un(t,e){return t.parameters=gi(t.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([r])=>!Object.hasOwn(t.parameters,r)))}function gi(t,e){return Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,Object.hasOwn(e,r)?e[r]:n.default]))}function bi(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
7
22
|
*,*::before,*::after{box-sizing:border-box}.control-box{min-width:0}slot{display:contents}
|
|
8
|
-
::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(r,this.controlBox)}projectAttributes(e){return
|
|
9
|
-
`,a),a<0&&(a=t.length),n+=t.slice(s,a);continue}if(t.startsWith("/*",a)){let c=t.indexOf("*/",a+2);a=c<0?t.length:c+2,n+=t.slice(s,a);continue}if(o==="/"&&i){let c=!1;for(a++;a<t.length;){let d=t[a++];if(d==="\\"){a++;continue}if(d==="[")c=!0;else if(d==="]")c=!1;else if(d==="/"&&!c)break}for(;/[a-z]/i.test(t[a]??"")&&a<t.length;)a++;n+=t.slice(s,a),i=!1;continue}let l=o==="{"?t.slice(a).match(
|
|
23
|
+
::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(r,this.controlBox)}projectAttributes(e){return un(this,e)}}}bi.parameters={};function et(t){if(typeof t!="string"||!["^","="].includes(t[0])||t.startsWith("=="))return null;let e=t.indexOf(":");if(e<0)return null;let r=t[e+1]==="=";return{pointer:t.slice(0,e),expression:r,body:t.slice(e+(r?2:1))}}var za=/^\{(\??[A-Za-z_][A-Za-z0-9_]*|\?)?\}/;function lr(t,e){let r="",n=!1;for(let i=0;i<t.length;){if(t[i]!=="{"&&t[i]!=="}"){r+=t[i++];continue}let a=t.slice(i).match(za);if(!a)throw new SyntaxError("Invalid pointer template placeholder");let s=a[1]??"",o=s.startsWith("?"),l=e(o?s.slice(1):s);l==null||l===""&&!o?n=!0:r+=String(l),i+=a[0].length}return n?null:r}function _i(t){let e=[],r=new Set,n="",i=!0;for(let a=0;a<t.length;){let s=a,o=t[a];if(o==='"'||o==="'"||o==="`"){for(a++;a<t.length;){if(t[a]==="\\"){a+=2;continue}if(t[a++]===o)break}n+=t.slice(s,a),i=!1;continue}if(t.startsWith("//",a)){a=t.indexOf(`
|
|
24
|
+
`,a),a<0&&(a=t.length),n+=t.slice(s,a);continue}if(t.startsWith("/*",a)){let c=t.indexOf("*/",a+2);a=c<0?t.length:c+2,n+=t.slice(s,a);continue}if(o==="/"&&i){let c=!1;for(a++;a<t.length;){let d=t[a++];if(d==="\\"){a++;continue}if(d==="[")c=!0;else if(d==="]")c=!1;else if(d==="/"&&!c)break}for(;/[a-z]/i.test(t[a]??"")&&a<t.length;)a++;n+=t.slice(s,a),i=!1;continue}let l=o==="{"?t.slice(a).match(za):null;if(l){let c=l[1]??"";if(c.startsWith("?"))throw new SyntaxError("Optional slots are supported in pointer templates only");n+=`_pointerValues[${e.length}]`,e.push(c),a+=l[0].length,i=!1;continue}let u=t.slice(a).match(/^[A-Za-z_$][\w$]*/);if(u){r.add(u[0]),n+=u[0],a+=u[0].length,i=["return","typeof","void","delete","new","in","instanceof","yield","await"].includes(u[0]);continue}n+=o,a++,/\s/.test(o)||(i=/[([{,:;=!?&|+*%~<>\/-]/.test(o))}return{text:n,slots:e,identifiers:r}}function Ha(t,e,r=()=>null){let n=new Map,i=[],a=s=>{if(n.has(s))return n.get(s);if(!t.has(s))throw new Error(`Referenced Source attribute '${s}' does not exist`);if(i.includes(s))throw new Error(`Cyclic attribute dependency: ${[...i,s].join(" -> ")}`);i.push(s);try{let o=t.get(s),l=typeof s=="string"?et(o):null,u=e.get(s);if(l){let c=d=>d?a(d):e.get(s);if(l.expression){let d=_i(l.body);u=r(s,o,d,d.slots.map(c))}else u=lr(l.body,c),e.get(s)==null&&(u=null)}return n.set(s,u),u}finally{i.pop()}};return new Map([...t.keys()].map(s=>[s,a(s)]))}function wi(t,e){let r=new Map([...Object.entries(t.getAttr()),...t.fixedAttrItems()]),n=new Set,i=[],a=s=>{let o=et(s);if(!o)return;let l=[];o.expression?l.push(..._i(o.body).slots):lr(o.body,u=>(l.push(u),""));for(let u of l.filter(Boolean)){if(!r.has(u))throw new Error(`Referenced Source attribute '${u}' does not exist`);if(i.includes(u))throw new Error(`Cyclic attribute dependency: ${[...i,u].join(" -> ")}`);n.has(u)||(i.push(u),a(r.get(u)),i.pop(),n.add(u))}};return a(e),n}/*!
|
|
10
25
|
* decimal.js v10.6.0
|
|
11
26
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
12
27
|
* https://github.com/MikeMcl/decimal.js
|
|
13
28
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
14
29
|
* MIT Licence
|
|
15
|
-
*/var It=9e15,rt=1e9,hi="0123456789abcdef",ln="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",un="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-It,maxE:It,crypto:!1},Fa,Ve,T=!0,dn="[DecimalError] ",tt=dn+"Invalid argument: ",qa=dn+"Precision limit exceeded",ja=dn+"crypto unavailable",Va="[object Decimal]",ce=Math.floor,Q=Math.pow,ql=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,jl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Vl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,za=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ce=1e7,D=7,zl=9007199254740991,Hl=ln.length-1,gi=un.length-1,b={toStringTag:Va};b.absoluteValue=b.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),E(t)};b.ceil=function(){return E(new this.constructor(this),this.e+1,2)};b.clampedTo=b.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(tt+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};b.comparedTo=b.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,l=a.s,u=t.s;if(!s||!o)return!l||!u?NaN:l!==u?l:s===o?0:!s^l<0?1:-1;if(!s[0]||!o[0])return s[0]?l:o[0]?-u:0;if(l!==u)return l;if(a.e!==t.e)return a.e>t.e^l<0?1:-1;for(n=s.length,i=o.length,e=0,r=n<i?n:i;e<r;++e)if(s[e]!==o[e])return s[e]>o[e]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};b.cosine=b.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=Wl(n,Xa(n,r)),n.precision=t,n.rounding=e,E(Ve==2||Ve==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};b.cubeRoot=b.cbrt=function(){var t,e,r,n,i,a,s,o,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(T=!1,a=c.s*Q(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=oe(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Q(r,1/3),t=ce((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new d(r),n.s=c.s):n=new d(a.toString()),s=(t=d.precision)+3;;)if(o=n,l=o.times(o).times(o),u=l.plus(c),n=q(u.plus(c).times(o),u.plus(l),s+2,1),oe(o.d).slice(0,s)===(r=oe(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(E(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(E(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return T=!0,E(n,t,d.rounding,e)};b.decimalPlaces=b.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-ce(this.e/D))*D,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};b.dividedBy=b.div=function(t){return q(this,new this.constructor(t))};b.dividedToIntegerBy=b.divToInt=function(t){var e=this,r=e.constructor;return E(q(e,new r(t),0,1,1),r.precision,r.rounding)};b.equals=b.eq=function(t){return this.cmp(t)===0};b.floor=function(){return E(new this.constructor(this),this.e+1,3)};b.greaterThan=b.gt=function(t){return this.cmp(t)>0};b.greaterThanOrEqualTo=b.gte=function(t){var e=this.cmp(t);return e==1||e===0};b.hyperbolicCosine=b.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/pn(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=Mt(s,1,a.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=a.times(a),a=o.minus(l.times(c.minus(l.times(c))));return E(a,s.precision=r,s.rounding=n,!0)};b.hyperbolicSine=b.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=Mt(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/pn(5,t)),i=Mt(a,2,i,i,!0);for(var s,o=new a(5),l=new a(16),u=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(l.times(s).plus(u))))}return a.precision=e,a.rounding=r,E(i,e,r,!0)};b.hyperbolicTangent=b.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};b.inverseCosine=b.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return r!==-1?r===0?t.isNeg()?Be(e,n,i):new e(0):new e(NaN):t.isZero()?Be(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))};b.inverseHyperbolicCosine=b.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,T=!1,r=r.times(r).minus(1).sqrt().plus(r),T=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};b.inverseHyperbolicSine=b.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,T=!1,r=r.times(r).plus(1).sqrt().plus(r),T=!0,n.precision=t,n.rounding=e,r.ln())};b.inverseHyperbolicTangent=b.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?E(new a(i),t,e,!0):(a.precision=r=n-i.e,i=q(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};b.inverseSine=b.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=Be(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};b.inverseTangent=b.atan=function(){var t,e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=gi)return s=Be(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=gi)return s=Be(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=o=d+10,c.rounding=1,r=Math.min(28,o/D+2|0),t=r;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(T=!1,e=Math.ceil(o/D),n=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),a=s.minus(i.div(n+=2)),i=i.times(l),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<<r-1)),T=!0,E(s,c.precision=d,c.rounding=f,!0)};b.isFinite=function(){return!!this.d};b.isInteger=b.isInt=function(){return!!this.d&&ce(this.e/D)>this.d.length-2};b.isNaN=function(){return!this.s};b.isNegative=b.isNeg=function(){return this.s<0};b.isPositive=b.isPos=function(){return this.s>0};b.isZero=function(){return!!this.d&&this.d[0]===0};b.lessThan=b.lt=function(t){return this.cmp(t)<0};b.lessThanOrEqualTo=b.lte=function(t){return this.cmp(t)<1};b.logarithm=b.log=function(t){var e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(T=!1,o=d+p,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),or(l.d,i=d,f))do if(o+=10,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),!a){+oe(l.d).slice(i+1,i+15)+1==1e14&&(l=E(l,d+1,0));break}while(or(l.d,i+=10,f));return T=!0,E(l,d,f)};b.minus=b.sub=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.constructor;if(t=new h(t),!p.d||!t.d)return!p.s||!t.s?t=new h(NaN):p.d?t.s=-t.s:t=new h(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,f=t.d,o=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new h(p);else return new h(l===3?-0:0);return T?E(t,o,l):t}if(r=ce(t.e/D),c=ce(p.e/D),u=u.slice(),a=c-r,a){for(d=a<0,d?(e=u,a=-a,s=f.length):(e=f,r=c,s=u.length),n=Math.max(Math.ceil(o/D),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}a=0}for(d&&(e=u,u=f,f=e,t.s=-t.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>a;){if(u[--n]<f[n]){for(i=n;i&&u[--i]===0;)u[i]=Ce-1;--u[i],u[n]+=Ce}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=fn(u,r),T?E(t,o,l):t):new h(l===3?-0:0)};b.modulo=b.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?E(new n(r),n.precision,n.rounding):(T=!1,n.modulo==9?(e=q(r,t.abs(),0,3,1),e.s*=t.s):e=q(r,t,0,n.modulo,1),e=e.times(t),T=!0,r.minus(e))};b.naturalExponential=b.exp=function(){return bi(this)};b.naturalLogarithm=b.ln=function(){return et(this)};b.negated=b.neg=function(){var t=new this.constructor(this);return t.s=-t.s,E(t)};b.plus=b.add=function(t){var e,r,n,i,a,s,o,l,u,c,d=this,f=d.constructor;if(t=new f(t),!d.d||!t.d)return!d.s||!t.s?t=new f(NaN):d.d||(t=new f(t.d||d.s===t.s?d:NaN)),t;if(d.s!=t.s)return t.s=-t.s,d.minus(t);if(u=d.d,c=t.d,o=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(t=new f(d)),T?E(t,o,l):t;if(a=ce(d.e/D),n=ce(t.e/D),u=u.slice(),i=a-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=a,s=u.length),a=Math.ceil(o/D),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/Ce|0,u[i]%=Ce;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=fn(u,n),T?E(t,o,l):t};b.precision=b.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(tt+t);return r.d?(e=Ha(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};b.round=function(){var t=this,e=t.constructor;return E(new e(t),t.e+1,e.rounding)};b.sine=b.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=Yl(n,Xa(n,r)),n.precision=t,n.rounding=e,E(Ve>2?r.neg():r,t,e,!0)):new n(NaN)};b.squareRoot=b.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?s:1/0);for(T=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=oe(o),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ce((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(a=n,n=a.plus(q(s,a,r+2,1)).times(.5),oe(a.d).slice(0,r)===(e=oe(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(E(a,l+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,l+1,1),t=!n.times(n).eq(s));break}return T=!0,E(n,l,c.rounding,t)};b.tangent=b.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,E(Ve==2||Ve==4?r.neg():r,t,e,!0)):new n(NaN)};b.times=b.mul=function(t){var e,r,n,i,a,s,o,l,u,c=this,d=c.constructor,f=c.d,p=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?t.s/0:t.s*0);for(r=ce(c.e/D)+ce(t.e/D),l=f.length,u=p.length,l<u&&(a=f,f=p,p=a,s=l,l=u,u=s),a=[],s=l+u,n=s;n--;)a.push(0);for(n=u;--n>=0;){for(e=0,i=l+n;i>n;)o=a[i]+p[n]*f[i-n-1]+e,a[i--]=o%Ce|0,e=o/Ce|0;a[i]=(a[i]+e)%Ce|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=fn(a,r),T?E(t,d.precision,d.rounding):t};b.toBinary=function(t,e){return _i(this,2,t,e)};b.toDecimalPlaces=b.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ge(t,0,rt),e===void 0?e=n.rounding:ge(e,0,8),E(r,t+r.e+1,e))};b.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,!0):(ge(t,0,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t+1,e),r=Ie(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Ie(i):(ge(t,0,rt),e===void 0?e=a.rounding:ge(e,0,8),n=E(new a(i),t+i.e+1,e),r=Ie(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};b.toFraction=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(u=r=new m(1),n=l=new m(0),e=new m(n),a=e.e=Ha(h)-p.e-1,s=a%D,e.d[0]=Q(10,s<0?D+s:s),t==null)t=a>0?e:u;else{if(o=new m(t),!o.isInt()||o.lt(u))throw Error(tt+o);t=o.gt(e)?a>0?e:u:o}for(T=!1,o=new m(oe(h)),c=m.precision,m.precision=a=h.length*D*2;d=q(o,e,0,1,1),i=r.plus(d.times(n)),i.cmp(t)!=1;)r=n,n=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=o.minus(d.times(i)),o=i;return i=q(t.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=p.s,f=q(u,n,a,1).minus(p).abs().cmp(q(l,r,a,1).minus(p).abs())<1?[u,n]:[l,r],m.precision=c,T=!0,f};b.toHexadecimal=b.toHex=function(t,e){return _i(this,16,t,e)};b.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:ge(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(T=!1,r=q(r,t,0,e,1).times(t),T=!0,E(r)):(t.s=r.s,r=t),r};b.toNumber=function(){return+this};b.toOctal=function(t,e){return _i(this,8,t,e)};b.toPower=b.pow=function(t){var e,r,n,i,a,s,o=this,l=o.constructor,u=+(t=new l(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new l(Q(+o,u));if(o=new l(o),o.eq(1))return o;if(n=l.precision,a=l.rounding,t.eq(1))return E(o,n,a);if(e=ce(t.e/D),e>=t.d.length-1&&(r=u<0?-u:u)<=zl)return i=Wa(l,o,r,n),t.s<0?new l(1).div(i):E(i,n,a);if(s=o.s,s<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(s=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=s,o}return r=Q(+o,u),e=r==0||!isFinite(r)?ce(u*(Math.log("0."+oe(o.d))/Math.LN10+o.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(T=!1,l.rounding=o.s=1,r=Math.min(12,(e+"").length),i=bi(t.times(et(o,n+r)),n),i.d&&(i=E(i,n+5,1),or(i.d,n,a)&&(e=n+10,i=E(bi(t.times(et(o,e+r)),e),e+5,1),+oe(i.d).slice(n+1,n+15)+1==1e14&&(i=E(i,n+1,0)))),i.s=s,T=!0,l.rounding=a,E(i,n,a))};b.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ge(t,1,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t,e),r=Ie(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toSignificantDigits=b.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ge(t,1,rt),e===void 0?e=n.rounding:ge(e,0,8)),E(new n(r),t,e)};b.toString=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};b.truncated=b.trunc=function(){return E(new this.constructor(this),this.e+1,1)};b.valueOf=b.toJSON=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function oe(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)n=t[e]+"",r=D-n.length,r&&(a+=Qe(r)),a+=n;s=t[e],n=s+"",r=D-n.length,r&&(a+=Qe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}function ge(t,e,r){if(t!==~~t||t<e||t>r)throw Error(tt+t)}function or(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=D,i=0):(i=Math.ceil((e+1)/D),e%=D),a=Q(10,D-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==Q(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==Q(10,e-3)-1,s}function sn(t,e,r){for(var n,i=[0],a,s=0,o=t.length;s<o;){for(a=i.length;a--;)i[a]*=e;for(i[0]+=hi.indexOf(t.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Wl(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/pn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=Mt(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var q=(function(){function t(n,i,a){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,l;if(a!=s)l=a>s?1:-1;else for(o=l=0;o<a;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*s+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s,o,l){var u,c,d,f,p,h,m,g,_,v,w,x,B,L,Z,ie,ae,je,K,he,Ee=n.constructor,F=n.s==i.s?1:-1,J=n.d,S=i.d;if(!J||!J[0]||!S||!S[0])return new Ee(!n.s||!i.s||(J?S&&J[0]==S[0]:!S)?NaN:J&&J[0]==0||!S?F*0:F/0);for(l?(p=1,c=n.e-i.e):(l=Ce,p=D,c=ce(n.e/p)-ce(i.e/p)),K=S.length,ae=J.length,_=new Ee(F),v=_.d=[],d=0;S[d]==(J[d]||0);d++);if(S[d]>(J[d]||0)&&c--,a==null?(L=a=Ee.precision,s=Ee.rounding):o?L=a+(n.e-i.e)+1:L=a,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,K==1){for(f=0,S=S[0],L++;(d<ae||f)&&L--;d++)Z=f*l+(J[d]||0),v[d]=Z/S|0,f=Z%S|0;h=f||d<ae}else{for(f=l/(S[0]+1)|0,f>1&&(S=t(S,f,l),J=t(J,f,l),K=S.length,ae=J.length),ie=K,w=J.slice(0,K),x=w.length;x<K;)w[x++]=0;he=S.slice(),he.unshift(0),je=S[0],S[1]>=l/2&&++je;do f=0,u=e(S,w,K,x),u<0?(B=w[0],K!=x&&(B=B*l+(w[1]||0)),f=B/je|0,f>1?(f>=l&&(f=l-1),m=t(S,f,l),g=m.length,x=w.length,u=e(m,w,g,x),u==1&&(f--,r(m,K<g?he:S,g,l))):(f==0&&(u=f=1),m=S.slice()),g=m.length,g<x&&m.unshift(0),r(w,m,x,l),u==-1&&(x=w.length,u=e(S,w,K,x),u<1&&(f++,r(w,K<x?he:S,x,l))),x=w.length):u===0&&(f++,w=[0]),v[d++]=f,u&&w[0]?w[x++]=J[ie]||0:(w=[J[ie]],x=1);while((ie++<ae||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=c,Fa=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+c*p-1,E(_,o?a+_.e+1:a,s,h)}return _}})();function E(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,o=d[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=D,s=e,c=d[f=0],l=c/Q(10,i-s-1)%10|0;else if(f=Math.ceil((a+1)/D),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=l=0,i=1,a%=D,s=a-D+1}else break e;else{for(c=o=d[f],i=1;o>=10;o/=10)i++;a%=D,s=a-D+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(a>0?s>0?c/Q(10,i-s):0:d[f-1])%10&1||r==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=Q(10,(D-e%D)%D),t.e=-e||0):d[0]=t.e=0,t;if(a==0?(d.length=f,o=1,f--):(d.length=f+1,o=Q(10,D-a),d[f]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*o:0),u)for(;;)if(f==0){for(a=1,s=d[0];s>=10;s/=10)a++;for(s=d[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,d[0]==Ce&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ce)break;d[f--]=0,o=1}for(a=d.length;d[--a]===0;)d.pop()}return T&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function Ie(t,e,r){if(!t.isFinite())return Ya(t);var n,i=t.e,a=oe(t.d),s=a.length;return e?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+Qe(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+Qe(-i-1)+a,r&&(n=r-s)>0&&(a+=Qe(n))):i>=s?(a+=Qe(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+Qe(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=Qe(n))),a}function fn(t,e){var r=t[0];for(e*=D;r>=10;r/=10)e++;return e}function cn(t,e,r){if(e>Hl)throw T=!0,r&&(t.precision=r),Error(qa);return E(new t(ln),e,1,!0)}function Be(t,e,r){if(e>gi)throw Error(qa);return E(new t(un),e,r,!0)}function Ha(t){var e=t.length-1,r=e*D+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function Qe(t){for(var e="";t--;)e+="0";return e}function Wa(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/D+4);for(T=!1;;){if(r%2&&(a=a.times(e),$a(a.d,s)&&(i=!0)),r=ce(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),$a(e.d,s)}return T=!0,a}function Pa(t){return t.d[t.d.length-1]&1}function Ga(t,e,r){for(var n,i,a=new t(e[0]),s=0;++s<e.length;){if(i=new t(e[s]),!i.s){a=i;break}n=a.cmp(i),(n===r||n===0&&a.s===r)&&(a=i)}return a}function bi(t,e){var r,n,i,a,s,o,l,u=0,c=0,d=0,f=t.constructor,p=f.rounding,h=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(T=!1,l=h):l=e,o=new f(.03125);t.e>-2;)t=t.times(o),d+=5;for(n=Math.log(Q(2,d))/Math.LN10*2+5|0,l+=n,r=a=s=new f(1),f.precision=l;;){if(a=E(a.times(t),l,1),r=r.times(++c),o=s.plus(q(a,r,l,1)),oe(o.d).slice(0,l)===oe(s.d).slice(0,l)){for(i=d;i--;)s=E(s.times(s),l,1);if(e==null)if(u<3&&or(s.d,l-n,p,u))f.precision=l+=10,r=a=o=new f(1),c=0,u++;else return E(s,f.precision=h,p,T=!0);else return f.precision=h,s}s=o}}function et(t,e){var r,n,i,a,s,o,l,u,c,d,f,p=1,h=10,m=t,g=m.d,_=m.constructor,v=_.rounding,w=_.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(T=!1,c=w):c=e,_.precision=c+=h,r=oe(g),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=oe(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new _("0."+r),a++):m=new _(n+"."+r.slice(1))}else return u=cn(_,c+2,w).times(a+""),m=et(new _(n+"."+r.slice(1)),c-h).plus(u),_.precision=w,e==null?E(m,w,v,T=!0):m;for(d=m,l=s=m=q(m.minus(1),m.plus(1),c,1),f=E(m.times(m),c,1),i=3;;){if(s=E(s.times(f),c,1),u=l.plus(q(s,new _(i),c,1)),oe(u.d).slice(0,c)===oe(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(cn(_,c+2,w).times(a+""))),l=q(l,new _(p),c,1),e==null)if(or(l.d,c-h,v,o))_.precision=c+=h,u=s=m=q(d.minus(1),d.plus(1),c,1),f=E(m.times(m),c,1),i=o=1;else return E(l,_.precision=w,v,T=!0);else return _.precision=w,l;l=u,i+=2}}function Ya(t){return String(t.s*t.s/0)}function on(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%D,r<0&&(n+=D),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=D;n<i;)t.d.push(+e.slice(n,n+=D));e=e.slice(n),n=D-e.length}else n-=i;for(;n--;)e+="0";t.d.push(+e),T&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function Gl(t,e){var r,n,i,a,s,o,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),za.test(e))return on(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(jl.test(e))r=16,e=e.toLowerCase();else if(ql.test(e))r=2;else if(Vl.test(e))r=8;else throw Error(tt+e);for(a=e.search(/p/i),a>0?(l=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=Wa(n,new n(r),a,a*2)),u=sn(e,r,Ce),c=u.length-1,a=c;u[a]===0;--a)u.pop();return a<0?new n(t.s*0):(t.e=fn(u,c),t.d=u,T=!1,s&&(t=q(t,i,o*4)),l&&(t=t.times(Math.abs(l)<54?Q(2,l):lr.pow(2,l))),T=!0,t)}function Yl(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Mt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/pn(5,r)),e=Mt(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function Mt(t,e,r,n,i){var a,s,o,l,u=1,c=t.precision,d=Math.ceil(c/D);for(T=!1,l=r.times(r),o=new t(n);;){if(s=q(o.times(l),new t(e++*e++),c,1),o=i?n.plus(s):n.minus(s),n=q(s.times(l),new t(e++*e++),c,1),s=o.plus(n),s.d[d]!==void 0){for(a=d;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a,u++}return T=!0,s.d.length=d+1,s}function pn(t,e){for(var r=t;--e;)r*=t;return r}function Xa(t,e){var r,n=e.s<0,i=Be(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return Ve=n?4:1,e;if(r=e.divToInt(i),r.isZero())Ve=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return Ve=Pa(r)?n?2:3:n?4:1,e;Ve=Pa(r)?n?1:4:n?3:2}return e.minus(i).abs()}function _i(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor,h=r!==void 0;if(h?(ge(r,1,rt),n===void 0?n=p.rounding:ge(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=Ya(t);else{for(c=Ie(t),s=c.indexOf("."),h?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-s,f.d=sn(Ie(f),10,i),f.e=f.d.length),d=sn(c,10,i),a=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=d,t.e=a,t=q(t,f,r,n,0,i),d=t.d,a=t.e,u=Fa),s=d[r],o=i/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||u||n===6&&d[r-1]&1||n===(t.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++a,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=hi.charAt(d[s]);if(h){if(l>1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=sn(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=hi.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function $a(t,e){if(t.length>e)return t.length=e,!0}function Xl(t){return new this(t).abs()}function Zl(t){return new this(t).acos()}function Jl(t){return new this(t).acosh()}function Kl(t,e){return new this(t).plus(e)}function Ql(t){return new this(t).asin()}function eu(t){return new this(t).asinh()}function tu(t){return new this(t).atan()}function ru(t){return new this(t).atanh()}function nu(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Be(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Be(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Be(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(q(t,e,a,1)),e=Be(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(q(t,e,a,1)),r}function iu(t){return new this(t).cbrt()}function au(t){return E(t=new this(t),t.e+1,2)}function su(t,e,r){return new this(t).clamp(e,r)}function ou(t){if(!t||typeof t!="object")throw Error(dn+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,rt,"rounding",0,8,"toExpNeg",-It,0,"toExpPos",0,It,"maxE",0,It,"minE",-It,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(r=a[e],i&&(this[r]=mi[r]),(n=t[r])!==void 0)if(ce(n)===n&&n>=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error(tt+r+": "+n);if(r="crypto",i&&(this[r]=mi[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ja);else this[r]=!1;else throw Error(tt+r+": "+n);return this}function lu(t){return new this(t).cos()}function uu(t){return new this(t).cosh()}function Za(t){var e,r,n;function i(a){var s,o,l,u=this;if(!(u instanceof i))return new i(a);if(u.constructor=i,Ua(a)){u.s=a.s,T?!a.d||a.e>i.maxE?(u.e=NaN,u.d=null):a.e<i.minE?(u.e=0,u.d=[0]):(u.e=a.e,u.d=a.d.slice()):(u.e=a.e,u.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){u.s=1/a<0?-1:1,u.e=0,u.d=[0];return}if(a<0?(a=-a,u.s=-1):u.s=1,a===~~a&&a<1e7){for(s=0,o=a;o>=10;o/=10)s++;T?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[a]):(u.e=s,u.d=[a]);return}if(a*0!==0){a||(u.s=NaN),u.e=NaN,u.d=null;return}return on(u,a.toString())}if(l==="string")return(o=a.charCodeAt(0))===45?(a=a.slice(1),u.s=-1):(o===43&&(a=a.slice(1)),u.s=1),za.test(a)?on(u,a):Gl(u,a);if(l==="bigint")return a<0?(a=-a,u.s=-1):u.s=1,on(u,a.toString());throw Error(tt+a)}if(i.prototype=b,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=ou,i.clone=Za,i.isDecimal=Ua,i.abs=Xl,i.acos=Zl,i.acosh=Jl,i.add=Kl,i.asin=Ql,i.asinh=eu,i.atan=tu,i.atanh=ru,i.atan2=nu,i.cbrt=iu,i.ceil=au,i.clamp=su,i.cos=lu,i.cosh=uu,i.div=cu,i.exp=du,i.floor=fu,i.hypot=pu,i.ln=hu,i.log=mu,i.log10=bu,i.log2=gu,i.max=_u,i.min=wu,i.mod=yu,i.mul=vu,i.pow=ku,i.random=Eu,i.round=xu,i.sign=Du,i.sin=Au,i.sinh=Tu,i.sqrt=Cu,i.sub=Nu,i.sum=Su,i.tan=Ou,i.tanh=Bu,i.trunc=Iu,t===void 0&&(t={}),t&&t.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function cu(t,e){return new this(t).div(e)}function du(t){return new this(t).exp()}function fu(t){return E(t=new this(t),t.e+1,3)}function pu(){var t,e,r=new this(0);for(T=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return T=!0,new this(1/0);r=e}return T=!0,r.sqrt()}function Ua(t){return t instanceof lr||t&&t.toStringTag===Va||!1}function hu(t){return new this(t).ln()}function mu(t,e){return new this(t).log(e)}function gu(t){return new this(t).log(2)}function bu(t){return new this(t).log(10)}function _u(){return Ga(this,arguments,-1)}function wu(){return Ga(this,arguments,1)}function yu(t,e){return new this(t).mod(e)}function vu(t,e){return new this(t).mul(e)}function ku(t,e){return new this(t).pow(e)}function Eu(t){var e,r,n,i,a=0,s=new this(1),o=[];if(t===void 0?t=this.precision:ge(t,1,rt),n=Math.ceil(t/D),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));a<n;)i=e[a],i>=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a<n;)i=e[a]+(e[a+1]<<8)+(e[a+2]<<16)+((e[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(ja);else for(;a<n;)o[a++]=Math.random()*1e7|0;for(n=o[--a],t%=D,n&&t&&(i=Q(10,D-t),o[a]=(n/i|0)*i);o[a]===0;a--)o.pop();if(a<0)r=0,o=[0];else{for(r=-1;o[0]===0;r-=D)o.shift();for(n=1,i=o[0];i>=10;i/=10)n++;n<D&&(r-=D-n)}return s.e=r,s.d=o,s}function xu(t){return E(t=new this(t),t.e+1,this.rounding)}function Du(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Au(t){return new this(t).sin()}function Tu(t){return new this(t).sinh()}function Cu(t){return new this(t).sqrt()}function Nu(t,e){return new this(t).sub(e)}function Su(){var t=0,e=arguments,r=new this(e[t]);for(T=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return T=!0,E(r,this.precision,this.rounding)}function Ou(t){return new this(t).tan()}function Bu(t){return new this(t).tanh()}function Iu(t){return E(t=new this(t),t.e+1,1)}b[Symbol.for("nodejs.util.inspect.custom")]=b.toString;b[Symbol.toStringTag]="Decimal";var lr=b.constructor=Za(mi);ln=new lr(ln);un=new lr(un);var Ja=lr;var Mu=20,Ru=1,pt=1e6,Ka=1e6,Lu=-7,Pu=21,$u=!1,ur="[big.js] ",ht=ur+"Invalid ",hn=ht+"decimal places",Uu=ht+"rounding mode",Qa=ur+"Division by zero",$={},Me=void 0,Fu=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function es(){function t(e){var r=this;if(!(r instanceof t))return e===Me?es():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(ht+"value");e=e===0&&1/e<0?"-0":String(e)}qu(r,e)}r.constructor=t}return t.prototype=$,t.DP=Mu,t.RM=Ru,t.NE=Lu,t.PE=Pu,t.strict=$u,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function qu(t,e){var r,n,i;if(!Fu.test(e))throw Error(ht+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function mt(t,e,r,n){var i=t.c;if(r===Me&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(Uu);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Me))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Me||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function gt(t,e,r){var n=t.e,i=t.c.join(""),a=i.length;if(e)i=i.charAt(0)+(a>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>a)for(n-=a;n--;)i+="0";else n<a&&(i=i.slice(0,n)+"."+i.slice(n));else a>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}$.abs=function(){var t=new this.constructor(this);return t.s=1,t};$.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,a=r.s,s=t.s,o=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?a:i[0]?-s:0;if(a!=s)return a;if(e=a<0,o!=l)return o>l^e?1:-1;for(s=(o=n.length)<(l=i.length)?o:l,a=-1;++a<s;)if(n[a]!=i[a])return n[a]>i[a]^e?1:-1;return o==l?0:o>l^e?1:-1};$.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,a=e.s==t.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>pt)throw Error(hn);if(!i[0])throw Error(Qa);if(!n[0])return t.s=a,t.c=[t.e=0],t;var o,l,u,c,d,f=i.slice(),p=o=i.length,h=n.length,m=n.slice(0,o),g=m.length,_=t,v=_.c=[],w=0,x=s+(_.e=e.e-t.e)+1;for(_.s=a,a=x<0?0:x,f.unshift(0);g++<o;)m.push(0);do{for(u=0;u<10;u++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(i[d]!=m[d]){c=i[d]>m[d]?1:-1;break}if(c<0){for(l=g==o?i:f;g;){if(m[--g]<l[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=l[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?u:++u,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Me)&&a--);return!v[0]&&w!=1&&(v.shift(),_.e--,x--),w>x&&mt(_,x,r.RM,m[0]!==Me),_};$.eq=function(t){return this.cmp(t)===0};$.gt=function(t){return this.cmp(t)>0};$.gte=function(t){return this.cmp(t)>-1};$.lt=function(t){return this.cmp(t)<0};$.lte=function(t){return this.cmp(t)<1};$.minus=$.sub=function(t){var e,r,n,i,a=this,s=a.constructor,o=a.s,l=(t=new s(t)).s;if(o!=l)return t.s=-l,a.plus(t);var u=a.c.slice(),c=a.e,d=t.c,f=t.e;if(!u[0]||!d[0])return d[0]?t.s=-l:u[0]?t=new s(a):t.s=1,t;if(o=c-f){for((i=o<0)?(o=-o,n=u):(f=c,n=d),n.reverse(),l=o;l--;)n.push(0);n.reverse()}else for(r=((i=u.length<d.length)?u:d).length,o=l=0;l<r;l++)if(u[l]!=d[l]){i=u[l]<d[l];break}if(i&&(n=u,u=d,d=n,t.s=-t.s),(l=(r=d.length)-(e=u.length))>0)for(;l--;)u[e++]=0;for(l=e;r>o;){if(u[--r]<d[r]){for(e=r;e&&!u[--e];)u[e]=9;--u[e],u[r]+=10}u[r]-=d[r]}for(;u[--l]===0;)u.pop();for(;u[0]===0;)u.shift(),--f;return u[0]||(t.s=1,u=[f=0]),t.c=u,t.e=f,t};$.mod=function(t){var e,r=this,n=r.constructor,i=r.s,a=(t=new n(t)).s;if(!t.c[0])throw Error(Qa);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=a,e?new n(r):(i=n.DP,a=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=a,this.minus(r.times(t)))};$.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};$.plus=$.add=function(t){var e,r,n,i=this,a=i.constructor;if(t=new a(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var s=i.e,o=i.c,l=t.e,u=t.c;if(!o[0]||!u[0])return u[0]||(o[0]?t=new a(i):t.s=i.s),t;if(o=o.slice(),e=s-l){for(e>0?(l=s,n=u):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-u.length<0&&(n=u,u=o,o=n),e=u.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+u[e]+r)/10|0;for(r&&(o.unshift(r),++l),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=l,t};$.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-Ka||t>Ka)throw Error(ht+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};$.prec=function(t,e){if(t!==~~t||t<1||t>pt)throw Error(ht+"precision");return mt(new this.constructor(this),t,e)};$.round=function(t,e){if(t===Me)t=0;else if(t!==~~t||t<-pt||t>pt)throw Error(hn);return mt(new this.constructor(this),t+this.e+1,e)};$.sqrt=function(){var t,e,r,n=this,i=n.constructor,a=n.s,s=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(a<0)throw Error(ur+"No square root");a=Math.sqrt(+gt(n,!0,!0)),a===0||a===1/0?(e=n.c.join(""),e.length+s&1||(e+="0"),a=Math.sqrt(e),s=((s+1)/2|0)-(s<0||s&1),t=new i((a==1/0?"5e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+s)):t=new i(a+""),s=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(n.div(r)));while(r.c.slice(0,s).join("")!==t.c.slice(0,s).join(""));return mt(t,(i.DP-=4)+t.e+1,i.RM)};$.times=$.mul=function(t){var e,r=this,n=r.constructor,i=r.c,a=(t=new n(t)).c,s=i.length,o=a.length,l=r.e,u=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!a[0])return t.c=[t.e=0],t;for(t.e=l+u,s<o&&(e=i,i=a,a=e,u=s,s=o,o=u),e=new Array(u=s+o);u--;)e[u]=0;for(l=o;l--;){for(o=0,u=s+l;u>l;)o=e[u]+a[l]*i[u-l-1]+o,e[u--]=o%10,o=o/10|0;e[u]=o}for(o?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};$.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return gt(r,!0,!!n)};$.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return gt(r,!1,!!n)};$[Symbol.for("nodejs.util.inspect.custom")]=$.toJSON=$.toString=function(){var t=this,e=t.constructor;return gt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};$.toNumber=function(){var t=+gt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(ur+"Imprecise conversion");return t};$.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Me){if(t!==~~t||t<1||t>pt)throw Error(ht+"precision");for(r=mt(new n(r),t,e);r.c.length<t;)r.c.push(0)}return gt(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};$.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(ur+"valueOf disallowed");return gt(t,t.e<=e.NE||t.e>=e.PE,!0)};var ju=es(),ts=ju;var Ni={};Ia(Ni,{DecodeError:()=>de,Decoder:()=>Se,EXT_TIMESTAMP:()=>yi,Encoder:()=>Rt,ExtData:()=>Ne,ExtensionCodec:()=>nt,decode:()=>cs,decodeArrayStream:()=>ps,decodeAsync:()=>fs,decodeMulti:()=>ds,decodeMultiStream:()=>hs,decodeTimestampExtension:()=>Di,decodeTimestampToTimeSpec:()=>xi,encode:()=>bn,encodeDateToTimeSpec:()=>ki,encodeTimeSpecToTimestamp:()=>vi,encodeTimestampExtension:()=>Ei});function rs(t){let e=t.length,r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if((i&4294967168)===0){r++;continue}else if((i&4294965248)===0)r+=2;else{if(i>=55296&&i<=56319&&n<e){let a=t.charCodeAt(n);(a&64512)===56320&&(++n,i=((i&1023)<<10)+(a&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function Vu(t,e,r){let n=t.length,i=r,a=0;for(;a<n;){let s=t.charCodeAt(a++);if((s&4294967168)===0){e[i++]=s;continue}else if((s&4294965248)===0)e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<n){let o=t.charCodeAt(a);(o&64512)===56320&&(++a,s=((s&1023)<<10)+(o&1023)+65536)}(s&4294901760)===0?(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128):(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128)}e[i++]=s&63|128}}var zu=new TextEncoder,Hu=50;function Wu(t,e,r){zu.encodeInto(t,e.subarray(r))}function ns(t,e,r){t.length>Hu?Wu(t,e,r):Vu(t,e,r)}var Gu=4096;function wi(t,e,r){let n=e,i=n+r,a=[],s="";for(;n<i;){let o=t[n++];if((o&128)===0)a.push(o);else if((o&224)===192){let l=t[n++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){let l=t[n++]&63,u=t[n++]&63;a.push((o&31)<<12|l<<6|u)}else if((o&248)===240){let l=t[n++]&63,u=t[n++]&63,c=t[n++]&63,d=(o&7)<<18|l<<12|u<<6|c;d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|d&1023),a.push(d)}else a.push(o);a.length>=Gu&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}var Yu=new TextDecoder,Xu=200;function Zu(t,e,r){let n=t.subarray(e,e+r);return Yu.decode(n)}function is(t,e,r){return r>Xu?Zu(t,e,r):wi(t,e,r)}var Ne=class{type;data;constructor(e,r){this.type=e,this.data=r}};var de=class t extends Error{constructor(e){super(e);let r=Object.create(t.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};function as(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function mn(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function gn(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function ss(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var yi=-1,Ju=4294967296-1,Ku=17179869184-1;function vi({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Ku)if(e===0&&t<=Ju){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}else{let r=t/4294967296,n=t&4294967295,i=new Uint8Array(8),a=new DataView(i.buffer);return a.setUint32(0,e<<2|r&3),a.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),mn(n,4,t),r}}function ki(t){let e=t.getTime(),r=Math.floor(e/1e3),n=(e-r*1e3)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-i*1e9}}function Ei(t){if(t instanceof Date){let e=ki(t);return vi(e)}else return null}function xi(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let r=e.getUint32(0),n=e.getUint32(4),i=(r&3)*4294967296+n,a=r>>>2;return{sec:i,nsec:a}}case 12:{let r=gn(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new de(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Di(t){let e=xi(t);return new Date(e.sec*1e3+e.nsec/1e6)}var os={type:yi,encode:Ei,decode:Di};var nt=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(os)}register({type:e,encode:r,decode:n}){if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{let i=-1-e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}}tryToEncode(e,r){for(let n=0;n<this.builtInEncoders.length;n++){let i=this.builtInEncoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=-1-n;return new Ne(s,a)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=n;return new Ne(s,a)}}}return e instanceof Ne?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Ne(r,e)}};function Qu(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function cr(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Qu(t)?new Uint8Array(t):Uint8Array.from(t)}var ec=100,tc=2048,Rt=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??ec,this.initialBufferSize=e?.initialBufferSize??tc,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,r)}ensureBufferSizeToWrite(e){let r=this.pos+e;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(e){let r=new ArrayBuffer(e),n=new Uint8Array(r),i=new DataView(r);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=rs(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),ns(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,r){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,r);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let r=e.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);let n=cr(e);this.writeU8a(n)}encodeArray(e,r){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let i of e)this.doEncode(i,r+1)}countWithoutUndefined(e,r){let n=0;for(let i of r)e[i]!==void 0&&n++;return n}encodeMap(e,r){let n=Object.keys(e);this.sortKeys&&n.sort();let i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(let a of n){let s=e[a];this.ignoreUndefined&&s===void 0||(this.encodeString(a),this.doEncode(s,r+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}let r=e.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let r=e.length;this.ensureBufferSizeToWrite(r),this.bytes.set(e,this.pos),this.pos+=r}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),as(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),mn(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function bn(t,e){return new Rt(e).encodeSharedRef(t)}function _n(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var rc=16,nc=16,wn=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=rc,r=nc){this.maxKeyLength=e,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,r,n){let i=this.caches[n-1];e:for(let a of i){let s=a.bytes;for(let o=0;o<n;o++)if(s[o]!==e[r+o])continue e;return a.str}return null}store(e,r){let n=this.caches[e.length-1],i={bytes:e,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,r,n){let i=this.find(e,r,n);if(i!=null)return this.hit++,i;this.miss++;let a=wi(e,r,n),s=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(s,a),a}};var Ai="array",pr="map_key",us="map_value",ic=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new de("The type of key must be string or number but "+typeof t)},Ti=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Ai,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=pr,r.readCount=0,r.size=e,r.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Ai){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===pr||e.type===us){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},fr=-1,Ci=new DataView(new ArrayBuffer(0)),ac=new Uint8Array(Ci.buffer);try{Ci.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ls=new RangeError("Insufficient data"),sc=new wn,Se=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Ci;bytes=ac;headByte=fr;stack=new Ti;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:sc,this.mapKeyConverter=e?.mapKeyConverter??ic}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=fr,this.stack.reset()}setBuffer(e){let r=cr(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===fr&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=cr(e),i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let r=!1,n;for await(let o of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{n=this.doDecodeSync(),r=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${_n(i)} at ${s} (${a} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,r){if(this.entered){yield*this.clone().decodeMultiAsync(e,r);return}try{this.entered=!0;let n=r,i=-1;for await(let a of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),r;if(e>=224)r=e-256;else if(e<192)if(e<128)r=e;else if(e<144){let i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e<160){let i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else{let i=e-160;r=this.decodeString(i,0)}else if(e===192)r=null;else if(e===194)r=!1;else if(e===195)r=!0;else if(e===202)r=this.readF32();else if(e===203)r=this.readF64();else if(e===204)r=this.readU8();else if(e===205)r=this.readU16();else if(e===206)r=this.readU32();else if(e===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(e===208)r=this.readI8();else if(e===209)r=this.readI16();else if(e===210)r=this.readI32();else if(e===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(e===217){let i=this.lookU8();r=this.decodeString(i,1)}else if(e===218){let i=this.lookU16();r=this.decodeString(i,2)}else if(e===219){let i=this.lookU32();r=this.decodeString(i,4)}else if(e===220){let i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===221){let i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===222){let i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===223){let i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===196){let i=this.lookU8();r=this.decodeBinary(i,1)}else if(e===197){let i=this.lookU16();r=this.decodeBinary(i,2)}else if(e===198){let i=this.lookU32();r=this.decodeBinary(i,4)}else if(e===212)r=this.decodeExtension(1,0);else if(e===213)r=this.decodeExtension(2,0);else if(e===214)r=this.decodeExtension(4,0);else if(e===215)r=this.decodeExtension(8,0);else if(e===216)r=this.decodeExtension(16,0);else if(e===199){let i=this.lookU8();r=this.decodeExtension(i,1)}else if(e===200){let i=this.lookU16();r=this.decodeExtension(i,2)}else if(e===201){let i=this.lookU32();r=this.decodeExtension(i,4)}else throw new de(`Unrecognized type byte: ${_n(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Ai)if(i.array[i.position]=r,i.position++,i.position===i.size)r=i.array,n.release(i);else continue e;else if(i.type===pr){if(r==="__proto__")throw new de("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=us;continue e}else if(i.map[i.key]=r,i.readCount++,i.readCount===i.size)r=i.map,n.release(i);else{i.key=null,i.type=pr;continue e}}return r}}readHeadByte(){return this.headByte===fr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=fr}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new de(`Unrecognized array type byte: ${_n(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new de(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new de(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,r):this.decodeBinary(e,r)}decodeUtf8String(e,r){if(e>this.maxStrLength)throw new de(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw ls;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=is(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===pr:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new de(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw ls;let n=this.pos+r,i=this.bytes.subarray(n,n+e);return this.pos+=r+e,i}decodeExtension(e,r){if(e>this.maxExtLength)throw new de(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+r),i=this.decodeBinary(e,r+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=ss(this.view,this.pos);return this.pos+=8,e}readI64(){let e=gn(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function cs(t,e){return new Se(e).decode(t)}function ds(t,e){return new Se(e).decodeMulti(t)}function oc(t){return t[Symbol.asyncIterator]!=null}async function*lc(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function yn(t){return oc(t)?t:lc(t)}async function fs(t,e){let r=yn(t);return new Se(e).decodeAsync(r)}function ps(t,e){let r=yn(t);return new Se(e).decodeArrayStream(r)}function hs(t,e){let r=yn(t);return new Se(e).decodeStream(r)}var Un=Ma(Ji(),1),Ki=Ja,Qi=ts,$e=Ni,yo=Un.DOMParser,vo=Un.XMLSerializer;var ko=$e!==null;function Eo(){if(!ko)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var xo=lf();function lf(){if(!ko)return null;let t=new TextEncoder,e=new TextDecoder,r=new $e.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=vt(n);if(i==="D"||i==="H")return null}return $e.encodeTimestampExtension(n)},decode:n=>$e.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>Te(n)?t.encode(n.toString()):null,decode:n=>Fn(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&&vt(n)==="D"){let i=n.getUTCFullYear(),a=String(n.getUTCMonth()+1).padStart(2,"0"),s=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${a}-${s}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&&vt(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),a=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${a}:${s}.${o}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf("."),s=a>=0?i.substring(0,a):i,o=a>=0?i.substring(a+1):"0",[l,u,c]=s.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+u,+c,d))}}),r.register({type:4,encode:n=>{let i=ea(n);if(i!==null){let[a,s]=i;return t.encode(`${a}:${s(n)}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf(":"),s=i.slice(0,a),o=i.slice(a+1),l=ct[s];if(l!==void 0){let[,u]=l;return u(o)}return`${o}::${s}`}}),r}function Do(t){return Eo(),$e.encode(t,{extensionCodec:xo})}function Ao(t){return Eo(),$e.decode(t,{extensionCodec:xo})}function jn(t,e=!1){let r=Vn(t);if(r===null)return[!1,String(t)];let[n,i,a]=r;return a&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function ta(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=ct[n];if(i===void 0)return[!1,t];let[,a]=i;return[!0,a(r)]}function qn(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,a]of Object.entries(t))n[i]=qn(a,e,r);return n}return Array.isArray(t)?t.map(n=>qn(n,e,r)):r(t)?e(t):t}function ra(t){let e=Vn(t);if(e!==null){let[r,n,i]=e;return i?[t,!1]:[`${n(t)}::${r}`,!0]}if(Array.isArray(t)){let r=!1;return[t.map(i=>{let[a,s]=ra(i);return s&&(r=!0),a}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,a]of Object.entries(t)){let[s,o]=ra(a);o&&(r=!0),n[i]=s}return[n,r]}return[t,!1]}function uf(t,e=!1){let[r,n]=jn(t,e);if(r)return n;let[i,a]=ra(t),s=JSON.stringify(i);return a?`${s}::JS`:s}function cf(t){return JSON.stringify(t)}function df(t){if(!$e)throw new Error("@msgpack/msgpack is required for MessagePack support");return $e.encode(t)}function ve(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${Co(t)}::QS`;if(r){if(e===null||e==="json")return cf(t);if(e==="msgpack")return df(t);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let a=uf(t,i);return e==="json"?`"${a}"`:a}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${To(t)}</tytx_root>`;if(e==="msgpack")return Do(t);throw new Error(`Unknown transport: ${e}`)}}var er,na;typeof window<"u"&&window.DOMParser?(er=window.DOMParser,na=window.XMLSerializer):(er=yo,na=vo);function No(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length!==1)return!1;let r=t[e[0]];return r!==null&&typeof r=="object"&&"value"in r}function So(t,e,r){let n=t.createElement(e),i=r.attrs||{},a=r.value;for(let[s,o]of Object.entries(i))n.setAttribute(s,ve(o,null,{_forceSuffix:!0}));if(Array.isArray(a))for(let s of a)if(No(s)){let[o]=Object.keys(s),l=s[o],u=So(t,o,l);n.appendChild(u)}else{n.textContent=ve(a);break}else n.textContent=ve(a);return n}function To(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(No(t)){let[e]=Object.keys(t),r=t[e],n=new er().parseFromString("<root/>","text/xml"),i=So(n,e,r);return new na().serializeToString(i)}else return ve(t)}function ia(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=re(i.value)}let r=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];i.nodeType===1&&r.push(i)}if(r.length>0)if(r.length===1){let n=r[0],i=ia(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let a=ia(i);n.push({[i.tagName]:a})}return{attrs:e,value:n}}return{attrs:e,value:re(t.textContent)}}function Oo(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new er().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let a=null;for(let s=0;s<n.childNodes.length;s++)if(n.childNodes[s].nodeType===1){a=n.childNodes[s];break}if(!a)return re(n.textContent);n=a}let i=ia(n);return{[n.tagName]:i}}function ff(t){return typeof t=="string"}function pf(t){let[e,r]=ta(t);if(e)return r;let n=t;n.endsWith("::JS")&&(n=n.slice(0,-4));let i;try{i=JSON.parse(n)}catch{return t}return qn(i,hf,ff)}function hf(t){return t.includes("::")?ta(t)[1]:t}function mf(t){let e=Oo(t);return typeof e=="string"?re(e):e}function gf(t){return Ao(t)}function re(t,e=null){if(t===null)return null;if(e===null||e==="json"){let r=t;return e==="json"&&t.startsWith('"')&&t.endsWith('"')&&(r=t.slice(1,-1)),pf(r)}else{if(e==="xml")return mf(t);if(e==="msgpack")return gf(t);throw new Error(`Unknown transport: ${e}`)}}function Co(t){if(Array.isArray(t))return t.map(e=>String(e)).join("&");if(t!==null&&typeof t=="object"){let e=[];for(let[r,n]of Object.entries(t)){let[i,a]=jn(n,!0);i?e.push(`${r}=${a}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function Bo(t){if(!t)return[];let e=t.split("&"),r=e.map(s=>s.includes("=")),n=r.every(Boolean),i=!r.some(Boolean);if(!n&&!i)throw new Error("QS format error: mixed items with and without '='");if(i)return e.map(s=>re(s));let a={};for(let s of e){let o=s.indexOf("="),l=s.slice(0,o),u=s.slice(o+1);a[l]=re(u)}return a}var Mo=Ki||Qi||Number,bf=Ki?"decimal.js":Qi?"big.js":"number";function Fn(t){return new Mo(t)}function Te(t){return bf==="number"?!1:t instanceof Mo}function vt(t){let e=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,r=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;return e&&!r?"H":r&&!e?"D":"DHZ"}function _f(t){return t.toString()}function wf(t){let e=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),n=String(t.getUTCDate()).padStart(2,"0");return`${e}-${r}-${n}`}function yf(t){return t.toISOString()}function vf(t){let e=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),n=String(t.getUTCSeconds()).padStart(2,"0"),i=String(t.getUTCMilliseconds()).padStart(3,"0");return`${e}:${r}:${n}.${i}`}function kf(t){return t?"true":"false"}function Ef(t){return t.toString()}function xf(t){return t.toString()}function Df(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode.apply(null,t.subarray(r,r+32768));return btoa(e)}var zn=[],aa=new Map;function ea(t){if(t===null||typeof t!="object")return null;for(let e=Object.getPrototypeOf(t);e!==null;e=Object.getPrototypeOf(e))for(let[r,n,i,a]of zn)if(r.prototype===e)return[n,i,a];return null}function Vn(t){if(t===null)return["NN",()=>"",!0];if(Te(t))return["N",_f,!1];if(t instanceof Uint8Array)return["RAW",Df,!1];if(t instanceof Date){let e=vt(t);return e==="D"?["D",wf,!1]:e==="H"?["H",vf,!1]:["DHZ",yf,!1]}return typeof t=="boolean"?["B",kf,!0]:typeof t=="number"?Number.isInteger(t)?["L",Ef,!0]:["R",xf,!0]:ea(t)}function Af(t){return Fn(t)}function Tf(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function Io(t){return new Date(t)}function Cf(t){let[e,r,n]=t.split(":"),[i,a]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(a||0)))}function Nf(t){return t.toLowerCase()==="true"}function Sf(t){return parseInt(t,10)}function Of(t){return parseFloat(t)}function Bf(t){return t}function If(t){return null}var Mf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Rf(t){if(!Mf.test(t))throw new Error(`RAW payload is not standard padded base64: '${t}'`);let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Lf(t){return Bo(t)}var Pf=/^[A-Z]+$/,ct={N:[Object,Af],D:[Date,Tf],DH:[Date,Io],DHZ:[Date,Io],H:[Date,Cf],L:[Number,Sf],R:[Number,Of],T:[String,Bf],B:[Boolean,Nf],QS:[Object,Lf],NN:[null,If],RAW:[Uint8Array,Rf]};function Ir(t){return Object.hasOwn(ct,t)?ct[t][0]:null}function sa(t,e,r,n,i=!1){if(typeof e!="string"||!Pf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let a=ct[e];if(a!==void 0&&a[0]!==t){let s=a[0]===null?"null":a[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${s}`)}zn=zn.filter(([s])=>s!==t),zn.push([t,e,r,i]),ct[e]=[t,n]}function Mr(t,e){aa.set(t,e)}function Ge(t){return aa.has(t)?aa.get(t):{}}var Ro={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function Uf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?Ro[e]||null:e}function Ff(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function qf(t){return new Promise(e=>setTimeout(e,t))}async function jf(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,a=e.jitter!==!1,s=e.on||["Error"],o=null,l=n*1e3;for(let u=0;u<r;u++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(o=c,u<r-1&&Ff(c,s)){let d=l;a&&(d*=1+Math.random()*.1),await qf(d),l*=i}else throw c}throw o}var ne=class t{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};for(let a of["interval","reactive"])if(Object.hasOwn(n,a))throw new TypeError(`Removed resolver option: ${a}. Schedule updates in the application; use reset() and read explicitly.`);this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let i=this.constructor.internalParams;for(let[a,s]of Object.entries(n))i.has(a)||(this._kw[a]=s);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(...e){if(e.length)throw new TypeError("reset() takes no arguments. It invalidates the cache for the next explicit read.");this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}_buildEffectiveKw(){let e={...this._kw};if(this._node&&this._node.attr)for(let r of Object.keys(this._kw))Object.hasOwn(this._node.attr,r)&&(e[r]=this._node.attr[r]);return e}resolve(e={}){let{static:r=!1,...n}=e;if(r)return this._node?this._node._value:this.cachedValue;let i=this._buildEffectiveKw();if(Object.keys(n).length>0)return this._load({...i,...n},s=>this._prepareValue(s));let a=this._computeEffectiveFingerprint(i);return a===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=a,this._load(i,s=>this._finalize(s)))}_load(e,r){let n=Uf(this),i=()=>this.load(e);if(n)return jf(i,n).then(r);let a=i();return a&&typeof a.then=="function"?a.then(r):r(a)}_finalize(e){return e=this._prepareValue(e),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_prepareValue(e){let r;return this._asBag===!0?r=!0:this._asBag===!1?r=!1:r=!this._readOnly,r&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),e}_convertToBag(e){let r=t._BagClass;if(!r||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&r.fromXml)return r.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&r.fromTytx)return r.fromTytx(e)}return e}static registerBagClass(e){t._BagClass=e}load(e){return null}};ne._BagClass=null;var Rr=class extends ne{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var Ye=class t{constructor(e,r,n=null,i=null,a=null,s=null,o=null,l=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=s,this.xmlTag=o,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,l),n!==null&&this.setValue(n,!1),a&&(this.resolver=a)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,r=null,n={}){if(r!==null){let i=re(`${r}::QS`);if(Array.isArray(i)){let a=i.length?i:Object.keys(this._attr),s=a.map(l=>{let u=this.getAttr(l);return!e&&u instanceof ne?u.resolve():u}),o=l=>i.length===0?Object.fromEntries(a.map((u,c)=>[u,l[c]])):l.length===1?l[0]:l;return s.some(l=>l&&typeof l.then=="function")?Promise.all(s).then(o):o(s)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...i}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,r=!0,n=null,i=null,a=!0,s=null,o=!1){e instanceof ne?(this.resolver=e,e=null):e instanceof t&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let u=l!==this._value,c=r??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,i,a);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}r=c&&(u||d!==null);let f=d?u?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),r){let p=d!==null?{oldvalue:l,attrs_diff:d}:{oldvalue:l};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],f,l,d,s,o))}replace(e){if(!(e instanceof t))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let r=e.staticValue;r&&typeof r._htraverse=="function"&&(r=r.createChildBag().replace(r));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let i=this._value,a={...this._attr},s=this.resolver;s&&s._node===this&&(s._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(a,this._attr),l=Object.keys(o).length?o:null,u=i!==r||s!==n;if(u||l){let c=l?u?"upd_value_attr":"upd_attrs":"upd_value",d=l?{oldvalue:i,attrs_diff:l}:{oldvalue:i};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,l)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,r=null){return e?e in this._attr?this._attr[e]:r:this._attr}_buildAttrDiff(e,r){let n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(let a of i){let s=a in e?e[a]:null,o=a in r?r[a]:null;s!==o&&(n[a]={old:s,new:o})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let a=e||{},s=Object.keys(this._nodeSubscribers).length>0,l=r&&(s||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,a):this._attr={...a},i)for(let u of Object.keys(this._attr))this._attr[u]===null&&delete this._attr[u];if(r&&l!==null){let u=this._buildAttrDiff(l,this._attr);if(Object.keys(u).length>0&&s)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:u},evt:"upd_attrs"});if(Object.keys(u).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,u,c)}}}delAttr(...e){for(let r of e)if(typeof r=="string"&&r.includes(","))for(let n of r.split(","))delete this._attr[n.trim()];else delete this._attr[r]}hasAttr(e,r=null){return e in this._attr?r!==null?this._attr[e]===r:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,r){this._nodeSubscribers[e]=r}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,r=null){let n=this;if(r===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==r;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof t)||this.label!==e.label)return!1;let r=Object.keys(this._attr),n=Object.keys(e._attr);if(r.length!==n.length)return!1;for(let i of r)if(this._attr[i]!==e._attr[i])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let r=Object.keys(this._attr),n=Object.keys(e._attr);return r.length!==n.length||r.some(i=>this._attr[i]!==e._attr[i])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let r=this.value;return r&&typeof r.toJson=="function"&&(r=r.toJson(e,!0)),{label:this.label,value:r,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var Lr=class t{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let r=e.match(/^#(\d+)$/);if(r){let n=parseInt(r[1],10);return n<this._list.length?n:-1}if(r=e.match(/^#(\w*)=(.*)$/),r){let[,n,i]=r,a=i.includes("::")?re(i):i;return n?this._list.findIndex(s=>s.getAttr(n)===a):this._list.findIndex(s=>s._value===a)}return-1}_parsePosition(e){let r=this._list.length;if(e==null||e===">")return r;if(typeof e=="number")return e<0&&(e=r+e),Math.max(0,Math.min(e,r));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,r)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let a=this._parseSharpIndex(n.slice(1),e);return Math.min(a,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let a=this._parseSharpIndex(n.slice(1),e);return Math.min(a+1,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,r){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${r}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${r}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let r=this.index(e);return r>=0?this._list[r]:null}return this._dict[e]||null}set(e,r,n=">",i=null,a=null,s=null,o=!1,l=!0,u=null,c=!0,d=!1,f=null){let p=null;if(e.includes("?")&&([e,p]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(p){let m=p.split("&");if(m.length===1)i={[m[0]]:r};else{if(!Array.isArray(r)||r.length!==m.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<m.length;g++)i[m[g]]=r[g]}r=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),s!==null&&(s===!1?h.resolver=null:h.resolver=s),p?h.setAttr(i,c,!0,l):h.setValue(r,c,i,o,l,u,d);else{let m=a&&a.nodeClass?a.nodeClass:Ye;h=new m(a,e,p?null:r,i,s,f,null,l);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&a&&a.backref&&a._onNodeInserted(h,g,null,u,d)}return d&&h.setValue(null,!1),h}pop(e){let r=this.get(e);if(r){delete this._dict[r.label];let n=this._list.indexOf(r);return n>=0&&this._list.splice(n,1),r}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,r,n=!0){if(r<0)return;let i=Array.isArray(e)?e:[e];if(i.length===0||r>=this._list.length)return;let a=this._list[r].label;if(i.length>1){let s=[...i].sort((c,d)=>c-d),o=s[0]<r?1:0,l=[];for(let c=s.length-1;c>=0;c--){let d=s[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),l.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let u=this.index(a);u<0&&(u=this._list.length),u+=o;for(let c of l)this._list.splice(u,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,u)}else{let s=i[0];if(s===r||s<0||s>=this._list.length)return;let o=this._list[s];this._list.splice(s,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,s),this._list.splice(r,0,o),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(o,r)}}isEqual(e){if(!(e instanceof t)||this._list.length!==e._list.length)return!1;for(let r=0;r<this._list.length;r++){let n=this._list[r],i=e._list[r];if(!n.isEqual(i))return!1}return!0}};var Uo=Ma(Ji(),1);var oa="::RSLV:",Vf=new Map,zf=new Map,Hn=new WeakMap,Y=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Pr=class extends ne{constructor(e){super({asBag:!1}),Hn.set(this,e)}get payload(){return Hn.get(this)}load(){throw new Y("This resolver is opaque; local execution is unavailable")}};function Lo(t){if(!t||typeof t!="object"||Array.isArray(t)||typeof t.resolver_module!="string"||typeof t.resolver_class!="string"||!Array.isArray(t.args??[])||!t.kwargs||typeof t.kwargs!="object"||Array.isArray(t.kwargs))throw new Y("Invalid resolver description")}function Po(t,e=new Set){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(typeof t!="object"||e.has(t)||!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.prototype&&Object.getPrototypeOf(t)!==null)throw new Y("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))Po(r,e);e.delete(t)}}function $r(t){if(Hn.has(t))return Hn.get(t);let e=zf.get(t.constructor);if(!e)throw new Y(`Unregistered resolver: ${t.constructor.name}`);let r=e.encode(t),n={resolver_module:e.module,resolver_class:e.name,args:r.args??[],kwargs:r.kwargs??{}};return Lo(n),Po(n),oa+JSON.stringify(n)}function Wn(t){if(typeof t!="string"||!t.startsWith(oa))return null;let e=t.slice(oa.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Pr(t);let r;try{r=JSON.parse(e)}catch{throw new Y("Invalid resolver JSON or signed token")}Lo(r);let n=Vf.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Pr(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new Y("Resolver decoder returned an incompatible instance");return i}function Gn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ne?$r(r):r]))}function la(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,Wn(r)??r]))}var Oe="__cls";function tr(t,e){return t!==null&&t.tytxSuffix===e?t:Ir(e)}function Hf(t){let e=t.tytxSuffix,r=Object.entries(Ge(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new Y(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new Y(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function ua(t,e){let r=Ge(t);if(!Object.hasOwn(r,e))throw new Y(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function ca(t,e){return t===e?null:Hf(t)}function*Fo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof se&&(yield*Fo(i,n))}}function Wf(t){let e=t.toISOString(),r=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,n=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;if(n&&!r)return e.slice(0,e.indexOf("T"));let i=e.replace(/\.000Z$/,"Z");return r&&!n?i.slice(i.indexOf("T")+1):i}function rr(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function dt(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(dt):rr(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,dt(r)])):t}function da(t){if(!rr(t))throw new TypeError("Bag options must be an object");let{recursive:e=!0}=t;if(typeof e!="boolean")throw new TypeError("recursive must be a boolean");return e}var $o=!1,se=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new Lr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},da(r),e!=null&&this.fillFrom(e,r)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return Ye}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let r=[],n=e;for(;n!==null;){if(n.parentBag===this)return r.push(n.label),r.reverse(),r.join(".");r.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let r=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(i=>i)):n=[...e];n.length&&n[0]==="#parent"&&r!==null;)n.shift(),r=r.parent;return[r,n]}_htraverse(e,r=!1,n=!0){let[i,a]=this._htraverseBefore(e);if(i===null)return[null,null];if(a.length===0)return[i,""];for(;a.length>1&&i instanceof t;){let s=a[0];if(s==="#parent"){if(i.parent===null||i.parent===void 0)break;a.shift(),i=i.parent;continue}let o=i._nodes.get(s);if(!o)break;let l=o.getValue(n);if(l instanceof t)a.shift(),i=l;else if(r){let u=i.createChildBag();o.setValue(u,!0,null,!0,!0,"autocreate"),a.shift(),i=u}else break}if(!r)return a.length>1?[null,null]:[i,a[0]];for(;a.length>1;){let s=a.shift();if(s.startsWith("#"))throw new Ur("Not existing index in #n syntax");let o=i.createChildBag();i._nodes.set(s,o,">",null,i,null,!1,!0,"autocreate"),i=o}return[i,a[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let a=null;e.includes("?")&&([e,a]=e.split("?",2));let s=this._nodes.get(e);return s?s.getValue(n,a,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[a,s]=this._htraverse(e,!1,n);return a instanceof t?a.get(s,r,n,i):r}setItem(e,r,n=null,i=">",a=!1,s=!0,o=null,l=!1,u=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,r,i,n,f,c,a,s,o,u,l,d)}_pop(e,r=null){let n=this._nodes.index(e);if(n>=0){let i=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(i,n,null,r),i}return null}pop(e,r=null,n=null){let i=this.popNode(e,n);return i?i.value:r}delItem(e,r=null,n=null){return this.pop(e,r,n)}popNode(e,r=null){let[n,i]=this._htraverse(e,!1,!0);if(!n||!i)return null;let a=n._nodes.get(i);if(!a)return null;try{return n._pop(i,r)}finally{a.parentBag===n&&n._nodes._dict[a.label]!==a&&(a.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let r of e)r.parentBag=null}getNode(e,r=!0,n=!1,i=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[a,s]=this._htraverse(e,n,r);if(a instanceof t&&s){let o=a._nodes.get(s);if(o)return o;if(n)return a._nodes.set(s,i,">",null,a,null,!1,!0,"autocreate"),a._nodes.get(s)}return null}setBackref(e=null,r=null){let n=this._backref;if(this._backref=!0,this._parent=r,this._parentNode=e,!n){this._nodes._parentBag=this;for(let i of this)i.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let r=e.getValue(!0);r instanceof t&&r.clearBackref()}}}_onNodeChanged(e,r,n,i=null,a=null,s=null,o=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:r,oldvalue:i,attrs_diff:a,evt:n,reason:s,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,a,s,o)}_onNodeInserted(e,r,n=null,i=null,a=!1){let s=e.parentBag,o=e.getValue(!0);s!==null&&s.backref&&o instanceof t&&o.setBackref(e,s),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:a});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,a)}_onNodeDeleted(e,r,n=null,i=null){for(let a of Object.values(this._delSubscribers))a({node:e,pathlist:n,ind:r,evt:"del",reason:i});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,r,[this._parentNode.label,...n],i))}_subscribe(e,r,n){n!=null&&(r[e]=n)}subscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=null,insert:i=null,delete:a=null,any:s=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||s),this._subscribe(e,this._insSubscribers,i||s),this._subscribe(e,this._delSubscribers,a||s)}unsubscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=!1,insert:i=!1,delete:a=!1,any:s=!1}=r;(n||s)&&delete this._updSubscribers[e],(i||s)&&delete this._insSubscribers[e],(a||s)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,r=null,n=!0){let i=t.prototype.getNode.call(this,e,!0,!0);i&&i.setAttr(r,!0,!0,n)}getAttr(e=null,r=null,n=null){let i=this.getNode(e);return i?i.getAttr(r,n):n}delAttr(e=null,...r){let n=this.getNode(e);n&&n.delAttr(...r)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(r=>e(r)):[...this._nodes]}getNodeByValue(e,r){for(let n of this._nodes){let i=n.value;if(i instanceof t){if(i.getItem(e)===r)return n}else if(i&&i.get&&i.get(e)===r)return n}return null}getNodeByAttr(e,r,n=!1,i=!1){let a=r===void 0,s=n&&typeof r=="string"?r.toLowerCase():r,o=l=>{let u=[];for(let c of l._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(a||d==s)return c}if(c._value instanceof t)if(i){let d=o(c._value);if(d)return d}else u.push(c._value)}for(let c of u){let d=o(c);if(d)return d}return null};return o(this)}isEmpty(e=!1,r=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let i=n.getValue(!0);if(i!=null&&!(e&&i===0)&&!(r&&i===""))return!1}return!0}query(e=null,r=null,n=!1,i=!1,a=!0,s=!0,o=null,l=!0){e||(e="#k,#v,#a");let u=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");u=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,_)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=_();return g&&v instanceof t?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=_();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=_();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let _ of m._nodes){let v=g?`${g}.${_.label}`:_.label,w=!1,x,B=()=>(w||(x=_.getValue(l),w=!0),x);if((a&&s||(B()instanceof t?s:a))&&(r===null||r(_))&&(yield c.length===1?d(_,c[0],v,i,B):c.map(Z=>d(_,Z,v,i,B)),p++,o!==null&&p>=o))return;if(i){let Z=B();if(Z instanceof t&&(yield*h(Z,v),o!==null&&p>=o))return}}}yield*h(u,"")}return n?f():[...f()]}getLeaves(){let e=[],r=(n,i)=>{for(let a of n._nodes){let s=i?`${i}.${a.label}`:a.label,o=a.getValue(!1);o instanceof t?r(o,s):e.push([s,o])}};return r(this,""),e}digest(e=null,r=null,n=!1){typeof r=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=r,r=null);let i=this.query(e,r,!1,!1,!0,!0,null,!1);if(n){if(!i||i.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(l=>l.trim()).map(()=>[]);let a=[...i];if(a.length&&Array.isArray(a[0])){let s=a[0].length,o=[];for(let l=0;l<s;l++)o.push(a.map(u=>u[l]));return o}return[a]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(a=>`${n}${a}`).join(",");return this.digest(i,null,!0)}sum(e="#v",r=!1,n=null){if(r!=null&&typeof r!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let i=a=>{let s=0,o=!1;for(let l of this.query(a,n)){if(l==null||l===""){o=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}s+=l}return r&&o?null:s};return e.includes(",")?e.split(",").map(a=>i(a.trim())):i(e)}sort(e="#k:a"){let r=(i,a)=>i==null?[-1,""]:a&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,a)=>i[0]!==a[0]?i[0]-a[0]:i[1]<a[1]?-1:i[1]>a[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,a)=>{let s=e(i),o=e(a);return s<o?-1:s>o?1:0});else{let i=e.split(",");i.reverse();for(let a of i){let s,o;a.includes(":")?[s,o]=a.split(":",2):(s=a,o="a"),s=s.trim(),o=o.trim();let l=o==="d"||o==="D",u=o==="a"||o==="d",c;if(s.toLowerCase()==="#k")c=d=>r(d.label,u);else if(s.toLowerCase()==="#v")c=d=>r(d.value,u);else if(s.toLowerCase().startsWith("#a.")){let d=s.slice(3);c=f=>r(f.getAttr(d),u)}else c=d=>{let f=d.value,p=f instanceof t?f.getItem(s):f?f[s]:null;return r(p,u)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return l?-p:p})}}return this}equalTo(e){return e instanceof t?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let r=null;e.includes("?")&&([e,r]=e.split("?",2));let n=this.getNode(e);return n===null?!1:r===null?!0:r.split("&").every(i=>i in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let r=this.getNode(e);return r?r.resolver:null}setResolver(e,r){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=r}setCallbackItem(e,r,n={}){let i=new Rr({callback:r,...n});this.setResolver(e,i)}move(e,r,n=!0){this._nodes.move(e,r,n)}asDict(e=!1,r=!1,n=!1,i=!1){let a={};for(let s of this._nodes){let o=s.value;if(i&&o==null)continue;let l=s.label;e&&(l=String(l)),r&&(l=l.toLowerCase()),n&&o instanceof t&&(o=t.prototype.asDict.call(o,e,r,n,i)),Object.defineProperty(a,l,{value:o,enumerable:!0,writable:!0,configurable:!0})}return a}setdefault(e,r=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,r),r)}deepcopy(e=!1){let r=this.createChildBag();for(let n of this._nodes){let i=n.getValue(!e);i instanceof t&&(i=i.deepcopy(e));let a=new r.nodeClass(r,n.label,i);a.setAttr({...n.attr},!1,!1,!1),a.nodeTag=n.nodeTag,a.xmlTag=n.xmlTag,r._nodes._list.push(a),r._nodes._dict[a.label]=a}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let a in e){let s=e[a];(!i||s!==null||!this._nodes.has(a))&&this.setItem(a,s,null,">",!1,!1,n,!1,n!==!1)}return}for(let a of[...e]){let s=a.label,o=r==="static"?a.resolver:null,l=o?null:a.getValue(),u=a.attr.__replace;delete a.attr.__replace;let c=this._nodes.get(s);if(c)if(c.setAttr(a.attr,n===null?!0:n,!0,!1),a.nodeTag!=null&&(c.nodeTag=a.nodeTag),a.xmlTag!=null&&(c.xmlTag=a.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{a.resolver&&(c.resolver=null);let d=c.getValue();l instanceof t&&d instanceof t&&!u?d.update(l,r,n,i):(!i||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(s,o||l,a.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=a.nodeTag,d.xmlTag=a.xmlTag}}}_fillFromBag(e){this.clear();for(let r of e){let n=new this.nodeClass(this,r.label);n.replace(r),n.nodeTag=r.nodeTag,n.xmlTag=r.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_appendLiteral(e,r,n=null,i=null,a=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let s=new this.nodeClass(this,e,null,n,i,a,null,!1);return r instanceof ne?s.resolver=r:s._value=r,this._nodes._dict[e]=s,this._nodes._list.push(s),s}fillFrom(e=null,r={}){let n=da(r);if(e!=null&&!rr(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),a=new Set,s=(o,l,u)=>{if(a.has(l))throw new TypeError(`Cyclic Bag source at ${u}`);a.add(l);try{let c=Array.isArray(l)?String(l.length).length+1:0,d=Array.isArray(l)?Array.from(l,(f,p)=>[`r_${String(p).padStart(c,"0")}`,f]):Object.entries(l);if(!Array.isArray(l)&&Object.getOwnPropertySymbols(l).some(f=>Object.prototype.propertyIsEnumerable.call(l,f)))throw new TypeError(`Bag labels must be strings at ${u}`);for(let[f,p]of d){let h=p;n&&(rr(h)||Array.isArray(h))&&(h=this.createChildBag(),s(h,p,`${u}[${JSON.stringify(f)}]`)),o._appendLiteral(f,h)}}finally{a.delete(l)}};return e!=null&&s(i,e,"$"),this._replacePrepared(i)}_loadSource(e,r={}){return this.fillFrom(e,r)}replace(e){if(!(e instanceof t))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let r=this.createChildBag();return r._fillFromBag(e),this._replacePrepared(r)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let i=n.getValue(!0);i instanceof t&&i.clearBackref()}let r=this._nodes;this._nodes=e._nodes,e._nodes=r,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:r=!0,deep:n=!1,kwargs:i={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let a=(s,o)=>{for(let l=0;l<s._nodes.length;l++){let u=s._nodes._list[l],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,u.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,l]);let d=e(u,c,l);if(d)return d;if(d==null&&n){let f=u.getValue(r);if(f instanceof t){let p=a(f,c);if(p)return p}}}return null};return a(this,i)}*traverse(){for(let e of this._nodes){yield e;let r=e.getValue(!0);r instanceof t&&(yield*r.traverse())}}*_iterNodesWithPaths(e=!0,r=""){for(let n of this._nodes){let i=r?`${r}.${n.label}`:n.label;yield[i,n];let a=n.getValue(e);a instanceof t&&(yield*a._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,a=new Map([["[]",this.constructor]]);for(let[s,o]of Fo(this)){let l=s.slice(0,-1),u=JSON.stringify(s),c=JSON.stringify(l),d=o.getValue(!0),f,p=null;if(o.resolver)f=$r(o.resolver);else if(d instanceof t){let g=d.constructor,_=g.tytxSuffix;a.set(u,g),p=ca(g,tr(a.get(c),_)),f=`::${_}`}else d===null?f="::NN":f=dt(d);if(o.attr&&Object.hasOwn(o.attr,Oe))throw new Y(`node '${s}': the attribute '${Oe}' is reserved for the Bag class name`);let h=Gn(dt(o.attr));p!==null&&(h[Oe]=p);let m=o.nodeTag;r?(yield[l.length?n[c]:null,o.label,m,f,h],d instanceof t&&(n[u]=i,e[i]=s,i++)):yield[l,o.label,m,f,h]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return bn(new Ne(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let a={};r={rows:[...this._nodeFlattener(a)],paths:a}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=ca(n,tr(null,n.tytxSuffix));return i!==null&&(r[Oe]=i),r.rows=r.rows.map(([a,s,o,l,u])=>[dt(a),dt(s),dt(o),l,u]),r.paths&&(r.paths=dt(r.paths)),ve(r)}static fromTytx(e,r="json",n={}){if(rr(r)&&(n=r,r="json"),da(n),typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError("fromTytx requires serialized text or bytes");if(r!=="json"&&r!=="msgpack")throw new TypeError(`Unsupported transport: ${r}`);r==="json"&&e instanceof Uint8Array&&(e=new TextDecoder().decode(e));let i=re(e,r==="json"?null:r);if(i instanceof t)return i;if(!rr(i)&&!Array.isArray(i))throw new TypeError("fromTytx requires a dictionary, array or typed Bag root");return new this(i,n)}static _fromTytxPayload(e){let r=this.tytxSuffix;if(e==="")return new(tr(null,r));let n=re(e);if(!n||!Array.isArray(n.rows))throw new Y("Invalid TYTX Bag: expected rows");let i=n.paths,a=i!=null,s=Object.hasOwn(n,Oe)?ua(r,n[Oe]):tr(null,r),o=new s,l=new Map([["[]",o]]);for(let u of n.rows){if(!Array.isArray(u)||u.length!==5)throw new Y("Invalid TYTX Bag row");let[c,d,f,p,h]=u,m=c??"";if(a){if(c!==null&&!Object.hasOwn(i,c))throw new Y(`Unknown TYTX parent reference: ${c}`);m=c===null?"":i[c]}if(typeof m=="string"&&(m=m?m.split("."):[]),!Array.isArray(m))throw new Y("Invalid TYTX parent path");let g=JSON.stringify(m);if(!l.has(g))throw new Y(`Missing or undecodable TYTX parent branch: ${m}`);let _=l.get(g),v=JSON.stringify([...m,d]),w=p,x=Wn(w),B=la(h),L=Object.hasOwn(B,Oe)?B[Oe]:null;if(delete B[Oe],w instanceof t){let ie=w.constructor.tytxSuffix,ae=L!==null?ua(ie,L):tr(_.constructor,ie);w=new ae,l.set(v,w)}else if(L!==null)throw new Y(`node '${v}': the attribute '${Oe}' is reserved for the Bag class name of a branch`);let Z=_._appendLiteral(d,x?null:w,B,x);Z.nodeTag=f??null}return o}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:a=null}=e,s=this._bagToXml(a,r);return i===!0?s=`<?xml version='1.0' encoding='${n}'?>
|
|
30
|
+
*/var Mt=9e15,it=1e9,yi="0123456789abcdef",fn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Mt,maxE:Mt,crypto:!1},Xa,He,C=!0,mn="[DecimalError] ",nt=mn+"Invalid argument: ",Za=mn+"Precision limit exceeded",Ja=mn+"crypto unavailable",Ka="[object Decimal]",ce=Math.floor,Q=Math.pow,Jl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Kl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ql=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Qa=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ne=1e7,D=7,eu=9007199254740991,tu=fn.length-1,ki=pn.length-1,b={toStringTag:Ka};b.absoluteValue=b.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),x(t)};b.ceil=function(){return x(new this.constructor(this),this.e+1,2)};b.clampedTo=b.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(nt+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};b.comparedTo=b.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,l=a.s,u=t.s;if(!s||!o)return!l||!u?NaN:l!==u?l:s===o?0:!s^l<0?1:-1;if(!s[0]||!o[0])return s[0]?l:o[0]?-u:0;if(l!==u)return l;if(a.e!==t.e)return a.e>t.e^l<0?1:-1;for(n=s.length,i=o.length,e=0,r=n<i?n:i;e<r;++e)if(s[e]!==o[e])return s[e]>o[e]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};b.cosine=b.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=ru(n,is(n,r)),n.precision=t,n.rounding=e,x(He==2||He==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};b.cubeRoot=b.cbrt=function(){var t,e,r,n,i,a,s,o,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(C=!1,a=c.s*Q(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=oe(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Q(r,1/3),t=ce((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new d(r),n.s=c.s):n=new d(a.toString()),s=(t=d.precision)+3;;)if(o=n,l=o.times(o).times(o),u=l.plus(c),n=q(u.plus(c).times(o),u.plus(l),s+2,1),oe(o.d).slice(0,s)===(r=oe(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(x(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(x(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return C=!0,x(n,t,d.rounding,e)};b.decimalPlaces=b.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-ce(this.e/D))*D,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};b.dividedBy=b.div=function(t){return q(this,new this.constructor(t))};b.dividedToIntegerBy=b.divToInt=function(t){var e=this,r=e.constructor;return x(q(e,new r(t),0,1,1),r.precision,r.rounding)};b.equals=b.eq=function(t){return this.cmp(t)===0};b.floor=function(){return x(new this.constructor(this),this.e+1,3)};b.greaterThan=b.gt=function(t){return this.cmp(t)>0};b.greaterThanOrEqualTo=b.gte=function(t){var e=this.cmp(t);return e==1||e===0};b.hyperbolicCosine=b.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/bn(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=Rt(s,1,a.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=a.times(a),a=o.minus(l.times(c.minus(l.times(c))));return x(a,s.precision=r,s.rounding=n,!0)};b.hyperbolicSine=b.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=Rt(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/bn(5,t)),i=Rt(a,2,i,i,!0);for(var s,o=new a(5),l=new a(16),u=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(l.times(s).plus(u))))}return a.precision=e,a.rounding=r,x(i,e,r,!0)};b.hyperbolicTangent=b.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};b.inverseCosine=b.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return r!==-1?r===0?t.isNeg()?Ie(e,n,i):new e(0):new e(NaN):t.isZero()?Ie(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))};b.inverseHyperbolicCosine=b.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,C=!1,r=r.times(r).minus(1).sqrt().plus(r),C=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};b.inverseHyperbolicSine=b.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,C=!1,r=r.times(r).plus(1).sqrt().plus(r),C=!0,n.precision=t,n.rounding=e,r.ln())};b.inverseHyperbolicTangent=b.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?x(new a(i),t,e,!0):(a.precision=r=n-i.e,i=q(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};b.inverseSine=b.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=Ie(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};b.inverseTangent=b.atan=function(){var t,e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=ki)return s=Ie(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=ki)return s=Ie(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=o=d+10,c.rounding=1,r=Math.min(28,o/D+2|0),t=r;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(C=!1,e=Math.ceil(o/D),n=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),a=s.minus(i.div(n+=2)),i=i.times(l),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<<r-1)),C=!0,x(s,c.precision=d,c.rounding=f,!0)};b.isFinite=function(){return!!this.d};b.isInteger=b.isInt=function(){return!!this.d&&ce(this.e/D)>this.d.length-2};b.isNaN=function(){return!this.s};b.isNegative=b.isNeg=function(){return this.s<0};b.isPositive=b.isPos=function(){return this.s>0};b.isZero=function(){return!!this.d&&this.d[0]===0};b.lessThan=b.lt=function(t){return this.cmp(t)<0};b.lessThanOrEqualTo=b.lte=function(t){return this.cmp(t)<1};b.logarithm=b.log=function(t){var e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(C=!1,o=d+p,s=rt(u,o),n=e?hn(c,o+10):rt(t,o),l=q(s,n,o,1),ur(l.d,i=d,f))do if(o+=10,s=rt(u,o),n=e?hn(c,o+10):rt(t,o),l=q(s,n,o,1),!a){+oe(l.d).slice(i+1,i+15)+1==1e14&&(l=x(l,d+1,0));break}while(ur(l.d,i+=10,f));return C=!0,x(l,d,f)};b.minus=b.sub=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.constructor;if(t=new h(t),!p.d||!t.d)return!p.s||!t.s?t=new h(NaN):p.d?t.s=-t.s:t=new h(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,f=t.d,o=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new h(p);else return new h(l===3?-0:0);return C?x(t,o,l):t}if(r=ce(t.e/D),c=ce(p.e/D),u=u.slice(),a=c-r,a){for(d=a<0,d?(e=u,a=-a,s=f.length):(e=f,r=c,s=u.length),n=Math.max(Math.ceil(o/D),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}a=0}for(d&&(e=u,u=f,f=e,t.s=-t.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>a;){if(u[--n]<f[n]){for(i=n;i&&u[--i]===0;)u[i]=Ne-1;--u[i],u[n]+=Ne}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=gn(u,r),C?x(t,o,l):t):new h(l===3?-0:0)};b.modulo=b.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?x(new n(r),n.precision,n.rounding):(C=!1,n.modulo==9?(e=q(r,t.abs(),0,3,1),e.s*=t.s):e=q(r,t,0,n.modulo,1),e=e.times(t),C=!0,r.minus(e))};b.naturalExponential=b.exp=function(){return xi(this)};b.naturalLogarithm=b.ln=function(){return rt(this)};b.negated=b.neg=function(){var t=new this.constructor(this);return t.s=-t.s,x(t)};b.plus=b.add=function(t){var e,r,n,i,a,s,o,l,u,c,d=this,f=d.constructor;if(t=new f(t),!d.d||!t.d)return!d.s||!t.s?t=new f(NaN):d.d||(t=new f(t.d||d.s===t.s?d:NaN)),t;if(d.s!=t.s)return t.s=-t.s,d.minus(t);if(u=d.d,c=t.d,o=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(t=new f(d)),C?x(t,o,l):t;if(a=ce(d.e/D),n=ce(t.e/D),u=u.slice(),i=a-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=a,s=u.length),a=Math.ceil(o/D),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/Ne|0,u[i]%=Ne;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=gn(u,n),C?x(t,o,l):t};b.precision=b.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(nt+t);return r.d?(e=es(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};b.round=function(){var t=this,e=t.constructor;return x(new e(t),t.e+1,e.rounding)};b.sine=b.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=iu(n,is(n,r)),n.precision=t,n.rounding=e,x(He>2?r.neg():r,t,e,!0)):new n(NaN)};b.squareRoot=b.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?s:1/0);for(C=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=oe(o),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ce((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(a=n,n=a.plus(q(s,a,r+2,1)).times(.5),oe(a.d).slice(0,r)===(e=oe(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(x(a,l+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(x(n,l+1,1),t=!n.times(n).eq(s));break}return C=!0,x(n,l,c.rounding,t)};b.tangent=b.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,x(He==2||He==4?r.neg():r,t,e,!0)):new n(NaN)};b.times=b.mul=function(t){var e,r,n,i,a,s,o,l,u,c=this,d=c.constructor,f=c.d,p=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?t.s/0:t.s*0);for(r=ce(c.e/D)+ce(t.e/D),l=f.length,u=p.length,l<u&&(a=f,f=p,p=a,s=l,l=u,u=s),a=[],s=l+u,n=s;n--;)a.push(0);for(n=u;--n>=0;){for(e=0,i=l+n;i>n;)o=a[i]+p[n]*f[i-n-1]+e,a[i--]=o%Ne|0,e=o/Ne|0;a[i]=(a[i]+e)%Ne|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=gn(a,r),C?x(t,d.precision,d.rounding):t};b.toBinary=function(t,e){return Ei(this,2,t,e)};b.toDecimalPlaces=b.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ge(t,0,it),e===void 0?e=n.rounding:ge(e,0,8),x(r,t+r.e+1,e))};b.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Me(n,!0):(ge(t,0,it),e===void 0?e=i.rounding:ge(e,0,8),n=x(new i(n),t+1,e),r=Me(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Me(i):(ge(t,0,it),e===void 0?e=a.rounding:ge(e,0,8),n=x(new a(i),t+i.e+1,e),r=Me(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};b.toFraction=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(u=r=new m(1),n=l=new m(0),e=new m(n),a=e.e=es(h)-p.e-1,s=a%D,e.d[0]=Q(10,s<0?D+s:s),t==null)t=a>0?e:u;else{if(o=new m(t),!o.isInt()||o.lt(u))throw Error(nt+o);t=o.gt(e)?a>0?e:u:o}for(C=!1,o=new m(oe(h)),c=m.precision,m.precision=a=h.length*D*2;d=q(o,e,0,1,1),i=r.plus(d.times(n)),i.cmp(t)!=1;)r=n,n=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=o.minus(d.times(i)),o=i;return i=q(t.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=p.s,f=q(u,n,a,1).minus(p).abs().cmp(q(l,r,a,1).minus(p).abs())<1?[u,n]:[l,r],m.precision=c,C=!0,f};b.toHexadecimal=b.toHex=function(t,e){return Ei(this,16,t,e)};b.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:ge(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(C=!1,r=q(r,t,0,e,1).times(t),C=!0,x(r)):(t.s=r.s,r=t),r};b.toNumber=function(){return+this};b.toOctal=function(t,e){return Ei(this,8,t,e)};b.toPower=b.pow=function(t){var e,r,n,i,a,s,o=this,l=o.constructor,u=+(t=new l(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new l(Q(+o,u));if(o=new l(o),o.eq(1))return o;if(n=l.precision,a=l.rounding,t.eq(1))return x(o,n,a);if(e=ce(t.e/D),e>=t.d.length-1&&(r=u<0?-u:u)<=eu)return i=ts(l,o,r,n),t.s<0?new l(1).div(i):x(i,n,a);if(s=o.s,s<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(s=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=s,o}return r=Q(+o,u),e=r==0||!isFinite(r)?ce(u*(Math.log("0."+oe(o.d))/Math.LN10+o.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(C=!1,l.rounding=o.s=1,r=Math.min(12,(e+"").length),i=xi(t.times(rt(o,n+r)),n),i.d&&(i=x(i,n+5,1),ur(i.d,n,a)&&(e=n+10,i=x(xi(t.times(rt(o,e+r)),e),e+5,1),+oe(i.d).slice(n+1,n+15)+1==1e14&&(i=x(i,n+1,0)))),i.s=s,C=!0,l.rounding=a,x(i,n,a))};b.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Me(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ge(t,1,it),e===void 0?e=i.rounding:ge(e,0,8),n=x(new i(n),t,e),r=Me(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toSignificantDigits=b.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ge(t,1,it),e===void 0?e=n.rounding:ge(e,0,8)),x(new n(r),t,e)};b.toString=function(){var t=this,e=t.constructor,r=Me(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};b.truncated=b.trunc=function(){return x(new this.constructor(this),this.e+1,1)};b.valueOf=b.toJSON=function(){var t=this,e=t.constructor,r=Me(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function oe(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)n=t[e]+"",r=D-n.length,r&&(a+=tt(r)),a+=n;s=t[e],n=s+"",r=D-n.length,r&&(a+=tt(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}function ge(t,e,r){if(t!==~~t||t<e||t>r)throw Error(nt+t)}function ur(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=D,i=0):(i=Math.ceil((e+1)/D),e%=D),a=Q(10,D-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==Q(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==Q(10,e-3)-1,s}function cn(t,e,r){for(var n,i=[0],a,s=0,o=t.length;s<o;){for(a=i.length;a--;)i[a]*=e;for(i[0]+=yi.indexOf(t.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function ru(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/bn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=Rt(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var q=(function(){function t(n,i,a){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,l;if(a!=s)l=a>s?1:-1;else for(o=l=0;o<a;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*s+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s,o,l){var u,c,d,f,p,h,m,g,_,v,w,E,B,L,Z,ie,ae,Ve,K,he,xe=n.constructor,F=n.s==i.s?1:-1,J=n.d,S=i.d;if(!J||!J[0]||!S||!S[0])return new xe(!n.s||!i.s||(J?S&&J[0]==S[0]:!S)?NaN:J&&J[0]==0||!S?F*0:F/0);for(l?(p=1,c=n.e-i.e):(l=Ne,p=D,c=ce(n.e/p)-ce(i.e/p)),K=S.length,ae=J.length,_=new xe(F),v=_.d=[],d=0;S[d]==(J[d]||0);d++);if(S[d]>(J[d]||0)&&c--,a==null?(L=a=xe.precision,s=xe.rounding):o?L=a+(n.e-i.e)+1:L=a,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,K==1){for(f=0,S=S[0],L++;(d<ae||f)&&L--;d++)Z=f*l+(J[d]||0),v[d]=Z/S|0,f=Z%S|0;h=f||d<ae}else{for(f=l/(S[0]+1)|0,f>1&&(S=t(S,f,l),J=t(J,f,l),K=S.length,ae=J.length),ie=K,w=J.slice(0,K),E=w.length;E<K;)w[E++]=0;he=S.slice(),he.unshift(0),Ve=S[0],S[1]>=l/2&&++Ve;do f=0,u=e(S,w,K,E),u<0?(B=w[0],K!=E&&(B=B*l+(w[1]||0)),f=B/Ve|0,f>1?(f>=l&&(f=l-1),m=t(S,f,l),g=m.length,E=w.length,u=e(m,w,g,E),u==1&&(f--,r(m,K<g?he:S,g,l))):(f==0&&(u=f=1),m=S.slice()),g=m.length,g<E&&m.unshift(0),r(w,m,E,l),u==-1&&(E=w.length,u=e(S,w,K,E),u<1&&(f++,r(w,K<E?he:S,E,l))),E=w.length):u===0&&(f++,w=[0]),v[d++]=f,u&&w[0]?w[E++]=J[ie]||0:(w=[J[ie]],E=1);while((ie++<ae||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=c,Xa=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+c*p-1,x(_,o?a+_.e+1:a,s,h)}return _}})();function x(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,o=d[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=D,s=e,c=d[f=0],l=c/Q(10,i-s-1)%10|0;else if(f=Math.ceil((a+1)/D),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=l=0,i=1,a%=D,s=a-D+1}else break e;else{for(c=o=d[f],i=1;o>=10;o/=10)i++;a%=D,s=a-D+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(a>0?s>0?c/Q(10,i-s):0:d[f-1])%10&1||r==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=Q(10,(D-e%D)%D),t.e=-e||0):d[0]=t.e=0,t;if(a==0?(d.length=f,o=1,f--):(d.length=f+1,o=Q(10,D-a),d[f]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*o:0),u)for(;;)if(f==0){for(a=1,s=d[0];s>=10;s/=10)a++;for(s=d[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,d[0]==Ne&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ne)break;d[f--]=0,o=1}for(a=d.length;d[--a]===0;)d.pop()}return C&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function Me(t,e,r){if(!t.isFinite())return ns(t);var n,i=t.e,a=oe(t.d),s=a.length;return e?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+tt(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+tt(-i-1)+a,r&&(n=r-s)>0&&(a+=tt(n))):i>=s?(a+=tt(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+tt(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=tt(n))),a}function gn(t,e){var r=t[0];for(e*=D;r>=10;r/=10)e++;return e}function hn(t,e,r){if(e>tu)throw C=!0,r&&(t.precision=r),Error(Za);return x(new t(fn),e,1,!0)}function Ie(t,e,r){if(e>ki)throw Error(Za);return x(new t(pn),e,r,!0)}function es(t){var e=t.length-1,r=e*D+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function tt(t){for(var e="";t--;)e+="0";return e}function ts(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/D+4);for(C=!1;;){if(r%2&&(a=a.times(e),Ga(a.d,s)&&(i=!0)),r=ce(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),Ga(e.d,s)}return C=!0,a}function Wa(t){return t.d[t.d.length-1]&1}function rs(t,e,r){for(var n,i,a=new t(e[0]),s=0;++s<e.length;){if(i=new t(e[s]),!i.s){a=i;break}n=a.cmp(i),(n===r||n===0&&a.s===r)&&(a=i)}return a}function xi(t,e){var r,n,i,a,s,o,l,u=0,c=0,d=0,f=t.constructor,p=f.rounding,h=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(C=!1,l=h):l=e,o=new f(.03125);t.e>-2;)t=t.times(o),d+=5;for(n=Math.log(Q(2,d))/Math.LN10*2+5|0,l+=n,r=a=s=new f(1),f.precision=l;;){if(a=x(a.times(t),l,1),r=r.times(++c),o=s.plus(q(a,r,l,1)),oe(o.d).slice(0,l)===oe(s.d).slice(0,l)){for(i=d;i--;)s=x(s.times(s),l,1);if(e==null)if(u<3&&ur(s.d,l-n,p,u))f.precision=l+=10,r=a=o=new f(1),c=0,u++;else return x(s,f.precision=h,p,C=!0);else return f.precision=h,s}s=o}}function rt(t,e){var r,n,i,a,s,o,l,u,c,d,f,p=1,h=10,m=t,g=m.d,_=m.constructor,v=_.rounding,w=_.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(C=!1,c=w):c=e,_.precision=c+=h,r=oe(g),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=oe(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new _("0."+r),a++):m=new _(n+"."+r.slice(1))}else return u=hn(_,c+2,w).times(a+""),m=rt(new _(n+"."+r.slice(1)),c-h).plus(u),_.precision=w,e==null?x(m,w,v,C=!0):m;for(d=m,l=s=m=q(m.minus(1),m.plus(1),c,1),f=x(m.times(m),c,1),i=3;;){if(s=x(s.times(f),c,1),u=l.plus(q(s,new _(i),c,1)),oe(u.d).slice(0,c)===oe(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(hn(_,c+2,w).times(a+""))),l=q(l,new _(p),c,1),e==null)if(ur(l.d,c-h,v,o))_.precision=c+=h,u=s=m=q(d.minus(1),d.plus(1),c,1),f=x(m.times(m),c,1),i=o=1;else return x(l,_.precision=w,v,C=!0);else return _.precision=w,l;l=u,i+=2}}function ns(t){return String(t.s*t.s/0)}function dn(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%D,r<0&&(n+=D),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=D;n<i;)t.d.push(+e.slice(n,n+=D));e=e.slice(n),n=D-e.length}else n-=i;for(;n--;)e+="0";t.d.push(+e),C&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function nu(t,e){var r,n,i,a,s,o,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Qa.test(e))return dn(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Kl.test(e))r=16,e=e.toLowerCase();else if(Jl.test(e))r=2;else if(Ql.test(e))r=8;else throw Error(nt+e);for(a=e.search(/p/i),a>0?(l=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=ts(n,new n(r),a,a*2)),u=cn(e,r,Ne),c=u.length-1,a=c;u[a]===0;--a)u.pop();return a<0?new n(t.s*0):(t.e=gn(u,c),t.d=u,C=!1,s&&(t=q(t,i,o*4)),l&&(t=t.times(Math.abs(l)<54?Q(2,l):cr.pow(2,l))),C=!0,t)}function iu(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Rt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/bn(5,r)),e=Rt(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function Rt(t,e,r,n,i){var a,s,o,l,u=1,c=t.precision,d=Math.ceil(c/D);for(C=!1,l=r.times(r),o=new t(n);;){if(s=q(o.times(l),new t(e++*e++),c,1),o=i?n.plus(s):n.minus(s),n=q(s.times(l),new t(e++*e++),c,1),s=o.plus(n),s.d[d]!==void 0){for(a=d;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a,u++}return C=!0,s.d.length=d+1,s}function bn(t,e){for(var r=t;--e;)r*=t;return r}function is(t,e){var r,n=e.s<0,i=Ie(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return He=n?4:1,e;if(r=e.divToInt(i),r.isZero())He=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return He=Wa(r)?n?2:3:n?4:1,e;He=Wa(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Ei(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor,h=r!==void 0;if(h?(ge(r,1,it),n===void 0?n=p.rounding:ge(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=ns(t);else{for(c=Me(t),s=c.indexOf("."),h?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-s,f.d=cn(Me(f),10,i),f.e=f.d.length),d=cn(c,10,i),a=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=d,t.e=a,t=q(t,f,r,n,0,i),d=t.d,a=t.e,u=Xa),s=d[r],o=i/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||u||n===6&&d[r-1]&1||n===(t.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++a,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=yi.charAt(d[s]);if(h){if(l>1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=cn(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=yi.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function Ga(t,e){if(t.length>e)return t.length=e,!0}function au(t){return new this(t).abs()}function su(t){return new this(t).acos()}function ou(t){return new this(t).acosh()}function lu(t,e){return new this(t).plus(e)}function uu(t){return new this(t).asin()}function cu(t){return new this(t).asinh()}function du(t){return new this(t).atan()}function fu(t){return new this(t).atanh()}function pu(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Ie(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Ie(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Ie(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(q(t,e,a,1)),e=Ie(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(q(t,e,a,1)),r}function hu(t){return new this(t).cbrt()}function mu(t){return x(t=new this(t),t.e+1,2)}function gu(t,e,r){return new this(t).clamp(e,r)}function bu(t){if(!t||typeof t!="object")throw Error(mn+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,it,"rounding",0,8,"toExpNeg",-Mt,0,"toExpPos",0,Mt,"maxE",0,Mt,"minE",-Mt,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(r=a[e],i&&(this[r]=vi[r]),(n=t[r])!==void 0)if(ce(n)===n&&n>=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error(nt+r+": "+n);if(r="crypto",i&&(this[r]=vi[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Ja);else this[r]=!1;else throw Error(nt+r+": "+n);return this}function _u(t){return new this(t).cos()}function wu(t){return new this(t).cosh()}function as(t){var e,r,n;function i(a){var s,o,l,u=this;if(!(u instanceof i))return new i(a);if(u.constructor=i,Ya(a)){u.s=a.s,C?!a.d||a.e>i.maxE?(u.e=NaN,u.d=null):a.e<i.minE?(u.e=0,u.d=[0]):(u.e=a.e,u.d=a.d.slice()):(u.e=a.e,u.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){u.s=1/a<0?-1:1,u.e=0,u.d=[0];return}if(a<0?(a=-a,u.s=-1):u.s=1,a===~~a&&a<1e7){for(s=0,o=a;o>=10;o/=10)s++;C?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[a]):(u.e=s,u.d=[a]);return}if(a*0!==0){a||(u.s=NaN),u.e=NaN,u.d=null;return}return dn(u,a.toString())}if(l==="string")return(o=a.charCodeAt(0))===45?(a=a.slice(1),u.s=-1):(o===43&&(a=a.slice(1)),u.s=1),Qa.test(a)?dn(u,a):nu(u,a);if(l==="bigint")return a<0?(a=-a,u.s=-1):u.s=1,dn(u,a.toString());throw Error(nt+a)}if(i.prototype=b,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=bu,i.clone=as,i.isDecimal=Ya,i.abs=au,i.acos=su,i.acosh=ou,i.add=lu,i.asin=uu,i.asinh=cu,i.atan=du,i.atanh=fu,i.atan2=pu,i.cbrt=hu,i.ceil=mu,i.clamp=gu,i.cos=_u,i.cosh=wu,i.div=yu,i.exp=vu,i.floor=ku,i.hypot=xu,i.ln=Eu,i.log=Du,i.log10=Cu,i.log2=Au,i.max=Tu,i.min=Nu,i.mod=Su,i.mul=Ou,i.pow=Bu,i.random=Iu,i.round=Mu,i.sign=Ru,i.sin=Lu,i.sinh=Pu,i.sqrt=$u,i.sub=Uu,i.sum=Fu,i.tan=qu,i.tanh=ju,i.trunc=Vu,t===void 0&&(t={}),t&&t.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function yu(t,e){return new this(t).div(e)}function vu(t){return new this(t).exp()}function ku(t){return x(t=new this(t),t.e+1,3)}function xu(){var t,e,r=new this(0);for(C=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return C=!0,new this(1/0);r=e}return C=!0,r.sqrt()}function Ya(t){return t instanceof cr||t&&t.toStringTag===Ka||!1}function Eu(t){return new this(t).ln()}function Du(t,e){return new this(t).log(e)}function Au(t){return new this(t).log(2)}function Cu(t){return new this(t).log(10)}function Tu(){return rs(this,arguments,-1)}function Nu(){return rs(this,arguments,1)}function Su(t,e){return new this(t).mod(e)}function Ou(t,e){return new this(t).mul(e)}function Bu(t,e){return new this(t).pow(e)}function Iu(t){var e,r,n,i,a=0,s=new this(1),o=[];if(t===void 0?t=this.precision:ge(t,1,it),n=Math.ceil(t/D),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));a<n;)i=e[a],i>=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a<n;)i=e[a]+(e[a+1]<<8)+(e[a+2]<<16)+((e[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(Ja);else for(;a<n;)o[a++]=Math.random()*1e7|0;for(n=o[--a],t%=D,n&&t&&(i=Q(10,D-t),o[a]=(n/i|0)*i);o[a]===0;a--)o.pop();if(a<0)r=0,o=[0];else{for(r=-1;o[0]===0;r-=D)o.shift();for(n=1,i=o[0];i>=10;i/=10)n++;n<D&&(r-=D-n)}return s.e=r,s.d=o,s}function Mu(t){return x(t=new this(t),t.e+1,this.rounding)}function Ru(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Lu(t){return new this(t).sin()}function Pu(t){return new this(t).sinh()}function $u(t){return new this(t).sqrt()}function Uu(t,e){return new this(t).sub(e)}function Fu(){var t=0,e=arguments,r=new this(e[t]);for(C=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return C=!0,x(r,this.precision,this.rounding)}function qu(t){return new this(t).tan()}function ju(t){return new this(t).tanh()}function Vu(t){return x(t=new this(t),t.e+1,1)}b[Symbol.for("nodejs.util.inspect.custom")]=b.toString;b[Symbol.toStringTag]="Decimal";var cr=b.constructor=as(vi);fn=new cr(fn);pn=new cr(pn);var ss=cr;var zu=20,Hu=1,ht=1e6,os=1e6,Wu=-7,Gu=21,Yu=!1,dr="[big.js] ",mt=dr+"Invalid ",_n=mt+"decimal places",Xu=mt+"rounding mode",ls=dr+"Division by zero",$={},Re=void 0,Zu=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function us(){function t(e){var r=this;if(!(r instanceof t))return e===Re?us():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(mt+"value");e=e===0&&1/e<0?"-0":String(e)}Ju(r,e)}r.constructor=t}return t.prototype=$,t.DP=zu,t.RM=Hu,t.NE=Wu,t.PE=Gu,t.strict=Yu,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Ju(t,e){var r,n,i;if(!Zu.test(e))throw Error(mt+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function gt(t,e,r,n){var i=t.c;if(r===Re&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(Xu);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Re))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Re||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function bt(t,e,r){var n=t.e,i=t.c.join(""),a=i.length;if(e)i=i.charAt(0)+(a>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>a)for(n-=a;n--;)i+="0";else n<a&&(i=i.slice(0,n)+"."+i.slice(n));else a>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}$.abs=function(){var t=new this.constructor(this);return t.s=1,t};$.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,a=r.s,s=t.s,o=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?a:i[0]?-s:0;if(a!=s)return a;if(e=a<0,o!=l)return o>l^e?1:-1;for(s=(o=n.length)<(l=i.length)?o:l,a=-1;++a<s;)if(n[a]!=i[a])return n[a]>i[a]^e?1:-1;return o==l?0:o>l^e?1:-1};$.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,a=e.s==t.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>ht)throw Error(_n);if(!i[0])throw Error(ls);if(!n[0])return t.s=a,t.c=[t.e=0],t;var o,l,u,c,d,f=i.slice(),p=o=i.length,h=n.length,m=n.slice(0,o),g=m.length,_=t,v=_.c=[],w=0,E=s+(_.e=e.e-t.e)+1;for(_.s=a,a=E<0?0:E,f.unshift(0);g++<o;)m.push(0);do{for(u=0;u<10;u++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(i[d]!=m[d]){c=i[d]>m[d]?1:-1;break}if(c<0){for(l=g==o?i:f;g;){if(m[--g]<l[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=l[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?u:++u,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Re)&&a--);return!v[0]&&w!=1&&(v.shift(),_.e--,E--),w>E&>(_,E,r.RM,m[0]!==Re),_};$.eq=function(t){return this.cmp(t)===0};$.gt=function(t){return this.cmp(t)>0};$.gte=function(t){return this.cmp(t)>-1};$.lt=function(t){return this.cmp(t)<0};$.lte=function(t){return this.cmp(t)<1};$.minus=$.sub=function(t){var e,r,n,i,a=this,s=a.constructor,o=a.s,l=(t=new s(t)).s;if(o!=l)return t.s=-l,a.plus(t);var u=a.c.slice(),c=a.e,d=t.c,f=t.e;if(!u[0]||!d[0])return d[0]?t.s=-l:u[0]?t=new s(a):t.s=1,t;if(o=c-f){for((i=o<0)?(o=-o,n=u):(f=c,n=d),n.reverse(),l=o;l--;)n.push(0);n.reverse()}else for(r=((i=u.length<d.length)?u:d).length,o=l=0;l<r;l++)if(u[l]!=d[l]){i=u[l]<d[l];break}if(i&&(n=u,u=d,d=n,t.s=-t.s),(l=(r=d.length)-(e=u.length))>0)for(;l--;)u[e++]=0;for(l=e;r>o;){if(u[--r]<d[r]){for(e=r;e&&!u[--e];)u[e]=9;--u[e],u[r]+=10}u[r]-=d[r]}for(;u[--l]===0;)u.pop();for(;u[0]===0;)u.shift(),--f;return u[0]||(t.s=1,u=[f=0]),t.c=u,t.e=f,t};$.mod=function(t){var e,r=this,n=r.constructor,i=r.s,a=(t=new n(t)).s;if(!t.c[0])throw Error(ls);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=a,e?new n(r):(i=n.DP,a=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=a,this.minus(r.times(t)))};$.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};$.plus=$.add=function(t){var e,r,n,i=this,a=i.constructor;if(t=new a(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var s=i.e,o=i.c,l=t.e,u=t.c;if(!o[0]||!u[0])return u[0]||(o[0]?t=new a(i):t.s=i.s),t;if(o=o.slice(),e=s-l){for(e>0?(l=s,n=u):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-u.length<0&&(n=u,u=o,o=n),e=u.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+u[e]+r)/10|0;for(r&&(o.unshift(r),++l),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=l,t};$.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-os||t>os)throw Error(mt+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};$.prec=function(t,e){if(t!==~~t||t<1||t>ht)throw Error(mt+"precision");return gt(new this.constructor(this),t,e)};$.round=function(t,e){if(t===Re)t=0;else if(t!==~~t||t<-ht||t>ht)throw Error(_n);return gt(new this.constructor(this),t+this.e+1,e)};$.sqrt=function(){var t,e,r,n=this,i=n.constructor,a=n.s,s=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(a<0)throw Error(dr+"No square root");a=Math.sqrt(+bt(n,!0,!0)),a===0||a===1/0?(e=n.c.join(""),e.length+s&1||(e+="0"),a=Math.sqrt(e),s=((s+1)/2|0)-(s<0||s&1),t=new i((a==1/0?"5e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+s)):t=new i(a+""),s=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(n.div(r)));while(r.c.slice(0,s).join("")!==t.c.slice(0,s).join(""));return gt(t,(i.DP-=4)+t.e+1,i.RM)};$.times=$.mul=function(t){var e,r=this,n=r.constructor,i=r.c,a=(t=new n(t)).c,s=i.length,o=a.length,l=r.e,u=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!a[0])return t.c=[t.e=0],t;for(t.e=l+u,s<o&&(e=i,i=a,a=e,u=s,s=o,o=u),e=new Array(u=s+o);u--;)e[u]=0;for(l=o;l--;){for(o=0,u=s+l;u>l;)o=e[u]+a[l]*i[u-l-1]+o,e[u--]=o%10,o=o/10|0;e[u]=o}for(o?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};$.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Re){if(t!==~~t||t<0||t>ht)throw Error(_n);for(r=gt(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return bt(r,!0,!!n)};$.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Re){if(t!==~~t||t<0||t>ht)throw Error(_n);for(r=gt(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return bt(r,!1,!!n)};$[Symbol.for("nodejs.util.inspect.custom")]=$.toJSON=$.toString=function(){var t=this,e=t.constructor;return bt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};$.toNumber=function(){var t=+bt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(dr+"Imprecise conversion");return t};$.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Re){if(t!==~~t||t<1||t>ht)throw Error(mt+"precision");for(r=gt(new n(r),t,e);r.c.length<t;)r.c.push(0)}return bt(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};$.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(dr+"valueOf disallowed");return bt(t,t.e<=e.NE||t.e>=e.PE,!0)};var Ku=us(),cs=Ku;var Ri={};Ua(Ri,{DecodeError:()=>de,Decoder:()=>Oe,EXT_TIMESTAMP:()=>Ai,Encoder:()=>Lt,ExtData:()=>Se,ExtensionCodec:()=>at,decode:()=>ws,decodeArrayStream:()=>ks,decodeAsync:()=>vs,decodeMulti:()=>ys,decodeMultiStream:()=>xs,decodeTimestampExtension:()=>Oi,decodeTimestampToTimeSpec:()=>Si,encode:()=>vn,encodeDateToTimeSpec:()=>Ti,encodeTimeSpecToTimestamp:()=>Ci,encodeTimestampExtension:()=>Ni});function ds(t){let e=t.length,r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if((i&4294967168)===0){r++;continue}else if((i&4294965248)===0)r+=2;else{if(i>=55296&&i<=56319&&n<e){let a=t.charCodeAt(n);(a&64512)===56320&&(++n,i=((i&1023)<<10)+(a&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function Qu(t,e,r){let n=t.length,i=r,a=0;for(;a<n;){let s=t.charCodeAt(a++);if((s&4294967168)===0){e[i++]=s;continue}else if((s&4294965248)===0)e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<n){let o=t.charCodeAt(a);(o&64512)===56320&&(++a,s=((s&1023)<<10)+(o&1023)+65536)}(s&4294901760)===0?(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128):(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128)}e[i++]=s&63|128}}var ec=new TextEncoder,tc=50;function rc(t,e,r){ec.encodeInto(t,e.subarray(r))}function fs(t,e,r){t.length>tc?rc(t,e,r):Qu(t,e,r)}var nc=4096;function Di(t,e,r){let n=e,i=n+r,a=[],s="";for(;n<i;){let o=t[n++];if((o&128)===0)a.push(o);else if((o&224)===192){let l=t[n++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){let l=t[n++]&63,u=t[n++]&63;a.push((o&31)<<12|l<<6|u)}else if((o&248)===240){let l=t[n++]&63,u=t[n++]&63,c=t[n++]&63,d=(o&7)<<18|l<<12|u<<6|c;d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|d&1023),a.push(d)}else a.push(o);a.length>=nc&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}var ic=new TextDecoder,ac=200;function sc(t,e,r){let n=t.subarray(e,e+r);return ic.decode(n)}function ps(t,e,r){return r>ac?sc(t,e,r):Di(t,e,r)}var Se=class{type;data;constructor(e,r){this.type=e,this.data=r}};var de=class t extends Error{constructor(e){super(e);let r=Object.create(t.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};function hs(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function wn(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function yn(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function ms(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var Ai=-1,oc=4294967296-1,lc=17179869184-1;function Ci({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=lc)if(e===0&&t<=oc){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}else{let r=t/4294967296,n=t&4294967295,i=new Uint8Array(8),a=new DataView(i.buffer);return a.setUint32(0,e<<2|r&3),a.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),wn(n,4,t),r}}function Ti(t){let e=t.getTime(),r=Math.floor(e/1e3),n=(e-r*1e3)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-i*1e9}}function Ni(t){if(t instanceof Date){let e=Ti(t);return Ci(e)}else return null}function Si(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let r=e.getUint32(0),n=e.getUint32(4),i=(r&3)*4294967296+n,a=r>>>2;return{sec:i,nsec:a}}case 12:{let r=yn(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new de(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Oi(t){let e=Si(t);return new Date(e.sec*1e3+e.nsec/1e6)}var gs={type:Ai,encode:Ni,decode:Oi};var at=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(gs)}register({type:e,encode:r,decode:n}){if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{let i=-1-e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}}tryToEncode(e,r){for(let n=0;n<this.builtInEncoders.length;n++){let i=this.builtInEncoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=-1-n;return new Se(s,a)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=n;return new Se(s,a)}}}return e instanceof Se?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Se(r,e)}};function uc(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function fr(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):uc(t)?new Uint8Array(t):Uint8Array.from(t)}var cc=100,dc=2048,Lt=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??at.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??cc,this.initialBufferSize=e?.initialBufferSize??dc,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,r)}ensureBufferSizeToWrite(e){let r=this.pos+e;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(e){let r=new ArrayBuffer(e),n=new Uint8Array(r),i=new DataView(r);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=ds(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),fs(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,r){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,r);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let r=e.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);let n=fr(e);this.writeU8a(n)}encodeArray(e,r){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let i of e)this.doEncode(i,r+1)}countWithoutUndefined(e,r){let n=0;for(let i of r)e[i]!==void 0&&n++;return n}encodeMap(e,r){let n=Object.keys(e);this.sortKeys&&n.sort();let i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(let a of n){let s=e[a];this.ignoreUndefined&&s===void 0||(this.encodeString(a),this.doEncode(s,r+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}let r=e.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let r=e.length;this.ensureBufferSizeToWrite(r),this.bytes.set(e,this.pos),this.pos+=r}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),hs(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),wn(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function vn(t,e){return new Lt(e).encodeSharedRef(t)}function kn(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var fc=16,pc=16,xn=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=fc,r=pc){this.maxKeyLength=e,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,r,n){let i=this.caches[n-1];e:for(let a of i){let s=a.bytes;for(let o=0;o<n;o++)if(s[o]!==e[r+o])continue e;return a.str}return null}store(e,r){let n=this.caches[e.length-1],i={bytes:e,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,r,n){let i=this.find(e,r,n);if(i!=null)return this.hit++,i;this.miss++;let a=Di(e,r,n),s=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(s,a),a}};var Bi="array",mr="map_key",_s="map_value",hc=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new de("The type of key must be string or number but "+typeof t)},Ii=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Bi,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=mr,r.readCount=0,r.size=e,r.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Bi){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===mr||e.type===_s){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},hr=-1,Mi=new DataView(new ArrayBuffer(0)),mc=new Uint8Array(Mi.buffer);try{Mi.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var bs=new RangeError("Insufficient data"),gc=new xn,Oe=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Mi;bytes=mc;headByte=hr;stack=new Ii;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??at.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:gc,this.mapKeyConverter=e?.mapKeyConverter??hc}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=hr,this.stack.reset()}setBuffer(e){let r=fr(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===hr&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=fr(e),i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let r=!1,n;for await(let o of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{n=this.doDecodeSync(),r=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${kn(i)} at ${s} (${a} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,r){if(this.entered){yield*this.clone().decodeMultiAsync(e,r);return}try{this.entered=!0;let n=r,i=-1;for await(let a of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),r;if(e>=224)r=e-256;else if(e<192)if(e<128)r=e;else if(e<144){let i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e<160){let i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else{let i=e-160;r=this.decodeString(i,0)}else if(e===192)r=null;else if(e===194)r=!1;else if(e===195)r=!0;else if(e===202)r=this.readF32();else if(e===203)r=this.readF64();else if(e===204)r=this.readU8();else if(e===205)r=this.readU16();else if(e===206)r=this.readU32();else if(e===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(e===208)r=this.readI8();else if(e===209)r=this.readI16();else if(e===210)r=this.readI32();else if(e===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(e===217){let i=this.lookU8();r=this.decodeString(i,1)}else if(e===218){let i=this.lookU16();r=this.decodeString(i,2)}else if(e===219){let i=this.lookU32();r=this.decodeString(i,4)}else if(e===220){let i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===221){let i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===222){let i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===223){let i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===196){let i=this.lookU8();r=this.decodeBinary(i,1)}else if(e===197){let i=this.lookU16();r=this.decodeBinary(i,2)}else if(e===198){let i=this.lookU32();r=this.decodeBinary(i,4)}else if(e===212)r=this.decodeExtension(1,0);else if(e===213)r=this.decodeExtension(2,0);else if(e===214)r=this.decodeExtension(4,0);else if(e===215)r=this.decodeExtension(8,0);else if(e===216)r=this.decodeExtension(16,0);else if(e===199){let i=this.lookU8();r=this.decodeExtension(i,1)}else if(e===200){let i=this.lookU16();r=this.decodeExtension(i,2)}else if(e===201){let i=this.lookU32();r=this.decodeExtension(i,4)}else throw new de(`Unrecognized type byte: ${kn(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Bi)if(i.array[i.position]=r,i.position++,i.position===i.size)r=i.array,n.release(i);else continue e;else if(i.type===mr){if(r==="__proto__")throw new de("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=_s;continue e}else if(i.map[i.key]=r,i.readCount++,i.readCount===i.size)r=i.map,n.release(i);else{i.key=null,i.type=mr;continue e}}return r}}readHeadByte(){return this.headByte===hr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=hr}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new de(`Unrecognized array type byte: ${kn(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new de(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new de(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,r):this.decodeBinary(e,r)}decodeUtf8String(e,r){if(e>this.maxStrLength)throw new de(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw bs;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=ps(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===mr:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new de(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw bs;let n=this.pos+r,i=this.bytes.subarray(n,n+e);return this.pos+=r+e,i}decodeExtension(e,r){if(e>this.maxExtLength)throw new de(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+r),i=this.decodeBinary(e,r+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=ms(this.view,this.pos);return this.pos+=8,e}readI64(){let e=yn(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function ws(t,e){return new Oe(e).decode(t)}function ys(t,e){return new Oe(e).decodeMulti(t)}function bc(t){return t[Symbol.asyncIterator]!=null}async function*_c(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function En(t){return bc(t)?t:_c(t)}async function vs(t,e){let r=En(t);return new Oe(e).decodeAsync(r)}function ks(t,e){let r=En(t);return new Oe(e).decodeArrayStream(r)}function xs(t,e){let r=En(t);return new Oe(e).decodeStream(r)}var Vn=Fa(na(),1),ia=ss,aa=cs,Ue=Ri,No=Vn.DOMParser,So=Vn.XMLSerializer;var Oo=Ue!==null;function Bo(){if(!Oo)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Io=_f();function _f(){if(!Oo)return null;let t=new TextEncoder,e=new TextDecoder,r=new Ue.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=kt(n);if(i==="D"||i==="H")return null}return Ue.encodeTimestampExtension(n)},decode:n=>Ue.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>Ce(n)?t.encode(n.toString()):null,decode:n=>zn(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&&kt(n)==="D"){let i=n.getUTCFullYear(),a=String(n.getUTCMonth()+1).padStart(2,"0"),s=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${a}-${s}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&&kt(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),a=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${a}:${s}.${o}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf("."),s=a>=0?i.substring(0,a):i,o=a>=0?i.substring(a+1):"0",[l,u,c]=s.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+u,+c,d))}}),r.register({type:4,encode:n=>{let i=sa(n);if(i!==null){let[a,s]=i;return t.encode(`${a}:${s(n)}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf(":"),s=i.slice(0,a),o=i.slice(a+1),l=ft[s];if(l!==void 0){let[,u]=l;return u(o)}return`${o}::${s}`}}),r}function Mo(t){return Bo(),Ue.encode(t,{extensionCodec:Io})}function Ro(t){return Bo(),Ue.decode(t,{extensionCodec:Io})}function Wn(t,e=!1){let r=Gn(t);if(r===null)return[!1,String(t)];let[n,i,a]=r;return a&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function oa(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=ft[n];if(i===void 0)return[!1,t];let[,a]=i;return[!0,a(r)]}function Hn(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,a]of Object.entries(t))n[i]=Hn(a,e,r);return n}return Array.isArray(t)?t.map(n=>Hn(n,e,r)):r(t)?e(t):t}function la(t){let e=Gn(t);if(e!==null){let[r,n,i]=e;return i?[t,!1]:[`${n(t)}::${r}`,!0]}if(Array.isArray(t)){let r=!1;return[t.map(i=>{let[a,s]=la(i);return s&&(r=!0),a}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,a]of Object.entries(t)){let[s,o]=la(a);o&&(r=!0),n[i]=s}return[n,r]}return[t,!1]}function wf(t,e=!1){let[r,n]=Wn(t,e);if(r)return n;let[i,a]=la(t),s=JSON.stringify(i);return a?`${s}::JS`:s}function yf(t){return JSON.stringify(t)}function vf(t){if(!Ue)throw new Error("@msgpack/msgpack is required for MessagePack support");return Ue.encode(t)}function ve(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${Po(t)}::QS`;if(r){if(e===null||e==="json")return yf(t);if(e==="msgpack")return vf(t);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let a=wf(t,i);return e==="json"?`"${a}"`:a}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${Lo(t)}</tytx_root>`;if(e==="msgpack")return Mo(t);throw new Error(`Unknown transport: ${e}`)}}var tr,ua;typeof window<"u"&&window.DOMParser?(tr=window.DOMParser,ua=window.XMLSerializer):(tr=No,ua=So);function $o(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length!==1)return!1;let r=t[e[0]];return r!==null&&typeof r=="object"&&"value"in r}function Uo(t,e,r){let n=t.createElement(e),i=r.attrs||{},a=r.value;for(let[s,o]of Object.entries(i))n.setAttribute(s,ve(o,null,{_forceSuffix:!0}));if(Array.isArray(a))for(let s of a)if($o(s)){let[o]=Object.keys(s),l=s[o],u=Uo(t,o,l);n.appendChild(u)}else{n.textContent=ve(a);break}else n.textContent=ve(a);return n}function Lo(t){if(!tr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if($o(t)){let[e]=Object.keys(t),r=t[e],n=new tr().parseFromString("<root/>","text/xml"),i=Uo(n,e,r);return new ua().serializeToString(i)}else return ve(t)}function ca(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=re(i.value)}let r=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];i.nodeType===1&&r.push(i)}if(r.length>0)if(r.length===1){let n=r[0],i=ca(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let a=ca(i);n.push({[i.tagName]:a})}return{attrs:e,value:n}}return{attrs:e,value:re(t.textContent)}}function Fo(t){if(!tr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new tr().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let a=null;for(let s=0;s<n.childNodes.length;s++)if(n.childNodes[s].nodeType===1){a=n.childNodes[s];break}if(!a)return re(n.textContent);n=a}let i=ca(n);return{[n.tagName]:i}}function kf(t){return typeof t=="string"}function xf(t){let[e,r]=oa(t);if(e)return r;let n=t;n.endsWith("::JS")&&(n=n.slice(0,-4));let i;try{i=JSON.parse(n)}catch{return t}return Hn(i,Ef,kf)}function Ef(t){return t.includes("::")?oa(t)[1]:t}function Df(t){let e=Fo(t);return typeof e=="string"?re(e):e}function Af(t){return Ro(t)}function re(t,e=null){if(t===null)return null;if(e===null||e==="json"){let r=t;return e==="json"&&t.startsWith('"')&&t.endsWith('"')&&(r=t.slice(1,-1)),xf(r)}else{if(e==="xml")return Df(t);if(e==="msgpack")return Af(t);throw new Error(`Unknown transport: ${e}`)}}function Po(t){if(Array.isArray(t))return t.map(e=>String(e)).join("&");if(t!==null&&typeof t=="object"){let e=[];for(let[r,n]of Object.entries(t)){let[i,a]=Wn(n,!0);i?e.push(`${r}=${a}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function qo(t){if(!t)return[];let e=t.split("&"),r=e.map(s=>s.includes("=")),n=r.every(Boolean),i=!r.some(Boolean);if(!n&&!i)throw new Error("QS format error: mixed items with and without '='");if(i)return e.map(s=>re(s));let a={};for(let s of e){let o=s.indexOf("="),l=s.slice(0,o),u=s.slice(o+1);a[l]=re(u)}return a}var Vo=ia||aa||Number,Cf=ia?"decimal.js":aa?"big.js":"number";function zn(t){return new Vo(t)}function Ce(t){return Cf==="number"?!1:t instanceof Vo}function kt(t){let e=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,r=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;return e&&!r?"H":r&&!e?"D":"DHZ"}function Tf(t){return t.toString()}function Nf(t){let e=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),n=String(t.getUTCDate()).padStart(2,"0");return`${e}-${r}-${n}`}function Sf(t){return t.toISOString()}function Of(t){let e=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),n=String(t.getUTCSeconds()).padStart(2,"0"),i=String(t.getUTCMilliseconds()).padStart(3,"0");return`${e}:${r}:${n}.${i}`}function Bf(t){return t?"true":"false"}function If(t){return t.toString()}function Mf(t){return t.toString()}function Rf(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode.apply(null,t.subarray(r,r+32768));return btoa(e)}var Yn=[],da=new Map;function sa(t){if(t===null||typeof t!="object")return null;for(let e=Object.getPrototypeOf(t);e!==null;e=Object.getPrototypeOf(e))for(let[r,n,i,a]of Yn)if(r.prototype===e)return[n,i,a];return null}function Gn(t){if(t===null)return["NN",()=>"",!0];if(Ce(t))return["N",Tf,!1];if(t instanceof Uint8Array)return["RAW",Rf,!1];if(t instanceof Date){let e=kt(t);return e==="D"?["D",Nf,!1]:e==="H"?["H",Of,!1]:["DHZ",Sf,!1]}return typeof t=="boolean"?["B",Bf,!0]:typeof t=="number"?Number.isInteger(t)?["L",If,!0]:["R",Mf,!0]:sa(t)}function Lf(t){return zn(t)}function Pf(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function jo(t){return new Date(t)}function $f(t){let[e,r,n]=t.split(":"),[i,a]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(a||0)))}function Uf(t){return t.toLowerCase()==="true"}function Ff(t){return parseInt(t,10)}function qf(t){return parseFloat(t)}function jf(t){return t}function Vf(t){return null}var zf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Hf(t){if(!zf.test(t))throw new Error(`RAW payload is not standard padded base64: '${t}'`);let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Wf(t){return qo(t)}var Gf=/^[A-Z]+$/,ft={N:[Object,Lf],D:[Date,Pf],DH:[Date,jo],DHZ:[Date,jo],H:[Date,$f],L:[Number,Ff],R:[Number,qf],T:[String,jf],B:[Boolean,Uf],QS:[Object,Wf],NN:[null,Vf],RAW:[Uint8Array,Hf]};function Rr(t){return Object.hasOwn(ft,t)?ft[t][0]:null}function fa(t,e,r,n,i=!1){if(typeof e!="string"||!Gf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let a=ft[e];if(a!==void 0&&a[0]!==t){let s=a[0]===null?"null":a[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${s}`)}Yn=Yn.filter(([s])=>s!==t),Yn.push([t,e,r,i]),ft[e]=[t,n]}function Lr(t,e){da.set(t,e)}function Xe(t){return da.has(t)?da.get(t):{}}var zo={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function Xf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?zo[e]||null:e}function Zf(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function Jf(t){return new Promise(e=>setTimeout(e,t))}async function Kf(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,a=e.jitter!==!1,s=e.on||["Error"],o=null,l=n*1e3;for(let u=0;u<r;u++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(o=c,u<r-1&&Zf(c,s)){let d=l;a&&(d*=1+Math.random()*.1),await Jf(d),l*=i}else throw c}throw o}var ne=class t{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};for(let a of["interval","reactive"])if(Object.hasOwn(n,a))throw new TypeError(`Removed resolver option: ${a}. Schedule updates in the application; use reset() and read explicitly.`);this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let i=this.constructor.internalParams;for(let[a,s]of Object.entries(n))i.has(a)||(this._kw[a]=s);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(...e){if(e.length)throw new TypeError("reset() takes no arguments. It invalidates the cache for the next explicit read.");this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}_buildEffectiveKw(){let e={...this._kw};if(this._node&&this._node.attr)for(let r of Object.keys(this._kw))Object.hasOwn(this._node.attr,r)&&(e[r]=this._node.attr[r]);return e}resolve(e={}){let{static:r=!1,...n}=e;if(r)return this._node?this._node._value:this.cachedValue;let i=this._buildEffectiveKw();if(Object.keys(n).length>0)return this._load({...i,...n},s=>this._prepareValue(s));let a=this._computeEffectiveFingerprint(i);return a===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=a,this._load(i,s=>this._finalize(s)))}_load(e,r){let n=Xf(this),i=()=>this.load(e);if(n)return Kf(i,n).then(r);let a=i();return a&&typeof a.then=="function"?a.then(r):r(a)}_finalize(e){return e=this._prepareValue(e),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_prepareValue(e){let r;return this._asBag===!0?r=!0:this._asBag===!1?r=!1:r=!this._readOnly,r&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),e}_convertToBag(e){let r=t._BagClass;if(!r||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&r.fromXml)return r.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&r.fromTytx)return r.fromTytx(e)}return e}static registerBagClass(e){t._BagClass=e}load(e){return null}};ne._BagClass=null;var Pr=class extends ne{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var Ze=class t{constructor(e,r,n=null,i=null,a=null,s=null,o=null,l=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=s,this.xmlTag=o,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,l),n!==null&&this.setValue(n,!1),a&&(this.resolver=a)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,r=null,n={}){if(r!==null){let i=re(`${r}::QS`);if(Array.isArray(i)){let a=i.length?i:Object.keys(this._attr),s=a.map(l=>{let u=this.getAttr(l);return!e&&u instanceof ne?u.resolve():u}),o=l=>i.length===0?Object.fromEntries(a.map((u,c)=>[u,l[c]])):l.length===1?l[0]:l;return s.some(l=>l&&typeof l.then=="function")?Promise.all(s).then(o):o(s)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...i}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,r=!0,n=null,i=null,a=!0,s=null,o=!1){e instanceof ne?(this.resolver=e,e=null):e instanceof t&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let u=l!==this._value,c=r??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,i,a);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}r=c&&(u||d!==null);let f=d?u?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),r){let p=d!==null?{oldvalue:l,attrs_diff:d}:{oldvalue:l};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],f,l,d,s,o))}replace(e){if(!(e instanceof t))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let r=e.staticValue;r&&typeof r._htraverse=="function"&&(r=r.createChildBag().replace(r));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let i=this._value,a={...this._attr},s=this.resolver;s&&s._node===this&&(s._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(a,this._attr),l=Object.keys(o).length?o:null,u=i!==r||s!==n;if(u||l){let c=l?u?"upd_value_attr":"upd_attrs":"upd_value",d=l?{oldvalue:i,attrs_diff:l}:{oldvalue:i};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,l)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,r=null){return e?e in this._attr?this._attr[e]:r:this._attr}_buildAttrDiff(e,r){let n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(let a of i){let s=a in e?e[a]:null,o=a in r?r[a]:null;s!==o&&(n[a]={old:s,new:o})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let a=e||{},s=Object.keys(this._nodeSubscribers).length>0,l=r&&(s||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,a):this._attr={...a},i)for(let u of Object.keys(this._attr))this._attr[u]===null&&delete this._attr[u];if(r&&l!==null){let u=this._buildAttrDiff(l,this._attr);if(Object.keys(u).length>0&&s)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:u},evt:"upd_attrs"});if(Object.keys(u).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,u,c)}}}delAttr(...e){for(let r of e)if(typeof r=="string"&&r.includes(","))for(let n of r.split(","))delete this._attr[n.trim()];else delete this._attr[r]}hasAttr(e,r=null){return e in this._attr?r!==null?this._attr[e]===r:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,r){this._nodeSubscribers[e]=r}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,r=null){let n=this;if(r===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==r;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof t)||this.label!==e.label)return!1;let r=Object.keys(this._attr),n=Object.keys(e._attr);if(r.length!==n.length)return!1;for(let i of r)if(this._attr[i]!==e._attr[i])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let r=Object.keys(this._attr),n=Object.keys(e._attr);return r.length!==n.length||r.some(i=>this._attr[i]!==e._attr[i])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let r=this.value;return r&&typeof r.toJson=="function"&&(r=r.toJson(e,!0)),{label:this.label,value:r,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var $r=class t{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let r=e.match(/^#(\d+)$/);if(r){let n=parseInt(r[1],10);return n<this._list.length?n:-1}if(r=e.match(/^#(\w*)=(.*)$/),r){let[,n,i]=r,a=i.includes("::")?re(i):i;return n?this._list.findIndex(s=>s.getAttr(n)===a):this._list.findIndex(s=>s._value===a)}return-1}_parsePosition(e){let r=this._list.length;if(e==null||e===">")return r;if(typeof e=="number")return e<0&&(e=r+e),Math.max(0,Math.min(e,r));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,r)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let a=this._parseSharpIndex(n.slice(1),e);return Math.min(a,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let a=this._parseSharpIndex(n.slice(1),e);return Math.min(a+1,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,r){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${r}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${r}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let r=this.index(e);return r>=0?this._list[r]:null}return this._dict[e]||null}set(e,r,n=">",i=null,a=null,s=null,o=!1,l=!0,u=null,c=!0,d=!1,f=null){let p=null;if(e.includes("?")&&([e,p]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(p){let m=p.split("&");if(m.length===1)i={[m[0]]:r};else{if(!Array.isArray(r)||r.length!==m.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<m.length;g++)i[m[g]]=r[g]}r=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),s!==null&&(s===!1?h.resolver=null:h.resolver=s),p?h.setAttr(i,c,!0,l):h.setValue(r,c,i,o,l,u,d);else{let m=a&&a.nodeClass?a.nodeClass:Ze;h=new m(a,e,p?null:r,i,s,f,null,l);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&a&&a.backref&&a._onNodeInserted(h,g,null,u,d)}return d&&h.setValue(null,!1),h}pop(e){let r=this.get(e);if(r){delete this._dict[r.label];let n=this._list.indexOf(r);return n>=0&&this._list.splice(n,1),r}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,r,n=!0){if(r<0)return;let i=Array.isArray(e)?e:[e];if(i.length===0||r>=this._list.length)return;let a=this._list[r].label;if(i.length>1){let s=[...i].sort((c,d)=>c-d),o=s[0]<r?1:0,l=[];for(let c=s.length-1;c>=0;c--){let d=s[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),l.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let u=this.index(a);u<0&&(u=this._list.length),u+=o;for(let c of l)this._list.splice(u,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,u)}else{let s=i[0];if(s===r||s<0||s>=this._list.length)return;let o=this._list[s];this._list.splice(s,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,s),this._list.splice(r,0,o),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(o,r)}}isEqual(e){if(!(e instanceof t)||this._list.length!==e._list.length)return!1;for(let r=0;r<this._list.length;r++){let n=this._list[r],i=e._list[r];if(!n.isEqual(i))return!1}return!0}};var Yo=Fa(na(),1);var pa="::RSLV:",Qf=new Map,ep=new Map,Xn=new WeakMap,Y=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Ur=class extends ne{constructor(e){super({asBag:!1}),Xn.set(this,e)}get payload(){return Xn.get(this)}load(){throw new Y("This resolver is opaque; local execution is unavailable")}};function Ho(t){if(!t||typeof t!="object"||Array.isArray(t)||typeof t.resolver_module!="string"||typeof t.resolver_class!="string"||!Array.isArray(t.args??[])||!t.kwargs||typeof t.kwargs!="object"||Array.isArray(t.kwargs))throw new Y("Invalid resolver description")}function Wo(t,e=new Set){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(typeof t!="object"||e.has(t)||!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.prototype&&Object.getPrototypeOf(t)!==null)throw new Y("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))Wo(r,e);e.delete(t)}}function Fr(t){if(Xn.has(t))return Xn.get(t);let e=ep.get(t.constructor);if(!e)throw new Y(`Unregistered resolver: ${t.constructor.name}`);let r=e.encode(t),n={resolver_module:e.module,resolver_class:e.name,args:r.args??[],kwargs:r.kwargs??{}};return Ho(n),Wo(n),pa+JSON.stringify(n)}function Zn(t){if(typeof t!="string"||!t.startsWith(pa))return null;let e=t.slice(pa.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Ur(t);let r;try{r=JSON.parse(e)}catch{throw new Y("Invalid resolver JSON or signed token")}Ho(r);let n=Qf.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Ur(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new Y("Resolver decoder returned an incompatible instance");return i}function Jn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ne?Fr(r):r]))}function ha(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,Zn(r)??r]))}var Be="__cls";function rr(t,e){return t!==null&&t.tytxSuffix===e?t:Rr(e)}function tp(t){let e=t.tytxSuffix,r=Object.entries(Xe(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new Y(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new Y(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function ma(t,e){let r=Xe(t);if(!Object.hasOwn(r,e))throw new Y(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function ga(t,e){return t===e?null:tp(t)}function*Xo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof se&&(yield*Xo(i,n))}}function rp(t){let e=t.toISOString(),r=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,n=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;if(n&&!r)return e.slice(0,e.indexOf("T"));let i=e.replace(/\.000Z$/,"Z");return r&&!n?i.slice(i.indexOf("T")+1):i}function nr(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function pt(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(pt):nr(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,pt(r)])):t}function ba(t){if(!nr(t))throw new TypeError("Bag options must be an object");let{recursive:e=!0}=t;if(typeof e!="boolean")throw new TypeError("recursive must be a boolean");return e}var Go=!1,se=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new $r,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},ba(r),e!=null&&this.fillFrom(e,r)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return Ze}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let r=[],n=e;for(;n!==null;){if(n.parentBag===this)return r.push(n.label),r.reverse(),r.join(".");r.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let r=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(i=>i)):n=[...e];n.length&&n[0]==="#parent"&&r!==null;)n.shift(),r=r.parent;return[r,n]}_htraverse(e,r=!1,n=!0){let[i,a]=this._htraverseBefore(e);if(i===null)return[null,null];if(a.length===0)return[i,""];for(;a.length>1&&i instanceof t;){let s=a[0];if(s==="#parent"){if(i.parent===null||i.parent===void 0)break;a.shift(),i=i.parent;continue}let o=i._nodes.get(s);if(!o)break;let l=o.getValue(n);if(l instanceof t)a.shift(),i=l;else if(r){let u=i.createChildBag();o.setValue(u,!0,null,!0,!0,"autocreate"),a.shift(),i=u}else break}if(!r)return a.length>1?[null,null]:[i,a[0]];for(;a.length>1;){let s=a.shift();if(s.startsWith("#"))throw new qr("Not existing index in #n syntax");let o=i.createChildBag();i._nodes.set(s,o,">",null,i,null,!1,!0,"autocreate"),i=o}return[i,a[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let a=null;e.includes("?")&&([e,a]=e.split("?",2));let s=this._nodes.get(e);return s?s.getValue(n,a,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[a,s]=this._htraverse(e,!1,n);return a instanceof t?a.get(s,r,n,i):r}setItem(e,r,n=null,i=">",a=!1,s=!0,o=null,l=!1,u=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,r,i,n,f,c,a,s,o,u,l,d)}_pop(e,r=null){let n=this._nodes.index(e);if(n>=0){let i=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(i,n,null,r),i}return null}pop(e,r=null,n=null){let i=this.popNode(e,n);return i?i.value:r}delItem(e,r=null,n=null){return this.pop(e,r,n)}popNode(e,r=null){let[n,i]=this._htraverse(e,!1,!0);if(!n||!i)return null;let a=n._nodes.get(i);if(!a)return null;try{return n._pop(i,r)}finally{a.parentBag===n&&n._nodes._dict[a.label]!==a&&(a.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let r of e)r.parentBag=null}getNode(e,r=!0,n=!1,i=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[a,s]=this._htraverse(e,n,r);if(a instanceof t&&s){let o=a._nodes.get(s);if(o)return o;if(n)return a._nodes.set(s,i,">",null,a,null,!1,!0,"autocreate"),a._nodes.get(s)}return null}setBackref(e=null,r=null){let n=this._backref;if(this._backref=!0,this._parent=r,this._parentNode=e,!n){this._nodes._parentBag=this;for(let i of this)i.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let r=e.getValue(!0);r instanceof t&&r.clearBackref()}}}_onNodeChanged(e,r,n,i=null,a=null,s=null,o=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:r,oldvalue:i,attrs_diff:a,evt:n,reason:s,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,a,s,o)}_onNodeInserted(e,r,n=null,i=null,a=!1){let s=e.parentBag,o=e.getValue(!0);s!==null&&s.backref&&o instanceof t&&o.setBackref(e,s),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:a});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,a)}_onNodeDeleted(e,r,n=null,i=null){for(let a of Object.values(this._delSubscribers))a({node:e,pathlist:n,ind:r,evt:"del",reason:i});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,r,[this._parentNode.label,...n],i))}_subscribe(e,r,n){n!=null&&(r[e]=n)}subscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=null,insert:i=null,delete:a=null,any:s=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||s),this._subscribe(e,this._insSubscribers,i||s),this._subscribe(e,this._delSubscribers,a||s)}unsubscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=!1,insert:i=!1,delete:a=!1,any:s=!1}=r;(n||s)&&delete this._updSubscribers[e],(i||s)&&delete this._insSubscribers[e],(a||s)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,r=null,n=!0){let i=t.prototype.getNode.call(this,e,!0,!0);i&&i.setAttr(r,!0,!0,n)}getAttr(e=null,r=null,n=null){let i=this.getNode(e);return i?i.getAttr(r,n):n}delAttr(e=null,...r){let n=this.getNode(e);n&&n.delAttr(...r)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(r=>e(r)):[...this._nodes]}getNodeByValue(e,r){for(let n of this._nodes){let i=n.value;if(i instanceof t){if(i.getItem(e)===r)return n}else if(i&&i.get&&i.get(e)===r)return n}return null}getNodeByAttr(e,r,n=!1,i=!1){let a=r===void 0,s=n&&typeof r=="string"?r.toLowerCase():r,o=l=>{let u=[];for(let c of l._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(a||d==s)return c}if(c._value instanceof t)if(i){let d=o(c._value);if(d)return d}else u.push(c._value)}for(let c of u){let d=o(c);if(d)return d}return null};return o(this)}isEmpty(e=!1,r=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let i=n.getValue(!0);if(i!=null&&!(e&&i===0)&&!(r&&i===""))return!1}return!0}query(e=null,r=null,n=!1,i=!1,a=!0,s=!0,o=null,l=!0){e||(e="#k,#v,#a");let u=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");u=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,_)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=_();return g&&v instanceof t?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=_();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=_();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let _ of m._nodes){let v=g?`${g}.${_.label}`:_.label,w=!1,E,B=()=>(w||(E=_.getValue(l),w=!0),E);if((a&&s||(B()instanceof t?s:a))&&(r===null||r(_))&&(yield c.length===1?d(_,c[0],v,i,B):c.map(Z=>d(_,Z,v,i,B)),p++,o!==null&&p>=o))return;if(i){let Z=B();if(Z instanceof t&&(yield*h(Z,v),o!==null&&p>=o))return}}}yield*h(u,"")}return n?f():[...f()]}getLeaves(){let e=[],r=(n,i)=>{for(let a of n._nodes){let s=i?`${i}.${a.label}`:a.label,o=a.getValue(!1);o instanceof t?r(o,s):e.push([s,o])}};return r(this,""),e}digest(e=null,r=null,n=!1){typeof r=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=r,r=null);let i=this.query(e,r,!1,!1,!0,!0,null,!1);if(n){if(!i||i.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(l=>l.trim()).map(()=>[]);let a=[...i];if(a.length&&Array.isArray(a[0])){let s=a[0].length,o=[];for(let l=0;l<s;l++)o.push(a.map(u=>u[l]));return o}return[a]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(a=>`${n}${a}`).join(",");return this.digest(i,null,!0)}sum(e="#v",r=!1,n=null){if(r!=null&&typeof r!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let i=a=>{let s=0,o=!1;for(let l of this.query(a,n)){if(l==null||l===""){o=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}s+=l}return r&&o?null:s};return e.includes(",")?e.split(",").map(a=>i(a.trim())):i(e)}sort(e="#k:a"){let r=(i,a)=>i==null?[-1,""]:a&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,a)=>i[0]!==a[0]?i[0]-a[0]:i[1]<a[1]?-1:i[1]>a[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,a)=>{let s=e(i),o=e(a);return s<o?-1:s>o?1:0});else{let i=e.split(",");i.reverse();for(let a of i){let s,o;a.includes(":")?[s,o]=a.split(":",2):(s=a,o="a"),s=s.trim(),o=o.trim();let l=o==="d"||o==="D",u=o==="a"||o==="d",c;if(s.toLowerCase()==="#k")c=d=>r(d.label,u);else if(s.toLowerCase()==="#v")c=d=>r(d.value,u);else if(s.toLowerCase().startsWith("#a.")){let d=s.slice(3);c=f=>r(f.getAttr(d),u)}else c=d=>{let f=d.value,p=f instanceof t?f.getItem(s):f?f[s]:null;return r(p,u)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return l?-p:p})}}return this}equalTo(e){return e instanceof t?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let r=null;e.includes("?")&&([e,r]=e.split("?",2));let n=this.getNode(e);return n===null?!1:r===null?!0:r.split("&").every(i=>i in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let r=this.getNode(e);return r?r.resolver:null}setResolver(e,r){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=r}setCallbackItem(e,r,n={}){let i=new Pr({callback:r,...n});this.setResolver(e,i)}move(e,r,n=!0){this._nodes.move(e,r,n)}asDict(e=!1,r=!1,n=!1,i=!1){let a={};for(let s of this._nodes){let o=s.value;if(i&&o==null)continue;let l=s.label;e&&(l=String(l)),r&&(l=l.toLowerCase()),n&&o instanceof t&&(o=t.prototype.asDict.call(o,e,r,n,i)),Object.defineProperty(a,l,{value:o,enumerable:!0,writable:!0,configurable:!0})}return a}setdefault(e,r=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,r),r)}deepcopy(e=!1){let r=this.createChildBag();for(let n of this._nodes){let i=n.getValue(!e);i instanceof t&&(i=i.deepcopy(e));let a=new r.nodeClass(r,n.label,i);a.setAttr({...n.attr},!1,!1,!1),a.nodeTag=n.nodeTag,a.xmlTag=n.xmlTag,r._nodes._list.push(a),r._nodes._dict[a.label]=a}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let a in e){let s=e[a];(!i||s!==null||!this._nodes.has(a))&&this.setItem(a,s,null,">",!1,!1,n,!1,n!==!1)}return}for(let a of[...e]){let s=a.label,o=r==="static"?a.resolver:null,l=o?null:a.getValue(),u=a.attr.__replace;delete a.attr.__replace;let c=this._nodes.get(s);if(c)if(c.setAttr(a.attr,n===null?!0:n,!0,!1),a.nodeTag!=null&&(c.nodeTag=a.nodeTag),a.xmlTag!=null&&(c.xmlTag=a.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{a.resolver&&(c.resolver=null);let d=c.getValue();l instanceof t&&d instanceof t&&!u?d.update(l,r,n,i):(!i||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(s,o||l,a.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=a.nodeTag,d.xmlTag=a.xmlTag}}}_fillFromBag(e){this.clear();for(let r of e){let n=new this.nodeClass(this,r.label);n.replace(r),n.nodeTag=r.nodeTag,n.xmlTag=r.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_appendLiteral(e,r,n=null,i=null,a=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let s=new this.nodeClass(this,e,null,n,i,a,null,!1);return r instanceof ne?s.resolver=r:s._value=r,this._nodes._dict[e]=s,this._nodes._list.push(s),s}fillFrom(e=null,r={}){let n=ba(r);if(e!=null&&!nr(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),a=new Set,s=(o,l,u)=>{if(a.has(l))throw new TypeError(`Cyclic Bag source at ${u}`);a.add(l);try{let c=Array.isArray(l)?String(l.length).length+1:0,d=Array.isArray(l)?Array.from(l,(f,p)=>[`r_${String(p).padStart(c,"0")}`,f]):Object.entries(l);if(!Array.isArray(l)&&Object.getOwnPropertySymbols(l).some(f=>Object.prototype.propertyIsEnumerable.call(l,f)))throw new TypeError(`Bag labels must be strings at ${u}`);for(let[f,p]of d){let h=p;n&&(nr(h)||Array.isArray(h))&&(h=this.createChildBag(),s(h,p,`${u}[${JSON.stringify(f)}]`)),o._appendLiteral(f,h)}}finally{a.delete(l)}};return e!=null&&s(i,e,"$"),this._replacePrepared(i)}_loadSource(e,r={}){return this.fillFrom(e,r)}replace(e){if(!(e instanceof t))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let r=this.createChildBag();return r._fillFromBag(e),this._replacePrepared(r)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let i=n.getValue(!0);i instanceof t&&i.clearBackref()}let r=this._nodes;this._nodes=e._nodes,e._nodes=r,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:r=!0,deep:n=!1,kwargs:i={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let a=(s,o)=>{for(let l=0;l<s._nodes.length;l++){let u=s._nodes._list[l],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,u.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,l]);let d=e(u,c,l);if(d)return d;if(d==null&&n){let f=u.getValue(r);if(f instanceof t){let p=a(f,c);if(p)return p}}}return null};return a(this,i)}*traverse(){for(let e of this._nodes){yield e;let r=e.getValue(!0);r instanceof t&&(yield*r.traverse())}}*_iterNodesWithPaths(e=!0,r=""){for(let n of this._nodes){let i=r?`${r}.${n.label}`:n.label;yield[i,n];let a=n.getValue(e);a instanceof t&&(yield*a._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,a=new Map([["[]",this.constructor]]);for(let[s,o]of Xo(this)){let l=s.slice(0,-1),u=JSON.stringify(s),c=JSON.stringify(l),d=o.getValue(!0),f,p=null;if(o.resolver)f=Fr(o.resolver);else if(d instanceof t){let g=d.constructor,_=g.tytxSuffix;a.set(u,g),p=ga(g,rr(a.get(c),_)),f=`::${_}`}else d===null?f="::NN":f=pt(d);if(o.attr&&Object.hasOwn(o.attr,Be))throw new Y(`node '${s}': the attribute '${Be}' is reserved for the Bag class name`);let h=Jn(pt(o.attr));p!==null&&(h[Be]=p);let m=o.nodeTag;r?(yield[l.length?n[c]:null,o.label,m,f,h],d instanceof t&&(n[u]=i,e[i]=s,i++)):yield[l,o.label,m,f,h]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return vn(new Se(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let a={};r={rows:[...this._nodeFlattener(a)],paths:a}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=ga(n,rr(null,n.tytxSuffix));return i!==null&&(r[Be]=i),r.rows=r.rows.map(([a,s,o,l,u])=>[pt(a),pt(s),pt(o),l,u]),r.paths&&(r.paths=pt(r.paths)),ve(r)}static fromTytx(e,r="json",n={}){if(nr(r)&&(n=r,r="json"),ba(n),typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError("fromTytx requires serialized text or bytes");if(r!=="json"&&r!=="msgpack")throw new TypeError(`Unsupported transport: ${r}`);r==="json"&&e instanceof Uint8Array&&(e=new TextDecoder().decode(e));let i=re(e,r==="json"?null:r);if(i instanceof t)return i;if(!nr(i)&&!Array.isArray(i))throw new TypeError("fromTytx requires a dictionary, array or typed Bag root");return new this(i,n)}static _fromTytxPayload(e){let r=this.tytxSuffix;if(e==="")return new(rr(null,r));let n=re(e);if(!n||!Array.isArray(n.rows))throw new Y("Invalid TYTX Bag: expected rows");let i=n.paths,a=i!=null,s=Object.hasOwn(n,Be)?ma(r,n[Be]):rr(null,r),o=new s,l=new Map([["[]",o]]);for(let u of n.rows){if(!Array.isArray(u)||u.length!==5)throw new Y("Invalid TYTX Bag row");let[c,d,f,p,h]=u,m=c??"";if(a){if(c!==null&&!Object.hasOwn(i,c))throw new Y(`Unknown TYTX parent reference: ${c}`);m=c===null?"":i[c]}if(typeof m=="string"&&(m=m?m.split("."):[]),!Array.isArray(m))throw new Y("Invalid TYTX parent path");let g=JSON.stringify(m);if(!l.has(g))throw new Y(`Missing or undecodable TYTX parent branch: ${m}`);let _=l.get(g),v=JSON.stringify([...m,d]),w=p,E=Zn(w),B=ha(h),L=Object.hasOwn(B,Be)?B[Be]:null;if(delete B[Be],w instanceof t){let ie=w.constructor.tytxSuffix,ae=L!==null?ma(ie,L):rr(_.constructor,ie);w=new ae,l.set(v,w)}else if(L!==null)throw new Y(`node '${v}': the attribute '${Be}' is reserved for the Bag class name of a branch`);let Z=_._appendLiteral(d,E?null:w,B,E);Z.nodeTag=f??null}return o}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:a=null}=e,s=this._bagToXml(a,r);return i===!0?s=`<?xml version='1.0' encoding='${n}'?>
|
|
16
31
|
${s}`:typeof i=="string"&&(s=`${i}
|
|
17
32
|
${s}`),s}_bagToXml(e=null,r=!1,n=0){let i=[];for(let a of this._nodes)i.push((r?" ".repeat(n):"")+this._nodeToXml(a,e,r,n));return i.join(r?`
|
|
18
|
-
`:"")}_nodeToXml(e,r=null,n=!1,i=0){let a=e.xmlTag||e.nodeTag||e.label,s=this._sanitizeTag(a),o=[];if(s!==a&&o.push(`_tag="${this._escapeAttr(a)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr(
|
|
33
|
+
`:"")}_nodeToXml(e,r=null,n=!1,i=0){let a=e.xmlTag||e.nodeTag||e.label,s=this._sanitizeTag(a),o=[];if(s!==a&&o.push(`_tag="${this._escapeAttr(a)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr(Fr(e.resolver))}"`),e.attr)for(let[f,p]of Object.entries(Jn(e.attr)))p!==null&&p!==!1&&p!==void 0&&o.push(`${f}="${this._escapeAttr(String(p))}"`);let l=o.length?" "+o.join(" "):"",u=e.resolver?null:e.getValue(!0);if(u&&typeof u._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let f=u._bagToXml(r,n,i+1);return f?n?`<${s}${l}>
|
|
19
34
|
${f}
|
|
20
|
-
${" ".repeat(i)}</${s}>`:`<${s}${l}>${f}</${s}>`:r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`}if(u==null||u==="")return r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`;let c=u instanceof Date&&!Number.isNaN(u.getTime())?
|
|
35
|
+
${" ".repeat(i)}</${s}>`:`<${s}${l}>${f}</${s}>`:r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`}if(u==null||u==="")return r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`;let c=u instanceof Date&&!Number.isNaN(u.getTime())?rp(u):String(u),d=this._escapeXml(c);return`<${s}${l}>${d}</${s}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}_escapeAttr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}static fromXml(e,r={}){let{tagAttribute:n=null}=r,i;if(typeof DOMParser<"u"){i=new DOMParser().parseFromString(e,"application/xml");let s=i.querySelector("parsererror");if(s)throw new Error(`XML parse error: ${s.textContent}`)}else i=new Yo.DOMParser().parseFromString(e,"application/xml");return this._xmlElementToBag(i.documentElement,n)}static _xmlElementToBag(e,r=null){let n=new this,i=Array.from(e.childNodes).filter(a=>a.nodeType===1);for(let a of i){let s=a.tagName,o={};for(let m=0;m<a.attributes.length;m++){let g=a.attributes[m];o[g.name]=g.value}let l=Zn(o._resolver);l&&delete o._resolver;let u=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,ha(o));let c=s;"_tag"in o&&(c=o._tag,delete o._tag),r&&r in o&&(c=o[r],delete o[r]);let d=c,f=1;for(;n.getNode(c);)c=`${d}_${f++}`;let p=Array.from(a.childNodes).filter(m=>m.nodeType===1),h;if(p.length>0||u){let m=this._xmlElementToBag(a,r);h=n.setItem(c,m,Object.keys(o).length>0?o:null)}else{let m=a.textContent||"";h=n.setItem(c,m,Object.keys(o).length>0?o:null)}l&&(h.resolver=l),h.xmlTag=s}return n}static async fromUrl(e,r={}){let{timeout:n=30}=r,i={};n&&(i.signal=AbortSignal.timeout(n*1e3));let a=await fetch(e,i),s=a.headers.get("content-type")||"",o=await a.text();if(s.includes("json"))return t.fromTytx(o);if(s.includes("xml"))return t.fromXml(o);let l=o.trim();if(l.startsWith("<"))return t.fromXml(o);if(l.startsWith("{")||l.startsWith("["))return t.fromTytx(o);throw new qr(`Unsupported content-type: ${s}`)}toJson(e=!0){let r=[];for(let n of this._nodes)r.push(this._nodeToJsonDict(n,e));return e?ve(r):JSON.stringify(r)}_nodeToJsonDict(e,r){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let a=[];for(let s of n._nodes)a.push(n._nodeToJsonDict(s,r));n=a}let i={label:e.label,value:n,attr:Jn(e.attr)};return e.nodeTag!==null&&(i.tag=e.nodeTag),e.resolver&&(i.resolver=Fr(e.resolver)),i}static fromJson(e,r={}){return Go||(console.warn("Bag.fromJson is deprecated; use Bag.fromTytx"),Go=!0),this.fromTytx(e,"json",r)}toStringTree(e=!0,r=null,n="",i=!0){r===null&&(r=new Map);let a=[],s=[...this._nodes];for(let o=0;o<s.length;o++){let l=s[o],u=o===s.length-1,c=l.getValue(e),d=l.getAttr(),f="",p=Object.keys(d);p.length>0&&(f=" ["+p.map(_=>`${_}=${JSON.stringify(d[_])}`).join(", ")+"]");let h=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",m=n+(u?" ":"\u2502 ");if(c instanceof t){let g=l,_=c.backref?"(*)":"";if(r.has(g))a.push(`${n}${h}${l.label}${_}${f} \u2192 (circular ref)`);else{r.set(g,l.label),a.push(`${n}${h}${l.label}${_}${f}`);let v=c.toStringTree(e,r,m,u);v&&a.push(v)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let _=new TextDecoder("utf-8",{fatal:!1}),v=c instanceof ArrayBuffer?new Uint8Array(c):c;g=_.decode(v)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);a.push(`${n}${h}${l.label}: ${g}${f}`)}}return a.join(`
|
|
21
36
|
`)}toString(e=!0,r=null,n=""){r||(r=new Set);let i=[],a=[...this._nodes];for(let s=0;s<a.length;s++){let o=a[s],l=s===a.length-1,u=o.getValue(e),c="",d=o.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(l?" ":"\u2502 ");if(u&&typeof u._htraverse=="function"){let h=o;if(r.has(h))i.push(`${n}${f}${o.label}${c} \u2192 (circular ref)`);else{r.add(h),i.push(`${n}${f}${o.label}${c}`);let m=u.toString(e,r,p);m&&i.push(m)}}else{let h;u==null?h="null":typeof u=="string"&&u.length>50?h=JSON.stringify(u.slice(0,47)+"..."):typeof u=="string"?h=JSON.stringify(u):h=String(u),i.push(`${n}${f}${o.label}: ${h}${c}`)}}return i.join(`
|
|
22
|
-
`)}},Ur=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(se);sa(se,"X",t=>t._toTytxPayload(),t=>se._fromTytxPayload(t));Mr(se.tytxSuffix,{...Ge(se.tytxSuffix),Bag:se});var qo=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 jo(t){return t.endsWith("_")&&qo.has(t.slice(0,-1))?t.slice(0,-1):t}function Vo(t){let e=jo(t);return e!==t?e:t.startsWith("_")&&qo.has(t.slice(1))?t.slice(1):t}function fa(t,{renderTag:e=null,ns:r=null,dialectName:n=null}={}){let i=e||t;if(!i)return i;if(i=jo(i),r&&!e){let a=`${n}_`;i.startsWith(a)&&(i=i.slice(a.length)),i=`${r}:${i}`}return i}var ir=Symbol("value"),Ho=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function pa(t){return Object.entries(t||{}).filter(([e])=>!Ho.has(e)).map(([e,r])=>[Vo(e),r])}var nr=class extends Ye{constructor(e,r,n=null,i=null,a=null,s=null,o=null){super(e,r,n,i,a,s,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let r=this.getAttr("_meta")||{},n=e.split(",").map(i=>i.trim());return n.length===1?r[n[0]]!==void 0?r[n[0]]:null:n.map(i=>r[i]!==void 0?r[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[r,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([r,n.split(":",1)[0]]);return this.pointerType(this.value)==="^"&&e.push(["",this.value.split(":",1)[0]]),e}fixedAttrItems(){return pa(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(ir,this.value),e}absDatapath(e){let r=e;this.pointerType(e)&&(e=(Ke(e)?.pointer??e).slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._finalizeAbsPath(this._resolveSymbolicDatapath(e,r),n):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,r)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,r){return e=this._collapseParentDatapath(e,e),r?`${e}?${r}`:e}_composeRelativeDatapath(e,r){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: ${r}`);return e}_collapseParentDatapath(e,r){let n=[];for(let i of e.split("."))if(i==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${r}`);n.pop()}else n.push(i);return n.join(".")}_resolveSymbolicDatapath(e,r){let n=e.slice(1),i=n.indexOf("."),a=i===-1?n:n.slice(0,i),s=i===-1?"":n.slice(i+1),o;if(a==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,r);else if(a==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,r);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${r} on a node without builder`);if(o=l.source.getNodeByAttr("nodeId",a),o==null)throw new Error(`#<id>: cannot resolve ${r}`)}return o.absDatapath(s?`.${s}`:".")}_findMarkedDatapathAncestor(e,r,n){let i=this;for(;i!=null;){let s=i.getAttr()||{};if(e&&(s.formId!=null||s.form===!0)||r&&"_anchor"in s)return i;i=i.parentNode}let a=e?"FORM":"ANCHOR";throw new Error(`#${a}: no marked ancestor found for ${n}`)}getRelativeData(e,r=null,{autocreate:n=!1}={}){let i=this.data,a=this.absDatapath(e);return n&&i.getItem(a)==null&&i.setItem(a,r),i.getItem(a,r)}setRelativeData(e,r,{attributes:n=null,fired:i=!1,reason:a=null}={}){let s=this.data,o=this.absDatapath(e);s.setItem(o,r,n,">",!1,!0,a===null?!0:a,i)}fireEvent(e,r=!0,{attributes:n=null,reason:i=null}={}){this.setRelativeData(e,r,{attributes:n,fired:!0,reason:i})}SET(e,r){this.setRelativeData(e,r)}GET(e){return this.getRelativeData(e)}PUT(e,r){this.setRelativeData(e,r,{reason:!1})}FIRE(e,r=!0){this.setRelativeData(e,r,{fired:!0})}},W=class t extends se{constructor(e=null,r=null){super(e),this._builder=r,this._insertingBuilder=null}get nodeClass(){return nr}_setBuilderItem(e,r,n,...i){let a=r?.map(([o])=>[o,o._builder])||null;if(r)for(let[o,l]of r)o._builder=l;let s=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(o){if(this.node(n)==null&&a)for(let[l,u]of a)l._builder=u;throw o}finally{this._insertingBuilder=s}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let r=this._builderBindingPlan(e);for(let[n,i]of r)n._builder=i;return this.setBackref(),this}_builderBindingPlan(e){let r=[],n=new WeakSet,i=(a,s)=>{if(n.has(a))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(a),r.push([a,s]);for(let o of a.getNodes()){let l=s,u=o._getMeta("subbuilder");u!=null&&(l=s._resolveSubbuilderReference(u,o.getAttr()||{},o.nodeTag)),r.push([o,l]);let c=o.getValue(!0);c instanceof t&&i(c,l)}};return i(this,e),r}};if((Ge(W.tytxSuffix).SourceBag??W)!==W)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Mr(W.tytxSuffix,{...Ge(W.tytxSuffix),SourceBag:W});function Zf(t){if(t.length===0)return{value:null,attrs:{}};let e=t[0];if(e!==null&&typeof e=="object"){let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null)return{value:null,attrs:e}}return{value:e,attrs:t[1]||{}}}var Jf=new Set(["then","toJSON"]),Wo=new WeakMap;function Fr(t){return Wo.get(t)||t}function ha(t){if(t==null)return t;t=Fr(t);let e=t._builder||t.parentBag&&t.parentBag._builder;return e?e.wrapSource(t):t}function Go(t,e){let r=e instanceof se,n=new Proxy(e,{get(i,a){if(typeof a=="symbol"||a.startsWith("_")||Jf.has(a))return Reflect.get(i,a,i);let s=t.schemaTag(a);if(r&&s)return zo(t,i,s,r);if(a in i){let l=Reflect.get(i,a,i);return typeof l=="function"?l.bind(i):l}if(s)return zo(t,i,s,r);let o=t.containerMethod(a);if(o)return(...l)=>t[o](t.wrapSource(i),...l)}});return Wo.set(n,e),n}function zo(t,e,r,n){return(...i)=>{let{value:a,attrs:s}=Zf(i),o=n?t.bagCall(e,r,a,s):t.commandOnNode(e,r,a,s);return o.builder.wrapSource(o)}}var Xo=/^[A-Za-z_][A-Za-z0-9_]*$/,Kf=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),Qf=new Set(["framework","value","attribute"]),ep=new Map([["builtins.str",t=>typeof t=="string"],["builtins.int",t=>Number.isInteger(t)],["builtins.float",t=>typeof t=="number"&&Number.isFinite(t)],["builtins.bool",t=>typeof t=="boolean"],["builtins.list",t=>Array.isArray(t)],["builtins.dict",t=>t!==null&&typeof t=="object"&&!Array.isArray(t)],["builtins.tuple",t=>Array.isArray(t)],["builtins.set",t=>Array.isArray(t)||t instanceof Set],["builtins.NoneType",t=>t===null],["builtins.object",t=>!0]]);function Et(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function k(t,e){throw new TypeError(`${t}: ${e}`)}function Ue(t,e,r,n){Et(t)||k(n,"must be an object");for(let i of Object.keys(t))e.includes(i)||k(n,`unknown field '${i}'`);for(let i of r)Object.hasOwn(t,i)||k(n,`missing field '${i}'`)}function xt(t,e){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t))return t.forEach((r,n)=>xt(r,`${e}[${n}]`));if(Et(t))return Object.entries(t).forEach(([r,n])=>xt(n,`${e}.${r}`));k(e,"must be lossless JSON data")}}function tp(t,e){let r="",n=!1;for(let i=0;i<t.length;i++){let a=t[i];if(a==="\\"){r+=a+(t[++i]??"");continue}a==="["&&(n=!0),!n&&a==="."&&!(e&16)?r+="[^\\n]":!n&&a==="^"&&e&8?r+="(?:^|(?<=\\n))":!n&&a==="$"?r+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":r+=a,a==="]"&&(n=!1)}return r}function kt(t,e,r=!1,n=null){if(t===null)return null;switch(Ue(t,["kind","dtype","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),t.kind){case"custom":return Ue(t,["kind","name"],["kind","name"],e),n||k(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(t.name,e);case"dtype":{Ue(t,["kind","dtype"],["kind","dtype"],e);let i=t.dtype;typeof i!="string"&&k(e,"dtype must be a string");let a=Ir(i);return!a&&i!=="NN"&&k(e,`unknown dtype '${i}'`),{...t,test:o=>i==="NN"?o===null:i==="N"?Te(o)&&!["NaN","Infinity","-Infinity"].includes(o.toString()):a===Number?typeof o=="number"&&Number.isFinite(o)&&(i!=="L"||Number.isInteger(o)):a===String?typeof o=="string":a===Boolean?typeof o=="boolean":a===Date?o instanceof Date&&Number.isFinite(o.getTime()):a===Object?Et(o)&&[Object.prototype,null].includes(Object.getPrototypeOf(o)):o instanceof a}}case"any":return{...t,test:i=>!0};case"type":{(typeof t.module!="string"||typeof t.name!="string")&&k(e,"type requires string module/name");let i=`${t.module}.${t.name}`;if(i==="collections.abc.Callable")return{...t,test:s=>typeof s=="function",portable:!1};let a=ep.get(i);return a||k(e,`unsupported type '${i}'`),{...t,test:a}}case"union":{(!Array.isArray(t.items)||!t.items.length)&&k(e,"union items must be non-empty");let i=t.items.map((a,s)=>kt(a,`${e}.items[${s}]`,!0,n));return{...t,items:i,inputConstraint:i.some(a=>a.inputConstraint),test:a=>i.some(s=>s.test&&s.test(a))}}case"literal":return Array.isArray(t.values)||k(e,"literal values must be an array"),t.values.forEach((i,a)=>xt(i,`${e}.values[${a}]`)),{...t,test:i=>t.values.some(a=>Object.is(a,i))};case"annotated":{Array.isArray(t.metadata)||k(e,"annotated metadata must be an array"),t.metadata.some(s=>!["regex","range","value"].includes(s?.kind))&&k(e,"unsupported annotation metadata kind");let i=kt(t.base,`${e}.base`,!0,n),a=t.metadata.map((s,o)=>kt(s,`${e}.metadata[${o}]`,!0,n));return{...t,base:i,metadata:a,inputConstraint:i.inputConstraint,test:s=>i.test(s)&&a.every(o=>!o.test||o.test(s))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(t,i)||k(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])t[i]!==null&&(typeof t[i]!="number"||!Number.isFinite(t[i]))&&k(e,`${i} must be finite number or null`);return{...t,test:i=>typeof i=="number"&&(t.ge===null||i>=t.ge)&&(t.le===null||i<=t.le)&&(t.gt===null||i>t.gt)&&(t.lt===null||i<t.lt)}}case"regex":{(typeof t.pattern!="string"||!Number.isInteger(t.flags)||t.flags<0)&&k(e,"regex requires pattern and non-negative integer flags");let i=t.flags&-59;i&&k(e,`unsupported Python regex flags ${i}`),t.flags&2&&k(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(t.pattern.replaceAll(String.raw`[\s\S]`,"."))&&k(e,"regex uses a non-portable construct or character class");let a="uy";t.flags&16&&(a+="s");let s;try{s=new RegExp(`(?:${tp(t.pattern,t.flags)})(?![\\s\\S])`,a)}catch(o){k(e,`invalid portable regex: ${o.message}`)}return{...t,test:o=>typeof o!="string"?!1:(s.lastIndex=0,s.test(o))}}case"value":return xt(t.value,`${e}.value`),{...t};case"generic":{let i=kt(t.origin,`${e}.origin`,!0,n);(t.origin?.kind!=="type"||t.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(t.origin.name))&&k(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(t.arguments)||k(e,"generic arguments must be an array");let a=t.arguments.map((s,o)=>kt(s,`${e}.arguments[${o}]`,!0,n));return{...t,origin:i,arguments:a,inputConstraint:a.some(s=>s.inputConstraint),test:s=>i.test(s)&&rp(t.origin,a,s)}}case"arguments":k(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return r||k(e,"ellipsis is only valid as a nested descriptor"),{...t};default:k(e,`unknown annotation kind '${t.kind}'`)}}function rp(t,e,r){let n=`${t.module}.${t.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?r.length===e.length&&r.every((i,a)=>e[a].test(i)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...r].every(i=>!e[0]?.test||e[0].test(i)):n==="builtins.dict"?Object.entries(r).every(([i,a])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(a))):!1}function Zo(t,e){if(t===null)return null;if(typeof t!="string"&&k(e,"must be string or null"),t==="")return new Map;let r=new Map;for(let n of t.split(",")){let i=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(i)&&k(e,`invalid cardinality item '${n}'`);let a=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);a||k(e,`invalid cardinality item '${n}'`);let[,s,o,l,u]=a;r.has(s)&&k(e,`duplicate tag '${s}'`);let c=0,d=1/0;i.includes("[")&&(i.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(o)),d<c&&k(e,`maximum ${d} is below minimum ${c}`),r.set(s,{min:c,max:d})}return r.has("*")&&r.size>1&&k(e,"wildcard '*' cannot be combined with named tags"),r}function Jo(t,e){if(t===null)return null;typeof t!="string"&&k(e,"must be string or null");let r=new Set;for(let n of t.split(",")){let i=n.trim();i&&((!Xo.test(i)||r.has(i))&&k(e,`invalid or duplicate parent '${n}'`),r.add(i))}return r}function np(t,e,r){if(t===null)return null;Ue(t,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=t.parameters??[];Array.isArray(n)||k(e,"parameters must be an array"),t={parameters:n,accepts_var_keyword:n.some(l=>l.kind==="var_keyword"),accepts_var_positional:n.some(l=>l.kind==="var_positional"),...t},(!Array.isArray(t.parameters)||typeof t.accepts_var_keyword!="boolean"||typeof t.accepts_var_positional!="boolean")&&k(e,"invalid signature descriptor");let i=new Set,a=!1,s=!1,o=t.parameters.map((l,u)=>{let c=`${e}.parameters[${u}]`;return Ue(l,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof l.name!="string"||!Xo.test(l.name)||i.has(l.name))&&k(c,"invalid or duplicate parameter name"),i.add(l.name),(!Kf.has(l.kind)||!Qf.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&&xt(l.default,`${c}.default`),a||=l.kind==="var_keyword",s||=l.kind==="var_positional",{...l,annotation:kt(l.annotation,`${c}.annotation`,!1,r)}});return(a!==t.accepts_var_keyword||s!==t.accepts_var_positional)&&k(e,"variadic summary flags do not match parameters"),{...t,parameters:o}}function Yo(t,e,r,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...r?["node_label","collection_key"]:[],"_meta"];Ue(t,i,[],e),t={...Object.fromEntries(i.map(a=>[a,null])),...t};for(let a of["doc","inherits_from","ns",...r?["node_label","collection_key"]:[]])t[a]!==null&&typeof t[a]!="string"&&k(e,`${a} must be string or null`);return t._meta!==null&&(Et(t._meta)||k(e,"_meta must be object or null"),xt(t._meta,`${e}._meta`)),Zo(t.sub_tags,`${e}.sub_tags`),Jo(t.parent_tags,`${e}.parent_tags`),{...t,attributes:np(t.attributes,`${e}.attributes`,n)}}function Ko(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function Qo(t,e){let r={...e};for(let[n,i]of Object.entries(t))n==="inherits_from"||n.startsWith("_")||r[n]||(r[n]=i);return r._meta={...t._meta||{},...e._meta||{}},r}function el(t){let e={...t};return e._subSpec=Object.hasOwn(e,"sub_tags")?Zo(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?Jo(e.parent_tags,"resolved.parent_tags"):null,e}function tl(t,e,r,n){if(r.get(t)===1&&k(n,`inheritance cycle at '${t}'`),r.get(t)===2)return e[t];let i=e[t];i||k(n,`unknown abstract '${t}'`),r.set(t,1);let a={...i};for(let s of Ko(i.inherits_from))a=Qo(tl(s,e,r,n),a);return a=el(a),r.set(t,2),e[t]=a,a}function ma({abstracts:t={},elements:e={}}){let r={...t},n=new Map;for(let a of Object.keys(r))tl(a,r,n,`abstracts.${a}.inherits_from`);let i={};for(let[a,s]of Object.entries(e)){let o={...s};for(let l of Ko(s.inherits_from)){let u=r[l];u||k(`elements.${a}.inherits_from`,`unknown abstract '${l}'`),o=Qo(u,o)}i[a]=el(o)}return{abstracts:r,elements:i}}function ga(t){Ue(t,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Ue(t.document_format,["name","version"],["name","version"],"document_format"),(t.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(t.document_format.version))&&k("document_format","expected builder_grammar version 1.1 or 1.2"),Ue(t.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof t.grammar.name!="string"||!t.grammar.name)&&k("grammar.name","must be non-empty string");for(let i of["version","title","description"])t.grammar[i]!==null&&typeof t.grammar[i]!="string"&&k(`grammar.${i}`,"must be string or null");(!Et(t.abstracts)||!Et(t.elements))&&k("grammar document","abstracts/elements must be objects"),Object.hasOwn(t,"custom_types")&&t.document_format.version!=="1.2"&&k("custom_types","requires version 1.2");let e=Yn.fromJSON(t.custom_types??{}),r={};for(let[i,a]of Object.entries(t.abstracts))(!i||i.startsWith("_"))&&k("abstracts",`invalid public name '${i}'`),r[i]=Yo(a,`abstracts.${i}`,!1,e);let n={};for(let[i,a]of Object.entries(t.elements))(!i||i.startsWith("_"))&&k("elements",`invalid public name '${i}'`),n[i]=Yo(a,`elements.${i}`,!0,e);return{grammar:structuredClone(t.grammar),abstracts:r,elements:n}}function rl(t,e,r,n){let i=e.attributes;if(!i)return;let a={...n};r!=null&&(a.node_value=r);let s=new Set(i.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),o=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))!s.has(u)&&!o.has(u)&&k(t,`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(a,u.name);!c&&!u.has_default&&k(t,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(a[u.name]))&&k(t,`invalid value for ${u.role} '${u.name}'`)}}var Yn=class t{#e=new Map;#t=new Map;register(e,r,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),a=i.has(r)?{kind:"type",module:"builtins",name:i.get(r)}:r;return this.#n(e,{kind:"annotated",base:a,metadata:[n]})}#n(e,r){(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||e in this||["to_dict","from_dict"].includes(e)||ip.has(e))&&k("custom_types",`invalid, reserved or duplicate name '${e}'`),Ue(r,["kind","base","metadata"],["kind","base","metadata"],`custom_types.${e}`),(r.kind!=="annotated"||!Array.isArray(r.metadata)||r.metadata.length!==1||!["regex","range"].includes(r.metadata[0]?.kind))&&k(`custom_types.${e}`,"requires an annotated base with one Regex or Range validator");let n=r.metadata[0].kind==="regex"?["str"]:["int","float"];(r.base?.kind!=="type"||r.base.module!=="builtins"||!n.includes(r.base.name))&&k(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),xt(r,`custom_types.${e}`);let i=structuredClone(r),a=kt(i,`custom_types.${e}`),s=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:s,enumerable:!0}),this.#e.set(e,i),this.#t.set(e,{...s,inputConstraint:!0,test:a.test}),s}resolve(e,r="custom_types"){return this.#t.has(e)||k(r,`unknown custom type '${e}'`),{...this.#t.get(e)}}validate(e,r){return this.resolve(e).test(r)||k(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){Et(e)||k("custom_types","must be an object");let r=new t;for(let[n,i]of Object.entries(e))r.#n(n,i);return r}},ip=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 nl(t,e,r,n){let i=e?.attributes;if(i)for(let a of i.parameters){if(!a.annotation?.inputConstraint||a.role==="framework"||["var_keyword","var_positional"].includes(a.kind))continue;let s=a.role==="value"?r:n[a.name];s!==void 0&&(a.annotation.test(s)||k(t,`invalid input for '${a.name}' (custom type)`))}}function il(t,e,r=[]){if(e===null)return structuredClone(t);if(r.length===2&&r[0]==="custom_types"&&t!==void 0){if(!ba(t,e))throw new TypeError(`conflicting custom type '${r[1]}'`);return structuredClone(t)}if(r.length===2&&["abstracts","elements"].includes(r[0]))return structuredClone(e);if(Xe(t)&&Xe(e)){let n=structuredClone(t);for(let[i,a]of Object.entries(e))a!==null&&Object.defineProperty(n,i,{value:il(n[i],a,[...r,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function ba(t,e){return Object.is(t,e)?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,n)=>ba(r,e[n])):Xe(t)&&Xe(e)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>Object.hasOwn(e,r)&&ba(t[r],e[r])):!1}function Xe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function _a(t){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t)){t.forEach(_a);return}if(Xe(t)){Object.values(t).forEach(_a);return}throw new TypeError("collection must contain only finite JSON values")}}var Ze=class t{#e;constructor(e){_a(e);let r=["document_format","grammar","abstracts","elements"];if(!Xe(e)||Object.keys(e).some(i=>![...r,"custom_types"].includes(i))||r.some(i=>!Object.hasOwn(e,i)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!Xe(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(!Xe(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!Xe(e.custom_types)))throw new TypeError("custom_types requires an object catalog and version 1.2");this.#e=structuredClone(e)}update(e){let r=new t(e),n=il(this.#e,r.#e);return(this.#e.document_format.version==="1.2"||r.#e.document_format.version==="1.2")&&(n.document_format.version="1.2"),this.#e=n,this}toDocument(){return structuredClone(this.#e)}};var Dt=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,r){this.renders.set(e,r)}getRender(e){let r=this.renders.get(e);if(r!==void 0)return r;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,r={}){let n=e.builder,[i,a]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,a,r);let s=this.getRender(n),o;return[o,a]=s._handleMeta(e,a),e._getMeta("subbuilder")||(a=s.adaptAttrs(a)),e.value instanceof W&&(i=this.renderChildren(e.value,r)),s.renderedItem(e,i,a,{tag:o,...r})}renderChildren(e,r={}){let n=[];for(let i of e.getNodes()){let a=this.render(i,r);a!==null&&(Array.isArray(a)?n.push(...a):n.push(a))}return n}_renderComponent(e,r,n){let[i,a,s,o]=this._expansionInputs(e,r);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,s,o,n);if(a==null)return[];if(!(a instanceof se))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${a?.constructor?.name||typeof a}`);return a.getNodes().map(l=>this._expandBlock(e,i,s,{node_label:l.label},n))}_expansionInputs(e,r){let n=e.builder,i=n.componentMethod(e.nodeTag),a=i&&n[i];if(typeof a!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let s=r.iterate;delete r.iterate,delete r.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let l of Object.keys(r)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(r[l]=`^${e.absDatapath(u)}`)}return[a,s,o,r]}_expandBlock(e,r,n,i,a){let s=e.builder._expansionRoot(n);r.call(e.builder,ha(s),i);let o=s.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let l={...a,depthOffset:this._nodeDepth(e,a.depthOffset||0)};return this.render(o[0],l)}preprocess(e){return e}renderedItem(e,r,n,i){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,r){let[n,i]=e._getMeta("render_tag,render_attributes"),a=fa(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!a)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(r={...r,...i}),[a,r]}adaptAttrs(e){return e}adapt(e){let r=`${this.builder.constructor._name}_`;return e.startsWith(r)?e.slice(r.length):e}finalize(e,r=null,n={}){let i=this._composeStringFragments(e);if(r==null)return i;if(typeof r=="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 r.full=="function"&&typeof r.write!="function")return r.full(i),null;if(typeof r.write=="function")return r.write(i),null;if(typeof r=="function")return r(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(r=>typeof r!="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,r=0){let i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+r}};var At=class extends Dt{static mode="xml";renderedItem(e,r,n,{tag:i,pretty:a=!1,depthOffset:s=0}={}){let o=this._formatAttrs(n),l=a?" ".repeat(this._nodeDepth(e,s)):"",u=a?`
|
|
23
|
-
`:"";if(Array.isArray(r)){let c=this._composeStringFragments(r);return`${l}<${i}${o}>${u}${c}${l}</${i}>${u}`}return r==null?`${l}<${i}${o}></${i}>${u}`:`${l}<${i}${o}>${this._escapeText(r)}</${i}>${u}`}finalize(e,r=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,r)}_formatAttrs(e){return Object.entries(e||{}).map(([r,n])=>` ${r.startsWith("xmlns_")?`xmlns:${r.slice(6)}`:r}="${this._escapeAttr(n)}"`).join("")}};var al={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 sl(t){let e=[];for(;t&&t!==Function.prototype;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function sp(t){let e=Object.create(null),r=(n,i)=>{let a=n.toLowerCase(),s=e[a];if(s!==void 0&&s!==i)throw new Error(`container '${n}' is already tied to implementation method '${s}' (cannot rebind to '${i}')`);e[a]=i};for(let n of sl(t))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])r(i,i);return e}function qr(t){let e=Object.create(null);for(let r of Object.keys(t)){let n=r.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${r}' has a case-insensitive collision with '${e[n]}'`);e[n]=r}return e}var jr="_root_",wa="_root_",ol=new Set(["destination","func","value","_on_start"]),Fe=class t{static _sourceClass=W;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof t))throw new TypeError("registerBuilder requires a BuilderBase subclass");let r=e._name;if(typeof r!="string"||!r)throw new TypeError("registered builders require a non-empty static _name");let n=t._registry.get(r);if(n&&n!==e)throw new Error(`Builder name '${r}' is already registered to ${n.name}; cannot register ${e.name}`);return t._registry.set(r,e),e}static getBuilderClass(e){let r=t._registry.get(e);if(!r)throw new Error(`No builder registered with name '${e}'`);return r}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new se,this._dataroot.setBackref(),this._dataroot.setItem(wa,new se),this.data=this._dataroot.getItem(wa),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 r=this.constructor._sourceClass;this._sourceroot=new r(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(jr,new r(null,this)),this.source=this._sourceroot.getItem(jr)}wrapSource(e){if(e=Fr(e),!(e instanceof W)&&!(e instanceof nr))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let r=this._sourceHandles.get(e);return r||(r=Go(this,e),this._sourceHandles.set(e,r)),r}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let r=this._subbuilders.get(e);if(!r){let n=t.getBuilderClass(e);r=new n,this._subbuilders.set(e,r)}return r._dataroot=this._dataroot,r.data=this.data,r}_resolveSubbuilderReference(e,r,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 r=this._classCollection,n=r?new Ze(r.toDocument()).update(e):new Ze(e),i=ga(n.toDocument()),a=ma(i),s=qr(a.elements);this._classCollection=n,this._classSchema=a.elements,this._abstracts=a.abstracts,this._tagNames=s}static{this.defineGrammar(al)}get _containers(){return sp(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??=qr(this.schema):this.constructor._tagNames??=qr(this.schema)}schemaTag(e){let r=e.toLowerCase(),n=this.schemaTagNames[r];if(n)return n;let i=`${this.constructor._name}_`;return r.startsWith(i)&&this.schemaTagNames[r.slice(i.length)]||null}loadGrammar(e,{replace:r=!1}={}){let n=this._collection||this.constructor._classCollection,i=r?new Ze(e):new Ze(n.toDocument()).update(e),a=ga(i.toDocument()),s=ma(a),o=qr(s.elements);return this._collection=i,this._schemaOverride=s.elements,this._tagNamesOverride=o,this}validateCustomTypes(e){let r=e.parentBag?.parentNode?.builder||e.parentBag?._builder,n=r&&r!==this&&r.schema[e.nodeTag]?._meta?.subbuilder?r:this;nl(e.nodeTag,n.schema[e.nodeTag],e.value,e.getAttr()||{})}validateNodeValues(e,r,n={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);return rl(i,this.schema[i],r,n),!0}validateNode(e,{value:r,attrs:n,childTags:i}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let a=r!==void 0?r:e.value instanceof W?null:e.value;this.validateNodeValues(e.nodeTag,a,n||e.getAttr?.()||{});let s=this.schema[this.schemaTag(e.nodeTag)],o=i||(e.value instanceof W?e.value.getNodes().map(l=>l.nodeTag):null);return o&&this._validateChildren(e.nodeTag,s,o,!1),!0}validateChildren(e,r,{includeMinimum:n=!1}={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);if(!Array.isArray(r)||r.some(a=>typeof a!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(i,this.schema[i],r,n)}validateParent(e,r=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 a=i._parentSpec;if(a==null||a.has("*"))return!0;if(r===null)throw new Error(`'${n}' requires a declared parent`);let s=this.schemaTag(r);if(!s)throw new Error(`unknown parent element '${r}'`);return this._validateParent(n,i,s),!0}bagCall(e,r,n,i){return this.setChild(e,r,n,i)}commandOnNode(e,r,n,i){if(e=Fr(e),e.value instanceof W)return this.setChild(e.value,r,n,i);let a=e.value,s=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(s,r,n,i,e);return this.promoteNodeValue(e,a,s),o}promoteNodeValue(e,r,n){e.setValue(n)}setChild(e,r,n,i,a=null){let s={...i},o=this.schema[r];if(!o)throw new Error(`unknown element '${r}'`);this.validateNodeValues(r,n,s);let l=o._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,s,r))||this,d=n instanceof W?n._builderBindingPlan(c):null,f=a?.rootBuilder||e.root._builder||this;if(s.nodeId!=null&&f.source.getNodeByAttr("nodeId",s.nodeId))throw new Error(`Duplicate nodeId '${s.nodeId}'`);n instanceof W&&this._validateChildren(r,o,n.getNodes().map(w=>w.nodeTag),!1);let p=a||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(r,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),r],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${r}' requires a declared parent`);o._meta&&!("_meta"in s)&&(s._meta=o._meta),o.ns&&!("ns"in s)&&(s.ns=o.ns);let m=s.node_position;delete s.node_position;let g=s.node_label;delete s.node_label;let _;if(h?.collection_key){if(g!=null)throw new Error(`'${r}': node_label is not allowed in a collection`);_=this._collectionLabel(h.collection_key,r,s)}else{let w=h?._subSpec?.get(r);if(w&&w.max===1){if(g!=null)throw new Error(`'${r}': node_label is not allowed on a singleton`);_=r}else _=g||o.node_label||this._autoLabel(e,r)}if(e.node(_)!=null)throw new Error(`duplicate node label '${_}'`);return e._setBuilderItem(c,d,_,n,s,m||">",!1,!0,null,!1,!0,null,r)}_countsForGrammar(e){let r=e?._meta||{};return!(r.data_element||r.subbuilder||r.component)}_validateParent(e,r,n){let i=r._parentSpec;if(!(i==null||i.has("*")||!this._countsForGrammar(r))&&!i.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,r,n,i){let a=r._subSpec;if(a==null||a.has("*")||r._meta?.subbuilder)return[];let s=new Map;for(let o of n){let l=this.schema[o];if(l&&!this._countsForGrammar(l))continue;let u=a.get(o);if(!u)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(s.get(o)||0)+1;if(s.set(o,c),c>u.max)throw new Error(`too many '${o}' in '${e}'`)}return i?[...a].filter(([o,l])=>(s.get(o)||0)<l.min).map(([o])=>o):[]}_collectionLabel(e,r,n){let i=a=>{if(n[a]===null||n[a]===void 0)throw new Error(`'${r}': collection key needs attribute '${a}'`);return String(n[a])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(a,s)=>i(s)):i(e)}validateSource(){let e=[],r=(n,i="")=>{for(let a of n.getNodes()){let s=i?`${i}.${a.label}`:a.label,o=a.builder;o.validateCustomTypes(a);let l=o.schema[a.nodeTag];if(l&&!a._getMeta("data_element,subbuilder,component").some(Boolean)){let u=a.value instanceof W?a.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(a.nodeTag,l,u,!0);c.length&&e.push([s,c])}a.value instanceof W&&r(a.value,s)}};return r(this.source),e}_autoLabel(e,r){let n=0;for(;e.node(`${r}_${n}`)!==null&&e.node(`${r}_${n}`)!==void 0;)n+=1;return`${r}_${n}`}nodeById(e){let r=this.source.getNodeByAttr("nodeId",e);if(r==null)throw new Error(`nodeId not found: ${e}`);return r.builder.wrapSource(r)}runtimeValues(e){e.builder.validateCustomTypes(e);let r=new Map,n={},i=e.runtimeToEvaluate(),a=new Set(i.keys()),s=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,d]of[...i])if(!(typeof c!="string"||!Ke(d)))for(let f of pi(e,d))i.has(f)||i.set(f,s.get(f));let o=e._getMeta("data_element");for(let[c,d]of i){if(d instanceof ne){r.set(c,d.resolve());continue}let f=typeof c=="string"?Ke(d)?.pointer??d:d;if(!e.pointerType(f)){r.set(c,typeof c=="string"&&typeof d=="string"&&d.startsWith("==")?null:d);continue}let p=e.absDatapath(f);if(r.set(c,this.data.getItem(p)),!o&&!p.includes("?")&&c===ir){let h=this.data.getNode(p);h&&Object.assign(n,h.getAttr("_wdg"))}}let l=La(i,r,(c,d,f,p)=>this.evaluatePointerExpression(e,c,d,f,p)),u=l.get(ir);l.delete(ir);for(let c of l.keys())a.has(c)||l.delete(c);return[u,{...Object.fromEntries(l),...n}]}evaluatePointerExpression(e,r,n,i,a){return null}targetId(e){if(e._targetId)return e._targetId;let r=e.rootBuilder;return e.parentBag.root!==r.source.root?null:(r._targetSerial+=1,e._targetId=`n${r._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 r of this.dataLogic){let i=(typeof r=="function"?r:r.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[,r]=this.runtimeValues(e),n={};for(let[i,a]of Object.entries(r))ol.has(i)||(n[i]=a);return n}computeLogic(e){for(let r of e)this._computeNode(r)}_computeNode(e){let r=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[i,a]of Object.entries(r))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=a);e.setRelativeData(r.destination,r.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(r.func);e.setRelativeData(r.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(r.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],r=n=>{for(let i of n.getNodes())i._getMeta("data_element")&&e.push(i),i.value instanceof W&&r(i.value)};return r(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of sl(this.constructor))if(Object.hasOwn(o,"components"))for(let l of o.components||[])e[l]=l;if(!Object.keys(e).length)return;let r={...this.schema},n={};for(let[o,l]of Object.entries(e))r[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=l;let i=qr(r),a=this._collection||this.constructor._classCollection,s=a.toDocument();s.abstracts={},s.elements=Object.fromEntries(Object.keys(e).map(o=>[o,r[o]])),this._collection=new Ze(a.toDocument()).update(s),this._schemaOverride=r,this._componentMap=n,this._tagNamesOverride=i}_expansionRoot(e=null){let r=this.constructor._sourceClass,n=new r(null,this);return n.setBackref(),n.setItem(jr,new r(null,this),e?{datapath:e}:null),n.getItem(jr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new At(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let r=this[`renderer_${e}`];if(!r)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return r}materialize(e=null,r={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),i=n.renderChildren(n.preprocess(this.source),r);return this.materialized[e]=i,i}setRenderTarget(e,r=null){r??=this.constructor._defaultRenderMode,this._defaultTargets.set(r,e)}render({mode:e=null,target:r=null,...n}={}){e??=this.constructor._defaultRenderMode;let i=this.getRenderer(e);if(r===!1&&i.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let a=r===!1?null:r||this._defaultTargets.get(i.mode)||null,s={...a?.renderOpts,...n};return i.finalize(this.materialize(e,s),a,s)}};Fe._registry=new Map;var op=new Set(["short","medium","long","full"]),lp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function up(t,e){if(!(t instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(t.getTime()))throw new RangeError("Invalid date");let r=e||ve(t).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(r))throw new RangeError(`Unsupported temporal dtype: ${r}`);return r}function cp(t,e,r,n){let i=e.match(lp)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let a=(c,d=2)=>String(c).padStart(d,"0"),s=c=>new Intl.DateTimeFormat(r,{timeZone:"UTC",...c}).format(t),u={...n==="H"?{}:{y:()=>String(t.getUTCFullYear()),yy:()=>a(t.getUTCFullYear()%100),yyyy:()=>a(t.getUTCFullYear(),4),M:()=>String(t.getUTCMonth()+1),MM:()=>a(t.getUTCMonth()+1),MMM:()=>s({month:"short"}),MMMM:()=>s({month:"long"}),d:()=>String(t.getUTCDate()),dd:()=>a(t.getUTCDate()),EEE:()=>s({weekday:"short"}),EEEE:()=>s({weekday:"long"})},...n==="D"?{}:{H:()=>String(t.getUTCHours()),HH:()=>a(t.getUTCHours()),h:()=>String(t.getUTCHours()%12||12),hh:()=>a(t.getUTCHours()%12||12),m:()=>String(t.getUTCMinutes()),mm:()=>a(t.getUTCMinutes()),s:()=>String(t.getUTCSeconds()),ss:()=>a(t.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(r,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(t).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 ll(t,{format:e,mask:r,locale:n,dtype:i,places:a}={}){let s=t==null?"":String(t);if(t!=null&&t!==""&&(e!=null&&e!==""||a!=null))if(typeof t=="number"||Te(t))s=fp(t,{format:e,locale:n,places:a});else{let o=up(t,i);if(op.has(e)){let l={timeZone:"UTC"};o!=="H"&&(l.dateStyle=e),o!=="D"&&(l.timeStyle=e),s=new Intl.DateTimeFormat(n||void 0,l).format(t)}else s=cp(t,String(e),n||void 0,o)}return r==null?s:String(r).replaceAll("%s",()=>s)}function dp({format:t="decimal",places:e}={}){let r={maximumFractionDigits:20};if(!t||t==="decimal")r.style="decimal";else if(t==="percent")r.style="percent";else if(t==="scientific")r.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(t);if(!n||t.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${t}`);r.useGrouping=n[1].includes(","),r.minimumFractionDigits=(n[2]||"").length,r.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");r.minimumFractionDigits=n,r.maximumFractionDigits=n}return r}function fp(t,e={}){if(typeof t!="number"&&!Te(t))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(t)))throw new RangeError("Number must be finite");let r=new Intl.NumberFormat(e.locale||void 0,dp(e));if(Te(t)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return r.format(Te(t)?t.toString():t)}var pp=new Set(["style","script"]),hp=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"]),ul=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"]),Vr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),cl=t=>t===!0?"true":t===!1?"false":String(t),Xn=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:String(t);function mp(t){if(ul.has(t))return!0;for(let e of ul)if(t.startsWith(`${e}_`))return!0;return!1}function gp(t){let e=new Map;if(!t)return e;let r=[],n=0,i=null,a=!1,s=!1,o=0,l=String(t);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(s){c==="*"&&d==="/"&&(s=!1,u+=1);continue}if(a){a=!1;continue}if(c==="\\"){a=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&d==="*"?(s=!0,u+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(r.push(l.slice(n,u)),n=u+1)}r.push(l.slice(n));for(let u of r){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 zr=class extends Dt{static mode="html";renderedItem(e,r,n,{tag:i,xml:a=!0,pretty:s=!1,depthOffset:o=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:p,dtype:h,...m}=n;!Array.isArray(r)&&(c!=null||d!=null||p!=null)&&(r=ll(r,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(l){if(!Object.hasOwn(n,"id")){let x=this.builder.targetId(e);x!==null&&(g+=` id="${this._htmlAttrValue(x)}"`)}for(let[x,B]of Object.entries(e.getAttr()))e.pointerType(B)&&(g+=` data-${this.adapt(x)}-pointer="${this._htmlAttrValue(e.absDatapath(B))}"`)}let _=s?" ".repeat(this._nodeDepth(e,o)):"",v=s?`
|
|
24
|
-
`:"";if(e._getMeta("void"))return`${_}<${i}${g}${a?"/":""}>${v}`;if(Array.isArray(r)){let x=this._composeStringFragments(r);return`${_}<${i}${g}>${v}${x}${_}</${i}>${v}`}if(r==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof r=="string"&&r.endsWith("::HTML")?r.slice(0,-6):pp.has(i)?String(r):this._escapeText(r);return`${_}<${i}${g}>${w}</${i}>${v}`}_displayLocale(e,r){if(r)return r;for(let n=e.parentNode;n;n=n.parentNode){let i=n.getAttr("locale");if(i==null)continue;let a=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(a)return a}}adaptAttrs(e){let r={},n={};for(let[a,s]of Object.entries(e||{}))if(a.startsWith(`${this.builder.constructor._name}_`))r[this.adapt(a)]=s;else if(a==="dtype")r.dtype=s;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>a.startsWith(o)))continue;this._isStyleContribution(a)?n[a]=s:r[a]=s}let i=this._adaptStyle(n);return i&&(r.style=i),r}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Vr.has(e))return!0;let r=e.includes("_")?e.slice(0,e.indexOf("_")):null;return r!==null&&Vr.has(r)||mp(e)}_adaptStyle(e){let r=gp(e.style),n=new Map,i=new Map;for(let[a,s]of Object.entries(e))if(a!=="style")if(a.startsWith("style_"))r.set(a.slice(6).replaceAll("_","-"),cl(s));else if(Vr.has(a))n.set(a,s);else{let o=a.indexOf("_"),l=o<0?a:a.slice(0,o);o>=0&&Vr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[a.slice(o+1)]=s):r.set(a.replaceAll("_","-"),cl(s))}for(let a of Vr)(n.has(a)||i.has(a))&&this[`_macro_${a}`](n.get(a),i.get(a)||{},r);return[...r].map(([a,s])=>`${a}: ${s}`).join("; ")}_formatAttrs(e){let r=[];for(let[n,i]of Object.entries(e||{}))hp.has(n)?i&&r.push(` ${n}`):r.push(` ${n}="${this._htmlAttrValue(i)}"`);return r.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,r,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[a,s]of Object.entries(r))if(a==="top"||a==="bottom")i[`${a}_left`]=s,i[`${a}_right`]=s;else if(a==="left"||a==="right")i[`top_${a}`]=s,i[`bottom_${a}`]=s;else if(["top_left","top_right","bottom_left","bottom_right"].includes(a))i[a]=s;else throw new TypeError(`rounded: unknown sub-kwarg '${a}'`);for(let[a,s]of Object.entries(i))n.set(`border-${a.replaceAll("_","-")}-radius`,Xn(s))}_macro_transform(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`rotate(${s}deg)`):a==="scale"||a==="translate"?i.push(`${a}(${s})`):a==="translate_x"?i.push(`translateX(${Xn(s)})`):a==="translate_y"?i.push(`translateY(${Xn(s)})`):a==="skew_x"?i.push(`skewX(${s}deg)`):a==="skew_y"?i.push(`skewY(${s}deg)`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`hue-rotate(${s}deg)`):a==="blur"?i.push(`blur(${Xn(s)})`):a==="drop_shadow"?i.push(`drop-shadow(${s})`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,r,n){e!==void 0&&n.set("transition",String(e));for(let[i,a]of Object.entries(r))n.set(`transition-${i.replaceAll("_","-")}`,String(a))}_macro_zoom(e,r,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,r,n){e!==void 0&&n.set("box-shadow",String(e));for(let[i,a]of Object.entries(r))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(a))}_macro_gradient(e,r,n){e!==void 0&&n.set("background-image",String(e))}};var bp=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 dl(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[bp.has(e)?e.replaceAll("_","-"):e,r]))}var Hr=class extends At{static mode="svg";adaptAttrs(e){return dl(e)}};var fl={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 Zn=class extends Fe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(fl)}get renderer_html(){return new zr(this)}};Fe.registerBuilder(Zn);var pl={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 Jn=class extends Fe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(pl)}get renderer_svg(){return new Hr(this)}};Fe.registerBuilder(Jn);var ar="http://www.w3.org/2000/svg";function ft(t,e,{align:r="start",matchWidth:n=!1,inset:i=0,placement:a="bottom",point:s=null}={}){let o=e.ownerDocument.defaultView,l=s?{left:s.x,right:s.x,top:s.y,bottom:s.y,width:0}:e.getBoundingClientRect(),u=Math.max(0,o.innerWidth-16);t.style.setProperty("--gramlot-popup-available-width",`${u}px`),n&&(t.style.width=`${Math.min(Math.max(0,l.width-2*i),u)}px`),t.style.removeProperty("--gramlot-popup-available-height");let c=t.getBoundingClientRect();if(a==="side"){let _=Math.max(0,o.innerWidth-8-l.right-3),v=Math.max(0,l.left-8-3),w=c.width>_&&v>_;t.style.setProperty("--gramlot-popup-available-width",`${w?v:_}px`),t.style.setProperty("--gramlot-popup-available-height",`${Math.max(0,o.innerHeight-16)}px`);let x=t.getBoundingClientRect(),B=w?l.left-x.width-3:l.right+3;t.style.left=`${Math.max(8,Math.min(B,o.innerWidth-x.width-8))}px`,t.style.top=`${Math.max(8,Math.min(l.top,o.innerHeight-x.height-8))}px`;return}let d=Math.max(0,o.innerHeight-8-l.bottom-3),f=Math.max(0,l.top-8-3),p=c.height>d&&f>d;t.style.setProperty("--gramlot-popup-available-height",`${p?f:d}px`);let h=t.getBoundingClientRect(),m=r==="end"?l.right-h.width-i:l.left+i,g=p?l.top-h.height-3:l.bottom+3;t.style.left=`${Math.max(8,Math.min(m,o.innerWidth-h.width-8))}px`,t.style.top=`${Math.max(8,Math.min(g,o.innerHeight-h.height-8))}px`}var hl=`
|
|
37
|
+
`)}},qr=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(se);fa(se,"X",t=>t._toTytxPayload(),t=>se._fromTytxPayload(t));Lr(se.tytxSuffix,{...Xe(se.tytxSuffix),Bag:se});var Zo=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 Jo(t){return t.endsWith("_")&&Zo.has(t.slice(0,-1))?t.slice(0,-1):t}function Ko(t){let e=Jo(t);return e!==t?e:t.startsWith("_")&&Zo.has(t.slice(1))?t.slice(1):t}function _a(t,{renderTag:e=null,ns:r=null,dialectName:n=null}={}){let i=e||t;if(!i)return i;if(i=Jo(i),r&&!e){let a=`${n}_`;i.startsWith(a)&&(i=i.slice(a.length)),i=`${r}:${i}`}return i}var ar=Symbol("value"),el=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function wa(t){return Object.entries(t||{}).filter(([e])=>!el.has(e)).map(([e,r])=>[Ko(e),r])}var ir=class extends Ze{constructor(e,r,n=null,i=null,a=null,s=null,o=null){super(e,r,n,i,a,s,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let r=this.getAttr("_meta")||{},n=e.split(",").map(i=>i.trim());return n.length===1?r[n[0]]!==void 0?r[n[0]]:null:n.map(i=>r[i]!==void 0?r[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[r,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([r,n.split(":",1)[0]]);return this.pointerType(this.value)==="^"&&e.push(["",this.value.split(":",1)[0]]),e}fixedAttrItems(){return wa(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(ar,this.value),e}absDatapath(e){let r=e;this.pointerType(e)&&(e=(et(e)?.pointer??e).slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._finalizeAbsPath(this._resolveSymbolicDatapath(e,r),n):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,r)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,r){return e=this._collapseParentDatapath(e,e),r?`${e}?${r}`:e}_composeRelativeDatapath(e,r){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: ${r}`);return e}_collapseParentDatapath(e,r){let n=[];for(let i of e.split("."))if(i==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${r}`);n.pop()}else n.push(i);return n.join(".")}_resolveSymbolicDatapath(e,r){let n=e.slice(1),i=n.indexOf("."),a=i===-1?n:n.slice(0,i),s=i===-1?"":n.slice(i+1),o;if(a==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,r);else if(a==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,r);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${r} on a node without builder`);if(o=l.source.getNodeByAttr("nodeId",a),o==null)throw new Error(`#<id>: cannot resolve ${r}`)}return o.absDatapath(s?`.${s}`:".")}_findMarkedDatapathAncestor(e,r,n){let i=this;for(;i!=null;){let s=i.getAttr()||{};if(e&&(s.formId!=null||s.form===!0)||r&&"_anchor"in s)return i;i=i.parentNode}let a=e?"FORM":"ANCHOR";throw new Error(`#${a}: no marked ancestor found for ${n}`)}getRelativeData(e,r=null,{autocreate:n=!1}={}){let i=this.data,a=this.absDatapath(e);return n&&i.getItem(a)==null&&i.setItem(a,r),i.getItem(a,r)}setRelativeData(e,r,{attributes:n=null,fired:i=!1,reason:a=null}={}){let s=this.data,o=this.absDatapath(e);s.setItem(o,r,n,">",!1,!0,a===null?!0:a,i)}fireEvent(e,r=!0,{attributes:n=null,reason:i=null}={}){this.setRelativeData(e,r,{attributes:n,fired:!0,reason:i})}SET(e,r){this.setRelativeData(e,r)}GET(e){return this.getRelativeData(e)}PUT(e,r){this.setRelativeData(e,r,{reason:!1})}FIRE(e,r=!0){this.setRelativeData(e,r,{fired:!0})}},W=class t extends se{constructor(e=null,r=null){super(e),this._builder=r,this._insertingBuilder=null}get nodeClass(){return ir}_setBuilderItem(e,r,n,...i){let a=r?.map(([o])=>[o,o._builder])||null;if(r)for(let[o,l]of r)o._builder=l;let s=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(o){if(this.node(n)==null&&a)for(let[l,u]of a)l._builder=u;throw o}finally{this._insertingBuilder=s}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let r=this._builderBindingPlan(e);for(let[n,i]of r)n._builder=i;return this.setBackref(),this}_builderBindingPlan(e){let r=[],n=new WeakSet,i=(a,s)=>{if(n.has(a))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(a),r.push([a,s]);for(let o of a.getNodes()){let l=s,u=o._getMeta("subbuilder");u!=null&&(l=s._resolveSubbuilderReference(u,o.getAttr()||{},o.nodeTag)),r.push([o,l]);let c=o.getValue(!0);c instanceof t&&i(c,l)}};return i(this,e),r}};if((Xe(W.tytxSuffix).SourceBag??W)!==W)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Lr(W.tytxSuffix,{...Xe(W.tytxSuffix),SourceBag:W});function sp(t){if(t.length===0)return{value:null,attrs:{}};let e=t[0];if(e!==null&&typeof e=="object"){let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null)return{value:null,attrs:e}}return{value:e,attrs:t[1]||{}}}var op=new Set(["then","toJSON"]),tl=new WeakMap;function jr(t){return tl.get(t)||t}function ya(t){if(t==null)return t;t=jr(t);let e=t._builder||t.parentBag&&t.parentBag._builder;return e?e.wrapSource(t):t}function rl(t,e){let r=e instanceof se,n=new Proxy(e,{get(i,a){if(typeof a=="symbol"||a.startsWith("_")||op.has(a))return Reflect.get(i,a,i);let s=t.schemaTag(a);if(r&&s)return Qo(t,i,s,r);if(a in i){let l=Reflect.get(i,a,i);return typeof l=="function"?l.bind(i):l}if(s)return Qo(t,i,s,r);let o=t.containerMethod(a);if(o)return(...l)=>t[o](t.wrapSource(i),...l)}});return tl.set(n,e),n}function Qo(t,e,r,n){return(...i)=>{let{value:a,attrs:s}=sp(i),o=n?t.bagCall(e,r,a,s):t.commandOnNode(e,r,a,s);return o.builder.wrapSource(o)}}var il=/^[A-Za-z_][A-Za-z0-9_]*$/,lp=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),up=new Set(["framework","value","attribute"]),cp=new Map([["builtins.str",t=>typeof t=="string"],["builtins.int",t=>Number.isInteger(t)],["builtins.float",t=>typeof t=="number"&&Number.isFinite(t)],["builtins.bool",t=>typeof t=="boolean"],["builtins.list",t=>Array.isArray(t)],["builtins.dict",t=>t!==null&&typeof t=="object"&&!Array.isArray(t)],["builtins.tuple",t=>Array.isArray(t)],["builtins.set",t=>Array.isArray(t)||t instanceof Set],["builtins.NoneType",t=>t===null],["builtins.object",t=>!0]]);function Et(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function k(t,e){throw new TypeError(`${t}: ${e}`)}function Fe(t,e,r,n){Et(t)||k(n,"must be an object");for(let i of Object.keys(t))e.includes(i)||k(n,`unknown field '${i}'`);for(let i of r)Object.hasOwn(t,i)||k(n,`missing field '${i}'`)}function Dt(t,e){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t))return t.forEach((r,n)=>Dt(r,`${e}[${n}]`));if(Et(t))return Object.entries(t).forEach(([r,n])=>Dt(n,`${e}.${r}`));k(e,"must be lossless JSON data")}}function dp(t,e){let r="",n=!1;for(let i=0;i<t.length;i++){let a=t[i];if(a==="\\"){r+=a+(t[++i]??"");continue}a==="["&&(n=!0),!n&&a==="."&&!(e&16)?r+="[^\\n]":!n&&a==="^"&&e&8?r+="(?:^|(?<=\\n))":!n&&a==="$"?r+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":r+=a,a==="]"&&(n=!1)}return r}function xt(t,e,r=!1,n=null){if(t===null)return null;switch(Fe(t,["kind","dtype","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),t.kind){case"custom":return Fe(t,["kind","name"],["kind","name"],e),n||k(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(t.name,e);case"dtype":{Fe(t,["kind","dtype"],["kind","dtype"],e);let i=t.dtype;typeof i!="string"&&k(e,"dtype must be a string");let a=Rr(i);return!a&&i!=="NN"&&k(e,`unknown dtype '${i}'`),{...t,test:o=>i==="NN"?o===null:i==="N"?Ce(o)&&!["NaN","Infinity","-Infinity"].includes(o.toString()):a===Number?typeof o=="number"&&Number.isFinite(o)&&(i!=="L"||Number.isInteger(o)):a===String?typeof o=="string":a===Boolean?typeof o=="boolean":a===Date?o instanceof Date&&Number.isFinite(o.getTime()):a===Object?Et(o)&&[Object.prototype,null].includes(Object.getPrototypeOf(o)):o instanceof a}}case"any":return{...t,test:i=>!0};case"type":{(typeof t.module!="string"||typeof t.name!="string")&&k(e,"type requires string module/name");let i=`${t.module}.${t.name}`;if(i==="collections.abc.Callable")return{...t,test:s=>typeof s=="function",portable:!1};let a=cp.get(i);return a||k(e,`unsupported type '${i}'`),{...t,test:a}}case"union":{(!Array.isArray(t.items)||!t.items.length)&&k(e,"union items must be non-empty");let i=t.items.map((a,s)=>xt(a,`${e}.items[${s}]`,!0,n));return{...t,items:i,inputConstraint:i.some(a=>a.inputConstraint),test:a=>i.some(s=>s.test&&s.test(a))}}case"literal":return Array.isArray(t.values)||k(e,"literal values must be an array"),t.values.forEach((i,a)=>Dt(i,`${e}.values[${a}]`)),{...t,test:i=>t.values.some(a=>Object.is(a,i))};case"annotated":{Array.isArray(t.metadata)||k(e,"annotated metadata must be an array"),t.metadata.some(s=>!["regex","range","value"].includes(s?.kind))&&k(e,"unsupported annotation metadata kind");let i=xt(t.base,`${e}.base`,!0,n),a=t.metadata.map((s,o)=>xt(s,`${e}.metadata[${o}]`,!0,n));return{...t,base:i,metadata:a,inputConstraint:i.inputConstraint,test:s=>i.test(s)&&a.every(o=>!o.test||o.test(s))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(t,i)||k(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])t[i]!==null&&(typeof t[i]!="number"||!Number.isFinite(t[i]))&&k(e,`${i} must be finite number or null`);return{...t,test:i=>typeof i=="number"&&(t.ge===null||i>=t.ge)&&(t.le===null||i<=t.le)&&(t.gt===null||i>t.gt)&&(t.lt===null||i<t.lt)}}case"regex":{(typeof t.pattern!="string"||!Number.isInteger(t.flags)||t.flags<0)&&k(e,"regex requires pattern and non-negative integer flags");let i=t.flags&-59;i&&k(e,`unsupported Python regex flags ${i}`),t.flags&2&&k(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(t.pattern.replaceAll(String.raw`[\s\S]`,"."))&&k(e,"regex uses a non-portable construct or character class");let a="uy";t.flags&16&&(a+="s");let s;try{s=new RegExp(`(?:${dp(t.pattern,t.flags)})(?![\\s\\S])`,a)}catch(o){k(e,`invalid portable regex: ${o.message}`)}return{...t,test:o=>typeof o!="string"?!1:(s.lastIndex=0,s.test(o))}}case"value":return Dt(t.value,`${e}.value`),{...t};case"generic":{let i=xt(t.origin,`${e}.origin`,!0,n);(t.origin?.kind!=="type"||t.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(t.origin.name))&&k(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(t.arguments)||k(e,"generic arguments must be an array");let a=t.arguments.map((s,o)=>xt(s,`${e}.arguments[${o}]`,!0,n));return{...t,origin:i,arguments:a,inputConstraint:a.some(s=>s.inputConstraint),test:s=>i.test(s)&&fp(t.origin,a,s)}}case"arguments":k(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return r||k(e,"ellipsis is only valid as a nested descriptor"),{...t};default:k(e,`unknown annotation kind '${t.kind}'`)}}function fp(t,e,r){let n=`${t.module}.${t.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?r.length===e.length&&r.every((i,a)=>e[a].test(i)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...r].every(i=>!e[0]?.test||e[0].test(i)):n==="builtins.dict"?Object.entries(r).every(([i,a])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(a))):!1}function al(t,e){if(t===null)return null;if(typeof t!="string"&&k(e,"must be string or null"),t==="")return new Map;let r=new Map;for(let n of t.split(",")){let i=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(i)&&k(e,`invalid cardinality item '${n}'`);let a=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);a||k(e,`invalid cardinality item '${n}'`);let[,s,o,l,u]=a;r.has(s)&&k(e,`duplicate tag '${s}'`);let c=0,d=1/0;i.includes("[")&&(i.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(o)),d<c&&k(e,`maximum ${d} is below minimum ${c}`),r.set(s,{min:c,max:d})}return r.has("*")&&r.size>1&&k(e,"wildcard '*' cannot be combined with named tags"),r}function sl(t,e){if(t===null)return null;typeof t!="string"&&k(e,"must be string or null");let r=new Set;for(let n of t.split(",")){let i=n.trim();i&&((!il.test(i)||r.has(i))&&k(e,`invalid or duplicate parent '${n}'`),r.add(i))}return r}function pp(t,e,r){if(t===null)return null;Fe(t,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=t.parameters??[];Array.isArray(n)||k(e,"parameters must be an array"),t={parameters:n,accepts_var_keyword:n.some(l=>l.kind==="var_keyword"),accepts_var_positional:n.some(l=>l.kind==="var_positional"),...t},(!Array.isArray(t.parameters)||typeof t.accepts_var_keyword!="boolean"||typeof t.accepts_var_positional!="boolean")&&k(e,"invalid signature descriptor");let i=new Set,a=!1,s=!1,o=t.parameters.map((l,u)=>{let c=`${e}.parameters[${u}]`;return Fe(l,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof l.name!="string"||!il.test(l.name)||i.has(l.name))&&k(c,"invalid or duplicate parameter name"),i.add(l.name),(!lp.has(l.kind)||!up.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&&Dt(l.default,`${c}.default`),a||=l.kind==="var_keyword",s||=l.kind==="var_positional",{...l,annotation:xt(l.annotation,`${c}.annotation`,!1,r)}});return(a!==t.accepts_var_keyword||s!==t.accepts_var_positional)&&k(e,"variadic summary flags do not match parameters"),{...t,parameters:o}}function nl(t,e,r,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...r?["node_label","collection_key"]:[],"_meta"];Fe(t,i,[],e),t={...Object.fromEntries(i.map(a=>[a,null])),...t};for(let a of["doc","inherits_from","ns",...r?["node_label","collection_key"]:[]])t[a]!==null&&typeof t[a]!="string"&&k(e,`${a} must be string or null`);return t._meta!==null&&(Et(t._meta)||k(e,"_meta must be object or null"),Dt(t._meta,`${e}._meta`)),al(t.sub_tags,`${e}.sub_tags`),sl(t.parent_tags,`${e}.parent_tags`),{...t,attributes:pp(t.attributes,`${e}.attributes`,n)}}function ol(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function ll(t,e){let r={...e};for(let[n,i]of Object.entries(t))n==="inherits_from"||n.startsWith("_")||r[n]||(r[n]=i);return r._meta={...t._meta||{},...e._meta||{}},r}function ul(t){let e={...t};return e._subSpec=Object.hasOwn(e,"sub_tags")?al(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?sl(e.parent_tags,"resolved.parent_tags"):null,e}function cl(t,e,r,n){if(r.get(t)===1&&k(n,`inheritance cycle at '${t}'`),r.get(t)===2)return e[t];let i=e[t];i||k(n,`unknown abstract '${t}'`),r.set(t,1);let a={...i};for(let s of ol(i.inherits_from))a=ll(cl(s,e,r,n),a);return a=ul(a),r.set(t,2),e[t]=a,a}function va({abstracts:t={},elements:e={}}){let r={...t},n=new Map;for(let a of Object.keys(r))cl(a,r,n,`abstracts.${a}.inherits_from`);let i={};for(let[a,s]of Object.entries(e)){let o={...s};for(let l of ol(s.inherits_from)){let u=r[l];u||k(`elements.${a}.inherits_from`,`unknown abstract '${l}'`),o=ll(u,o)}i[a]=ul(o)}return{abstracts:r,elements:i}}function ka(t){Fe(t,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Fe(t.document_format,["name","version"],["name","version"],"document_format"),(t.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(t.document_format.version))&&k("document_format","expected builder_grammar version 1.1 or 1.2"),Fe(t.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof t.grammar.name!="string"||!t.grammar.name)&&k("grammar.name","must be non-empty string");for(let i of["version","title","description"])t.grammar[i]!==null&&typeof t.grammar[i]!="string"&&k(`grammar.${i}`,"must be string or null");(!Et(t.abstracts)||!Et(t.elements))&&k("grammar document","abstracts/elements must be objects"),Object.hasOwn(t,"custom_types")&&t.document_format.version!=="1.2"&&k("custom_types","requires version 1.2");let e=Kn.fromJSON(t.custom_types??{}),r={};for(let[i,a]of Object.entries(t.abstracts))(!i||i.startsWith("_"))&&k("abstracts",`invalid public name '${i}'`),r[i]=nl(a,`abstracts.${i}`,!1,e);let n={};for(let[i,a]of Object.entries(t.elements))(!i||i.startsWith("_"))&&k("elements",`invalid public name '${i}'`),n[i]=nl(a,`elements.${i}`,!0,e);return{grammar:structuredClone(t.grammar),abstracts:r,elements:n}}function dl(t,e,r,n){let i=e.attributes;if(!i)return;let a={...n};r!=null&&(a.node_value=r);let s=new Set(i.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),o=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))!s.has(u)&&!o.has(u)&&k(t,`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(a,u.name);!c&&!u.has_default&&k(t,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(a[u.name]))&&k(t,`invalid value for ${u.role} '${u.name}'`)}}var Kn=class t{#e=new Map;#t=new Map;register(e,r,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),a=i.has(r)?{kind:"type",module:"builtins",name:i.get(r)}:r;return this.#n(e,{kind:"annotated",base:a,metadata:[n]})}#n(e,r){(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||e in this||["to_dict","from_dict"].includes(e)||hp.has(e))&&k("custom_types",`invalid, reserved or duplicate name '${e}'`),Fe(r,["kind","base","metadata"],["kind","base","metadata"],`custom_types.${e}`),(r.kind!=="annotated"||!Array.isArray(r.metadata)||r.metadata.length!==1||!["regex","range"].includes(r.metadata[0]?.kind))&&k(`custom_types.${e}`,"requires an annotated base with one Regex or Range validator");let n=r.metadata[0].kind==="regex"?["str"]:["int","float"];(r.base?.kind!=="type"||r.base.module!=="builtins"||!n.includes(r.base.name))&&k(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),Dt(r,`custom_types.${e}`);let i=structuredClone(r),a=xt(i,`custom_types.${e}`),s=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:s,enumerable:!0}),this.#e.set(e,i),this.#t.set(e,{...s,inputConstraint:!0,test:a.test}),s}resolve(e,r="custom_types"){return this.#t.has(e)||k(r,`unknown custom type '${e}'`),{...this.#t.get(e)}}validate(e,r){return this.resolve(e).test(r)||k(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){Et(e)||k("custom_types","must be an object");let r=new t;for(let[n,i]of Object.entries(e))r.#n(n,i);return r}},hp=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 fl(t,e,r,n){let i=e?.attributes;if(i)for(let a of i.parameters){if(!a.annotation?.inputConstraint||a.role==="framework"||["var_keyword","var_positional"].includes(a.kind))continue;let s=a.role==="value"?r:n[a.name];s!==void 0&&(a.annotation.test(s)||k(t,`invalid input for '${a.name}' (custom type)`))}}function pl(t,e,r=[]){if(e===null)return structuredClone(t);if(r.length===2&&r[0]==="custom_types"&&t!==void 0){if(!xa(t,e))throw new TypeError(`conflicting custom type '${r[1]}'`);return structuredClone(t)}if(r.length===2&&["abstracts","elements"].includes(r[0]))return structuredClone(e);if(Je(t)&&Je(e)){let n=structuredClone(t);for(let[i,a]of Object.entries(e))a!==null&&Object.defineProperty(n,i,{value:pl(n[i],a,[...r,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function xa(t,e){return Object.is(t,e)?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,n)=>xa(r,e[n])):Je(t)&&Je(e)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>Object.hasOwn(e,r)&&xa(t[r],e[r])):!1}function Je(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function Ea(t){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t)){t.forEach(Ea);return}if(Je(t)){Object.values(t).forEach(Ea);return}throw new TypeError("collection must contain only finite JSON values")}}var Ke=class t{#e;constructor(e){Ea(e);let r=["document_format","grammar","abstracts","elements"];if(!Je(e)||Object.keys(e).some(i=>![...r,"custom_types"].includes(i))||r.some(i=>!Object.hasOwn(e,i)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!Je(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(!Je(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!Je(e.custom_types)))throw new TypeError("custom_types requires an object catalog and version 1.2");this.#e=structuredClone(e)}update(e){let r=new t(e),n=pl(this.#e,r.#e);return(this.#e.document_format.version==="1.2"||r.#e.document_format.version==="1.2")&&(n.document_format.version="1.2"),this.#e=n,this}toDocument(){return structuredClone(this.#e)}};var At=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,r){this.renders.set(e,r)}getRender(e){let r=this.renders.get(e);if(r!==void 0)return r;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,r={}){let n=e.builder,[i,a]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,a,r);let s=this.getRender(n),o;return[o,a]=s._handleMeta(e,a),e._getMeta("subbuilder")||(a=s.adaptAttrs(a)),e.value instanceof W&&(i=this.renderChildren(e.value,r)),s.renderedItem(e,i,a,{tag:o,...r})}renderChildren(e,r={}){let n=[];for(let i of e.getNodes()){let a=this.render(i,r);a!==null&&(Array.isArray(a)?n.push(...a):n.push(a))}return n}_renderComponent(e,r,n){let[i,a,s,o]=this._expansionInputs(e,r);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,s,o,n);if(a==null)return[];if(!(a instanceof se))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${a?.constructor?.name||typeof a}`);return a.getNodes().map(l=>this._expandBlock(e,i,s,{node_label:l.label},n))}_expansionInputs(e,r){let n=e.builder,i=n.componentMethod(e.nodeTag),a=i&&n[i];if(typeof a!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let s=r.iterate;delete r.iterate,delete r.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let l of Object.keys(r)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(r[l]=`^${e.absDatapath(u)}`)}return[a,s,o,r]}_expandBlock(e,r,n,i,a){let s=e.builder._expansionRoot(n);r.call(e.builder,ya(s),i);let o=s.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let l={...a,depthOffset:this._nodeDepth(e,a.depthOffset||0)};return this.render(o[0],l)}preprocess(e){return e}renderedItem(e,r,n,i){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,r){let[n,i]=e._getMeta("render_tag,render_attributes"),a=_a(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!a)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(r={...r,...i}),[a,r]}adaptAttrs(e){return e}adapt(e){let r=`${this.builder.constructor._name}_`;return e.startsWith(r)?e.slice(r.length):e}finalize(e,r=null,n={}){let i=this._composeStringFragments(e);if(r==null)return i;if(typeof r=="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 r.full=="function"&&typeof r.write!="function")return r.full(i),null;if(typeof r.write=="function")return r.write(i),null;if(typeof r=="function")return r(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(r=>typeof r!="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,r=0){let i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+r}};var Ct=class extends At{static mode="xml";renderedItem(e,r,n,{tag:i,pretty:a=!1,depthOffset:s=0}={}){let o=this._formatAttrs(n),l=a?" ".repeat(this._nodeDepth(e,s)):"",u=a?`
|
|
38
|
+
`:"";if(Array.isArray(r)){let c=this._composeStringFragments(r);return`${l}<${i}${o}>${u}${c}${l}</${i}>${u}`}return r==null?`${l}<${i}${o}></${i}>${u}`:`${l}<${i}${o}>${this._escapeText(r)}</${i}>${u}`}finalize(e,r=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,r)}_formatAttrs(e){return Object.entries(e||{}).map(([r,n])=>` ${r.startsWith("xmlns_")?`xmlns:${r.slice(6)}`:r}="${this._escapeAttr(n)}"`).join("")}};var hl={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 ml(t){let e=[];for(;t&&t!==Function.prototype;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function gp(t){let e=Object.create(null),r=(n,i)=>{let a=n.toLowerCase(),s=e[a];if(s!==void 0&&s!==i)throw new Error(`container '${n}' is already tied to implementation method '${s}' (cannot rebind to '${i}')`);e[a]=i};for(let n of ml(t))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])r(i,i);return e}function Vr(t){let e=Object.create(null);for(let r of Object.keys(t)){let n=r.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${r}' has a case-insensitive collision with '${e[n]}'`);e[n]=r}return e}var zr="_root_",Da="_root_",gl=new Set(["destination","func","value","_on_start"]),qe=class t{static _sourceClass=W;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof t))throw new TypeError("registerBuilder requires a BuilderBase subclass");let r=e._name;if(typeof r!="string"||!r)throw new TypeError("registered builders require a non-empty static _name");let n=t._registry.get(r);if(n&&n!==e)throw new Error(`Builder name '${r}' is already registered to ${n.name}; cannot register ${e.name}`);return t._registry.set(r,e),e}static getBuilderClass(e){let r=t._registry.get(e);if(!r)throw new Error(`No builder registered with name '${e}'`);return r}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new se,this._dataroot.setBackref(),this._dataroot.setItem(Da,new se),this.data=this._dataroot.getItem(Da),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 r=this.constructor._sourceClass;this._sourceroot=new r(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(zr,new r(null,this)),this.source=this._sourceroot.getItem(zr)}wrapSource(e){if(e=jr(e),!(e instanceof W)&&!(e instanceof ir))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let r=this._sourceHandles.get(e);return r||(r=rl(this,e),this._sourceHandles.set(e,r)),r}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let r=this._subbuilders.get(e);if(!r){let n=t.getBuilderClass(e);r=new n,this._subbuilders.set(e,r)}return r._dataroot=this._dataroot,r.data=this.data,r}_resolveSubbuilderReference(e,r,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 r=this._classCollection,n=r?new Ke(r.toDocument()).update(e):new Ke(e),i=ka(n.toDocument()),a=va(i),s=Vr(a.elements);this._classCollection=n,this._classSchema=a.elements,this._abstracts=a.abstracts,this._tagNames=s}static{this.defineGrammar(hl)}get _containers(){return gp(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??=Vr(this.schema):this.constructor._tagNames??=Vr(this.schema)}schemaTag(e){let r=e.toLowerCase(),n=this.schemaTagNames[r];if(n)return n;let i=`${this.constructor._name}_`;return r.startsWith(i)&&this.schemaTagNames[r.slice(i.length)]||null}loadGrammar(e,{replace:r=!1}={}){let n=this._collection||this.constructor._classCollection,i=r?new Ke(e):new Ke(n.toDocument()).update(e),a=ka(i.toDocument()),s=va(a),o=Vr(s.elements);return this._collection=i,this._schemaOverride=s.elements,this._tagNamesOverride=o,this}validateCustomTypes(e){let r=e.parentBag?.parentNode?.builder||e.parentBag?._builder,n=r&&r!==this&&r.schema[e.nodeTag]?._meta?.subbuilder?r:this;fl(e.nodeTag,n.schema[e.nodeTag],e.value,e.getAttr()||{})}validateNodeValues(e,r,n={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);return dl(i,this.schema[i],r,n),!0}validateNode(e,{value:r,attrs:n,childTags:i}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let a=r!==void 0?r:e.value instanceof W?null:e.value;this.validateNodeValues(e.nodeTag,a,n||e.getAttr?.()||{});let s=this.schema[this.schemaTag(e.nodeTag)],o=i||(e.value instanceof W?e.value.getNodes().map(l=>l.nodeTag):null);return o&&this._validateChildren(e.nodeTag,s,o,!1),!0}validateChildren(e,r,{includeMinimum:n=!1}={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);if(!Array.isArray(r)||r.some(a=>typeof a!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(i,this.schema[i],r,n)}validateParent(e,r=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 a=i._parentSpec;if(a==null||a.has("*"))return!0;if(r===null)throw new Error(`'${n}' requires a declared parent`);let s=this.schemaTag(r);if(!s)throw new Error(`unknown parent element '${r}'`);return this._validateParent(n,i,s),!0}bagCall(e,r,n,i){return this.setChild(e,r,n,i)}commandOnNode(e,r,n,i){if(e=jr(e),e.value instanceof W)return this.setChild(e.value,r,n,i);let a=e.value,s=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(s,r,n,i,e);return this.promoteNodeValue(e,a,s),o}promoteNodeValue(e,r,n){e.setValue(n)}setChild(e,r,n,i,a=null){let s={...i},o=this.schema[r];if(!o)throw new Error(`unknown element '${r}'`);this.validateNodeValues(r,n,s);let l=o._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,s,r))||this,d=n instanceof W?n._builderBindingPlan(c):null,f=a?.rootBuilder||e.root._builder||this;if(s.nodeId!=null&&f.source.getNodeByAttr("nodeId",s.nodeId))throw new Error(`Duplicate nodeId '${s.nodeId}'`);n instanceof W&&this._validateChildren(r,o,n.getNodes().map(w=>w.nodeTag),!1);let p=a||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(r,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),r],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${r}' requires a declared parent`);o._meta&&!("_meta"in s)&&(s._meta=o._meta),o.ns&&!("ns"in s)&&(s.ns=o.ns);let m=s.node_position;delete s.node_position;let g=s.node_label;delete s.node_label;let _;if(h?.collection_key){if(g!=null)throw new Error(`'${r}': node_label is not allowed in a collection`);_=this._collectionLabel(h.collection_key,r,s)}else{let w=h?._subSpec?.get(r);if(w&&w.max===1){if(g!=null)throw new Error(`'${r}': node_label is not allowed on a singleton`);_=r}else _=g||o.node_label||this._autoLabel(e,r)}if(e.node(_)!=null)throw new Error(`duplicate node label '${_}'`);return e._setBuilderItem(c,d,_,n,s,m||">",!1,!0,null,!1,!0,null,r)}_countsForGrammar(e){let r=e?._meta||{};return!(r.data_element||r.subbuilder||r.component)}_validateParent(e,r,n){let i=r._parentSpec;if(!(i==null||i.has("*")||!this._countsForGrammar(r))&&!i.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,r,n,i){let a=r._subSpec;if(a==null||a.has("*")||r._meta?.subbuilder)return[];let s=new Map;for(let o of n){let l=this.schema[o];if(l&&!this._countsForGrammar(l))continue;let u=a.get(o);if(!u)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(s.get(o)||0)+1;if(s.set(o,c),c>u.max)throw new Error(`too many '${o}' in '${e}'`)}return i?[...a].filter(([o,l])=>(s.get(o)||0)<l.min).map(([o])=>o):[]}_collectionLabel(e,r,n){let i=a=>{if(n[a]===null||n[a]===void 0)throw new Error(`'${r}': collection key needs attribute '${a}'`);return String(n[a])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(a,s)=>i(s)):i(e)}validateSource(){let e=[],r=(n,i="")=>{for(let a of n.getNodes()){let s=i?`${i}.${a.label}`:a.label,o=a.builder;o.validateCustomTypes(a);let l=o.schema[a.nodeTag];if(l&&!a._getMeta("data_element,subbuilder,component").some(Boolean)){let u=a.value instanceof W?a.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(a.nodeTag,l,u,!0);c.length&&e.push([s,c])}a.value instanceof W&&r(a.value,s)}};return r(this.source),e}_autoLabel(e,r){let n=0;for(;e.node(`${r}_${n}`)!==null&&e.node(`${r}_${n}`)!==void 0;)n+=1;return`${r}_${n}`}nodeById(e){let r=this.source.getNodeByAttr("nodeId",e);if(r==null)throw new Error(`nodeId not found: ${e}`);return r.builder.wrapSource(r)}runtimeValues(e){e.builder.validateCustomTypes(e);let r=new Map,n={},i=e.runtimeToEvaluate(),a=new Set(i.keys()),s=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,d]of[...i])if(!(typeof c!="string"||!et(d)))for(let f of wi(e,d))i.has(f)||i.set(f,s.get(f));let o=e._getMeta("data_element");for(let[c,d]of i){if(d instanceof ne){r.set(c,d.resolve());continue}let f=typeof c=="string"?et(d)?.pointer??d:d;if(!e.pointerType(f)){r.set(c,typeof c=="string"&&typeof d=="string"&&d.startsWith("==")?null:d);continue}let p=e.absDatapath(f);if(r.set(c,this.data.getItem(p)),!o&&!p.includes("?")&&c===ar){let h=this.data.getNode(p);h&&Object.assign(n,h.getAttr("_wdg"))}}let l=Ha(i,r,(c,d,f,p)=>this.evaluatePointerExpression(e,c,d,f,p)),u=l.get(ar);l.delete(ar);for(let c of l.keys())a.has(c)||l.delete(c);return[u,{...Object.fromEntries(l),...n}]}evaluatePointerExpression(e,r,n,i,a){return null}targetId(e){if(e._targetId)return e._targetId;let r=e.rootBuilder;return e.parentBag.root!==r.source.root?null:(r._targetSerial+=1,e._targetId=`n${r._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 r of this.dataLogic){let i=(typeof r=="function"?r:r.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[,r]=this.runtimeValues(e),n={};for(let[i,a]of Object.entries(r))gl.has(i)||(n[i]=a);return n}computeLogic(e){for(let r of e)this._computeNode(r)}_computeNode(e){let r=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[i,a]of Object.entries(r))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=a);e.setRelativeData(r.destination,r.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(r.func);e.setRelativeData(r.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(r.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],r=n=>{for(let i of n.getNodes())i._getMeta("data_element")&&e.push(i),i.value instanceof W&&r(i.value)};return r(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of ml(this.constructor))if(Object.hasOwn(o,"components"))for(let l of o.components||[])e[l]=l;if(!Object.keys(e).length)return;let r={...this.schema},n={};for(let[o,l]of Object.entries(e))r[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=l;let i=Vr(r),a=this._collection||this.constructor._classCollection,s=a.toDocument();s.abstracts={},s.elements=Object.fromEntries(Object.keys(e).map(o=>[o,r[o]])),this._collection=new Ke(a.toDocument()).update(s),this._schemaOverride=r,this._componentMap=n,this._tagNamesOverride=i}_expansionRoot(e=null){let r=this.constructor._sourceClass,n=new r(null,this);return n.setBackref(),n.setItem(zr,new r(null,this),e?{datapath:e}:null),n.getItem(zr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new Ct(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let r=this[`renderer_${e}`];if(!r)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return r}materialize(e=null,r={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),i=n.renderChildren(n.preprocess(this.source),r);return this.materialized[e]=i,i}setRenderTarget(e,r=null){r??=this.constructor._defaultRenderMode,this._defaultTargets.set(r,e)}render({mode:e=null,target:r=null,...n}={}){e??=this.constructor._defaultRenderMode;let i=this.getRenderer(e);if(r===!1&&i.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let a=r===!1?null:r||this._defaultTargets.get(i.mode)||null,s={...a?.renderOpts,...n};return i.finalize(this.materialize(e,s),a,s)}};qe._registry=new Map;var bp=new Set(["short","medium","long","full"]),_p=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function wp(t,e){if(!(t instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(t.getTime()))throw new RangeError("Invalid date");let r=e||ve(t).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(r))throw new RangeError(`Unsupported temporal dtype: ${r}`);return r}function yp(t,e,r,n){let i=e.match(_p)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let a=(c,d=2)=>String(c).padStart(d,"0"),s=c=>new Intl.DateTimeFormat(r,{timeZone:"UTC",...c}).format(t),u={...n==="H"?{}:{y:()=>String(t.getUTCFullYear()),yy:()=>a(t.getUTCFullYear()%100),yyyy:()=>a(t.getUTCFullYear(),4),M:()=>String(t.getUTCMonth()+1),MM:()=>a(t.getUTCMonth()+1),MMM:()=>s({month:"short"}),MMMM:()=>s({month:"long"}),d:()=>String(t.getUTCDate()),dd:()=>a(t.getUTCDate()),EEE:()=>s({weekday:"short"}),EEEE:()=>s({weekday:"long"})},...n==="D"?{}:{H:()=>String(t.getUTCHours()),HH:()=>a(t.getUTCHours()),h:()=>String(t.getUTCHours()%12||12),hh:()=>a(t.getUTCHours()%12||12),m:()=>String(t.getUTCMinutes()),mm:()=>a(t.getUTCMinutes()),s:()=>String(t.getUTCSeconds()),ss:()=>a(t.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(r,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(t).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 bl(t,{format:e,mask:r,locale:n,dtype:i,places:a}={}){let s=t==null?"":String(t);if(t!=null&&t!==""&&(e!=null&&e!==""||a!=null))if(typeof t=="number"||Ce(t))s=kp(t,{format:e,locale:n,places:a});else{let o=wp(t,i);if(bp.has(e)){let l={timeZone:"UTC"};o!=="H"&&(l.dateStyle=e),o!=="D"&&(l.timeStyle=e),s=new Intl.DateTimeFormat(n||void 0,l).format(t)}else s=yp(t,String(e),n||void 0,o)}return r==null?s:String(r).replaceAll("%s",()=>s)}function vp({format:t="decimal",places:e}={}){let r={maximumFractionDigits:20};if(!t||t==="decimal")r.style="decimal";else if(t==="percent")r.style="percent";else if(t==="scientific")r.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(t);if(!n||t.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${t}`);r.useGrouping=n[1].includes(","),r.minimumFractionDigits=(n[2]||"").length,r.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");r.minimumFractionDigits=n,r.maximumFractionDigits=n}return r}function kp(t,e={}){if(typeof t!="number"&&!Ce(t))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(t)))throw new RangeError("Number must be finite");let r=new Intl.NumberFormat(e.locale||void 0,vp(e));if(Ce(t)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return r.format(Ce(t)?t.toString():t)}var xp=new Set(["style","script"]),Ep=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"]),_l=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"]),Hr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),wl=t=>t===!0?"true":t===!1?"false":String(t),Qn=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:String(t);function Dp(t){if(_l.has(t))return!0;for(let e of _l)if(t.startsWith(`${e}_`))return!0;return!1}function Ap(t){let e=new Map;if(!t)return e;let r=[],n=0,i=null,a=!1,s=!1,o=0,l=String(t);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(s){c==="*"&&d==="/"&&(s=!1,u+=1);continue}if(a){a=!1;continue}if(c==="\\"){a=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&d==="*"?(s=!0,u+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(r.push(l.slice(n,u)),n=u+1)}r.push(l.slice(n));for(let u of r){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 Wr=class extends At{static mode="html";renderedItem(e,r,n,{tag:i,xml:a=!0,pretty:s=!1,depthOffset:o=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:p,dtype:h,...m}=n;!Array.isArray(r)&&(c!=null||d!=null||p!=null)&&(r=bl(r,{format:c,mask:d,places:p,dtype:h,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,B]of Object.entries(e.getAttr()))e.pointerType(B)&&(g+=` data-${this.adapt(E)}-pointer="${this._htmlAttrValue(e.absDatapath(B))}"`)}let _=s?" ".repeat(this._nodeDepth(e,o)):"",v=s?`
|
|
39
|
+
`:"";if(e._getMeta("void"))return`${_}<${i}${g}${a?"/":""}>${v}`;if(Array.isArray(r)){let E=this._composeStringFragments(r);return`${_}<${i}${g}>${v}${E}${_}</${i}>${v}`}if(r==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof r=="string"&&r.endsWith("::HTML")?r.slice(0,-6):xp.has(i)?String(r):this._escapeText(r);return`${_}<${i}${g}>${w}</${i}>${v}`}_displayLocale(e,r){if(r)return r;for(let n=e.parentNode;n;n=n.parentNode){let i=n.getAttr("locale");if(i==null)continue;let a=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(a)return a}}adaptAttrs(e){let r={},n={};for(let[a,s]of Object.entries(e||{}))if(a.startsWith(`${this.builder.constructor._name}_`))r[this.adapt(a)]=s;else if(a==="dtype")r.dtype=s;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>a.startsWith(o)))continue;this._isStyleContribution(a)?n[a]=s:r[a]=s}let i=this._adaptStyle(n);return i&&(r.style=i),r}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Hr.has(e))return!0;let r=e.includes("_")?e.slice(0,e.indexOf("_")):null;return r!==null&&Hr.has(r)||Dp(e)}_adaptStyle(e){let r=Ap(e.style),n=new Map,i=new Map;for(let[a,s]of Object.entries(e))if(a!=="style")if(a.startsWith("style_"))r.set(a.slice(6).replaceAll("_","-"),wl(s));else if(Hr.has(a))n.set(a,s);else{let o=a.indexOf("_"),l=o<0?a:a.slice(0,o);o>=0&&Hr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[a.slice(o+1)]=s):r.set(a.replaceAll("_","-"),wl(s))}for(let a of Hr)(n.has(a)||i.has(a))&&this[`_macro_${a}`](n.get(a),i.get(a)||{},r);return[...r].map(([a,s])=>`${a}: ${s}`).join("; ")}_formatAttrs(e){let r=[];for(let[n,i]of Object.entries(e||{}))Ep.has(n)?i&&r.push(` ${n}`):r.push(` ${n}="${this._htmlAttrValue(i)}"`);return r.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,r,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[a,s]of Object.entries(r))if(a==="top"||a==="bottom")i[`${a}_left`]=s,i[`${a}_right`]=s;else if(a==="left"||a==="right")i[`top_${a}`]=s,i[`bottom_${a}`]=s;else if(["top_left","top_right","bottom_left","bottom_right"].includes(a))i[a]=s;else throw new TypeError(`rounded: unknown sub-kwarg '${a}'`);for(let[a,s]of Object.entries(i))n.set(`border-${a.replaceAll("_","-")}-radius`,Qn(s))}_macro_transform(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`rotate(${s}deg)`):a==="scale"||a==="translate"?i.push(`${a}(${s})`):a==="translate_x"?i.push(`translateX(${Qn(s)})`):a==="translate_y"?i.push(`translateY(${Qn(s)})`):a==="skew_x"?i.push(`skewX(${s}deg)`):a==="skew_y"?i.push(`skewY(${s}deg)`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`hue-rotate(${s}deg)`):a==="blur"?i.push(`blur(${Qn(s)})`):a==="drop_shadow"?i.push(`drop-shadow(${s})`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,r,n){e!==void 0&&n.set("transition",String(e));for(let[i,a]of Object.entries(r))n.set(`transition-${i.replaceAll("_","-")}`,String(a))}_macro_zoom(e,r,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,r,n){e!==void 0&&n.set("box-shadow",String(e));for(let[i,a]of Object.entries(r))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(a))}_macro_gradient(e,r,n){e!==void 0&&n.set("background-image",String(e))}};var Cp=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 yl(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[Cp.has(e)?e.replaceAll("_","-"):e,r]))}var Gr=class extends Ct{static mode="svg";adaptAttrs(e){return yl(e)}};var vl={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 ei=class extends qe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(vl)}get renderer_html(){return new Wr(this)}};qe.registerBuilder(ei);var kl={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 ti=class extends qe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(kl)}get renderer_svg(){return new Gr(this)}};qe.registerBuilder(ti);var sr="http://www.w3.org/2000/svg";var xl=`
|
|
25
40
|
:host{display:inline-block;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
26
41
|
.control-box{display:flex;align-items:center;gap:.35rem}
|
|
27
42
|
button{font:inherit;color:inherit;cursor:pointer;border:0;background:transparent;border-radius:var(--gramlot-radius-sm,4px)}
|
|
@@ -45,7 +60,7 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
|
|
|
45
60
|
.previous,.notice{color:var(--gramlot-text-secondary,GrayText)}
|
|
46
61
|
.arrow{padding:0 .5rem}
|
|
47
62
|
.notice{font-size:.9em;margin:.5rem .35rem .15rem}
|
|
48
|
-
`;var
|
|
63
|
+
`;var El=(0,P.defineComponent)({name:"editingStatus",tag:"gramlot-editing-status",base:bi,sourceContext:!0,parameters:{},implementation:t=>class extends t{#e;#t;#n=new Map;#r;#a;#i;#s;#o;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=xl,this.shadowRoot.append(r),this.control.replaceChildren(),this.control.setAttribute("role","group"),this.control.setAttribute("aria-label","Editing reports");for(let[a,s,o]of[["errors","Errors","M12 3L22 21H2ZM12 9V14M12 17V17.1"],["changes","Changes","M4 5H14M4 10H10M4 15H8M13 20L20 13L17 10L10 17L9 21Z"]]){let l=e.createElement("button");l.type="button",l.dataset.kind=a,l.setAttribute("aria-haspopup","dialog"),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-controls","editing-report");let u=e.createElementNS(sr,"svg");u.setAttribute("viewBox","0 0 24 24"),u.setAttribute("aria-hidden","true");let c=e.createElementNS(sr,"path");c.setAttribute("d",o),u.append(c);let d=e.createElement("span");d.textContent=s;let f=e.createElement("span");f.className="count",f.textContent="0",l.append(u,d,f),this.control.append(l),this.#n.set(a,{button:l,count:f}),l.addEventListener("click",()=>{let p=this.#r.matches(":popover-open");if(p&&this.#o===a){this.#r.hidePopover();return}this.#o=a,this.#d(),p||this.#r.showPopover(),this.#f(),Te(this.#r,l,{align:"end"})})}this.#r=e.createElement("section"),this.#r.id="editing-report",this.#r.className="report",this.#r.setAttribute("popover","auto"),this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-labelledby","report-title");let n=e.createElement("header");this.#a=e.createElement("strong"),this.#a.id="report-title";let i=e.createElement("button");i.type="button",i.textContent="\xD7",i.setAttribute("aria-label","Close report"),i.addEventListener("click",()=>this.#r.hidePopover()),n.append(this.#a,i),this.#i=e.createElement("ul"),this.#s=e.createElement("p"),this.#s.className="notice",this.#s.setAttribute("role","status"),this.#r.append(n,this.#i,this.#s),this.shadowRoot.append(this.#r),this.#r.addEventListener("toggle",()=>this.#f())}setSourceContext(e){if(this.#t?.(),this.#t=null,this.#e=e.sourceNode.formState,!this.#e)throw new Error("editingStatus requires a shared editing session.");this.#u()}connectedCallback(){this.#u()}disconnectedCallback(){this.#t?.(),this.#t=null,this.#r.matches(":popover-open")&&this.#r.hidePopover()}#u(){!this.#e||this.#t||!this.isConnected||(this.#t=this.#e.subscribe(()=>this.#c()),this.#c())}#f(){let e=this.#r.matches(":popover-open");for(let[r,{button:n}]of this.#n)n.setAttribute("aria-expanded",String(e&&r===this.#o))}#c(){this.#n.get("errors").count.textContent=String(this.#e.errorEntries.length),this.#n.get("changes").count.textContent=String(this.#e.changeEntries.length),this.#n.get("errors").button.classList.toggle("invalid",this.#e.errorEntries.length>0),this.#r.matches(":popover-open")&&this.#d()}#l(e,r){return r?e==null?"\u2205":e instanceof Sp?`${e.length} fields`:e instanceof Date?e.toLocaleString():String(e):"Not present"}#d(){let e=this.#o==="errors",r=e?this.#e.errorEntries:this.#e.changeEntries;this.#a.textContent=e?"Validation errors":"Unsaved changes",this.#s.textContent=r.length?"Select an entry to return to its field.":e?"No validation errors.":"No changes since the accepted snapshot.";let n=this.shadowRoot.activeElement?.dataset.path;this.#i.replaceChildren();for(let i of r){let a=this.ownerDocument,s=a.createElement("li"),o=a.createElement("button");o.type="button",o.dataset.path=i.path;let l=a.createElement("span");l.className="field",l.textContent=i.path.slice(this.#e.path?this.#e.path.length+1:0);let u=a.createElement("span");if(u.className="detail",e)u.textContent=i.message;else{let c=a.createElement("span");c.className="previous",c.textContent=this.#l(i.previous,i.existed);let d=a.createElement("span");d.className="arrow",d.textContent="\u2192";let f=a.createElement("span");f.className="current",f.textContent=this.#l(i.current,i.exists),u.append(c,d,f)}o.append(l,u),s.append(o),this.#i.append(s),o.addEventListener("click",()=>{this.#e.focusField(i.path)?this.#r.hidePopover():this.#s.textContent="This field is not visible. Check the grid filter or whether the row still exists."}),i.path===n&&o.focus({preventScroll:!0})}}}});function ri(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{display:inline-block;font:inherit} *,*::before,*::after{box-sizing:border-box}
|
|
49
64
|
input,textarea{font:inherit;max-width:100%} .control-box{min-width:0;color:var(--gramlot-ink,CanvasText)}
|
|
50
65
|
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea{
|
|
51
66
|
appearance:none;box-sizing:border-box;width:100%;border:1px solid var(--gramlot-border-control,#7a8798);
|
|
@@ -61,7 +76,7 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
|
|
|
61
76
|
input[type=range],input[type=color],button{min-width:var(--gramlot-touch-target,0px);min-height:var(--gramlot-touch-target,0px)}
|
|
62
77
|
input[type=checkbox],input[type=radio]{min-width:calc(var(--gramlot-touch-target,0px) / 2);min-height:calc(var(--gramlot-touch-target,0px) / 2)}
|
|
63
78
|
.options{display:grid;gap:.3em .8em} .option{display:flex;align-items:center;gap:.35em;min-width:var(--gramlot-touch-target,0px);min-height:var(--gramlot-touch-target,0px)}
|
|
64
|
-
.caption:empty{display:none}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",e.append(r,this.controlBox)}projectAttributes(e){return an(this,e)}setPageContext(e){this.pageContext=e}connectedCallback(){}releaseControl(){}get liveWrites(){return this.control.localName==="textarea"||["text","password","range","color"].includes(this.control.type)}validateCandidate(e,r){return r(e),{ok:!0,value:e,isCurrent:()=>this.pageContext.isActive()}}finishValidation(){}validationValueCheck(){let e=this.constructor.gramlotComponent.parameters.value.nullable;return(r,n)=>{if(r==null&&!e)throw new TypeError("This component requires a non-null value.");if(r!=null&&n!=null&&typeof r!=typeof n)throw new TypeError("Validation must preserve the component value type.")}}validationSelection(){return()=>{throw new TypeError("validate_select requires a constrained choice editor.")}}validateSelection(e){return this.validationSelection()(e)}shouldProjectControlValue(){return!0}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>{this.validationValueCheck()(r,e),this.sameControlValue(e,r)||this.writeControlValue(r)})}restoreFormDraft(e){this.control.value=e}restoreFormValue(e){this.writeControlValue(e)}sameControlValue(e,r){return Object.is(e,r)}focus(e){this.control.focus(e)}}}function pe(t){return class extends Qn(t){constructor(){super(),this.control=this.createControl(),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.setAttribute("autocomplete","off"),this.control.setAttribute("autocorrect","off"),this.control.setAttribute("autocapitalize","off"),this.control.setAttribute("spellcheck","false")),this.control.id="control";let e=this.ownerDocument.createElement("label");e.className="option",this.optionCaption=this.ownerDocument.createElement("span"),this.optionCaption.className="caption",e.append(this.control,this.optionCaption),this.controlBox.append(e)}projectAttributes(e,r){let n=super.projectAttributes(e,r),{disabled:i,readonly:a}=this.parameters;this.control.disabled=!!i,this.control.readOnly=!!a;for(let[s,o]of Object.entries(this.constructor.gramlotComponent.parameters)){if(o.target==="control"){let l=this.parameters[s]??"";String(this.control[s])!==String(l)&&(this.control[s]=l)}o.target==="optionCaption"&&(this.optionCaption.textContent=this.parameters[s]??"")}return n}}}pe.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},live:{dtype:"B",default:!1,binding:"read"}};function ei(t){return class extends Qn(t){#e=new Map;#t;#n=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.className="options",this.control.id="control",this.control.setAttribute("role",this.multiple?"group":"radiogroup"),this.controlBox.append(this.control),this.control.addEventListener("keydown",e=>{if(!this.multiple||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;let r=[...this.control.querySelectorAll("input:not(:disabled)")],n=r.indexOf(e.target);if(n<0)return;e.preventDefault();let i=e.key==="Home"?0:e.key==="End"?r.length-1:Math.max(0,Math.min(r.length-1,n+(["ArrowDown","ArrowRight"].includes(e.key)?1:-1)));r[i].focus()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.values??"";if(i!==this.#t){let s=Kn(i),o=new Set,l=null;for(let{id:u,caption:c}of s){let d=this.#e.get(u);if(!d){let p=this.ownerDocument.createElement("label");p.className="option";let h=this.ownerDocument.createElement("input");h.type=this.choiceType,h.name="choice",h.value=u;let m=this.ownerDocument.createElement("span");p.append(h,m),d={label:p,input:h,text:m},this.#e.set(u,d)}d.text.textContent=c;let f=l?l.nextSibling:this.control.firstChild;f!==d.label&&this.control.insertBefore(d.label,f),l=d.label,o.add(u)}for(let[u,c]of this.#e)o.has(u)||(c.label.remove(),this.#e.delete(u));this.#t=i}let a=this.parameters.cols;if(!Number.isInteger(a)||a<1)throw new TypeError("cols must be a positive integer");this.control.style.gridTemplateColumns=`repeat(${a}, minmax(0, 1fr))`,this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly;for(let{input:s}of this.#e.values())s.disabled=this.control.disabled||this.control.readOnly;return n}readControlValue(){if(this.multiple){let r=(this.#n?this.#n.split(","):[]).filter(n=>!this.#e.has(n)||this.#e.get(n).input.checked);for(let[n,{input:i}]of this.#e)i.checked&&!r.includes(n)&&r.push(n);return r.join(",")||null}for(let[e,{input:r}]of this.#e)if(r.checked)return e;return null}writeControlValue(e){this.#n=e;let r=this.multiple?new Set(e?e.split(","):[]):null;for(let[n,{input:i}]of this.#e)i.checked=this.multiple?r.has(n):n===e}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>this.writeControlValue(r))}focus(e){let r=[...this.#e.values()];(r.find(({input:n})=>n.checked&&!n.disabled)??r.find(({input:n})=>!n.disabled))?.input.focus(e)}}}ei.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"}};var gl=["TL","TC","TR","L","R","BL","BC","BR"];function G(t){return class extends t{setLabelbox(e){let{box:r,labelBox:n,fieldLabel:i}=e;Object.assign(this,{box:r,labelBox:n,fieldLabel:i}),i.addEventListener("click",()=>{this.control.focus(),this.control.localName==="input"&&["checkbox","radio"].includes(this.control.type)&&this.control.click()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.lbl??"";return i?this.control.setAttribute("aria-label",i):this.control.removeAttribute("aria-label"),n}}}G.labelbox=!0;G.parameters={lbl:{dtype:"T",qualification:"intl_str",nullable:!0,binding:"read"},lbl_position:{dtype:"T",default:"TL",binding:"read",enum:gl}};function Tt(t,e){return e===2?t%4===0&&(t%100!==0||t%400===0)?29:28:[4,6,9,11].includes(e)?30:31}function ke(t,e,r){if(![t,e,r].every(Number.isInteger)||t<1||t>9999||e<1||e>12||r<1||r>Tt(t,e))throw new RangeError("Date must exist in Gregorian years 0001\u20139999.");return`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function Ct(t){if(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new RangeError("Expected a civil date in YYYY-MM-DD format.");let e=t.split("-").map(Number);return ke(...e),e}function Wr(t,e,r){let n=t-1,i=365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+r-1;for(let a=1;a<e;a++)i+=Tt(t,a);return i}function Gr(t,e){let r=Wr(...Ct(t))+e;if(!Number.isSafeInteger(r)||r<0||r>Wr(9999,12,31))throw new RangeError("Date offset exceeds Gregorian years 0001\u20139999.");let n=1,i=1e4;for(;i-n>1;){let s=Math.floor((n+i)/2);Wr(s,1,1)<=r?n=s:i=s}r-=Wr(n,1,1);let a=1;for(;r>=Tt(n,a);)r-=Tt(n,a++);return ke(n,a,r+1)}function ya(t){return Gr(t,-(Wr(...Ct(t))%7))}function bl(t,e,r=0,n=1){let i=t*12+e-1+r,a=Math.floor(i/12),s=(i%12+12)%12+1,o=i+n-1,l=Math.floor(o/12),u=(o%12+12)%12+1;return{start:ke(a,s,1),end:ke(l,u,Tt(l,u))}}var ti={en:{months:{january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},weekdays:{monday:0,tuesday:1,wednesday:2,thursday:3,friday:4,saturday:5,sunday:6,mon:0,tue:1,wed:2,thu:3,fri:4,sat:5,sun:6},quarters:{"1st quarter":1,"2nd quarter":2,"3rd quarter":3,"4th quarter":4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["today"],yesterday:["yesterday"],tomorrow:["tomorrow"],this_week:["this week","week"],last_week:["last week"],next_week:["next week"],this_month:["this month","month"],last_month:["last month"],next_month:["next month"],last:["last"],next:["next"],articles:["the"],from:["from","between"],to:["to","and"],no_period:["no period","always"]},date_order:{default:"MDY",GB:"DMY",AU:"DMY",IE:"DMY",NZ:"DMY",IN:"DMY"}},it:{months:{gennaio:1,febbraio:2,marzo:3,aprile:4,maggio:5,giugno:6,luglio:7,agosto:8,settembre:9,ottobre:10,novembre:11,dicembre:12,gen:1,feb:2,mar:3,apr:4,mag:5,giu:6,lug:7,ago:8,set:9,ott:10,nov:11,dic:12},weekdays:{luned\u00EC:0,marted\u00EC:1,mercoled\u00EC:2,gioved\u00EC:3,venerd\u00EC:4,sabato:5,domenica:6,lun:0,mar:1,mer:2,gio:3,ven:4,sab:5,dom:6},quarters:{"1\xBA trimestre":1,"2\xBA trimestre":2,"3\xBA trimestre":3,"4\xBA trimestre":4,"1\xB0 trimestre":1,"2\xB0 trimestre":2,"3\xB0 trimestre":3,"4\xB0 trimestre":4,t1:1,t2:2,t3:3,t4:4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["oggi"],yesterday:["ieri"],tomorrow:["domani"],this_week:["questa settimana","settimana"],last_week:["settimana scorsa"],next_week:["settimana prossima"],this_month:["questo mese","mese"],last_month:["mese scorso"],next_month:["mese prossimo"],last:["scorso","scorsa"],next:["prossimo","prossima"],articles:["il","lo","la"],from:["da","dal","dalla","tra","fra"],to:["a","al","alla","e"],no_period:["-","senza periodo","sempre"]},date_order:{default:"DMY"}}};function _l(t){if(typeof t!="string")throw new RangeError("A supported locale is required.");let e=t.replaceAll("-","_"),r=e.indexOf("_"),n=(r<0?e:e.slice(0,r)).toLowerCase(),i=(r<0?"":e.slice(r+1)).toUpperCase();if(!Object.hasOwn(ti,n))throw new RangeError(`Unsupported locale: ${t}`);let a=ti[n];return{dictionary:a,phrases:o=>[...new Set([...a.keywords[o],...ti.en.keywords[o]])],order:a.date_order[i]??a.date_order.default}}var Nt=/^(?:\d{4}|\d{2})$/,wl=/^\d{1,2}$/,Yr=(t,e)=>({ok:!1,error:{code:t,message:e}}),Ot=(t="UNRECOGNIZED_EXPRESSION",e="Text is not a supported date expression.")=>{throw Object.assign(new SyntaxError(e),{code:t})},kl=(t,e)=>Object.hasOwn(t,e);function St(t,e){if(t.length===4)return Number(t);let r=e.year+e.twoDigitYearAhead-100;return r+((Number(t)-r)%100+100)%100}function vp(t,e){if(t.includes(";")){let i=t.split(";").map(a=>a.trim());return i.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:i,range:!0}}if(e.phrases("no_period").includes(t))return{bounds:["",""],range:!0};let r=e.phrases("to"),n=e.phrases("from");for(let i of r)if(t.startsWith(`${i} `))return{bounds:["",t.slice(i.length+1).trim()],range:!0};for(let i of r){let a=` ${i} `;if(!t.includes(a))continue;for(let o of n)if(t.startsWith(`${o} `)){t=t.slice(o.length+1);break}let s=t.split(a).map(o=>o.trim());return s.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:s,range:!0}}for(let i of n)if(t.startsWith(`${i} `))return{bounds:[t.slice(i.length+1).trim(),""],range:!0};return{bounds:[t,t],range:!1}}function kp(t,e,r){let n=[[t,0]],i=/^(.+?)\s*([+-])\s*(\d+)$/.exec(t);i&&n.push([i[1],Number(i[2]+i[3])]);let a={today:0,yesterday:-1,tomorrow:1,this_week:0,last_week:-1,next_week:1,this_month:0,last_month:-1,next_month:1};for(let[s,o]of n)for(let[l,u]of Object.entries(a))if(e.phrases(l).includes(s)){if(l.endsWith("_week"))return Gr(ya(e.workdate),(u+o)*7+(r?6:0));if(l.endsWith("_month")){let c=bl(e.year,e.month,u+o);return r?c.end:c.start}return Gr(e.workdate,u+o)}return null}function Ep(t,e,r){let n=Object.entries(e.dictionary.quarters).sort((i,a)=>a[0].length-i[0].length);for(let[i,a]of n){let s;if(t===i)s=null;else if(t.startsWith(i)&&Nt.test(t.slice(i.length).trim()))s=St(t.slice(i.length).trim(),e);else if(t.endsWith(i)&&Nt.test(t.slice(0,-i.length).trim()))s=St(t.slice(0,-i.length).trim(),e);else continue;return{year:s,month:r?a*3:a*3-2}}return null}function yl(t,e){if(kl(e.months,t))return e.months[t];let r=/^m(\d{1,2})$/.exec(t);return r&&Number(r[1])>=1&&Number(r[1])<=12?Number(r[1]):null}function xp(t,e){let r=t.split(/\s+/),n=r.map((u,c)=>yl(u,e.dictionary)?c:-1).filter(u=>u>=0);if(!n.length)return null;if(n.length!==1)return Ot();let i=n[0],a=yl(r[i],e.dictionary),s=r.slice(0,i),o=r.slice(i+1),l=[...s,...o];if(l.length===1&&e.phrases("last").includes(l[0]))return{year:e.year-(a>e.month?1:0),month:a};if(l.length===1&&e.phrases("next").includes(l[0]))return{year:e.year+(a<e.month?1:0),month:a};if(!l.length)return{year:null,month:a};if(!s.length&&o.length===1&&Nt.test(o[0]))return{year:St(o[0],e),month:a};if(s.length===1&&wl.test(s[0])){if(!o.length)return ke(e.year,a,Number(s[0]));if(o.length===1&&Nt.test(o[0]))return ke(St(o[0],e),a,Number(s[0]))}return!s.length&&o.length===2&&wl.test(o[0])&&Nt.test(o[1])?ke(St(o[1],e),a,Number(o[0])):Ot()}function Dp(t,e){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(r)return ke(...r.slice(1).map(Number));let n=/^(\d{1,4})[/\-. ]+(\d{1,4})[/\-. ]+(\d{1,4})$/.exec(t),i={};if(n)e.order.split("").forEach((o,l)=>{i[o]=n[l+1]});else if(/^(?:\d{6}|\d{8})$/.test(t)){let o=t.length===8?4:2;for(let l of e.order){let u=l==="Y"?o:2;i[l]=t.slice(0,u),t=t.slice(u)}}else return null;if(!Nt.test(i.Y)||i.D.length>2||i.M.length>2)return Ot();let a=Number(i.D),s=Number(i.M);return n&&s>12&&a<=12&&([a,s]=[s,a]),ke(St(i.Y,e),s,a)}function vl(t,e,r){if(!t)return null;let n=e.phrases("articles");if(t=t.split(/\s+/).filter(a=>!n.includes(a)).join(" "),!t)return Ot();if(Nt.test(t))return ke(St(t,e),r?12:1,r?31:1);let i=kp(t,e,r)??Ep(t,e,r)??xp(t,e);return i!==null?i:kl(e.dictionary.weekdays,t)?Gr(ya(e.workdate),e.dictionary.weekdays[t]):Dp(t,e)??Ot()}function Ap(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year,i=typeof e=="string"?Ct(e)[0]:e?.year,a=typeof e=="string"?Ct(e)[1]:e?.month;return i&&(n>i&&(n=i),n===i&&t.month>a&&n--),ke(n,t.month,1)}function Tp(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year;if(e!==null){let[i,a]=Ct(e);n<i&&(n=i),n===i&&a>t.month&&n++}return ke(n,t.month,Tt(n,t.month))}function va(t,e={}){if(!e||typeof e!="object"||Array.isArray(e))return Yr("INVALID_CONTEXT","Options must provide a civil workdate and supported locale.");let r;try{let{locale:n="it-IT",workdate:i,twoDigitYearAhead:a=20}=e,[s,o]=Ct(i);if(!Number.isInteger(a)||a<0||a>99)throw new RangeError("twoDigitYearAhead must be an integer from 0 to 99.");r={..._l(n),workdate:i,year:s,month:o,twoDigitYearAhead:a}}catch(n){return Yr("INVALID_CONTEXT",n.message)}if(typeof t!="string")return Yr("INVALID_INPUT","Expression must be a string.");try{let n=t.toLowerCase().trim().replaceAll(",",""),{bounds:i,range:a}=vp(n,r),s=vl(i[1],r,!0),o=vl(i[0],r,!1),l=Ap(o,s,r),u=Tp(s,l,r);return!a&&typeof o=="string"&&l===u?{ok:!0,kind:"date",date:l}:{ok:!0,kind:"period",start:l,end:u}}catch(n){if(n instanceof RangeError)return Yr("INVALID_DATE",n.message);if(n instanceof SyntaxError)return Yr(n.code,n.message);throw n}}function qe(t,e,r){let n=new Date(0);return n.setUTCFullYear(t,e,r),n}function Zr(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCHours()||t.getUTCMinutes()||t.getUTCSeconds()||t.getUTCMilliseconds()))throw new TypeError("Expected a civil Date at UTC midnight")}var ri=(t,e)=>t===e||t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime(),Cp=t=>t.toISOString().slice(0,10),Xr=class{constructor(e,r){this.container=e,this.select=r,this.value=null;let n=e.ownerDocument,i=n.createElement("style");i.textContent=`.calendar{width:var(--gramlot-calendar-width,18em);max-width:100%;font:inherit;color:inherit}
|
|
79
|
+
.caption:empty{display:none}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",e.append(r,this.controlBox)}projectAttributes(e){return un(this,e)}setPageContext(e){this.pageContext=e}connectedCallback(){}releaseControl(){}get liveWrites(){return this.control.localName==="textarea"||["text","password","range","color"].includes(this.control.type)}validateCandidate(e,r){return r(e),{ok:!0,value:e,isCurrent:()=>this.pageContext.isActive()}}finishValidation(){}validationValueCheck(){return this.constructor.validationValueCheck(this.pageContext)}static validationValueCheck(){let e=this.gramlotComponent.parameters.value.nullable;return(r,n)=>{if(r==null&&!e)throw new TypeError("This component requires a non-null value.");if(r!=null&&n!=null&&typeof r!=typeof n)throw new TypeError("Validation must preserve the component value type.")}}validationSelection(){return this.constructor.validationSelection(this.parameters,this.pageContext)}static validationSelection(){return()=>{throw new TypeError("validate_select requires a constrained choice editor.")}}validateSelection(e){return this.validationSelection()(e)}shouldProjectControlValue(){return!0}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>{this.validationValueCheck()(r,e),this.sameControlValue(e,r)||this.writeControlValue(r)})}restoreFormDraft(e){this.control.value=e}restoreFormValue(e){this.writeControlValue(e)}sameControlValue(e,r){return Object.is(e,r)}focus(e){this.control.focus(e)}}}function pe(t){return class extends ri(t){constructor(){super(),this.control=this.createControl(),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.setAttribute("autocomplete","off"),this.control.setAttribute("autocorrect","off"),this.control.setAttribute("autocapitalize","off"),this.control.setAttribute("spellcheck","false")),this.control.id="control";let e=this.ownerDocument.createElement("label");e.className="option",this.optionCaption=this.ownerDocument.createElement("span"),this.optionCaption.className="caption",e.append(this.control,this.optionCaption),this.controlBox.append(e)}projectAttributes(e,r){let n=super.projectAttributes(e,r),{disabled:i,readonly:a}=this.parameters;this.control.disabled=!!i,this.control.readOnly=!!a;for(let[s,o]of Object.entries(this.constructor.gramlotComponent.parameters)){if(o.target==="control"){let l=this.parameters[s]??"";String(this.control[s])!==String(l)&&(this.control[s]=l)}o.target==="optionCaption"&&(this.optionCaption.textContent=this.parameters[s]??"")}return n}}}pe.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},live:{dtype:"B",default:!1,binding:"read"}};function ni(t){return class extends ri(t){#e=new Map;#t;#n=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.className="options",this.control.id="control",this.control.setAttribute("role",this.multiple?"group":"radiogroup"),this.controlBox.append(this.control),this.control.addEventListener("keydown",e=>{if(!this.multiple||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;let r=[...this.control.querySelectorAll("input:not(:disabled)")],n=r.indexOf(e.target);if(n<0)return;e.preventDefault();let i=e.key==="Home"?0:e.key==="End"?r.length-1:Math.max(0,Math.min(r.length-1,n+(["ArrowDown","ArrowRight"].includes(e.key)?1:-1)));r[i].focus()})}choiceOptions(){return ze(this.parameters.values??"")}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.choiceOptions(),a=JSON.stringify(i);if(a!==this.#t){let o=i,l=new Set,u=null;for(let{id:c,caption:d}of o){let f=this.#e.get(c);if(!f){let h=this.ownerDocument.createElement("label");h.className="option";let m=this.ownerDocument.createElement("input");m.type=this.choiceType,m.name="choice",m.value=c;let g=this.ownerDocument.createElement("span");h.append(m,g),f={label:h,input:m,text:g},this.#e.set(c,f)}f.text.textContent=d;let p=u?u.nextSibling:this.control.firstChild;p!==f.label&&this.control.insertBefore(f.label,p),u=f.label,l.add(c)}for(let[c,d]of this.#e)l.has(c)||(d.label.remove(),this.#e.delete(c));this.#t=a}let s=this.parameters.cols;if(!Number.isInteger(s)||s<1)throw new TypeError("cols must be a positive integer");this.control.style.gridTemplateColumns=`repeat(${s}, minmax(0, 1fr))`,this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly;for(let{input:o}of this.#e.values())o.disabled=this.control.disabled||this.control.readOnly;return n}readControlValue(){if(this.multiple){let r=(this.#n?this.#n.split(","):[]).filter(n=>!this.#e.has(n)||this.#e.get(n).input.checked);for(let[n,{input:i}]of this.#e)i.checked&&!r.includes(n)&&r.push(n);return r.join(",")||null}for(let[e,{input:r}]of this.#e)if(r.checked)return e;return null}writeControlValue(e){this.#n=e;let r=this.multiple?new Set(e?e.split(","):[]):null;for(let[n,{input:i}]of this.#e)i.checked=this.multiple?r.has(n):n===e}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>this.writeControlValue(r))}focus(e){let r=[...this.#e.values()];(r.find(({input:n})=>n.checked&&!n.disabled)??r.find(({input:n})=>!n.disabled))?.input.focus(e)}}}ni.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"}};var Dl=["TL","TC","TR","L","R","BL","BC","BR"];function G(t){return class extends t{setLabelbox(e){let{box:r,labelBox:n,fieldLabel:i}=e;Object.assign(this,{box:r,labelBox:n,fieldLabel:i}),i.addEventListener("click",()=>{this.control.focus(),this.control.localName==="input"&&["checkbox","radio"].includes(this.control.type)&&this.control.click()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),{lbl:i,lbl_value:a,lbl_values:s}=this.parameters,o=s==null?i??"":pi(ze(s),a,i);return o?this.control.setAttribute("aria-label",o):this.control.removeAttribute("aria-label"),n}}}G.labelbox=!0;G.parameters={lbl:{dtype:"T",qualification:"intl_str",nullable:!0,binding:"read"},lbl_value:{dtype:"T",nullable:!0,binding:"twoWay"},lbl_values:{dtype:"T",nullable:!0,binding:"read"},lbl_position:{dtype:"T",default:"TL",binding:"read",enum:Dl}};function Tt(t,e){return e===2?t%4===0&&(t%100!==0||t%400===0)?29:28:[4,6,9,11].includes(e)?30:31}function ke(t,e,r){if(![t,e,r].every(Number.isInteger)||t<1||t>9999||e<1||e>12||r<1||r>Tt(t,e))throw new RangeError("Date must exist in Gregorian years 0001\u20139999.");return`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function Nt(t){if(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new RangeError("Expected a civil date in YYYY-MM-DD format.");let e=t.split("-").map(Number);return ke(...e),e}function Yr(t,e,r){let n=t-1,i=365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+r-1;for(let a=1;a<e;a++)i+=Tt(t,a);return i}function Xr(t,e){let r=Yr(...Nt(t))+e;if(!Number.isSafeInteger(r)||r<0||r>Yr(9999,12,31))throw new RangeError("Date offset exceeds Gregorian years 0001\u20139999.");let n=1,i=1e4;for(;i-n>1;){let s=Math.floor((n+i)/2);Yr(s,1,1)<=r?n=s:i=s}r-=Yr(n,1,1);let a=1;for(;r>=Tt(n,a);)r-=Tt(n,a++);return ke(n,a,r+1)}function Aa(t){return Xr(t,-(Yr(...Nt(t))%7))}function Al(t,e,r=0,n=1){let i=t*12+e-1+r,a=Math.floor(i/12),s=(i%12+12)%12+1,o=i+n-1,l=Math.floor(o/12),u=(o%12+12)%12+1;return{start:ke(a,s,1),end:ke(l,u,Tt(l,u))}}var ii={en:{months:{january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},weekdays:{monday:0,tuesday:1,wednesday:2,thursday:3,friday:4,saturday:5,sunday:6,mon:0,tue:1,wed:2,thu:3,fri:4,sat:5,sun:6},quarters:{"1st quarter":1,"2nd quarter":2,"3rd quarter":3,"4th quarter":4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["today"],yesterday:["yesterday"],tomorrow:["tomorrow"],this_week:["this week","week"],last_week:["last week"],next_week:["next week"],this_month:["this month","month"],last_month:["last month"],next_month:["next month"],last:["last"],next:["next"],articles:["the"],from:["from","between"],to:["to","and"],no_period:["no period","always"]},date_order:{default:"MDY",GB:"DMY",AU:"DMY",IE:"DMY",NZ:"DMY",IN:"DMY"}},it:{months:{gennaio:1,febbraio:2,marzo:3,aprile:4,maggio:5,giugno:6,luglio:7,agosto:8,settembre:9,ottobre:10,novembre:11,dicembre:12,gen:1,feb:2,mar:3,apr:4,mag:5,giu:6,lug:7,ago:8,set:9,ott:10,nov:11,dic:12},weekdays:{luned\u00EC:0,marted\u00EC:1,mercoled\u00EC:2,gioved\u00EC:3,venerd\u00EC:4,sabato:5,domenica:6,lun:0,mar:1,mer:2,gio:3,ven:4,sab:5,dom:6},quarters:{"1\xBA trimestre":1,"2\xBA trimestre":2,"3\xBA trimestre":3,"4\xBA trimestre":4,"1\xB0 trimestre":1,"2\xB0 trimestre":2,"3\xB0 trimestre":3,"4\xB0 trimestre":4,t1:1,t2:2,t3:3,t4:4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["oggi"],yesterday:["ieri"],tomorrow:["domani"],this_week:["questa settimana","settimana"],last_week:["settimana scorsa"],next_week:["settimana prossima"],this_month:["questo mese","mese"],last_month:["mese scorso"],next_month:["mese prossimo"],last:["scorso","scorsa"],next:["prossimo","prossima"],articles:["il","lo","la"],from:["da","dal","dalla","tra","fra"],to:["a","al","alla","e"],no_period:["-","senza periodo","sempre"]},date_order:{default:"DMY"}}};function Cl(t){if(typeof t!="string")throw new RangeError("A supported locale is required.");let e=t.replaceAll("-","_"),r=e.indexOf("_"),n=(r<0?e:e.slice(0,r)).toLowerCase(),i=(r<0?"":e.slice(r+1)).toUpperCase();if(!Object.hasOwn(ii,n))throw new RangeError(`Unsupported locale: ${t}`);let a=ii[n];return{dictionary:a,phrases:o=>[...new Set([...a.keywords[o],...ii.en.keywords[o]])],order:a.date_order[i]??a.date_order.default}}var St=/^(?:\d{4}|\d{2})$/,Tl=/^\d{1,2}$/,Zr=(t,e)=>({ok:!1,error:{code:t,message:e}}),Bt=(t="UNRECOGNIZED_EXPRESSION",e="Text is not a supported date expression.")=>{throw Object.assign(new SyntaxError(e),{code:t})},Ol=(t,e)=>Object.hasOwn(t,e);function Ot(t,e){if(t.length===4)return Number(t);let r=e.year+e.twoDigitYearAhead-100;return r+((Number(t)-r)%100+100)%100}function Op(t,e){if(t.includes(";")){let i=t.split(";").map(a=>a.trim());return i.length!==2?Bt("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:i,range:!0}}if(e.phrases("no_period").includes(t))return{bounds:["",""],range:!0};let r=e.phrases("to"),n=e.phrases("from");for(let i of r)if(t.startsWith(`${i} `))return{bounds:["",t.slice(i.length+1).trim()],range:!0};for(let i of r){let a=` ${i} `;if(!t.includes(a))continue;for(let o of n)if(t.startsWith(`${o} `)){t=t.slice(o.length+1);break}let s=t.split(a).map(o=>o.trim());return s.length!==2?Bt("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:s,range:!0}}for(let i of n)if(t.startsWith(`${i} `))return{bounds:[t.slice(i.length+1).trim(),""],range:!0};return{bounds:[t,t],range:!1}}function Bp(t,e,r){let n=[[t,0]],i=/^(.+?)\s*([+-])\s*(\d+)$/.exec(t);i&&n.push([i[1],Number(i[2]+i[3])]);let a={today:0,yesterday:-1,tomorrow:1,this_week:0,last_week:-1,next_week:1,this_month:0,last_month:-1,next_month:1};for(let[s,o]of n)for(let[l,u]of Object.entries(a))if(e.phrases(l).includes(s)){if(l.endsWith("_week"))return Xr(Aa(e.workdate),(u+o)*7+(r?6:0));if(l.endsWith("_month")){let c=Al(e.year,e.month,u+o);return r?c.end:c.start}return Xr(e.workdate,u+o)}return null}function Ip(t,e,r){let n=Object.entries(e.dictionary.quarters).sort((i,a)=>a[0].length-i[0].length);for(let[i,a]of n){let s;if(t===i)s=null;else if(t.startsWith(i)&&St.test(t.slice(i.length).trim()))s=Ot(t.slice(i.length).trim(),e);else if(t.endsWith(i)&&St.test(t.slice(0,-i.length).trim()))s=Ot(t.slice(0,-i.length).trim(),e);else continue;return{year:s,month:r?a*3:a*3-2}}return null}function Nl(t,e){if(Ol(e.months,t))return e.months[t];let r=/^m(\d{1,2})$/.exec(t);return r&&Number(r[1])>=1&&Number(r[1])<=12?Number(r[1]):null}function Mp(t,e){let r=t.split(/\s+/),n=r.map((u,c)=>Nl(u,e.dictionary)?c:-1).filter(u=>u>=0);if(!n.length)return null;if(n.length!==1)return Bt();let i=n[0],a=Nl(r[i],e.dictionary),s=r.slice(0,i),o=r.slice(i+1),l=[...s,...o];if(l.length===1&&e.phrases("last").includes(l[0]))return{year:e.year-(a>e.month?1:0),month:a};if(l.length===1&&e.phrases("next").includes(l[0]))return{year:e.year+(a<e.month?1:0),month:a};if(!l.length)return{year:null,month:a};if(!s.length&&o.length===1&&St.test(o[0]))return{year:Ot(o[0],e),month:a};if(s.length===1&&Tl.test(s[0])){if(!o.length)return ke(e.year,a,Number(s[0]));if(o.length===1&&St.test(o[0]))return ke(Ot(o[0],e),a,Number(s[0]))}return!s.length&&o.length===2&&Tl.test(o[0])&&St.test(o[1])?ke(Ot(o[1],e),a,Number(o[0])):Bt()}function Rp(t,e){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(r)return ke(...r.slice(1).map(Number));let n=/^(\d{1,4})[/\-. ]+(\d{1,4})[/\-. ]+(\d{1,4})$/.exec(t),i={};if(n)e.order.split("").forEach((o,l)=>{i[o]=n[l+1]});else if(/^(?:\d{6}|\d{8})$/.test(t)){let o=t.length===8?4:2;for(let l of e.order){let u=l==="Y"?o:2;i[l]=t.slice(0,u),t=t.slice(u)}}else return null;if(!St.test(i.Y)||i.D.length>2||i.M.length>2)return Bt();let a=Number(i.D),s=Number(i.M);return n&&s>12&&a<=12&&([a,s]=[s,a]),ke(Ot(i.Y,e),s,a)}function Sl(t,e,r){if(!t)return null;let n=e.phrases("articles");if(t=t.split(/\s+/).filter(a=>!n.includes(a)).join(" "),!t)return Bt();if(St.test(t))return ke(Ot(t,e),r?12:1,r?31:1);let i=Bp(t,e,r)??Ip(t,e,r)??Mp(t,e);return i!==null?i:Ol(e.dictionary.weekdays,t)?Xr(Aa(e.workdate),e.dictionary.weekdays[t]):Rp(t,e)??Bt()}function Lp(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year,i=typeof e=="string"?Nt(e)[0]:e?.year,a=typeof e=="string"?Nt(e)[1]:e?.month;return i&&(n>i&&(n=i),n===i&&t.month>a&&n--),ke(n,t.month,1)}function Pp(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year;if(e!==null){let[i,a]=Nt(e);n<i&&(n=i),n===i&&a>t.month&&n++}return ke(n,t.month,Tt(n,t.month))}function Ca(t,e={}){if(!e||typeof e!="object"||Array.isArray(e))return Zr("INVALID_CONTEXT","Options must provide a civil workdate and supported locale.");let r;try{let{locale:n="it-IT",workdate:i,twoDigitYearAhead:a=20}=e,[s,o]=Nt(i);if(!Number.isInteger(a)||a<0||a>99)throw new RangeError("twoDigitYearAhead must be an integer from 0 to 99.");r={...Cl(n),workdate:i,year:s,month:o,twoDigitYearAhead:a}}catch(n){return Zr("INVALID_CONTEXT",n.message)}if(typeof t!="string")return Zr("INVALID_INPUT","Expression must be a string.");try{let n=t.toLowerCase().trim().replaceAll(",",""),{bounds:i,range:a}=Op(n,r),s=Sl(i[1],r,!0),o=Sl(i[0],r,!1),l=Lp(o,s,r),u=Pp(s,l,r);return!a&&typeof o=="string"&&l===u?{ok:!0,kind:"date",date:l}:{ok:!0,kind:"period",start:l,end:u}}catch(n){if(n instanceof RangeError)return Zr("INVALID_DATE",n.message);if(n instanceof SyntaxError)return Zr(n.code,n.message);throw n}}function je(t,e,r){let n=new Date(0);return n.setUTCFullYear(t,e,r),n}function Kr(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCHours()||t.getUTCMinutes()||t.getUTCSeconds()||t.getUTCMilliseconds()))throw new TypeError("Expected a civil Date at UTC midnight")}var ai=(t,e)=>t===e||t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime(),$p=t=>t.toISOString().slice(0,10),Jr=class{constructor(e,r){this.container=e,this.select=r,this.value=null;let n=e.ownerDocument,i=n.createElement("style");i.textContent=`.calendar{width:var(--gramlot-calendar-width,18em);max-width:100%;font:inherit;color:inherit}
|
|
65
80
|
.calendar button{min-height:var(--gramlot-touch-target,0px);font:inherit;color:inherit;border:1px solid transparent;border-radius:3px;background:transparent;cursor:pointer;padding:.25em}
|
|
66
81
|
.calendar button:focus-visible{outline:2px solid var(--gramlot-focus-ring,#4369c5);outline-offset:-2px}
|
|
67
82
|
.calendar button:disabled{opacity:.5;cursor:default}
|
|
@@ -71,31 +86,31 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
|
|
|
71
86
|
.calendar-weekday{text-align:center;font-size:.85em;color:var(--gramlot-text-secondary,#64748b)}
|
|
72
87
|
.calendar button[aria-pressed=true]{background:var(--gramlot-brand-blue,#4369c5);color:white}
|
|
73
88
|
.calendar button[data-today=true]{border-color:var(--gramlot-brand-blue,#4369c5)}
|
|
74
|
-
.calendar button:hover:not(:disabled){background:var(--gramlot-selected,#e5ebf7);color:var(--gramlot-ink,#203047)}`,e.classList.add("calendar"),this.header=n.createElement("div"),this.header.className="calendar-header",this.month=n.createElement("span"),this.month.className="calendar-month",this.month.setAttribute("aria-live","polite"),this.previous=this.button("\u2039","Previous month",()=>this.moveMonth(-1)),this.next=this.button("\u203A","Next month",()=>this.moveMonth(1)),this.header.append(this.previous,this.month,this.next),this.grid=n.createElement("div"),this.grid.className="calendar-grid",this.footer=n.createElement("div"),this.footer.className="calendar-footer",this.todayButton=this.button("Today","Today",()=>this.choose(this.today)),this.clearButton=this.button("Clear","Clear date",()=>this.choose(null)),this.footer.append(this.todayButton,this.clearButton),e.append(i,this.header,this.grid,this.footer),this.grid.addEventListener("keydown",a=>{if(this.locked||!a.target.dataset.date)return;let s={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};if(a.key in s)a.preventDefault(),this.active=
|
|
89
|
+
.calendar button:hover:not(:disabled){background:var(--gramlot-selected,#e5ebf7);color:var(--gramlot-ink,#203047)}`,e.classList.add("calendar"),this.header=n.createElement("div"),this.header.className="calendar-header",this.month=n.createElement("span"),this.month.className="calendar-month",this.month.setAttribute("aria-live","polite"),this.previous=this.button("\u2039","Previous month",()=>this.moveMonth(-1)),this.next=this.button("\u203A","Next month",()=>this.moveMonth(1)),this.header.append(this.previous,this.month,this.next),this.grid=n.createElement("div"),this.grid.className="calendar-grid",this.footer=n.createElement("div"),this.footer.className="calendar-footer",this.todayButton=this.button("Today","Today",()=>this.choose(this.today)),this.clearButton=this.button("Clear","Clear date",()=>this.choose(null)),this.footer.append(this.todayButton,this.clearButton),e.append(i,this.header,this.grid,this.footer),this.grid.addEventListener("keydown",a=>{if(this.locked||!a.target.dataset.date)return;let s={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};if(a.key in s)a.preventDefault(),this.active=je(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+s[a.key]);else if(a.key==="Home"||a.key==="End"){a.preventDefault();let o=(this.active.getUTCDay()+6)%7;this.active=je(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+(a.key==="Home"?-o:6-o))}else if(a.key==="PageUp"||a.key==="PageDown"){a.preventDefault(),this.moveMonth(a.key==="PageUp"?-1:1,!0);return}else return;this.render(),this.focusDay()})}button(e,r,n){let i=this.container.ownerDocument.createElement("button");return i.type="button",i.textContent=e,i.setAttribute("aria-label",r),i.addEventListener("click",n),i}configure({value:e,locale:r,workdate:n,locked:i=!1}){Kr(e);let a=new Date;this.today=n?je(...n.split("-").map((o,l)=>Number(o)-(l===1?1:0))):je(a.getFullYear(),a.getMonth(),a.getDate()),(!this.active||!ai(this.value,e))&&(this.active=e??this.today),this.value=e,this.locale=r,this.locked=i;let s=this.grid.contains(this.container.getRootNode().activeElement);this.render(),s&&!i&&this.focusDay()}choose(e){this.locked||(this.value=e,this.active=e??this.today,this.render(),this.focusDay(),this.select(e))}moveMonth(e,r=!1){if(this.locked)return;let n=this.active.getUTCFullYear(),i=this.active.getUTCMonth()+e;this.active=je(n,i,Math.min(this.active.getUTCDate(),je(n,i+1,0).getUTCDate())),this.render(),r&&this.focusDay()}render(){let e=this.active.getUTCFullYear(),r=this.active.getUTCMonth();this.month.textContent=new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric",timeZone:"UTC"}).format(this.active),this.grid.replaceChildren();let n=new Intl.DateTimeFormat(this.locale,{weekday:"short",timeZone:"UTC"});for(let s=0;s<7;s++){let o=this.container.ownerDocument.createElement("span");o.className="calendar-weekday",o.textContent=n.format(je(2024,0,1+s)),this.grid.append(o)}let i=(je(e,r,1).getUTCDay()+6)%7;for(let s=0;s<i;s++)this.grid.append(this.container.ownerDocument.createElement("span"));let a=new Intl.DateTimeFormat(this.locale,{dateStyle:"full",timeZone:"UTC"});for(let s=1;s<=je(e,r+1,0).getUTCDate();s++){let o=je(e,r,s),l=this.button(String(s),a.format(o),()=>this.choose(o));l.dataset.date=$p(o),l.dataset.today=String(ai(o,this.today)),l.setAttribute("aria-pressed",String(ai(o,this.value))),l.disabled=this.locked,l.tabIndex=s===this.active.getUTCDate()?0:-1,this.grid.append(l)}for(let s of[this.previous,this.next,this.todayButton,this.clearButton])s.disabled=this.locked}focusDay(){this.grid.querySelector('button[tabindex="0"]')?.focus()}};function Ta(t){return class extends ri(t){#e=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.id="control",this.control.setAttribute("role","group"),this.controlBox.append(this.control),this.calendarView=new Jr(this.control,e=>{this.#e=e,this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change",{bubbles:!0}))})}get commitOnChange(){return!0}readControlValue(){return this.#e}sameControlValue(e,r){return ai(e,r)}writeControlValue(e){Kr(e),this.#e=e,this.syncCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly,this.syncCalendar(),n}syncCalendar(){!this.pageContext||!this.parameters||this.calendarView.configure({value:this.#e,locale:this.parameters.locale??this.pageContext.locale,workdate:this.parameters.workdate,locked:this.control.disabled||this.control.readOnly})}focus(){this.calendarView.focusDay()}releaseControl(){this.calendarView.locked=!0}}}Ta.parameters={value:{dtype:"D",nullable:!0,binding:"twoWay"},disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},locale:{dtype:"T",nullable:!0,binding:"read"},workdate:{dtype:"T",nullable:!0,binding:"read"}};var Up=(t,e,r)=>t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():r(t)&&r(e)?t.eq(e):Object.is(t,e),Fp=t=>!["NaN","Infinity","-Infinity"].includes(t.toString()),Qr=t=>String(t).padStart(2,"0");function Bl(t){let e=new Intl.NumberFormat(t).formatToParts(-12345.6);return{decimal:e.find(r=>r.type==="decimal").value,group:e.find(r=>r.type==="group")?.value,minus:e.find(r=>r.type==="minusSign").value}}function en(t){return class extends pe(t){#e=null;#t=!1;#n=!1;#r=null;#a=null;#i=!1;constructor(){super(),this.control.addEventListener("focus",()=>{if(this.#n=!0,!this.#t){let e=this.control.selectionStart,r=this.control.selectionEnd,n=e===0&&r===this.control.value.length;this.#r=this.context(),this.display(),this.control.setSelectionRange(e,n?this.control.value.length:r)}}),this.control.addEventListener("input",()=>{this.#i||(this.#a=null),this.#t=!0,this.#r??=this.context(),this.error("")}),this.control.addEventListener("blur",()=>{this.#n=!1,this.#t&&this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change")),this.#t||(this.#r=null,this.display())}),this.control.addEventListener("keydown",e=>{e.isComposing||this.control.disabled||this.control.readOnly||(e.key==="Escape"?(e.preventDefault(),this.#a=null,this.#t=!1,this.#r=null,this.pageContext.form&&this.pageContext.formClearDraft(),this.error(""),this.display(),this.pageContext.form&&this.validateCandidate(this.#e,()=>{})):e.key==="Enter"&&(e.preventDefault(),this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change"))))})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e}context(){return{locale:this.parameters.locale??this.pageContext.locale,timeZone:this.pageContext.timeZone,pattern:this.parameters.format,dtype:this.parameters.dtype}}readControlValue(){return this.#e}readDraftValue(){return this.#t?this.control.value.trim()===""?null:this.parse(this.control.value,this.#r??this.context()):this.#e}sameControlValue(e,r){return Up(e,r,this.pageContext.isDecimal)}writeControlValue(e){if(this.checkValue(e),this.sameControlValue(e,this.#e)){!this.#t&&!this.#n&&this.display();return}this.#e=e,this.#a=null,this.#t=!1,this.#r=null,this.error(""),this.display()}selectControlValue(e){this.checkValue(e),this.control.value=e===null?"":this.editText(e,this.context()),this.#a={value:e},this.#i=!0;try{for(let r of["input","change"])this.control.dispatchEvent(new this.ownerDocument.defaultView.Event(r,{bubbles:!0}))}finally{this.#i=!1}}acceptControlValue(){if(!this.#t)return{ok:!1};try{let e=this.#a?this.#a.value:this.readDraftValue();return this.checkValue(e),this.validateCandidate(e,r=>{this.checkValue(r),this.acceptDraft(r,this.#a?null:this.control.value,this.#r??this.context()),this.#e=r,this.#a=null,this.#t=!1,(!this.#n||!this.sameControlValue(e,r))&&(this.#r=null,this.display())})}catch(e){return this.pageContext.form&&this.pageContext.formParseError(e.message),this.error(e.message),{ok:!1}}}acceptDraft(e,r,n){}restoreFormDraft(e){this.#t=!0,this.#r=this.context(),this.control.value=e}restoreFormValue(e){this.#t=!1,this.#r=null,this.#a=null,this.error(""),this.writeControlValue(e),this.display()}display(){if(!this.pageContext||!this.parameters)return;let e=this.#e==null?"":this.#n?this.editText(this.#e,this.#r??this.context()):this.pageContext.format(this.#e,this.context());this.control.value!==e&&(this.control.value=e)}projectAttributes(e,r){let n=super.projectAttributes(e,r);return!this.#t&&!this.#n&&this.display(),n}}}en.parameters={...pe.parameters,placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},locale:{dtype:"T",nullable:!0,binding:"read"},format:{dtype:"T",nullable:!0,binding:"read"}};var Rl=t=>class extends t{createControl(){let e=super.createControl();return e.inputMode="decimal",e}static validationValueCheck(e){let r=e.isDecimal;return n=>Il(n,r)}checkValue(e){Il(e,this.pageContext.isDecimal)}context(){return{...super.context(),pattern:this.parameters.format??"0.####################"}}editText(e,r){return String(e).replace(".",Bl(r.locale).decimal)}parse(e,r){let{decimal:n,group:i,minus:a}=Bl(r.locale),s=e.trim().replaceAll(a,"-");if(i&&s.includes(i))throw new Error("Enter the number without grouping separators.");if(s=s.replace(n,"."),!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(s))throw new Error("Enter a complete number.");let o=r.dtype==="N"||this.pageContext.isDecimal(this.readControlValue());if(o&&this.pageContext.getDecimalLibrary()==="number")throw new Error("A Decimal backend is required.");let l=o?this.pageContext.createDecimal(s):Number(s);if(this.checkValue(l),r.dtype==="L"&&!Number.isSafeInteger(l))throw new Error("Enter a safe integer.");for(let[u,c]of[["min",-1],["max",1]]){let d=this.parameters[u];if(d!=null&&(o?l.cmp(d):Math.sign(l-d))===c)throw new Error(`${u}: ${d}`)}return l}},Ll=t=>class extends t{#e=!1;#t;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`.date-entry{position:relative;max-width:100%}
|
|
75
90
|
.date-entry #control{display:block;min-width:0;width:100%}
|
|
76
91
|
.date-entry:has(.calendar-toggle:not([hidden])) #control{padding-right:calc(var(--gramlot-touch-target,1.6em) + .4em)}
|
|
77
92
|
.calendar-toggle{position:absolute;right:0;top:0;bottom:0;width:var(--gramlot-touch-target,1.6em);min-width:0;min-height:0;font:inherit;font-size:var(--gramlot-field-font-size,1em);line-height:inherit;padding:0;border:0;border-radius:var(--gramlot-radius-sm,4px);background:transparent;color:inherit;cursor:pointer}
|
|
78
93
|
.calendar-toggle:disabled{cursor:default;opacity:.6}
|
|
79
94
|
.calendar-toggle svg{display:block;width:1.1em;height:1.1em;margin:auto;pointer-events:none}
|
|
80
95
|
.calendar-popup{position:fixed;inset:auto;margin:0;padding:.5em;max-width:var(--gramlot-popup-available-width,100vw);max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;
|
|
81
|
-
border:1px solid var(--gramlot-border-control,#aab4c4);border-radius:var(--gramlot-radius,5px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);box-shadow:var(--gramlot-shadow,0 3px 12px #0003);font:inherit}`,this.shadowRoot.append(r);let n=e.createElement("div");n.className="date-entry",this.control.parentElement.replaceWith(n),n.append(this.control),this.calendarButton=e.createElement("button"),this.calendarButton.type="button",this.calendarButton.className="calendar-toggle";let i=e.createElementNS(ar,"svg");for(let[o,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(o,l);let a=e.createElementNS(ar,"path");a.setAttribute("d","M5 5h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z M7 2v6 M17 2v6 M3 11h18 M7 15h2 M15 15h2 M7 18h2 M15 18h2"),i.append(a),this.calendarButton.append(i),this.calendarButton.setAttribute("aria-label","Open calendar"),this.calendarButton.setAttribute("aria-haspopup","dialog"),this.calendarButton.setAttribute("aria-expanded","false"),this.calendarButton.setAttribute("aria-controls","calendar-popup"),n.append(this.calendarButton),this.calendarPopup=e.createElement("div"),this.calendarPopup.className="calendar-popup",this.calendarPopup.id="calendar-popup",this.calendarPopup.setAttribute("popover","auto"),this.calendarPopup.setAttribute("role","dialog"),this.calendarPopup.setAttribute("aria-label","Choose date"),this.shadowRoot.append(this.calendarPopup);let s=e.createElement("div");this.calendarPopup.append(s),this.calendarView=new Xr(s,o=>{this.control.disabled||this.control.readOnly||!this.pageContext.isActive()||(this.closeCalendar(),this.control.focus(),this.selectControlValue(o))}),this.calendarButton.addEventListener("click",()=>this.#e?this.closeCalendar():this.openCalendar()),this.control.addEventListener("keydown",o=>{o.altKey&&o.key==="ArrowDown"&&(o.preventDefault(),this.openCalendar())}),this.calendarPopup.addEventListener("keydown",o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),this.closeCalendar(),this.control.focus())}),this.calendarPopup.addEventListener("toggle",o=>{o.newState==="closed"&&(this.#e=!1,this.cleanupCalendar())})}openCalendar(){if(!this.parameters.calendar||this.control.disabled||this.control.readOnly||!this.pageContext.isActive())return;let e=this.readControlValue();try{e=this.readDraftValue()}catch{}this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate}),this.calendarPopup.showPopover(),this.#e=!0,this.calendarButton.setAttribute("aria-expanded","true");let r=this.ownerDocument.defaultView,n=()=>ft(this.calendarPopup,this.control);this.#t?.(),n(),r.addEventListener("resize",n),r.addEventListener("scroll",n,!0),this.#t=()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n,!0)},this.calendarView.focusDay()}cleanupCalendar(){this.#t?.(),this.#t=null,this.calendarButton.setAttribute("aria-expanded","false")}closeCalendar(){this.#e&&this.calendarPopup.hidePopover(),this.#e=!1,this.cleanupCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.calendarButton.hidden=!this.parameters.calendar,this.calendarButton.disabled=this.control.disabled||this.control.readOnly,!this.parameters.calendar||this.calendarButton.disabled?this.closeCalendar():this.#e&&this.calendarView.configure({value:this.readControlValue(),locale:this.context().locale,workdate:this.parameters.workdate}),n}writeControlValue(e){super.writeControlValue(e),this.#e&&this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate})}releaseControl(){this.closeCalendar(),super.releaseControl()}context(){return{...super.context(),dtype:"D",pattern:this.parameters.format??"short"}}validationValueCheck(){return Zr}checkValue(e){Zr(e)}editText(e,r){return this.pageContext.format(e,{...r,pattern:"short"})}parse(e,r){let n=new Date,i=this.parameters.workdate??`${n.getFullYear()}-${Jr(n.getMonth()+1)}-${Jr(n.getDate())}`,a={locale:r.locale,workdate:i},s=va(e,a);if(!s.ok)throw new Error(s.error.message);if(s.kind!=="date")throw new Error("Enter one complete date, not a period.");let[o,l,u]=s.date.split("-").map(Number),c=new Date(0);return c.setUTCFullYear(o,l-1,u),c}},Cl=t=>class extends t{context(){return{...super.context(),dtype:"H",pattern:this.parameters.format??"short"}}validationValueCheck(){return Dl}checkValue(e){Dl(e)}editText(e){return`${Jr(e.getUTCHours())}:${Jr(e.getUTCMinutes())}:${Jr(e.getUTCSeconds())}`+(e.getUTCMilliseconds()?`.${String(e.getUTCMilliseconds()).padStart(3,"0")}`:"")}parse(e){let r=/^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e.trim());if(!r||+r[1]>23||+r[2]>59||+(r[3]??0)>59)throw new Error("Enter HH:mm or HH:mm:ss, using the 24-hour clock.");return new Date(Date.UTC(1970,0,1,+r[1],+r[2],+(r[3]??0),+(r[4]??"").padEnd(3,"0")))}};function xl(t,e){if(t!==null&&!(typeof t=="number"&&Number.isFinite(t))&&!(e(t)&&Sp(t)))throw new TypeError("Expected a finite number or Decimal")}function Dl(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCFullYear()!==1970||t.getUTCMonth()!==0||t.getUTCDate()!==1))throw new TypeError("Expected a civil time on the TYTX epoch date")}import{Bag as Op}from"@gramlot/gramlot";var Da=["select","notnull","empty","case","len","min","max","email","regex","call","remote"],Bp=["nodup","exist","gridnodup"],ni=t=>t==null||t==="",Ea=(t,e)=>t instanceof Promise?t.then(e):e(t);function Aa(t,e,r={}){let n={value:t,modified:!1,error:null,warnings:[],issues:[],datachanges:[]},i=Object.fromEntries(Object.entries(e).map(([u,c])=>[u.slice(9),c])),a=u=>Object.hasOwn(e,`validate_${u}`)&&e[`validate_${u}`]!=null;for(let u of Bp)if(a(u))throw new Error(`validate_${u} requires the DB/grid integration.`);let s=(u,c,d=!1)=>r.invoke(u,e[u],{...i,value:c,result:n,validations:i,userChange:!0,signal:r.signal},d),o=(u,c)=>{if(c==null||c===!0)return;if(typeof c!="boolean"&&typeof c!="string"&&(typeof c!="object"||Array.isArray(c)))throw new TypeError("A validator returns true, false, null, an error code, or a result object/Bag.");let d=`validate_${u}`,f=c instanceof Op?Object.fromEntries(c.getNodes().map(_=>[_.label,_.value])):typeof c=="object"?c:{errorcode:c===!1?"error":c};if(Object.hasOwn(f,"value")&&(n.modified||=!Object.is(n.value,f.value),n.value=f.value),f.data!=null&&(r.checkDataPatch(f.data),n.datachanges.push(f.data)),!f.errorcode)return;let p=e[`${d}_iswarning`]??f.iswarning??!!(e[`${d}_warning`]&&!e[`${d}_error`]),h=e[`${d}_${f.errorcode}`]||e[`${d}_${p?"warning":"error"}`]||f.message||e[`${d}_${p?"error":"warning"}`]||String(f.errorcode),m=sr(h,_=>_?{...i,...f,value:n.value}[_]:n.value);if(m==null)throw new Error("A validation message references a missing value.");let g={rule:u,code:f.errorcode,severity:p?"warning":"error",message:m};n.issues.push(g),p?n.warnings.push(m):(n.error=m,n.required=!!f.required)},l=u=>{if(r.signal?.aborted)throw r.signal.reason;if(n.error||u===Da.length)return n;let c=Da[u],d=`validate_${c}`,f=e[d];if(!a(c)||f===!1&&c!=="empty")return l(u+1);let p=m=>{if(!m)return l(u+1);let g;return c==="remote"&&n.value==null?l(u+1):(c==="call"?g=s(d,n.value):c==="remote"?g=r.remote(f,{...Ip(e),value:n.value},r.signal):g=Mp(c,f,n.value,r),Ea(g,_=>{if(r.signal?.aborted)throw r.signal.reason;let v=()=>(o(c,_),l(u+1));return c==="remote"&&e.validate__onResult?Ea(r.invoke("validate__onResult",e.validate__onResult,{result:_,value:n.value,validations:i,signal:r.signal}),v):v()}))},h=e[`${d}_if`];return Ea(h==null?!0:typeof h=="boolean"?h:s(`${d}_if`,n.value,!0),p)};return l(0)}function Ip(t){let e=new Set(["if","error","warning","iswarning"]);return Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith("validate_remote_")&&!e.has(r.slice(16))).map(([r,n])=>[r.slice(16),n]))}function Qr(t,e,r={}){return{errorcode:t,message:e,...r}}function Mp(t,e,r,n){if(t==="select")return n.selection(r);if(t==="notnull")return ni(r)&&e?Qr("notnull","A value is required.",{required:!0}):null;if(t==="empty")return ni(r)?{value:e}:null;if(t==="len"){if(typeof e!="string"||!/^(?:\d+|\d+:\d*|:\d+)$/.test(e))throw new Error("Invalid validate_len: use a length or min:max.");let[i,a]=e.split(":"),s=Number(i||0),o=a===void 0?s:a===""?1/0:Number(a);if(s>o)throw new Error("Invalid validate_len: minimum exceeds maximum.");if(ni(r))return;if(typeof r!="string")throw new TypeError("validate_len requires a text value.");return r.length<s||r.length>o?Qr(s===o?"wrong length":r.length<s?"too short":"too long",s===o?`Enter exactly ${s} characters.`:o===1/0?`Enter at least ${s} characters.`:s===0?`Enter no more than ${o} characters.`:`Enter between ${s} and ${o} characters.`):void 0}if(!ni(r)){if(t==="case"){if(typeof r!="string")throw new TypeError("validate_case requires a text value.");switch(e){case"upper":case"u":return{value:r.toUpperCase()};case"lower":case"l":return{value:r.toLowerCase()};case"title":case"t":return{value:r.replace(/\p{L}[\p{L}\p{M}]*/gu,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())};case"capitalize":case"c":return{value:r[0].toUpperCase()+r.slice(1).toLowerCase()};default:throw new Error("Invalid validate_case: use upper, lower, title or capitalize.")}}if(t==="min"||t==="max"){let i;if(n.isDecimal?.(r))i=r.comparedTo(e);else if(r instanceof Date&&e instanceof Date)i=r.getTime()-e.getTime();else if(typeof r=="number"&&Number.isFinite(r)&&typeof e=="number"&&Number.isFinite(e))i=r-e;else throw new TypeError(`validate_${t} requires matching numeric or date/time values.`);return(t==="min"?i<0:i>0)?Qr(t,`Value must be ${t==="min"?"at least":"at most"} ${e}.`):void 0}if(t==="email"){if(typeof r!="string")throw new TypeError("validate_email requires a text value.");return/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(r)?null:Qr("email","Check email format.",{iswarning:!0})}if(t==="regex"){if(typeof r!="string"||typeof e!="string")throw new TypeError("validate_regex requires text.");let i=e.trim(),a=i.startsWith("!");return new RegExp(a?i.slice(1):i,"u").test(r)!==a?null:Qr("regex","The value does not match the required pattern.")}}}var en={dtype:"T",nullable:!0,binding:"read"},ii={dtype:"B",nullable:!0,binding:"read"},xa={dtype:["T","L","N","R","B","D","H","DH","DHZ"],nullable:!0,binding:"read"},Nl={validate_select:ii,validate_notnull:{...ii,default:!1},validate_empty:xa,validate_case:{...en,enum:["upper","lower","title","capitalize","u","l","t","c"]},validate_len:en,validate_min:xa,validate_max:xa,validate_email:ii,validate_regex:en,validate_call:{dtype:"T",nullable:!0},validate_remote:en,validate_onAccept:{dtype:"T",nullable:!0},validate_onReject:{dtype:"T",nullable:!0},validate__onResult:{dtype:"T",nullable:!0},validate_timeout:{dtype:"L",nullable:!0,binding:"read"},...Object.fromEntries(Da.flatMap(t=>[[`validate_${t}_if`,{dtype:["T","B"],nullable:!0}],[`validate_${t}_iswarning`,ii],...["error","warning"].map(e=>[`validate_${t}_${e}`,{...en,qualification:"intl_str"}])]))};var ai=class{epoch=0;controller=null;cancel(){this.epoch++,this.controller?.abort(),this.controller=null}start(e,r,n,i,a,s=()=>{}){this.cancel();let o=new AbortController,l=this.epoch;this.controller=o;let u=n.validationCurrent(),c=()=>l===this.epoch&&!o.signal.aborted&&u(),d=m=>({value:e,modified:!1,error:m.message,warnings:[],issues:[],datachanges:[]}),f=!1,p=m=>{if(f||!c())return{ok:!1};f=!0,this.controller=null;let g={ok:!m.error,value:m.value,result:m,rules:r,isCurrent:c};return a(g),g},h;try{if(r.validate_timeout!=null&&(!Number.isInteger(r.validate_timeout)||r.validate_timeout<=0))throw new TypeError("validate_timeout must be a positive integer in milliseconds.");h=i(e,r,{...n,signal:o.signal})}catch(m){return p(d(m))}return h instanceof Promise?(s(),new Promise(m=>{let g,_=()=>{clearTimeout(g),m({ok:!1})};o.signal.addEventListener("abort",_,{once:!0});let v=w=>{clearTimeout(g),o.signal.removeEventListener("abort",_);try{m(p(w))}catch(x){n.reportError(x,"Validation completion failed"),m({ok:!1})}};r.validate_timeout!=null&&(g=setTimeout(()=>{v(d(new Error("Validation timed out."))),o.abort()},r.validate_timeout)),h.then(v,w=>v(d(w)))})):p(h)}};var Rp=1800,Sl=200;function X(t){return class extends t{get supportsFormValidation(){return!0}get validationExecutor(){return Aa}connectedCallback(){super.connectedCallback(),this.pageContext?.form&&this.pageContext.formValidate()}#e=!1;#t;#n;#r;#a=new ai;#i;#s={};validationResult=null;constructor(){super(),this.message=this.ownerDocument.createElement("small"),this.message.id="field-message",this.message.hidden=!0,this.message.setAttribute("aria-live","polite"),this.message.setAttribute("popover","manual"),this.message.setAttribute("role","tooltip");let e=this.ownerDocument.createElement("style");e.textContent=`#control[aria-invalid="true"]{background:var(--gramlot-error-background,#fff1f0)}
|
|
96
|
+
border:1px solid var(--gramlot-border-control,#aab4c4);border-radius:var(--gramlot-radius,5px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);box-shadow:var(--gramlot-shadow,0 3px 12px #0003);font:inherit}`,this.shadowRoot.append(r);let n=e.createElement("div");n.className="date-entry",this.control.parentElement.replaceWith(n),n.append(this.control),this.calendarButton=e.createElement("button"),this.calendarButton.type="button",this.calendarButton.className="calendar-toggle";let i=e.createElementNS(sr,"svg");for(let[o,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(o,l);let a=e.createElementNS(sr,"path");a.setAttribute("d","M5 5h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z M7 2v6 M17 2v6 M3 11h18 M7 15h2 M15 15h2 M7 18h2 M15 18h2"),i.append(a),this.calendarButton.append(i),this.calendarButton.setAttribute("aria-label","Open calendar"),this.calendarButton.setAttribute("aria-haspopup","dialog"),this.calendarButton.setAttribute("aria-expanded","false"),this.calendarButton.setAttribute("aria-controls","calendar-popup"),n.append(this.calendarButton),this.calendarPopup=e.createElement("div"),this.calendarPopup.className="calendar-popup",this.calendarPopup.id="calendar-popup",this.calendarPopup.setAttribute("popover","auto"),this.calendarPopup.setAttribute("role","dialog"),this.calendarPopup.setAttribute("aria-label","Choose date"),this.shadowRoot.append(this.calendarPopup);let s=e.createElement("div");this.calendarPopup.append(s),this.calendarView=new Jr(s,o=>{this.control.disabled||this.control.readOnly||!this.pageContext.isActive()||(this.closeCalendar(),this.control.focus(),this.selectControlValue(o))}),this.calendarButton.addEventListener("click",()=>this.#e?this.closeCalendar():this.openCalendar()),this.control.addEventListener("keydown",o=>{o.altKey&&o.key==="ArrowDown"&&(o.preventDefault(),this.openCalendar())}),this.calendarPopup.addEventListener("keydown",o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),this.closeCalendar(),this.control.focus())}),this.calendarPopup.addEventListener("toggle",o=>{o.newState==="closed"&&(this.#e=!1,this.cleanupCalendar())})}openCalendar(){if(!this.parameters.calendar||this.control.disabled||this.control.readOnly||!this.pageContext.isActive())return;let e=this.readControlValue();try{e=this.readDraftValue()}catch{}this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate}),this.calendarPopup.showPopover(),this.#e=!0,this.calendarButton.setAttribute("aria-expanded","true");let r=this.ownerDocument.defaultView,n=()=>Te(this.calendarPopup,this.control);this.#t?.(),n(),r.addEventListener("resize",n),r.addEventListener("scroll",n,!0),this.#t=()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n,!0)},this.calendarView.focusDay()}cleanupCalendar(){this.#t?.(),this.#t=null,this.calendarButton.setAttribute("aria-expanded","false")}closeCalendar(){this.#e&&this.calendarPopup.hidePopover(),this.#e=!1,this.cleanupCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.calendarButton.hidden=!this.parameters.calendar,this.calendarButton.disabled=this.control.disabled||this.control.readOnly,!this.parameters.calendar||this.calendarButton.disabled?this.closeCalendar():this.#e&&this.calendarView.configure({value:this.readControlValue(),locale:this.context().locale,workdate:this.parameters.workdate}),n}writeControlValue(e){super.writeControlValue(e),this.#e&&this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate})}releaseControl(){this.closeCalendar(),super.releaseControl()}context(){return{...super.context(),dtype:"D",pattern:this.parameters.format??"short"}}static validationValueCheck(){return Kr}checkValue(e){Kr(e)}editText(e,r){return this.pageContext.format(e,{...r,pattern:"short"})}dateExpression(e,r){let n=new Date,i=this.parameters.workdate??`${n.getFullYear()}-${Qr(n.getMonth()+1)}-${Qr(n.getDate())}`,a={locale:r.locale,workdate:i},s=Ca(e,a);if(!s.ok)throw new Error(s.error.message);if(s.kind!=="date"&&!this.parameters.period_to)throw new Error("Enter one complete date, not a period.");return s}acceptDraft(e,r,n){if(!r?.trim()||!this.parameters.period_to)return;let i=this.dateExpression(r,n);i.kind==="period"&&this.pageContext.periodOutput(this.parameters.period_to,new Date(i.end+"T00:00:00Z"))}parse(e,r){let n=this.dateExpression(e,r),[i,a,s]=(n.kind==="date"?n.date:n.start).split("-").map(Number),o=new Date(0);return o.setUTCFullYear(i,a-1,s),o}},Pl=t=>class extends t{context(){return{...super.context(),dtype:"H",pattern:this.parameters.format??"short"}}static validationValueCheck(){return Ml}checkValue(e){Ml(e)}editText(e){return`${Qr(e.getUTCHours())}:${Qr(e.getUTCMinutes())}:${Qr(e.getUTCSeconds())}`+(e.getUTCMilliseconds()?`.${String(e.getUTCMilliseconds()).padStart(3,"0")}`:"")}parse(e){let r=/^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e.trim());if(!r||+r[1]>23||+r[2]>59||+(r[3]??0)>59)throw new Error("Enter HH:mm or HH:mm:ss, using the 24-hour clock.");return new Date(Date.UTC(1970,0,1,+r[1],+r[2],+(r[3]??0),+(r[4]??"").padEnd(3,"0")))}};function Il(t,e){if(t!==null&&!(typeof t=="number"&&Number.isFinite(t))&&!(e(t)&&Fp(t)))throw new TypeError("Expected a finite number or Decimal")}function Ml(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCFullYear()!==1970||t.getUTCMonth()!==0||t.getUTCDate()!==1))throw new TypeError("Expected a civil time on the TYTX epoch date")}import{Bag as qp}from"@gramlot/gramlot";var Oa=["select","notnull","empty","case","len","min","max","email","regex","call","remote"],jp=["nodup","exist","gridnodup"],si=t=>t==null||t==="",Na=(t,e)=>t instanceof Promise?t.then(e):e(t);function Ba(t,e,r={}){let n={value:t,modified:!1,error:null,warnings:[],issues:[],datachanges:[]},i=Object.fromEntries(Object.entries(e).map(([u,c])=>[u.slice(9),c])),a=u=>Object.hasOwn(e,`validate_${u}`)&&e[`validate_${u}`]!=null;for(let u of jp)if(a(u))throw new Error(`validate_${u} requires the DB/grid integration.`);let s=(u,c,d=!1)=>r.invoke(u,e[u],{...i,value:c,result:n,validations:i,userChange:!0,signal:r.signal},d),o=(u,c)=>{if(c==null||c===!0)return;if(typeof c!="boolean"&&typeof c!="string"&&(typeof c!="object"||Array.isArray(c)))throw new TypeError("A validator returns true, false, null, an error code, or a result object/Bag.");let d=`validate_${u}`,f=c instanceof qp?Object.fromEntries(c.getNodes().map(_=>[_.label,_.value])):typeof c=="object"?c:{errorcode:c===!1?"error":c};if(Object.hasOwn(f,"value")&&(n.modified||=!Object.is(n.value,f.value),n.value=f.value),f.data!=null&&(r.checkDataPatch(f.data),n.datachanges.push(f.data)),!f.errorcode)return;let p=e[`${d}_iswarning`]??f.iswarning??!!(e[`${d}_warning`]&&!e[`${d}_error`]),h=e[`${d}_${f.errorcode}`]||e[`${d}_${p?"warning":"error"}`]||f.message||e[`${d}_${p?"error":"warning"}`]||String(f.errorcode),m=lr(h,_=>_?{...i,...f,value:n.value}[_]:n.value);if(m==null)throw new Error("A validation message references a missing value.");let g={rule:u,code:f.errorcode,severity:p?"warning":"error",message:m};n.issues.push(g),p?n.warnings.push(m):(n.error=m,n.required=!!f.required)},l=u=>{if(r.signal?.aborted)throw r.signal.reason;if(n.error||u===Oa.length)return n;let c=Oa[u],d=`validate_${c}`,f=e[d];if(!a(c)||f===!1&&c!=="empty")return l(u+1);let p=m=>{if(!m)return l(u+1);let g;return c==="remote"&&n.value==null?l(u+1):(c==="call"?g=s(d,n.value):c==="remote"?g=r.remote(f,{...Vp(e),value:n.value},r.signal):g=zp(c,f,n.value,r),Na(g,_=>{if(r.signal?.aborted)throw r.signal.reason;let v=()=>(o(c,_),l(u+1));return c==="remote"&&e.validate__onResult?Na(r.invoke("validate__onResult",e.validate__onResult,{result:_,value:n.value,validations:i,signal:r.signal}),v):v()}))},h=e[`${d}_if`];return Na(h==null?!0:typeof h=="boolean"?h:s(`${d}_if`,n.value,!0),p)};return l(0)}function Vp(t){let e=new Set(["if","error","warning","iswarning"]);return Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith("validate_remote_")&&!e.has(r.slice(16))).map(([r,n])=>[r.slice(16),n]))}function tn(t,e,r={}){return{errorcode:t,message:e,...r}}function zp(t,e,r,n){if(t==="select")return n.selection(r,n.signal);if(t==="notnull")return si(r)&&e?tn("notnull","A value is required.",{required:!0}):null;if(t==="empty")return si(r)?{value:e}:null;if(t==="len"){if(typeof e!="string"||!/^(?:\d+|\d+:\d*|:\d+)$/.test(e))throw new Error("Invalid validate_len: use a length or min:max.");let[i,a]=e.split(":"),s=Number(i||0),o=a===void 0?s:a===""?1/0:Number(a);if(s>o)throw new Error("Invalid validate_len: minimum exceeds maximum.");if(si(r))return;if(typeof r!="string")throw new TypeError("validate_len requires a text value.");return r.length<s||r.length>o?tn(s===o?"wrong length":r.length<s?"too short":"too long",s===o?`Enter exactly ${s} characters.`:o===1/0?`Enter at least ${s} characters.`:s===0?`Enter no more than ${o} characters.`:`Enter between ${s} and ${o} characters.`):void 0}if(!si(r)){if(t==="case"){if(typeof r!="string")throw new TypeError("validate_case requires a text value.");switch(e){case"upper":case"u":return{value:r.toUpperCase()};case"lower":case"l":return{value:r.toLowerCase()};case"title":case"t":return{value:r.replace(/\p{L}[\p{L}\p{M}]*/gu,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())};case"capitalize":case"c":return{value:r[0].toUpperCase()+r.slice(1).toLowerCase()};default:throw new Error("Invalid validate_case: use upper, lower, title or capitalize.")}}if(t==="min"||t==="max"){let i;if(n.isDecimal?.(r))i=r.comparedTo(e);else if(r instanceof Date&&e instanceof Date)i=r.getTime()-e.getTime();else if(typeof r=="number"&&Number.isFinite(r)&&typeof e=="number"&&Number.isFinite(e))i=r-e;else throw new TypeError(`validate_${t} requires matching numeric or date/time values.`);return(t==="min"?i<0:i>0)?tn(t,`Value must be ${t==="min"?"at least":"at most"} ${e}.`):void 0}if(t==="email"){if(typeof r!="string")throw new TypeError("validate_email requires a text value.");return/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(r)?null:tn("email","Check email format.",{iswarning:!0})}if(t==="regex"){if(typeof r!="string"||typeof e!="string")throw new TypeError("validate_regex requires text.");let i=e.trim(),a=i.startsWith("!");return new RegExp(a?i.slice(1):i,"u").test(r)!==a?null:tn("regex","The value does not match the required pattern.")}}}var rn={dtype:"T",nullable:!0,binding:"read"},oi={dtype:"B",nullable:!0,binding:"read"},Sa={dtype:["T","L","N","R","B","D","H","DH","DHZ"],nullable:!0,binding:"read"},$l={validate_select:oi,validate_notnull:{...oi,default:!1},validate_empty:Sa,validate_case:{...rn,enum:["upper","lower","title","capitalize","u","l","t","c"]},validate_len:rn,validate_min:Sa,validate_max:Sa,validate_email:oi,validate_regex:rn,validate_call:{dtype:"T",nullable:!0},validate_remote:rn,validate_onAccept:{dtype:"T",nullable:!0},validate_onReject:{dtype:"T",nullable:!0},validate__onResult:{dtype:"T",nullable:!0},validate_timeout:{dtype:"L",nullable:!0,binding:"read"},...Object.fromEntries(Oa.flatMap(t=>[[`validate_${t}_if`,{dtype:["T","B"],nullable:!0}],[`validate_${t}_iswarning`,oi],...["error","warning"].map(e=>[`validate_${t}_${e}`,{...rn,qualification:"intl_str"}])]))};var li=class{epoch=0;controller=null;cancel(){this.epoch++,this.controller?.abort(),this.controller=null}start(e,r,n,i,a,s=()=>{}){this.cancel();let o=new AbortController,l=this.epoch;this.controller=o;let u=n.validationCurrent(),c=()=>l===this.epoch&&!o.signal.aborted&&u(),d=m=>({value:e,modified:!1,error:m.message,warnings:[],issues:[],datachanges:[]}),f=!1,p=m=>{if(f||!c())return{ok:!1};f=!0,this.controller=null;let g={ok:!m.error,value:m.value,result:m,rules:r,isCurrent:c};return a(g),g},h;try{if(r.validate_timeout!=null&&(!Number.isInteger(r.validate_timeout)||r.validate_timeout<=0))throw new TypeError("validate_timeout must be a positive integer in milliseconds.");h=i(e,r,{...n,signal:o.signal})}catch(m){return p(d(m))}return h instanceof Promise?(s(),new Promise(m=>{let g,_=()=>{clearTimeout(g),m({ok:!1})};o.signal.addEventListener("abort",_,{once:!0});let v=w=>{clearTimeout(g),o.signal.removeEventListener("abort",_);try{m(p(w))}catch(E){n.reportError(E,"Validation completion failed"),m({ok:!1})}};r.validate_timeout!=null&&(g=setTimeout(()=>{v(d(new Error("Validation timed out."))),o.abort()},r.validate_timeout)),h.then(v,w=>v(d(w)))})):p(h)}};var Hp=1800,Ul=200;function X(t){return class extends t{get supportsFormValidation(){return!0}static validationParameters(e){let r={...gi(this.gramlotComponent,e),...e};return this.constrained&&r.validate_select==null&&(r.validate_select=!0),r}static get validationExecutor(){return Ba}get validationExecutor(){return this.constructor.validationExecutor}connectedCallback(){super.connectedCallback(),this.pageContext?.form&&this.pageContext.formValidate()}#e=!1;#t;#n;#r;#a=new li;#i;#s={};validationResult=null;constructor(){super(),this.message=this.ownerDocument.createElement("small"),this.message.id="field-message",this.message.hidden=!0,this.message.setAttribute("aria-live","polite"),this.message.setAttribute("popover","manual"),this.message.setAttribute("role","tooltip");let e=this.ownerDocument.createElement("style");e.textContent=`#control[aria-invalid="true"]{background:var(--gramlot-error-background,#fff1f0)}
|
|
82
97
|
input#control[aria-invalid="true"],textarea#control[aria-invalid="true"]{color:var(--gramlot-error,#8c1d18)}
|
|
83
98
|
#field-message{position:fixed;inset:auto;margin:0;padding:.4em .65em;border:1px solid var(--gramlot-error,#b3261e);border-radius:var(--gramlot-radius-sm,4px);
|
|
84
99
|
color:var(--gramlot-error,#8c1d18);background:var(--gramlot-error-background,#fff1f0);font:inherit;font-size:.85em;box-shadow:var(--gramlot-shadow,0 2px 8px #0003);
|
|
85
|
-
max-width:min(28em,var(--gramlot-popup-available-width,100vw));max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;overflow-wrap:anywhere;opacity:1;transition:opacity ${
|
|
100
|
+
max-width:min(28em,var(--gramlot-popup-available-width,100vw));max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;overflow-wrap:anywhere;opacity:1;transition:opacity ${Ul}ms ease-out}
|
|
86
101
|
#field-message[data-severity="warning"]{color:var(--gramlot-warning,#805600);border-color:var(--gramlot-warning,#805600);background:var(--gramlot-warning-background,#fff8df)}
|
|
87
102
|
#field-message[data-fading]{opacity:0}
|
|
88
|
-
@media(prefers-reduced-motion:reduce){#field-message{transition:none}}`,this.shadowRoot.append(e),this.control.setAttribute("aria-describedby",this.message.id),this.controlBox.append(this.message),this.control.addEventListener("input",()=>this.cancelValidation()),this.control.addEventListener("compositionstart",()=>this.cancelValidation()),this.control.addEventListener("focusin",()=>this.#u()),this.control.addEventListener("mouseenter",()=>this.#u()),this.control.addEventListener("keydown",r=>{r.key==="Escape"&&(this.cancelValidation(),this.#o())})}#o(){this.ownerDocument.defaultView.clearTimeout(this.#n),this.#r?.abort(),this.#r=null,this.message.hidden||this.message.hidePopover(),this.message.hidden=!0,this.message.removeAttribute("data-fading")}#u(){if(!this.message.textContent||!this.isConnected)return;this.#o();let e=this.ownerDocument.defaultView;this.message.hidden=!1,this.message.showPopover(),
|
|
89
|
-
`),this.#u())}validateCandidate(e,r){if(this.pageContext.form){let n=this.validationSelection();return r(e),this.pageContext.formValidateCandidate(e,n)}return this.cancelValidation(),this.#i=this.pageContext.validationCurrent(),this.#a.start(e,this.#s,{...this.pageContext,selection:n=>this.validateSelection(n)},
|
|
103
|
+
@media(prefers-reduced-motion:reduce){#field-message{transition:none}}`,this.shadowRoot.append(e),this.control.setAttribute("aria-describedby",this.message.id),this.controlBox.append(this.message),this.control.addEventListener("input",()=>this.cancelValidation()),this.control.addEventListener("compositionstart",()=>this.cancelValidation()),this.control.addEventListener("focusin",()=>this.#u()),this.control.addEventListener("mouseenter",()=>this.#u()),this.control.addEventListener("keydown",r=>{r.key==="Escape"&&(this.cancelValidation(),this.#o())})}#o(){this.ownerDocument.defaultView.clearTimeout(this.#n),this.#r?.abort(),this.#r=null,this.message.hidden||this.message.hidePopover(),this.message.hidden=!0,this.message.removeAttribute("data-fading")}#u(){if(!this.message.textContent||!this.isConnected)return;this.#o();let e=this.ownerDocument.defaultView;this.message.hidden=!1,this.message.showPopover(),Te(this.message,this.control),this.#n=e.setTimeout(()=>{this.message.hidden||(this.message.setAttribute("data-fading",""),this.#n=e.setTimeout(()=>this.#o(),Ul))},Hp),this.#r=new e.AbortController;let r={capture:!0,signal:this.#r.signal};e.addEventListener("scroll",()=>this.#o(),r),e.addEventListener("resize",()=>this.#o(),r)}releaseControl(){this.#a.cancel(),this.#o(),super.releaseControl()}disconnectedCallback(){this.releaseControl()}setFieldState({invalid:e=!1,pending:r=!1}={}){this.control.setAttribute("aria-invalid",String(e)),this.control.setAttribute("aria-busy",String(r))}error(e){this.#e=!1,["input","textarea"].includes(this.control.localName)&&this.control.setCustomValidity(e),this.control.setAttribute("aria-invalid",String(!!e)),this.message.textContent=e,e?this.#u():this.#o()}restoreFormValue(e){this.error(""),this.#e=!1,super.restoreFormValue(e)}cancelValidation(){this.pageContext?.form&&this.pageContext.formCancelValidation(),this.#a.cancel(),this.#i=null,this.control.setAttribute("aria-busy","false")}presentValidation(e){this.validationResult=e,this.control.setAttribute("aria-busy","false"),this.error(e.error||""),this.message.dataset.severity=e.error?"error":"warning",this.#e=!!e.error,!e.error&&e.warnings.length&&(this.message.textContent=e.warnings.join(`
|
|
104
|
+
`),this.#u())}validateCandidate(e,r){if(this.pageContext.form){let n=this.validationSelection();return r(e),this.pageContext.formValidateCandidate(e,n)}return this.cancelValidation(),this.#i=this.pageContext.validationCurrent(),this.#a.start(e,this.#s,{...this.pageContext,selection:n=>this.validateSelection(n)},Ba,n=>{if(this.#i=null,n.ok)try{r(n.value)}catch(i){n.ok=!1,n.result.error=i.message}this.presentValidation(n.result),n.ok||this.finishValidation(n)},()=>this.control.setAttribute("aria-busy","true"))}finishValidation(e){e.result&&this.pageContext.finishValidation(e)}shouldProjectControlValue(e){!this.pageContext?.form&&this.#i&&!this.#i()&&this.cancelValidation();let r=this.sameControlValue(e,this.#t);return r&&this.#e?!1:(!r&&!this.pageContext?.form&&this.cancelValidation(),this.#t=e,!r&&this.#e&&this.error(""),!0)}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=Object.fromEntries(Object.entries(e).filter(([l])=>l.startsWith("validate_"))),a=new Set([...Object.keys(i),...Object.keys(this.#s)]);!this.pageContext?.form&&([...a].some(l=>!Object.is(i[l],this.#s[l]))||e.disabled||e.readonly)&&this.cancelValidation();let s=[...a].some(l=>!Object.is(i[l],this.#s[l]));this.#s=i,s&&this.pageContext?.form&&this.pageContext.formValidate();for(let l of Object.keys(i))delete n[l];let o=!!this.parameters.validate_notnull;return this.control.setAttribute("aria-required",String(o)),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.required=o),n}}}X.parameters=$l;import{Bag as Wp}from"@gramlot/gramlot";function It(t){return class extends pe(t){#e;#t=[];#n=-1;#r=0;#a=!1;#i=!1;#s=null;#o;#u;#f;#c;#l=!1;#d;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=ln+`.option{position:relative} #control{width:100%;padding-right:calc(var(--gramlot-choice-toggle-width,1.6em) + .2em)}
|
|
90
105
|
#control:focus-visible{outline:1px solid var(--gramlot-border-control,#7a8798);outline-offset:-3px}
|
|
91
|
-
|
|
106
|
+
|
|
92
107
|
.choices{min-width:min(var(--gramlot-choice-popup-min-width,0px),var(--gramlot-popup-available-width,100vw));max-width:var(--gramlot-popup-available-width,100vw);position:fixed;inset:auto;margin:0;padding:var(--gramlot-popup-padding,4px);box-sizing:border-box;max-height:min(var(--gramlot-choice-max-height,20rem),var(--gramlot-popup-available-height,100vh));overflow:auto;
|
|
93
108
|
border:1px solid var(--gramlot-border-control,#aab4c2);border-radius:var(--gramlot-radius-sm,4px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);font:inherit;font-size:var(--gramlot-field-font-size,1em);line-height:1.4;box-shadow:var(--gramlot-shadow,0 3px 9px #0002)}
|
|
94
109
|
.choices[hidden]{display:none} .choice{min-height:var(--gramlot-touch-target,0px);display:flex;align-items:center;padding:var(--gramlot-choice-item-padding,.25em .5em);border-radius:var(--gramlot-radius-sm,4px);cursor:pointer}
|
|
95
110
|
.choice:nth-child(even){background:var(--gramlot-choice-alternate-background,var(--gramlot-surface-subtle,transparent))}
|
|
96
111
|
.choice:hover{background:var(--gramlot-selected,Highlight)}
|
|
97
112
|
.choice-detail{margin-inline-start:var(--gramlot-space-3,.75rem);color:var(--gramlot-text-secondary,GrayText)}
|
|
98
|
-
.choice[aria-selected=true]{background:var(--gramlot-selected,Highlight);color:var(--gramlot-ink,HighlightText)}`,this.toggle=e.createElement("button"),this.toggle.className="toggle",this.toggle.type="button",this.toggle.tabIndex=-1,this.toggle.textContent="\u25BE",this.toggle.setAttribute("aria-label","Show options"),this.control.parentElement.append(this.toggle),this.choices=e.createElement("div"),this.choices.id="choices",this.choices.className="choices",this.choices.hidden=!0,this.choices.setAttribute("role","listbox"),this.choices.setAttribute("popover","manual"),this.controlBox.append(r,this.choices),this.toggle.addEventListener("mousedown",n=>n.preventDefault()),this.toggle.addEventListener("click",()=>{this.locked||(this.control.focus(),this.#a?this.closeChoices():this.search(""))}),this.choices.addEventListener("mousedown",n=>n.preventDefault()),this.control.addEventListener("input",n=>{this.#i=!0,this.#s=null,n.isComposing||this.scheduleSearch(this.control.value)}),this.control.addEventListener("compositionend",()=>this.scheduleSearch(this.control.value)),this.control.addEventListener("keydown",n=>{if(!(n.isComposing||this.locked))if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault();let i=n.key==="ArrowDown"?1:-1;this.#a?this.activate(this.#n<0?i>0?0:this.#t.length-1:Math.max(0,this.#n+i)):this.search("",i)}else n.key==="Enter"?(n.preventDefault(),this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.commitDraft()):n.key==="Escape"&&(this.closeChoices(),this.#i=!1,this.#s=null,this.constrained?this.resolveValue():(this.control.value=this.#e??"",this.error("")))}),this.control.addEventListener("blur",()=>{!this.autoHighlight&&this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.#i&&this.commitDraft(),this.closeChoices()})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls","choices"),e.setAttribute("aria-expanded","false"),e.autocomplete="off",e}get constrained(){return!0}get revalidateDraftOnSourceChange(){return!1}get autoHighlight(){return!0}get matchTypedChoice(){return!0}get emptyChoice(){return null}get choiceSource(){return this.parameters.store??this.parameters.callback??this.parameters.values}get searchDelay(){return 0}textValue(e){return e}selectionAccepted(e){}selectionResolved(e){}renderChoice(e,r){r.textContent=e.caption}scheduleSearch(e){if(this.closeChoices(),!this.searchDelay)return this.search(e);this.#d=setTimeout(()=>{this.#d=null,this.search(e)},this.searchDelay)}get commitOnChange(){return this.constrained}get locked(){return this.control.disabled||this.control.readOnly}get active(){return this.isConnected&&this.pageContext?.isActive()}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.choiceSource,a=i!==this.#o||this.parameters.separator!==this.#u;return this.#u=this.parameters.separator,this.#o=i,this.toggle.disabled=this.locked,a&&this.revalidateDraftOnSourceChange&&(this.#i=!1),a&&(this.#t=[],this.#s=null),(a||this.locked)&&this.closeChoices({cancelLookup:a}),a&&this.active&&!this.#i&&this.resolveValue(),n}setPageContext(e){super.setPageContext(e),this.resolveValue()}connectedCallback(){super.connectedCallback(),this.resolveValue()}readControlValue(){return this.#e}writeControlValue(e){Object.is(e,this.#e)||(this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue())}restoreFormDraft(e){this.closeChoices({cancelLookup:!0}),this.#i=!0,this.#s=null,this.control.value=e}restoreFormValue(e){this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue()}validationValueCheck(){let e=this.constrained;return(r,n)=>{if(e&&r!==n)throw new Error("Validation cannot replace a selected code; update the Data explicitly.")}}validationSelection(){if(!this.constrained)return super.validationSelection();let e=this.#t.map(({id:n,error:i})=>({id:n,error:i})),r=this.#s?{id:this.#s.id,error:this.#s.error}:null;return n=>{let i=r?.id===n?r:e.find(a=>a.id===n);return i?.error?{errorcode:"condition",message:i.error}:n==null||i?!0:{errorcode:"missing",message:"Choose a value from the list."}}}acceptControlValue(){if(!this.#i)return this.validateCandidate(this.#e,a=>this.writeControlValue(a));let e=this.#s??(!this.autoHighlight&&this.#a?this.#t[this.#n]:null),r=e&&!this.constrained?e.caption:this.control.value,n=e?[e]:this.matchTypedChoice?this.#t.filter(a=>a.caption===r):[];if(this.constrained&&r!==""&&n.length!==1)return this.error("Choose a value from the list."),{ok:!1};let i=this.constrained?r===""?null:n[0].id:this.textValue(r);return this.validateCandidate(i,a=>{this.validationValueCheck()(a,i),this.#e=a,this.#i=!1,this.#s=null,(a==null||!this.constrained)&&(this.control.value=a??""),this.selectionAccepted(n.length===1&&a===i&&n[0].id!==null?n[0]:null),e&&!this.autoHighlight&&this.closeChoices()})}commitDraft(){this.closeChoices();let e=this.ownerDocument.defaultView.Event;this.control.dispatchEvent(new e("change",{bubbles:!0}))}choose(e){this.locked||!this.active||(this.pageContext.form&&this.pageContext.formSelectionError(e.error??""),this.#s=e,this.#i=!0,this.control.value=e.id===null?"":e.caption,this.closeChoices(),this.commitDraft())}async request(e,{selection:r=!1}={}){this.#c?.abort();let n=new AbortController;this.#c=n,this.#l=r||Object.hasOwn(e,"_id"),this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!0);let i=++this.#r;this.control.setAttribute("aria-busy","true"),this.error("");try{let a=await this.loadChoices(e,n.signal);return i!==this.#r||!this.active?null:a}catch(a){return i===this.#r&&this.active&&(this.error(a.message),this.pageContext.form&&this.#l&&this.pageContext.formSelectionError(a.message)),null}finally{i===this.#r&&(this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c=null,this.#l=!1,this.control.setAttribute("aria-busy","false"))}}async resolveValue(){if(this.#e==null||this.#e===""){this.pageContext?.form&&(this.pageContext.formSelectionPending(!1),this.pageContext.formSelectionError("")),this.control.value="",this.error(""),this.active&&this.selectionResolved(null);return}if(!this.active)return;if(this.control.value=this.#e,!this.constrained){this.error(""),this.selectionResolved(null);return}let e=this.request({_id:this.#e}),r=this.#r,n=await e;if(!n){r===this.#r&&this.active&&(this.selectionResolved(null),this.pageContext.form&&this.pageContext.formValidate());return}let i=n.find(s=>s.id===this.#e);this.#t=n,this.control.value=i?i.caption:this.#e;let a=i?i.error??"":"Value is not in the list.";this.error(a),this.pageContext.form&&(this.pageContext.formSelectionError(a),this.pageContext.formValidate()),this.selectionResolved(i??null)}async search(e,r=0){if(this.locked||!this.active)return;this.closeChoices(),this.#t=[];let n=await this.request({_querystring:e});if(!n||this.locked||this.shadowRoot.activeElement!==this.control)return;let i=this.emptyChoice;this.#t=i?[i,...n]:n;let a=this.ownerDocument;this.choices.replaceChildren(...this.#t.map((f,p)=>{let h=a.createElement("div");return h.id=`choice-${p}`,h.className="choice",h.setAttribute("role","option"),this.renderChoice(f,h),h.addEventListener("click",()=>this.choose(f)),h})),this.#t.length||(this.choices.textContent="No results");let s=a.defaultView;this.choices.hidden=!1,this.choices.showPopover(),this.#a=!0;let o=parseFloat(s.getComputedStyle(this).getPropertyValue("--gramlot-choice-popup-inset")||"2");ft(this.choices,this.control,{matchWidth:!0,inset:o}),this.control.setAttribute("aria-expanded","true");let l=this.constrained&&!this.#i&&e===""&&this.#e!=null;this.activate(l?this.#t.findIndex(f=>f.id===this.#e):r<0?this.#t.length-1:r>0?0:this.autoHighlight&&n.length?i?1:0:-1);let u=()=>this.closeChoices(),c=f=>{f.composedPath().includes(this)||u()},d=f=>{f.composedPath().includes(this.choices)||u()};a.addEventListener("pointerdown",c,!0),a.addEventListener("scroll",d,!0),s.addEventListener("resize",u),this.#f=()=>{a.removeEventListener("pointerdown",c,!0),a.removeEventListener("scroll",d,!0),s.removeEventListener("resize",u)}}activate(e){this.#n=this.#t.length&&e>=0?Math.min(e,this.#t.length-1):-1;for(let[r,n]of[...this.choices.children].entries())n.setAttribute("aria-selected",String(r===this.#n)),r===this.#n&&n.scrollIntoView({block:"nearest"});this.#n<0?this.control.removeAttribute("aria-activedescendant"):this.control.setAttribute("aria-activedescendant",`choice-${this.#n}`)}closeChoices({cancelLookup:e=!1}={}){clearTimeout(this.#d),this.#d=null,(e||!this.#l)&&(this.pageContext?.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c?.abort(),this.#c=null,this.#l=!1,++this.#r,this.control.setAttribute("aria-busy","false")),this.#f?.(),this.#f=null,this.#a&&this.choices.hidePopover(),this.#a=!1,this.choices.hidden=!0,this.control.setAttribute("aria-expanded","false"),this.control.removeAttribute("aria-activedescendant")}releaseControl(){this.closeChoices({cancelLookup:!0})}disconnectedCallback(){this.releaseControl()}}}Bt.parameters={...pe.parameters,value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}};function Ta(t){return class extends t{loadChoices(e){let r;if(this.parameters.store!=null){if(!(this.parameters.store instanceof Lp))throw new TypeError("store must be a Bag");if(this.parameters.values)throw new TypeError("store and values are mutually exclusive");let n=new Set;r=this.parameters.store.getNodes().map(i=>{let a=i.staticValue,s=i.attr.caption;if(typeof a!="string"||!a||typeof s!="string"||n.has(a))throw new TypeError("Invalid or duplicate store choice");return n.add(a),{id:a,caption:s}})}else r=Kn(this.parameters.values??"",this.parameters.separator);return r.filter(n=>Object.hasOwn(e,"_id")?n.id===e._id:n.caption.toLocaleLowerCase().includes(e._querystring.toLocaleLowerCase()))}}}function Ol(t){return class extends t{async loadChoices(e){let r=await this.pageContext.callLogic(this.parameters.callback,e);if(!r||!Array.isArray(r.rows)||typeof r.identifier!="string"||typeof r.caption!="string")throw new TypeError("callbackSelect requires {rows, identifier, caption}");let n=new Set;return r.rows.map(i=>{let a=i[r.identifier],s=i[r.caption];if(typeof a!="string"||!a||typeof s!="string"||n.has(a))throw new TypeError("Invalid or duplicate choice code/caption");return n.add(a),{id:a,caption:s}})}}}import{createDOMPurify as Pp}from"@gramlot/gramlot";var Na={dbtable:{dtype:"T",binding:"read"},caption_field:{dtype:"T",binding:"read"},condition:{dtype:"T",binding:"read"},weakCondition:{dtype:["B","T"],default:!1,binding:"read"},method:{dtype:"T",default:"dbSelect",binding:"read"},columns:{dtype:"T",binding:"read"},hiddenColumns:{dtype:"T",binding:"read"},auxColumns:{dtype:"T",binding:"read"},template:{dtype:"T",binding:"read"},templateNull:{dtype:"T",default:"",binding:"read"},order_by:{dtype:"T",binding:"read"},limit:{dtype:"L",default:10,binding:"read"},searchDelay:{dtype:"L",default:300,binding:"read"},ignoreCase:{dtype:"B",default:!0,binding:"read"},hasDownArrow:{dtype:"B",default:!0,binding:"read"},emptyLabel:{dtype:"T",qualification:"intl_str",default:"Clear selection",binding:"read"},selectedCaption:{dtype:"T"},selectedRecord:{dtype:"T"},selectedCb:{dtype:"T"}},Ca=["dbtable","method","caption_field","columns","hiddenColumns","auxColumns","order_by","limit","ignoreCase","condition","weakCondition"];function Sa(t){return class extends t{#e={};#t=!1;#n={};#r=0;#a;#i;#s;constructor(){super(),this.#s=Pp(this.ownerDocument.defaultView)}get choiceSource(){return this.#r}get searchDelay(){return this.parameters.searchDelay}get revalidateDraftOnSourceChange(){return this.constrained}get autoHighlight(){return this.constrained}get matchTypedChoice(){return this.constrained}get emptyChoice(){return this.constrained&&!this.parameters.validate_notnull?{id:null,caption:this.parameters.emptyLabel}:null}get commitOnChange(){return!0}textValue(e){return e===""?null:e}projectAttributes(e,r){let n=Object.fromEntries(Object.entries(e).filter(([c])=>Ca.includes(c)||["autoSelect","template","templateNull","emptyLabel","validate_notnull"].includes(c)||c.startsWith("condition_")||c.startsWith("selected_"))),i=new Set([...Object.keys(n),...Object.keys(this.#e)].filter(c=>c==="condition"||c==="weakCondition"||c.startsWith("condition_")));Object.keys(this.#e).length&&[...i].some(c=>!Object.is(n[c],this.#e[c]))&&(this.#t=!0),[...new Set([...Object.keys(n),...Object.keys(this.#e)])].some(c=>!Object.is(n[c],this.#e[c]))&&(this.cancelValidation(),this.#a=void 0,this.#e=n,this.#r++),this.#n=Object.fromEntries(Object.entries(e).filter(([c])=>c.startsWith("selected_")));let s=super.projectAttributes(e,r);if(this.#i=null,this.parameters.template!=null){this.#i=this.#s.sanitize(this.parameters.template,{USE_PROFILES:{html:!0},RETURN_DOM_FRAGMENT:!0,FORBID_TAGS:["style","form","input","button","select","textarea","a","audio","video","details","summary"],FORBID_ATTR:["id","name","role","tabindex","contenteditable","autofocus"]});for(let c of this.#i.querySelectorAll("*"))if([...c.attributes].some(d=>/\{[A-Za-z0-9_]+\}/.test(d.value)))throw this.#i=null,new TypeError("Selector template placeholders belong in text, not HTML attributes.")}if(this.choices.style.minWidth=this.#i?"min(var(--gramlot-choice-popup-min-width,28rem),var(--gramlot-popup-available-width,100vw))":"",this.parameters.caption_field!=null&&!this.parameters.caption_field.trim())throw new TypeError("caption_field must be a nonempty field name.");if(this.parameters.condition!=null&&!this.parameters.condition.trim())throw new TypeError("condition must be a nonempty expression.");if(typeof this.parameters.weakCondition!="boolean"&&(typeof this.parameters.weakCondition!="string"||!this.parameters.weakCondition.trim()))throw new TypeError("weakCondition must be boolean or a nonempty expression.");let{limit:o,searchDelay:l,hasDownArrow:u}=this.parameters;if(!Number.isInteger(o)||o<1)throw new TypeError("limit must be a positive integer.");if(!Number.isInteger(l)||l<0)throw new TypeError("searchDelay must be a non-negative integer.");this.toggle.hidden=!u,this.control.style.paddingRight=u?"":"var(--gramlot-field-padding, .25em)";for(let c of Object.keys(s))(c.startsWith("condition_")||c.startsWith("selected_"))&&delete s[c];return s}async loadChoices(e,r){let n=Object.fromEntries(Ca.filter(o=>o!=="method"&&this.parameters[o]!=null).map(o=>[o,this.parameters[o]]));n.weakCondition===!1&&delete n.weakCondition;let i=new Set(Object.entries(this.#n).filter(([,o])=>o).map(([o])=>o.slice(9)));if(this.#i){let o=this.ownerDocument.createTreeWalker(this.#i,4);for(;o.nextNode();)for(let l of o.currentNode.data.matchAll(/\{([A-Za-z0-9_]+)\}/g))i.add(l[1])}i.size&&(n.hiddenColumns=[...new Set([...(n.hiddenColumns??"").split(",").map(o=>o.trim()).filter(Boolean),...i])].join(","));for(let[o,l]of Object.entries(this.#e))if(o.startsWith("condition_")){let u=o.slice(10);if(!u||u.startsWith("_")||Ca.includes(u))throw new TypeError("Invalid condition parameter.");n[u]=l}let a=await this.pageContext.remote(this.parameters.method,{...n,...e},r);if(!a||!Array.isArray(a.rows)||typeof a.identifier!="string"||typeof a.caption!="string")throw new TypeError("Database selectors require {rows, identifier, caption}.");if(n.auxColumns!=null){if(!Array.isArray(a.columns)||!Array.isArray(a.headers)||a.columns.length!==a.headers.length||!a.columns.length||a.columns.some(o=>typeof o!="string"||!o)||a.headers.some(o=>typeof o!="string")||new Set(a.columns).size!==a.columns.length)throw new TypeError("auxColumns requires columns and headers display metadata.");for(let o of a.columns)i.add(o)}if(a.errors!=null&&(typeof a.errors!="string"||!Object.hasOwn(e,"_id")))throw new TypeError("Selector errors must be literal text attached to identity lookup.");let s=new Set;return a.rows.map(o=>{let l=o[a.identifier],u=o[a.caption];if(!(typeof l=="string"&&l.length||Number.isSafeInteger(l))||typeof u!="string"||s.has(l))throw new TypeError("Invalid or duplicate database choice identity/caption.");for(let c of i)if(!Object.hasOwn(o,c))throw new TypeError(`Missing requested selector column: ${c}`);return s.add(l),{id:l,caption:u,record:o,error:a.errors,captionField:a.caption,columns:n.auxColumns!=null?a.columns:null,headers:n.auxColumns!=null?a.headers:null}})}selectionAccepted(e){this.#a=e}renderChoice(e,r){if(e.id===null){super.renderChoice(e,r),r.style.color="var(--gramlot-text-secondary,GrayText)",r.style.borderBottom="1px solid var(--gramlot-border,#d5dce5)",r.style.marginBottom="var(--gramlot-space-1,.25rem)";return}if(this.#i){let n=this.#i.cloneNode(!0),i=this.ownerDocument.createTreeWalker(n,4);for(;i.nextNode();)i.currentNode.data=i.currentNode.data.replace(/\{([A-Za-z0-9_]+)\}/g,(a,s)=>e.record[s]==null?this.parameters.templateNull:String(e.record[s]));r.style.display="block",r.style.overflowWrap="anywhere",r.replaceChildren(n);return}if(e.columns){r.style.display="grid",r.style.gridTemplateColumns=`repeat(${e.columns.length}, minmax(0, 1fr))`,r.style.gap="var(--gramlot-space-3,.75rem)",r.style.alignItems="start",r.replaceChildren(...e.columns.map((n,i)=>{let a=this.ownerDocument.createElement("span");a.style.overflowWrap="anywhere";let s=this.ownerDocument.createElement("small");s.textContent=e.headers[i],s.style.display="block",s.style.opacity=".7";let o=this.ownerDocument.createElement("span");return o.textContent=e.record[n]??"",a.append(s,o),a}));return}super.renderChoice(e,r);for(let n of(this.parameters.columns??"").split(",").map(i=>i.trim()).filter(i=>i&&i!==e.captionField)){let i=this.ownerDocument.createElement("span");i.className="choice-detail",i.textContent=e.record[n]??"",r.append(i)}}selectionResolved(e){this.#o(e)}#o(e){let{selectedCaption:r,selectedRecord:n}=this.parameters;this.pageContext.selectionOutputs({selectedCaption:r,selectedRecord:n,fields:this.#n},e)}finishValidation(e){if(e.ok&&this.#a!==void 0){let r=this.#a;if(this.#a=void 0,this.#o(r),this.parameters.selectedCb){let n=i=>console.error("Selection notification failed:",i);try{let i=this.pageContext.callLogic(this.parameters.selectedCb,{value:e.value,record:r?.record??null});i instanceof Promise&&i.catch(n)}catch(i){n(i)}}}super.finishValidation(e)}async resolveValue(){let e=this.#t;if(this.#t=!1,e&&this.active&&!this.locked&&this.constrained&&this.parameters.validate_notnull){let i=await this.request({_querystring:"",limit:2},{selection:!0});if(!i)return;if(i.length===1){this.choose(i[0]);return}}let r=this.readControlValue(),n=super.resolveValue();if(r!=null&&r!=="")return n;if(await n,this.active&&!this.locked&&this.parameters.autoSelect&&this.readControlValue()==null&&this.control.value===""){let i=await this.request({_querystring:"",limit:2},{selection:!0});i?.length===1&&this.readControlValue()==null&&!this.locked&&this.choose(i[0])}}}}var $p=(0,P.defineComponent)({name:"textbox",tag:"gramlot-textbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:si("input","text")}),Up=(0,P.defineComponent)({name:"checkbox",tag:"gramlot-checkbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",binding:"twoWay"},mode:{dtype:"T",default:"checkbox",binding:"read",enum:["checkbox","switch"]},switch_color:{dtype:"T",nullable:!0,default:null,binding:"read"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="checkbox",e}constructor(){super();let e=this.ownerDocument.createElement("style");e.textContent=`input[role=switch]{appearance:none;position:relative;flex:none;cursor:pointer;
|
|
113
|
+
.choice[aria-selected=true]{background:var(--gramlot-selected,Highlight);color:var(--gramlot-ink,HighlightText)}`,this.toggle=e.createElement("button"),this.toggle.className="toggle choice-toggle",this.toggle.type="button",this.toggle.tabIndex=-1,this.control.parentElement.classList.add("choice-field"),this.toggle.setAttribute("aria-label","Show options"),this.control.parentElement.append(this.toggle),this.choices=e.createElement("div"),this.choices.id="choices",this.choices.className="choices",this.choices.hidden=!0,this.choices.setAttribute("role","listbox"),this.choices.setAttribute("popover","manual"),this.controlBox.append(r,this.choices),this.toggle.addEventListener("mousedown",n=>n.preventDefault()),this.toggle.addEventListener("click",()=>{this.locked||(this.control.focus({preventScroll:!0}),this.#a?this.closeChoices():this.search(""))}),this.choices.addEventListener("mousedown",n=>n.preventDefault()),this.control.addEventListener("input",n=>{this.#i=!0,this.#s=null,n.isComposing||this.scheduleSearch(this.control.value)}),this.control.addEventListener("compositionend",()=>this.scheduleSearch(this.control.value)),this.control.addEventListener("keydown",n=>{if(!(n.isComposing||this.locked))if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault();let i=n.key==="ArrowDown"?1:-1;this.#a?this.activate(this.#n<0?i>0?0:this.#t.length-1:Math.max(0,this.#n+i)):this.search("",i)}else n.key==="Enter"?(n.preventDefault(),this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.commitDraft()):n.key==="Escape"&&(this.closeChoices(),this.#i=!1,this.#s=null,this.constrained?this.resolveValue():(this.control.value=this.#e??"",this.error("")))}),this.control.addEventListener("blur",()=>{!this.autoHighlight&&this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.#i&&this.commitDraft(),this.closeChoices()})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls","choices"),e.setAttribute("aria-expanded","false"),e.autocomplete="off",e}static get constrained(){return!0}get constrained(){return this.constructor.constrained}get revalidateDraftOnSourceChange(){return!1}get autoHighlight(){return!0}get matchTypedChoice(){return!0}get emptyChoice(){return null}get choiceSource(){return this.parameters.store??this.parameters.callback??this.parameters.values}get searchDelay(){return 0}textValue(e){return e}selectionAccepted(e){}selectionResolved(e){}renderChoice(e,r){r.textContent=e.caption}scheduleSearch(e){if(this.closeChoices(),!this.searchDelay)return this.search(e);this.#d=setTimeout(()=>{this.#d=null,this.search(e)},this.searchDelay)}get commitOnChange(){return this.constrained}get locked(){return this.control.disabled||this.control.readOnly}get active(){return this.isConnected&&this.pageContext?.isActive()}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.choiceSource,a=i!==this.#o||this.parameters.separator!==this.#u;return this.#u=this.parameters.separator,this.#o=i,this.toggle.disabled=this.locked,a&&this.revalidateDraftOnSourceChange&&(this.#i=!1),a&&(this.#t=[],this.#s=null),(a||this.locked)&&this.closeChoices({cancelLookup:a}),a&&this.active&&!this.#i&&this.resolveValue(),n}setPageContext(e){super.setPageContext(e),this.resolveValue()}connectedCallback(){super.connectedCallback(),this.resolveValue()}readControlValue(){return this.#e}writeControlValue(e){Object.is(e,this.#e)||(this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue())}restoreFormDraft(e){this.closeChoices({cancelLookup:!0}),this.#i=!0,this.#s=null,this.control.value=e}restoreFormValue(e){this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue()}static validationValueCheck(){let e=this.constrained;return(r,n)=>{if(e&&r!==n)throw new Error("Validation cannot replace a selected code; update the Data explicitly.")}}static validationSelection(e,r){return this.constrained?async(n,i)=>{if(n==null)return!0;let a=await this.loadChoices(e,r,{_id:n},i);return Fl(a.find(s=>s.id===n),n)}:super.validationSelection(e,r)}validationSelection(){if(!this.constrained)return super.validationSelection();let e=this.#t.map(({id:n,error:i})=>({id:n,error:i})),r=this.#s?{id:this.#s.id,error:this.#s.error}:null;return n=>{let i=r?.id===n?r:e.find(a=>a.id===n);return Fl(i,n)}}acceptControlValue(){if(!this.#i)return this.validateCandidate(this.#e,a=>this.writeControlValue(a));let e=this.#s??(!this.autoHighlight&&this.#a?this.#t[this.#n]:null),r=e&&!this.constrained?e.caption:this.control.value,n=e?[e]:this.matchTypedChoice?this.#t.filter(a=>a.caption===r):[];if(this.constrained&&r!==""&&n.length!==1)return this.error("Choose a value from the list."),{ok:!1};let i=this.constrained?r===""?null:n[0].id:this.textValue(r);return this.validateCandidate(i,a=>{this.validationValueCheck()(a,i),this.#e=a,this.#i=!1,this.#s=null,(a==null||!this.constrained)&&(this.control.value=a??""),this.selectionAccepted(n.length===1&&a===i&&n[0].id!==null?n[0]:null),e&&!this.autoHighlight&&this.closeChoices()})}commitDraft(){this.closeChoices();let e=this.ownerDocument.defaultView.Event;this.control.dispatchEvent(new e("change",{bubbles:!0}))}choose(e){this.locked||!this.active||(this.pageContext.form&&this.pageContext.formSelectionError(e.error??""),this.#s=e,this.#i=!0,this.control.value=e.id===null?"":e.caption,this.closeChoices(),this.commitDraft())}async request(e,{selection:r=!1}={}){this.#c?.abort();let n=new AbortController;this.#c=n,this.#l=r||Object.hasOwn(e,"_id"),this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!0);let i=++this.#r;this.control.setAttribute("aria-busy","true"),this.error("");try{let a=await this.loadChoices(e,n.signal);return i!==this.#r||!this.active?null:a}catch(a){return i===this.#r&&this.active&&(this.error(a.message),this.pageContext.form&&this.#l&&this.pageContext.formSelectionError(a.message)),null}finally{i===this.#r&&(this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c=null,this.#l=!1,this.control.setAttribute("aria-busy","false"))}}async resolveValue(){if(this.#e==null||this.#e===""){this.pageContext?.form&&(this.pageContext.formSelectionPending(!1),this.pageContext.formSelectionError("")),this.control.value="",this.error(""),this.active&&this.selectionResolved(null);return}if(!this.active)return;if(this.control.value=this.#e,!this.constrained){this.error(""),this.selectionResolved(null);return}let e=this.request({_id:this.#e}),r=this.#r,n=await e;if(!n){r===this.#r&&this.active&&(this.selectionResolved(null),this.pageContext.form&&this.pageContext.formValidate());return}let i=n.find(s=>s.id===this.#e);this.#t=n,this.control.value=i?i.caption:this.#e;let a=i?i.error??"":"Value is not in the list.";this.error(a),this.pageContext.form&&(this.pageContext.formSelectionError(a),this.pageContext.formValidate()),this.selectionResolved(i??null)}async search(e,r=0){if(this.locked||!this.active)return;this.closeChoices(),this.#t=[];let n=await this.request({_querystring:e});if(!n||this.locked||this.shadowRoot.activeElement!==this.control)return;let i=this.emptyChoice;this.#t=i?[i,...n]:n;let a=this.ownerDocument;this.choices.replaceChildren(...this.#t.map((f,p)=>{let h=a.createElement("div");return h.id=`choice-${p}`,h.className="choice",h.setAttribute("role","option"),this.renderChoice(f,h),h.addEventListener("click",()=>this.choose(f)),h})),this.#t.length||(this.choices.textContent="No results");let s=a.defaultView;this.choices.hidden=!1,this.choices.showPopover(),this.#a=!0;let o=parseFloat(s.getComputedStyle(this).getPropertyValue("--gramlot-choice-popup-inset")||"2");Te(this.choices,this.control,{matchWidth:!0,inset:o}),this.control.setAttribute("aria-expanded","true");let l=this.constrained&&!this.#i&&e===""&&this.#e!=null;this.activate(l?this.#t.findIndex(f=>f.id===this.#e):r<0?this.#t.length-1:r>0?0:this.autoHighlight&&n.length?i?1:0:-1);let u=()=>this.closeChoices(),c=f=>{f.composedPath().includes(this)||u()},d=f=>{f.composedPath().includes(this.choices)||u()};a.addEventListener("pointerdown",c,!0),a.addEventListener("scroll",d,!0),s.addEventListener("resize",u),this.#f=()=>{a.removeEventListener("pointerdown",c,!0),a.removeEventListener("scroll",d,!0),s.removeEventListener("resize",u)}}activate(e){this.#n=this.#t.length&&e>=0?Math.min(e,this.#t.length-1):-1;for(let[r,n]of[...this.choices.children].entries())n.setAttribute("aria-selected",String(r===this.#n)),r===this.#n&&n.scrollIntoView({block:"nearest"});this.#n<0?this.control.removeAttribute("aria-activedescendant"):this.control.setAttribute("aria-activedescendant",`choice-${this.#n}`)}closeChoices({cancelLookup:e=!1}={}){clearTimeout(this.#d),this.#d=null,(e||!this.#l)&&(this.pageContext?.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c?.abort(),this.#c=null,this.#l=!1,++this.#r,this.control.setAttribute("aria-busy","false")),this.#f?.(),this.#f=null,this.#a&&this.choices.hidePopover(),this.#a=!1,this.choices.hidden=!0,this.control.setAttribute("aria-expanded","false"),this.control.removeAttribute("aria-activedescendant")}releaseControl(){this.closeChoices({cancelLookup:!0})}disconnectedCallback(){this.releaseControl()}}}It.parameters={...pe.parameters,value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}};function Ia(t){return class extends t{loadChoices(e){return this.constructor.loadChoices(this.parameters,this.pageContext,e)}static loadChoices(e,r,n){let i;if(e.store!=null){if(!(e.store instanceof Wp))throw new TypeError("store must be a Bag");if(e.values)throw new TypeError("store and values are mutually exclusive");let a=new Set;i=e.store.getNodes().map(s=>{let o=s.staticValue,l=s.attr.caption;if(typeof o!="string"||!o||typeof l!="string"||a.has(o))throw new TypeError("Invalid or duplicate store choice");return a.add(o),{id:o,caption:l}})}else i=ze(e.values??"",e.separator);return i.filter(a=>Object.hasOwn(n,"_id")?a.id===n._id:a.caption.toLocaleLowerCase().includes(n._querystring.toLocaleLowerCase()))}}}function ql(t){return class extends t{loadChoices(e){return this.constructor.loadChoices(this.parameters,this.pageContext,e)}static async loadChoices(e,r,n){let i=await r.callLogic(e.callback,n);if(!i||!Array.isArray(i.rows)||typeof i.identifier!="string"||typeof i.caption!="string")throw new TypeError("callbackSelect requires {rows, identifier, caption}");let a=new Set;return i.rows.map(s=>{let o=s[i.identifier],l=s[i.caption];if(typeof o!="string"||!o||typeof l!="string"||a.has(o))throw new TypeError("Invalid or duplicate choice code/caption");return a.add(o),{id:o,caption:l}})}}}function Fl(t,e){return t?.error?{errorcode:"condition",message:t.error}:e==null||t?!0:{errorcode:"missing",message:"Choose a value from the list."}}import{createDOMPurify as Gp}from"@gramlot/gramlot";var Ra={dbtable:{dtype:"T",binding:"read"},caption_field:{dtype:"T",binding:"read"},condition:{dtype:"T",binding:"read"},weakCondition:{dtype:["B","T"],default:!1,binding:"read"},method:{dtype:"T",default:"dbSelect",binding:"read"},columns:{dtype:"T",binding:"read"},hiddenColumns:{dtype:"T",binding:"read"},auxColumns:{dtype:"T",binding:"read"},template:{dtype:"T",binding:"read"},templateNull:{dtype:"T",default:"",binding:"read"},order_by:{dtype:"T",binding:"read"},limit:{dtype:"L",default:10,binding:"read"},searchDelay:{dtype:"L",default:300,binding:"read"},ignoreCase:{dtype:"B",default:!0,binding:"read"},hasDownArrow:{dtype:"B",default:!0,binding:"read"},emptyLabel:{dtype:"T",qualification:"intl_str",default:"Clear selection",binding:"read"},selectedCaption:{dtype:"T"},selectedRecord:{dtype:"T"},selectedCb:{dtype:"T"}},Ma=["dbtable","method","caption_field","columns","hiddenColumns","auxColumns","order_by","limit","ignoreCase","condition","weakCondition"];function La(t){return class extends t{#e={};#t=!1;#n={};#r=0;#a;#i;#s;constructor(){super(),this.#s=Gp(this.ownerDocument.defaultView)}get choiceSource(){return this.#r}get searchDelay(){return this.parameters.searchDelay}get revalidateDraftOnSourceChange(){return this.constrained}get autoHighlight(){return this.constrained}get matchTypedChoice(){return this.constrained}get emptyChoice(){return this.constrained&&!this.parameters.validate_notnull?{id:null,caption:this.parameters.emptyLabel}:null}get commitOnChange(){return!0}textValue(e){return e===""?null:e}projectAttributes(e,r){let n=Object.fromEntries(Object.entries(e).filter(([c])=>Ma.includes(c)||["autoSelect","template","templateNull","emptyLabel","validate_notnull"].includes(c)||c.startsWith("condition_")||c.startsWith("selected_"))),i=new Set([...Object.keys(n),...Object.keys(this.#e)].filter(c=>c==="condition"||c==="weakCondition"||c.startsWith("condition_")));Object.keys(this.#e).length&&[...i].some(c=>!Object.is(n[c],this.#e[c]))&&(this.#t=!0),[...new Set([...Object.keys(n),...Object.keys(this.#e)])].some(c=>!Object.is(n[c],this.#e[c]))&&(this.cancelValidation(),this.#a=void 0,this.#e=n,this.#r++),this.#n=Object.fromEntries(Object.entries(e).filter(([c])=>c.startsWith("selected_")));let s=super.projectAttributes(e,r);if(this.#i=null,this.parameters.template!=null){this.#i=this.#s.sanitize(this.parameters.template,{USE_PROFILES:{html:!0},RETURN_DOM_FRAGMENT:!0,FORBID_TAGS:["style","form","input","button","select","textarea","a","audio","video","details","summary"],FORBID_ATTR:["id","name","role","tabindex","contenteditable","autofocus"]});for(let c of this.#i.querySelectorAll("*"))if([...c.attributes].some(d=>/\{[A-Za-z0-9_]+\}/.test(d.value)))throw this.#i=null,new TypeError("Selector template placeholders belong in text, not HTML attributes.")}if(this.choices.style.minWidth=this.#i?"min(var(--gramlot-choice-popup-min-width,28rem),var(--gramlot-popup-available-width,100vw))":"",this.parameters.caption_field!=null&&!this.parameters.caption_field.trim())throw new TypeError("caption_field must be a nonempty field name.");if(this.parameters.condition!=null&&!this.parameters.condition.trim())throw new TypeError("condition must be a nonempty expression.");if(typeof this.parameters.weakCondition!="boolean"&&(typeof this.parameters.weakCondition!="string"||!this.parameters.weakCondition.trim()))throw new TypeError("weakCondition must be boolean or a nonempty expression.");let{limit:o,searchDelay:l,hasDownArrow:u}=this.parameters;if(!Number.isInteger(o)||o<1)throw new TypeError("limit must be a positive integer.");if(!Number.isInteger(l)||l<0)throw new TypeError("searchDelay must be a non-negative integer.");this.toggle.hidden=!u,this.control.style.paddingRight=u?"":"var(--gramlot-field-padding, .25em)";for(let c of Object.keys(s))(c.startsWith("condition_")||c.startsWith("selected_"))&&delete s[c];return s}loadChoices(e,r){let n=new Set(Object.entries(this.#n).filter(([,i])=>i).map(([i])=>i.slice(9)));if(this.#i){let i=this.ownerDocument.createTreeWalker(this.#i,4);for(;i.nextNode();)for(let a of i.currentNode.data.matchAll(/\{([A-Za-z0-9_]+)\}/g))n.add(a[1])}return this.constructor.loadChoices({...this.parameters,...this.#e},this.pageContext,e,r,n)}static async loadChoices(e,r,n,i,a=new Set){let s=Object.fromEntries(Ma.filter(u=>u!=="method"&&e[u]!=null).map(u=>[u,e[u]]));s.weakCondition===!1&&delete s.weakCondition,a.size&&(s.hiddenColumns=[...new Set([...(s.hiddenColumns??"").split(",").map(u=>u.trim()).filter(Boolean),...a])].join(","));for(let[u,c]of Object.entries(e))if(u.startsWith("condition_")){let d=u.slice(10);if(!d||d.startsWith("_")||Ma.includes(d))throw new TypeError("Invalid condition parameter.");s[d]=c}let o=await r.remote(e.method,{...s,...n},i);if(!o||!Array.isArray(o.rows)||typeof o.identifier!="string"||typeof o.caption!="string")throw new TypeError("Database selectors require {rows, identifier, caption}.");if(s.auxColumns!=null){if(!Array.isArray(o.columns)||!Array.isArray(o.headers)||o.columns.length!==o.headers.length||!o.columns.length||o.columns.some(u=>typeof u!="string"||!u)||o.headers.some(u=>typeof u!="string")||new Set(o.columns).size!==o.columns.length)throw new TypeError("auxColumns requires columns and headers display metadata.");for(let u of o.columns)a.add(u)}if(o.errors!=null&&(typeof o.errors!="string"||!Object.hasOwn(n,"_id")))throw new TypeError("Selector errors must be literal text attached to identity lookup.");let l=new Set;return o.rows.map(u=>{let c=u[o.identifier],d=u[o.caption];if(!(typeof c=="string"&&c.length||Number.isSafeInteger(c))||typeof d!="string"||l.has(c))throw new TypeError("Invalid or duplicate database choice identity/caption.");for(let f of a)if(!Object.hasOwn(u,f))throw new TypeError(`Missing requested selector column: ${f}`);return l.add(c),{id:c,caption:d,record:u,error:o.errors,captionField:o.caption,columns:s.auxColumns!=null?o.columns:null,headers:s.auxColumns!=null?o.headers:null}})}selectionAccepted(e){this.#a=e}renderChoice(e,r){if(e.id===null){super.renderChoice(e,r),r.style.color="var(--gramlot-text-secondary,GrayText)",r.style.borderBottom="1px solid var(--gramlot-border,#d5dce5)",r.style.marginBottom="var(--gramlot-space-1,.25rem)";return}if(this.#i){let n=this.#i.cloneNode(!0),i=this.ownerDocument.createTreeWalker(n,4);for(;i.nextNode();)i.currentNode.data=i.currentNode.data.replace(/\{([A-Za-z0-9_]+)\}/g,(a,s)=>e.record[s]==null?this.parameters.templateNull:String(e.record[s]));r.style.display="block",r.style.overflowWrap="anywhere",r.replaceChildren(n);return}if(e.columns){r.style.display="grid",r.style.gridTemplateColumns=`repeat(${e.columns.length}, minmax(0, 1fr))`,r.style.gap="var(--gramlot-space-3,.75rem)",r.style.alignItems="start",r.replaceChildren(...e.columns.map((n,i)=>{let a=this.ownerDocument.createElement("span");a.style.overflowWrap="anywhere";let s=this.ownerDocument.createElement("small");s.textContent=e.headers[i],s.style.display="block",s.style.opacity=".7";let o=this.ownerDocument.createElement("span");return o.textContent=e.record[n]??"",a.append(s,o),a}));return}super.renderChoice(e,r);for(let n of(this.parameters.columns??"").split(",").map(i=>i.trim()).filter(i=>i&&i!==e.captionField)){let i=this.ownerDocument.createElement("span");i.className="choice-detail",i.textContent=e.record[n]??"",r.append(i)}}selectionResolved(e){this.#o(e)}#o(e){let{selectedCaption:r,selectedRecord:n}=this.parameters;this.pageContext.selectionOutputs({selectedCaption:r,selectedRecord:n,fields:this.#n},e)}finishValidation(e){if(e.ok&&this.#a!==void 0){let r=this.#a;if(this.#a=void 0,this.#o(r),this.parameters.selectedCb){let n=i=>console.error("Selection notification failed:",i);try{let i=this.pageContext.callLogic(this.parameters.selectedCb,{value:e.value,record:r?.record??null});i instanceof Promise&&i.catch(n)}catch(i){n(i)}}}super.finishValidation(e)}async resolveValue(){let e=this.#t;if(this.#t=!1,e&&this.active&&!this.locked&&this.constrained&&this.parameters.validate_notnull){let i=await this.request({_querystring:"",limit:2},{selection:!0});if(!i)return;if(i.length===1){this.choose(i[0]);return}}let r=this.readControlValue(),n=super.resolveValue();if(r!=null&&r!=="")return n;if(await n,this.active&&!this.locked&&this.parameters.autoSelect&&this.readControlValue()==null&&this.control.value===""){let i=await this.request({_querystring:"",limit:2},{selection:!0});i?.length===1&&this.readControlValue()==null&&!this.locked&&this.choose(i[0])}}}}var Xp=(0,P.defineComponent)({name:"textbox",tag:"gramlot-textbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:ui("input","text")}),Zp=(0,P.defineComponent)({name:"checkbox",tag:"gramlot-checkbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",binding:"twoWay"},mode:{dtype:"T",default:"checkbox",binding:"read",enum:["checkbox","switch"]},switch_color:{dtype:"T",nullable:!0,default:null,binding:"read"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="checkbox",e}constructor(){super();let e=this.ownerDocument.createElement("style");e.textContent=`input[role=switch]{appearance:none;position:relative;flex:none;cursor:pointer;
|
|
99
114
|
width:var(--gramlot-switch-width,2.5em);height:var(--gramlot-switch-height,1.4em);min-width:0;min-height:0;
|
|
100
115
|
margin:0;border:1px solid var(--gramlot-border-control,#888);border-radius:2em;
|
|
101
116
|
background:var(--gramlot-switch-off,var(--gramlot-field-readonly-background,#bbb));transition:background 120ms}
|
|
@@ -104,4 +119,4 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
|
|
|
104
119
|
input[role=switch]:checked{background:var(--gramlot-switch-on,var(--gramlot-brand-blue,Highlight))}
|
|
105
120
|
input[role=switch]:checked::before{left:calc(100% - var(--gramlot-switch-height,1.4em) + var(--gramlot-switch-inset,2px) + 2px)}
|
|
106
121
|
input[role=switch]:disabled{cursor:not-allowed}
|
|
107
|
-
@media(prefers-reduced-motion:reduce){input[role=switch],input[role=switch]::before{transition:none}}`,this.shadowRoot.append(e),this.control.addEventListener("click",r=>{this.control.readOnly&&r.preventDefault()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.mode;if(!this.constructor.gramlotComponent.parameters.mode.enum.includes(i))throw new TypeError("checkbox mode must be checkbox or switch");return i==="switch"?this.control.setAttribute("role","switch"):this.control.removeAttribute("role"),i==="switch"&&this.parameters.switch_color!=null?this.control.style.setProperty("--gramlot-switch-on",this.parameters.switch_color):this.control.style.removeProperty("--gramlot-switch-on"),n}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),
|
|
122
|
+
@media(prefers-reduced-motion:reduce){input[role=switch],input[role=switch]::before{transition:none}}`,this.shadowRoot.append(e),this.control.addEventListener("click",r=>{this.control.readOnly&&r.preventDefault()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.mode;if(!this.constructor.gramlotComponent.parameters.mode.enum.includes(i))throw new TypeError("checkbox mode must be checkbox or switch");return i==="switch"?this.control.setAttribute("role","switch"):this.control.removeAttribute("role"),i==="switch"&&this.parameters.switch_color!=null?this.control.style.setProperty("--gramlot-switch-on",this.parameters.switch_color):this.control.style.removeProperty("--gramlot-switch-on"),n}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),Jp=(0,P.defineComponent)({name:"radioButtonText",tag:"gramlot-radio-button-text",base:ni,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:"T",binding:"read"},cols:{dtype:"L",default:1,binding:"read"}},implementation:t=>class extends t{get choiceType(){return"radio"}get multiple(){return!1}}});function ui(t,e){return r=>class extends r{createControl(){let n=this.ownerDocument.createElement(t);return t==="input"&&(n.type=e),n}readControlValue(){return this.control.value}writeControlValue(n){this.control.value!==(n??"")&&(this.control.value=n??"")}}}var Kp=(0,P.defineComponent)({name:"textBoxArea",tag:"gramlot-text-box-area",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},rows:{dtype:"L",default:4,binding:"read",target:"control"},cols:{dtype:"L",default:24,binding:"read",target:"control"}},implementation:ui("textarea")}),Qp=(0,P.defineComponent)({name:"passwordbox",tag:"gramlot-passwordbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:ui("input","password")}),eh=(0,P.defineComponent)({name:"radioButton",tag:"gramlot-radio-button",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",default:!1,binding:"twoWay"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"},group:{dtype:"T",nullable:!0,binding:"read"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="radio",e}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),th=(0,P.defineComponent)({name:"colorpicker",tag:"gramlot-colorpicker",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",default:"#000000",binding:"twoWay"}},implementation:ui("input","color")}),jl={value:{dtype:"R",default:0,binding:"twoWay"},min:{dtype:"R",default:0,binding:"read",target:"control"},max:{dtype:"R",default:100,binding:"read",target:"control"},step:{dtype:"R",default:1,binding:"read",target:"control"}};function Vl(t){return e=>class extends e{#e;#t=!1;setSourceContext(r){this.#e=r}projectAttributes(r,n){let i=this.parameters,a=super.projectAttributes(r,n);return i&&["min","max","step"].some(s=>i[s]!==this.parameters[s])&&this.writeControlValue(this.parameters.value),a}createControl(){let r=this.ownerDocument.createElement("input");return r.type="range",t?(r.style.cssText="writing-mode:vertical-lr;direction:rtl;width:var(--gramlot-slider-width,1.5rem);height:var(--gramlot-slider-height,10rem)",r.setAttribute("aria-orientation","vertical")):r.style.width="100%",r}readControlValue(){return this.control.valueAsNumber}writeControlValue(r){this.control.value=String(r);let n=this.control.valueAsNumber;if(!this.#t&&Number.isFinite(r)&&Number.isFinite(n)&&n!==r){this.#t=!0;try{this.#e.writeParameter("value",n)}finally{this.#t=!1}}}}}var rh=(0,P.defineComponent)({name:"horizontalSlider",tag:"gramlot-horizontal-slider",base:pe,mixins:[G,X],parameters:jl,sourceContext:!0,implementation:Vl(!1)}),nh=(0,P.defineComponent)({name:"verticalSlider",tag:"gramlot-vertical-slider",base:pe,mixins:[G,X],parameters:jl,sourceContext:!0,implementation:Vl(!0)}),ih=(0,P.defineComponent)({name:"numberTextBox",tag:"gramlot-number-text-box",base:en,mixins:[G,X],parameters:{value:{dtype:["L","R","N"],nullable:!0,binding:"twoWay"},dtype:{dtype:"T",default:"R"},min:{dtype:"R",nullable:!0,binding:"read"},max:{dtype:"R",nullable:!0,binding:"read"}},implementation:Rl}),ah=(0,P.defineComponent)({name:"dateTextBox",tag:"gramlot-date-text-box",base:en,mixins:[G,X],parameters:{value:{dtype:"D",nullable:!0,binding:"twoWay"},workdate:{dtype:"T",nullable:!0,binding:"read"},period_to:{dtype:"T",nullable:!0},calendar:{dtype:"B",default:!0,binding:"read"}},implementation:Ll}),sh=(0,P.defineComponent)({name:"dateCalendar",tag:"gramlot-date-calendar",base:Ta,mixins:[G,X],parameters:{},implementation:t=>class extends t{}}),oh=(0,P.defineComponent)({name:"timeTextBox",tag:"gramlot-time-text-box",base:en,mixins:[G,X],parameters:{value:{dtype:"H",nullable:!0,binding:"twoWay"}},implementation:Pl}),lh=(0,P.defineComponent)({name:"filteringSelect",tag:"gramlot-filtering-select",base:It,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"}},implementation:Ia}),uh=(0,P.defineComponent)({name:"callbackSelect",tag:"gramlot-callback-select",base:It,mixins:[G,X],parameters:{callback:{dtype:"T"}},implementation:ql}),ch=(0,P.defineComponent)({name:"comboBox",tag:"gramlot-combo-box",base:It,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"},store:{dtype:"X",nullable:!0,default:null,binding:"read"}},implementation:t=>class extends Ia(t){static get constrained(){return!1}}}),dh=(0,P.defineComponent)({name:"dbSelect",tag:"gramlot-db-select",base:It,mixins:[G,X],parameters:{...Ra,value:{dtype:["T","L"],nullable:!0,binding:"twoWay"},autoSelect:{dtype:"B",default:!1,binding:"read"}},implementation:La}),fh=(0,P.defineComponent)({name:"dbComboBox",tag:"gramlot-db-combo-box",base:It,mixins:[G,X],parameters:Ra,implementation:t=>class extends La(t){static get constrained(){return!1}}}),ph=(0,P.defineComponent)({name:"checkBoxText",tag:"gramlot-check-box-text",sourceContext:!0,base:ni,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:["T","X"],default:"",binding:"read"},cols:{dtype:"L",default:1,binding:"read"},popup:{dtype:"B",default:!1,binding:"read"},hierarchical:{dtype:"B",default:!1,binding:"read"},checkChildren:{dtype:"B",default:!0,binding:"read"},identifier:{dtype:"T",binding:"read"},labelAttribute:{dtype:"T",binding:"read"},dbtable:{dtype:"T",binding:"read"},method:{dtype:"T",binding:"read"},caption_field:{dtype:"T",binding:"read"},order_by:{dtype:"T",binding:"read"},condition:{dtype:"T",binding:"read"}},implementation:Va}),Q0=mi({name:"inputs",dependencies:[Yp],components:[El,Xp,Zp,Jp,Kp,Qp,eh,th,rh,nh,ih,ah,oh,lh,uh,ch,dh,fh,ph,sh]});export{uh as CallbackSelect,ph as CheckBoxText,Zp as Checkbox,th as Colorpicker,ch as ComboBox,sh as DateCalendar,ah as DateTextBox,fh as DbComboBox,dh as DbSelect,lh as FilteringSelect,rh as HorizontalSlider,ih as NumberTextBox,Qp as Passwordbox,eh as RadioButton,Jp as RadioButtonText,Kp as TextBoxArea,Xp as Textbox,oh as TimeTextBox,nh as VerticalSlider,Q0 as default};
|