@webqit/oohtml 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +2 -2
- package/dist/data-binding.js +5 -5
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +15 -15
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +10 -10
- package/dist/main.lite.js.map +2 -2
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +1 -1
- package/dist/scoped-css.js.map +2 -2
- package/package.json +2 -2
- package/src/bindings-api/index.js +1 -1
- package/src/context-api/DOMContexts.js +1 -1
- package/src/data-binding/index.js +13 -13
- package/src/html-imports/HTMLImportsContext.js +1 -1
package/dist/scoped-css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var oe=Object.defineProperty;var se=(n,t,r)=>t in n?oe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var pt=(n,t,r)=>(se(n,typeof t!="symbol"?t+"":t,r),r);function x(n){return!Array.isArray(n)&&typeof n=="object"&&n}function g(n){return Array.isArray(n)}function z(n){return typeof n=="function"}function Q(n){return n===null||n===""}function R(n){return arguments.length&&(n===void 0||typeof n>"u")}function S(n){return Array.isArray(n)||typeof n=="object"&&n||z(n)}function ht(n){return Q(n)||R(n)||n===!1||n===0||S(n)&&!Object.keys(n).length}function b(n){return z(n)||n&&{}.toString.call(n)==="[object function]"}function J(n){return n instanceof Number||typeof n=="number"}function P(n){return J(n)||n!==!0&&n!==!1&&n!==null&&n!==""&&!isNaN(n*1)}function X(n){return n instanceof String||typeof n=="string"&&n!==null}function gt(n){return!X(n)&&!R(n.length)}function st(n,...t){return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n}function yt(e,t){t=t||Object.prototype,t=t&&!g(t)?[t]:t;for(var r=[],e=e;e&&(!t||t.indexOf(e)<0)&&e.name!=="default";)r.push(e),e=e?Object.getPrototypeOf(e):null;return r}function wt(n,t){var r=[];return yt(n,t).forEach(e=>{st(r,...Object.getOwnPropertyNames(e))}),r}function $(n,t,r=!1,e=!1,i=!1){var o=0,s=n.shift();if((P(s)||s===!0||s===!1)&&(o=s,s=n.shift()),!n.length)throw new Error("_merge() requires two or more array/objects.");return n.forEach((l,c)=>{!S(l)&&!b(l)||(r?wt(l):Object.keys(l)).forEach(f=>{if(!!t(f,s,l,c)){var u=s[f],m=l[f];if((g(u)&&g(m)||x(u)&&x(m))&&(o===!0||o>0))s[f]=g(u)&&g(m)?[]:{},$([P(o)?o-1:o,s[f],u,m],t,r,e,i);else if(g(s)&&g(l))e?s[f]=m:s.push(m);else try{i?Object.defineProperty(s,f,Object.getOwnPropertyDescriptor(l,f)):s[f]=l[f]}catch{}}})}),s}function Y(...n){return $(n,(t,r,e)=>!0,!1,!1,!1)}function q(n,...t){if(!n||!["object","function"].includes(typeof n))throw new Error("Argument #1 must be of type object");let r=n[Symbol.for("wq")];if(r||(r=new lt,Object.defineProperty(n,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!t.length)return r;let e,i;for(;e=t.shift();)(i=r)&&!(r=r.get(e))&&(r=new lt,i.set(e,r));return r}var lt=class extends Map{};function A(n,t=!0){return g(n)?n:!t&&x(n)?[n]:n!==!1&&n!==0&&ht(n)?[]:gt(n)?Array.prototype.slice.call(n):x(n)?Object.values(n):[n]}function Z(n,t,r={},e={}){t=A(t).slice();for(var i=n;!R(i)&&!Q(i)&&t.length;){var o=t.shift();if(!(r.get?r.get(i,o):S(i)?o in i:i[o])){e.exists=!1;return}i=r.get?r.get(i,o):i[o]}return e.exists=!0,i}function _t(n,t,r,e={},i={}){let o=(u,m,a)=>i.set?i.set(u,m,a):(P(t[l])&&g(u)?u.push(a):u[m]=a,!0);t=A(t);for(var s=n,l=0;l<t.length;l++)if(l<t.length-1){if(!s||!S(s)&&!b(s))return!1;var c=Z(s,t[l],i);if(!S(c)){if(i.buildTree===!1)return!1;c=b(i.buildTree)?i.buildTree(l):P(t[l+1])?[]:{};var f=o(s,t[l],c);if(!f)return!1}s=c}else return o(s,t[l],r)}var K=class{constructor(t,r=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!r&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let r=await t();return this._synthesis--,r}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.readCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.writeCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,r,e){this.onread(()=>{let i=t(e),o=s=>{s!==void 0&&this.onwrite(()=>{let l=r(s,e),c=f=>{f!==void 0&&this.cycle(t,r,f)};l instanceof Promise?l.then(c):c(l)})};i instanceof Promise?i.then(o):o(i)})}};function Dt(n){return(n=n.trim())&&n.startsWith("(")&&n.endsWith(")")}function at(n,t,r,e=!0){r=(Array.isArray(r)?r:[r]).map(s=>(s+"").replace("(",e?"(.//":"(./")).join("|");let i=[],o;try{let s=n.document.evaluate(r,t,null,n.XPathResult.ANY_TYPE);for(;o=s.iterateNext();)i.push(o)}catch{}return i}function Nt(n,t,r){r=(Array.isArray(r)?r:[r]).map(e=>(e+"").replace("(","(self::")).join("|");try{return n.document.evaluate(`${r}`,t,null,n.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function tt(n,t,r,e=!1,i=null){let o=i?.get(t)?.get(r);if(typeof o<"u")return o;let s=f=>(i?.has(t)||i?.set(t,new WeakMap),i?.get(t)?.set(r,f),f),l=t.getRootNode(),c=r.getRootNode();return l===c?s(t.contains(r)):e&&c instanceof n.ShadowRoot?s(tt(n,t,c.host,e,i)):s(!1)}function Rt(n,t="|"){return[...n].reduce(([r,e,i,o],s)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(s)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(s)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(s)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(s)&&!i[0].endsWith("\\")&&(r=r===s?null:r||s),i[0]+=s,[r,e,i]),[null,0,[""]])[2].reverse()}var I=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Dt(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=Rt(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var B=class{constructor(t,r,e){this.context=t,this.namespace=r,this.window=t.defaultView||t.ownerDocument?.defaultView||e,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(b(t[0])?t=[[],...t]:x(t[0])&&!(t[0]instanceof I)&&t.length===1?t=[[],void 0,t[0]]:x(t[1])&&t.length===2?t=[A(t[0],!1),void 0,t[1]]:t[0]=A(t[0],!1),t[0].filter(r=>typeof r!="string"&&!(r instanceof I)&&!(r instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(r=>r instanceof I?r:new I(r)),t}registry(...t){return q(this.window,"realdom",this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,r,e){let{window:i}=this,o=new Set,s=new WeakMap;for(let[l,c]of this.registry(t)){let f=[].concat(r).filter(m=>tt(i,l.context,m.target,l.params.subtree==="cross-roots",s));if(!f.length)continue;let u=[l,Array.isArray(r)?f:f[0]];c?o.add(u):e.call(i,...u)}for(let l of o)e.call(i,...l);o.clear()}disconnectables(t,...r){let e={disconnect(){r.forEach(i=>i&&b(i.disconnect)&&i.disconnect()||b(i)&&i()||x(i)&&(i.disconnected=!0))}};return t&&t.addEventListener("abort",()=>e.disconnect()),e}};var F=class extends B{type="attr";constructor(t,...r){super(t,"attr",...r)}get(t,r=void 0,e={}){let i=typeof t=="string"||t instanceof I;[t=[],r=void 0,e={}]=this.resolveArgs(arguments);let{context:o}=this,s=Ut(o,t);if(!r)return s;let l=e.lifecycleSignals&&this.createSignalGenerator();if(i)for(let c of s){let f=l?l.generate():{};r(c,f,o)}else{let c=l?.generate()||{};r(s,c,o)}if(e.live){l&&(e={...e,signalGenerator:l});let c=this.observe(i?t[0]:t,r,{newValue:!0,...e});return this.disconnectables(e.signal,c)}}observe(t,r,e={}){let i=typeof t=="string"||t instanceof I;if([t=[],r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(i?t[0]:t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:o,window:s,webqit:l}=this;e.eventDetails&&!l.realdom.attrInterceptionHooks?.intercepting&&kt.call(s,"intercept",()=>{});let c=new s.MutationObserver(a=>{a=Ft(a).map(d=>Wt.call(s,d)),Ht.call(s,m,a,o)}),f={attributes:!0,attributeOldValue:e.oldValue,subtree:e.subtree&&!0};t.length&&(f.attributeFilter=t.map(a=>a+"")),c.observe(o,f);let u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),m={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:c};return this.disconnectables(e.signal,c,u)}observeSync(t,r,e={}){let i=typeof t=="string"||t instanceof I;[t,r,e={}]=this.resolveArgs(arguments);let{context:o,window:s}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let l=e.timing==="intercept"?"intercept":"sync";this.registry(l).size||kt.call(s,l,a=>{this.forEachMatchingContext(l,a,Ht)});let c={disconnect(){m.delete(u)}},f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:f,disconnectable:c},m=this.registry(l);return m.set(u,!!u.params.deferred),this.disconnectables(e.signal,c,f)}};function Ft(n){return n.reduce((t,r,e)=>t[e-1]?.attributeName===r.attributeName||q(r.target,"realdom","internalAttrInteractions").get(r.attributeName)?t:t.concat(r),[])}function Ht(n,t){let{context:r,spec:e,callback:i,params:o,atomics:s,originalFilterIsString:l,signalGenerator:c}=n;if(o.subtree||(t=t.filter(a=>a.target===r)),!t.length)return;let f=e.map(a=>a+"");if(o.atomic&&!s.size?t=Ut(r,e,t):o.timing!=="async"&&e.length&&(t=t.filter(a=>f.includes(a.name))),!t.length)return;o.newValue===null&&o.oldValue===null&&o.eventDetails||(t=t.map(a=>{let d;return o.eventDetails||({event:d,...a}=a),!o.oldValue&&"oldValue"in a&&({oldValue:d,...a}=a),!o.newValue&&"value"in a?{value:d,...a}=a:o.newValue&&typeof a.value>"u"&&(a={...a,value:ft(a.target,a.name,()=>a.target.getAttribute(a.name))}),a})),o.atomic&&(t.forEach(a=>s.set(a.name,a)),t=Array.from(s.entries()).map(([,a])=>a));let u=l?t[0]:t,m=c?c.generate():{};i(u,m,r)}function ft(n,t,r){let e=q(n,"realdom","internalAttrInteractions").get(t);q(n,"realdom","internalAttrInteractions").set(t,!0);let i=r();return q(n,"realdom","internalAttrInteractions").set(t,e),i}function Ut(n,t,r=[]){let e={event:null,type:"attribute"};return t.length?t.map(o=>(o=o+"",r.find(s=>s.name===o)||{target:n,name:o,value:ft(n,o,()=>n.getAttribute(o)),...e})):Array.from(n.attributes).map(o=>r.find(s=>s.name===o.nodeName)||{target:n,name:o.nodeName,value:ft(n,o.nodeName,()=>o.nodeValue),...e})}function Wt({target:n,attributeName:t,value:r,oldValue:e}){let s=(this.webqit.realdom.attrInterceptionRecords?.get(n)||{})[t]?.[0]||"mutation";return{target:n,name:t,value:r,oldValue:e,type:"observation",event:s}}function kt(n,t){let r=this,{webqit:e,document:i,Element:o}=r;e.realdom.attrInterceptionHooks||Object.defineProperty(e.realdom,"attrInterceptionHooks",{value:new Map}),e.realdom.attrInterceptionHooks.has(n)||e.realdom.attrInterceptionHooks.set(n,new Set),e.realdom.attrInterceptionHooks.get(n).add(t);let s=()=>e.realdom.attrInterceptionHooks.get(n).delete(t);if(e.realdom.attrInterceptionHooks?.intercepting)return s;console.warn("Attr mutation APIs are now being intercepted."),e.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"attrInterceptionRecords",{value:new Map});let l=(u,m)=>{e.realdom.attrInterceptionRecords.has(u.target)||e.realdom.attrInterceptionRecords.set(u.target,{});let a=e.realdom.attrInterceptionRecords.get(u.target);if(a[u.name]=a[u.name]||[],a[u.name].unshift(u.event),q(u.target,"realdom","internalAttrInteractions").get(u.name))return m();e.realdom.attrInterceptionHooks.get("intercept")?.forEach(w=>w([u]));let d=m();return e.realdom.attrInterceptionHooks.get("sync")?.forEach(w=>w([u])),d};new r.MutationObserver(u=>{u=u.filter(m=>!(r.webqit.realdom.attrInterceptionRecords?.get(m.target)||{})[m.attributeName]?.shift()),u=Ft(u).map(m=>Wt.call(r,m)),u.length&&(e.realdom.attrInterceptionHooks.get("intercept")?.forEach(m=>m(u)),e.realdom.attrInterceptionHooks.get("sync")?.forEach(m=>m(u)))}).observe(i,{attributes:!0,subtree:!0,attributeOldValue:!0});let f=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(u=>{f[u]=o.prototype[u],o.prototype[u]=function(...m){let a,d=ft(this,m[0],()=>this.getAttribute(m[0]));["setAttribute","toggleAttribute"].includes(u)&&(a=m[1]),u==="toggleAttribute"&&a===void 0&&(a=d===null);let w={target:this,name:m[0],value:a,oldValue:d,type:"interception",event:[this,u]};return l(w,()=>f[u].call(this,...m))}}),s}var et=class extends B{constructor(t,...r){super(t,"tree",...r)}attr(t,r=void 0,e={}){let{context:i,window:o}=this;return new F(i,o).get(...arguments)}query(t,r=void 0,e={}){[t,r=void 0,e={}]=this.resolveArgs(arguments);let{context:i}=this,o=new Map,s=f=>(o.has(f)||o.set(f,{target:f,entrants:[],exits:[],type:"query",event:null}),o.get(f));if(!e.generation||e.generation==="entrants"){if(!t.length)[...i.children].forEach(f=>s(i).entrants.push(f));else if(t.every(f=>f.type==="selector")){let[f,u]=t.reduce(([a,d],w)=>w.kind==="xpath"?[a,d.concat(w)]:[a.concat(w),d],[[],[]]),m=[];e.subtree?(f.length&&m.push(...i.querySelectorAll(f.join(","))),u.length&&m.push(...at(this.window,i,u))):(f.length&&m.push(...[...i.children].filter(a=>a.matches(f))),u.length&&m.push(...at(this.window,i,u,!1))),m.forEach(a=>s(a.parentNode||i).entrants.push(a))}}if(!r)return o;let l={disconnected:!1},c=r&&e.lifecycleSignals&&this.createSignalGenerator();for(let[,f]of o){if(l.disconnected)break;let u=c?.generate()||{};r(f,u,i)}if(e.live){c&&(e={...e,signalGenerator:c});let f=this.observe(t,r,e);return this.disconnectables(e.signal,l,f)}return this.disconnectables(e.signal,l,c)}children(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!1})}subtree(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!0})}observe(t,r,e={}){if([t,r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:i,window:o,webqit:s,document:l}=this;e.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(l.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&Gt.call(o,"sync",()=>{});let c=new o.MutationObserver(m=>m.forEach(a=>{vt.call(o,u,Bt.call(o,a),i)}));c.observe(i,{childList:!0,subtree:e.subtree&&!0});let f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:i,spec:t,callback:r,params:e,signalGenerator:f,disconnectable:c};if(e.staticSensitivity){let m=Vt.call(o,u);return this.disconnectables(e.signal,c,f,m)}return this.disconnectables(e.signal,c,f)}observeSync(t,r,e={}){[t,r,e={}]=this.resolveArgs(arguments);let{context:i,window:o}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let s=e.timing==="intercept"?"intercept":"sync";this.registry(s).size||Gt.call(o,s,a=>{this.forEachMatchingContext(s,a,vt)});let l=new o.MutationObserver(a=>a.forEach(d=>{Array.isArray((d=Bt.call(o,d)).event)||vt.call(o,u,d,i)}));l.observe(i,{childList:!0,subtree:e.subtree&&!0});let c={disconnect(){m.delete(u),l.disconnect()}},f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:i,spec:t,callback:r,params:e,signalGenerator:f,disconnectable:c},m=this.registry(s);if(m.set(u,!!u.params.deferred),e.staticSensitivity){let a=Vt.call(o,u);return this.disconnectables(e.signal,c,f,a)}return this.disconnectables(e.signal,c,f)}track(t,r,e={}){return e={subtree:!0,...e},this.observe(t,i=>{i.entrants.length&&r(!0,Array.isArray(t)?i.entrants:i.entrants[0]),i.exits.length&&r(!1,Array.isArray(t)?i.exits:i.exits[0])},e)}};function Vt(n){let t=this,{context:r,spec:e,callback:i,params:o,signalGenerator:s}=n,l=e.filter(d=>d.kind==="css"),c=d=>d.match(/\.([\w-]+)/g)?.length?["class"]:[],f=d=>d.match(/#([\w-]+)/g)?.length?["id"]:[],u=d=>[...d.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(w=>w[1]).concat(c(d)).concat(f(d));if(!(n.$attrs=Array.from(new Set(l.filter(d=>(d+"").includes("[")).reduce((d,w)=>d.concat(u(w+"")),[])))).length)return;let m=new Set,a=new Set;return m.push=d=>(a.delete(d),m.add(d)),a.push=d=>(m.delete(d),a.add(d)),n.$deliveryCache={entrants:m,exits:a},new F(r,t).observe(n.$attrs,d=>{let w=new Map,O=y=>(w.has(y)||w.set(y,{target:y,entrants:[],exits:[],type:"static",event:null}),w.get(y)),L=new WeakMap,p=y=>(L.has(y)||L.set(y,l.some(_=>y.matches(_+""))),L.get(y));for(let y of d)["entrants","exits"].forEach(_=>{o.generation&&_!==o.generation||n.$deliveryCache[_].has(y.target)||(_==="entrants"?!p(y.target):p(y.target))||(n.$deliveryCache[_].push(y.target),O(y.target)[_].push(y.target),O(y.target).event=y.event)});for(let[,y]of w){let _=s?.generate()||{};i(y,_,r)}},{subtree:o.subtree,timing:o.timing,eventDetails:o.eventDetails})}function vt(n,t){let{context:r,spec:e,callback:i,params:o,signalGenerator:s,$deliveryCache:l}=n,c={...t,entrants:[],exits:[]};if(o.eventDetails||delete c.event,["entrants","exits"].forEach(u=>{if(!(o.generation&&u!==o.generation)&&(e.length?c[u]=Oe.call(this,e,o.subtree==="cross-roots",t[u],t.event!=="parse"):c[u]=[...t[u]],!!l))for(let m of c[u])l[u].push(m)}),!c.entrants.length&&!c.exits.length)return;let f=s?.generate()||{};i(c,f,r)}function Oe(n,t,r,e){r=Array.isArray(r)?r:[...r];let i=(o,s)=>{if(s.type==="selector"){let l=s.isXpathAttr?[]:o.filter(c=>s.kind==="xpath"?Nt(this,c,s+""):c.matches&&c.matches(s+""));if((e||s.isXpathAttr)&&(l=o.reduce((c,f)=>s.kind==="xpath"?[...c,...at(this,f,s,e)]:f.querySelectorAll?[...c,...f.querySelectorAll(s+"")]:c,l)),l.length)return l}else if(o.includes(s.content)||e&&o.some(l=>tt(this,l,s.content,t)))return[s.content]};return r.$$searchCache||(r.$$searchCache=new Map),n.reduce((o,s)=>{let l;return r.$$searchCache.has(s.content)?l=r.$$searchCache.get(s.content):(l=i(r,s)||[],s.type==="instance"&&r.$$searchCache.set(s.content,l)),o.concat(l)},[])}function Bt({target:n,addedNodes:t,removedNodes:r}){let e=this,i;return i=A(t).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),null),i=A(r).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),i),i=i||e.document.readyState==="loading"&&"parse"||"mutation",{target:n,entrants:t,exits:r,type:"observation",event:i}}function Gt(n,t){let r=this,{webqit:e,document:i,Node:o,CharacterData:s,Element:l,HTMLElement:c,HTMLTemplateElement:f,DocumentFragment:u}=r;e.realdom.domInterceptionHooks||Object.defineProperty(e.realdom,"domInterceptionHooks",{value:new Map}),e.realdom.domInterceptionNoRecurse||Object.defineProperty(e.realdom,"domInterceptionNoRecurse",{value:new Map}),e.realdom.domInterceptionHooks.has(n)||e.realdom.domInterceptionHooks.set(n,new Set),e.realdom.domInterceptionHooks.get(n).add(t);let m=()=>e.realdom.domInterceptionHooks.get(n).delete(t);if(e.realdom.domInterceptionHooks?.intercepting)return m;console.warn("DOM mutation APIs are now being intercepted."),e.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"domInterceptionRecords",{value:new Map});let a=(p,y,_)=>{e.realdom.domInterceptionNoRecurse.set(p,y);let h=_();return e.realdom.domInterceptionNoRecurse.delete(p),h},d=(p,y)=>{p.entrants.concat(p.exits).forEach(h=>{clearTimeout(e.realdom.domInterceptionRecords.get(h)?.timeout),e.realdom.domInterceptionRecords.set(h,p.event);let C=setTimeout(()=>{e.realdom.domInterceptionRecords.delete(h)},0);Object.defineProperty(p.event,"timeout",{value:C,configurable:!0})}),e.realdom.domInterceptionHooks.get("intercept")?.forEach(h=>h(p));let _=y();return e.realdom.domInterceptionHooks.get("sync")?.forEach(h=>h(p)),_},w={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},O={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(w).reduce((p,y)=>p.concat(y),[])).forEach(p=>{Object.keys(w).forEach(h=>{if(!w[h].includes(p))return;let C=Object.getOwnPropertyDescriptor(r[h].prototype,p);!C||(Object.defineProperty(r[h].prototype,p,"value"in C?{...C,value:y}:{...C,set:_}),O[h][p]=C)});function y(...h){let C=Object.keys(O).find(j=>this instanceof r[j]&&p in O[j]),U=O[C],T=()=>U[p].value.call(this,...h);if(e.realdom.domInterceptionNoRecurse.get(this)===p)return T();let E=[],v=[],H=this;["insertBefore"].includes(p)?v=[h[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(p)?(v=[h[1]],["beforebegin","afterend"].includes(h[0])&&(H=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(p)?(E=[...this.childNodes],v=p==="replaceChildren"?[...h]:[h[0]]):["replaceWith","remove"].includes(p)?(E=[this],v=p==="replaceWith"?[...h]:[],H=this.parentNode):["replaceChild"].includes(p)?(E=[h[1]],v=[h[0]]):["removeChild"].includes(p)?E=[...h]:(v=[...h],["before","after"].includes(p)&&(H=this.parentNode));let ot=p;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(p)){let j=this.nodeName;if(p==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(h[0])){if(!this.parentNode)return U[p].value.call(this,...h);j=this.parentNode.nodeName}let k=i.createElement(j.includes("-")?"div":j);U.setHTMLUnsafe.value.call(k,v[0],p==="setHTMLUnsafe"?h[1]:{}),v=[...k.childNodes],p==="insertAdjacentHTML"?(ot="insertAdjacentElement",h[1]=new u,a(h[1],"append",()=>h[1].append(...k.childNodes))):(ot="replaceChildren",h=[...k.childNodes])}return d({target:H,entrants:v,exits:E,type:"interception",event:[this,p]},()=>U[ot].value.call(this,...h))}function _(h){let C=Object.keys(O).find(W=>this instanceof r[W]&&p in O[W]),U=O[C],T=()=>U[p].set.call(this,h);if(this instanceof HTMLScriptElement||e.realdom.domInterceptionNoRecurse.get(this)===p)return T();let E=[],v=[],H=this;if(["outerHTML","outerText"].includes(p)?(E=[this],H=this.parentNode):this instanceof f?(H=this.content,E=[...this.content.childNodes]):E=[...this.childNodes],["outerHTML","innerHTML"].includes(p)){let W=this.nodeName;if(p==="outerHTML"){if(!this.parentNode)return T();W=this.parentNode.nodeName}let j=i.createElement(W.includes("-")?"div":W);if(a(j,p,()=>j[p]=h),v=this instanceof f?[...j.content.childNodes]:[...j.childNodes],this instanceof f&&this.hasAttribute("src")||this instanceof ShadowRoot){let k=V=>V.reduce((D,N)=>N instanceof HTMLScriptElement?D.concat(N):N instanceof f?D.concat(k([N.content])):(D=D.concat(k([...N.querySelectorAll?.("template")||[]].map(ie=>ie.content))),D.concat(...N.querySelectorAll?.("script")||[])),[]);for(let V of k(v)){if(this instanceof ShadowRoot){V.setAttribute("data-handling","manual");continue}let D=i.createElement("script");[...V.attributes].forEach(N=>D.setAttribute(N.name,N.value)),D.textContent=V.textContent,a(V,"replaceWith",()=>V.replaceWith(D))}}p==="outerHTML"?(h=new u,a(h,"append",()=>h.append(...v)),T=()=>a(this,"replaceWith",()=>l.prototype.replaceWith.call(this,h))):this instanceof f?T=()=>a(this.content,"replaceChildren",()=>this.content.replaceChildren(...v)):T=()=>a(this,"replaceChildren",()=>l.prototype.replaceChildren.call(this,...v))}return d({target:H,entrants:v,exits:E,type:"interception",event:[this,p]},T)}}),m}function zt(){ve.call(this),Se.call(this),Ae.call(this)}function ve(){let n=this;n.CSS||(n.CSS={}),n.CSS.escape||(n.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Se(){let n=this;"isConnected"in n.Node.prototype||Object.defineProperty(n.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Ae(){let n=this;n.Element.prototype.matches||(n.Element.prototype.matches=n.Element.prototype.matchesSelector||n.Element.prototype.mozMatchesSelector||n.Element.prototype.msMatchesSelector||n.Element.prototype.oMatchesSelector||n.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),e=r.length;--e>=0&&r.item(e)!==this;);return e>-1})}function Xt(){let n=this;if(n.webqit||(n.webqit={}),n.webqit.realdom)return n.webqit.realdom;n.webqit.realdom={},zt.call(n),n.webqit.realdom.meta=(...r)=>Ce.call(n,...r),n.webqit.realdom.ready=(...r)=>St.call(n,...r),n.webqit.realdom.realtime=(r,e="dom")=>{if(e==="dom")return new et(r,n);if(e==="attr")return new F(r,n)};let t=new K(n);return n.webqit.realdom.schedule=(r,...e)=>t[`on${r}`](...e),n.webqit.realdom.synthesizeWhile=(...r)=>t.synthesizeWhile(...r),n.webqit.realdom}function St(...n){let t="interactive",r;X(n[0])?(t=n[0],b(n[1])&&(r=n[1])):b(n[0])&&(r=n[0]);let e={interactive:["interactive","complete"],complete:["complete"]};if(!e[t])throw new Error(`Invalid ready-state timing: ${t}.`);let i=this;if(!r)return i.webqit.realdom.readyStatePromises||(i.webqit.realdom.readyStatePromises={interactive:new Promise(o=>St.call(this,"interactive",o)),complete:new Promise(o=>St.call(this,"complete",o))}),i.webqit.realdom.readyStatePromises[t];if(e[t].includes(i.document.readyState))return r(i);i.webqit.realdom.readyStateCallbacks||(i.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},i.document.addEventListener("readystatechange",()=>{let o=i.document.readyState;for(let s of i.webqit.realdom.readyStateCallbacks[o].splice(0))s(i)},!1)),i.webqit.realdom.readyStateCallbacks[t].push(r)}function Ce(n){let t=this,r={},e;return(e=t.document.querySelector(`meta[name="${n}"]`))&&(r=(e.content||"").split(";").filter(i=>i).reduce((i,o)=>{let s=o.split("=").map(l=>l.trim());return _t(i,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:P(s[1])?parseInt(s[1]):s[1]),i},{})),{get name(){return n},get content(){return e.content},json(){return JSON.parse(JSON.stringify(r))}}}function ut(n,t){return typeof n!="string"?n:n.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}var mt=(n,...t)=>q(n,"oohtml",...t),M={};function Ct(n,t,r){let e=this,i=Xt.call(e);M.window=e,e.webqitConfig||(e.webqitConfig=i.meta("webqit").json()),e.webqit||(e.webqit={}),e.webqit.oohtml||(e.webqit.oohtml={}),e.webqit.oohtml.configs||(e.webqit.oohtml.configs={});let o=n.toUpperCase().replace("-","_");if(!e.webqit.oohtml.configs[o]){e.webqit.oohtml.configs[o]={};let s=e.webqit.oohtml.configs[o];Y(2,s,r,t,i.meta(n).json()),e.webqitConfig.prefix&&Object.keys(s).forEach(l=>{Object.keys(s[l]).forEach(c=>{l==="api"&&typeof s[l][c]=="string"?s[l][c]=`${e.webqitConfig.prefix}${ut(s[l][c])}`:["attr","elements"].includes(l)&&s[l][c]?.startsWith("data-")===!1&&(s[l][c]=`${e.webqitConfig.prefix}-${s[l][c]}`)})})}return{config:e.webqit.oohtml.configs[o],realdom:i,window:e}}function Jt(n,t){return[...n].reduce(([r,e,i],o)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(o)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(o)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(o)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(o)&&!i[0].endsWith("\\")&&(r=r===o?null:r||o),i[0]+=o,[r,e,i]),[null,0,[""]])[2].reverse()}var Pe=()=>(0|Math.random()*9e6).toString(36),At=new Map;function dt(n){let t;return(t=At.get(n))||(t=Pe(),At.set(n,t)),t}function Yt(n){let t;return At.forEach((r,e)=>{r===n&&(t=e)}),t}function Zt(){let{window:n}=M,{webqit:t}=n;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class r extends n.Event{constructor(...i){let o=i.pop();if(typeof o!="function")throw new Error("Callback must be provided.");let s=i.pop();if(!s?.kind)throw new Error('"options.kind" must be specified.');let l=["contextrequest","contextclaim"],c=i.pop()||l[0];if(!l.includes(c))throw new Error(`Invalid event type. Must be one of: ${l.join(",")}`);let{kind:f,detail:u,targetContext:m,live:a,signal:d,diff:w,...O}=s;super(c,{...O,bubbles:O.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>o}),Object.defineProperty(this,"kind",{get:()=>f}),Object.defineProperty(this,"targetContext",{get:()=>m}),Object.defineProperty(this,"detail",{get:()=>u}),Object.defineProperty(this,"live",{get:()=>a}),Object.defineProperty(this,"signal",{get:()=>d}),Object.defineProperty(this,"diff",{get:()=>w}),Object.defineProperty(this,"options",{get:()=>O}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(i){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===i)return;Object.defineProperty(this,"_prevValue",{value:i,configurable:!0})}return this.callback(i)}}return t.DOMContextRequestEvent=r,r}var rt=class extends AbortController{constructor(t){super(),t(r=>{let{window:{webqit:{Observer:e}}}=M;e.defineProperty(this,"value",{value:r,configurable:!0,enumerable:!0})},this)}};var nt=class extends Error{};var it=class{static instance(t){return _wq(t).get("contexts::instance")||new this(t)}constructor(t){_wq(t).get("contexts::instance")?.dispose(),_wq(t).set("contexts::instance",this);let r={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>r})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(r=>typeof t[0]=="function"?t[0](r):r.constructor.kind===t[0]&&(!t[1]||r.detail===t[1]))}attach(t){if(!(t instanceof G))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new nt(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new rt((r,e)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(r):t[t.length-1]=r);let i;(i=t.find(s=>typeof s=="object"&&s))&&i.live&&(i.signal&&i.signal.addEventListener("abort",()=>e.abort()),t[t.indexOf(i)]={...i,signal:e.signal});let o=new(Zt())(...t);this["#"].host.dispatchEvent(o)})}};var Et=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=M;return t}get name(){return[M.window.Document,M.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof Et)||t.target===this.host)return;let r=new Set;if(this.subscriptions.forEach(e=>{!t.target.contains(e.target)||!t.detail.matchEvent(e)||(this.subscriptions.delete(e),this.unsubscribed(e),r.add(e))}),r.size)return t.respondWith(r)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:r}=it.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return r?.forEach(e=>{this.subscriptions.add(e),this.subscribed(e),this.handle(e)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(r=>{this.subscriptions.delete(r),this.unsubscribed(r);let{target:e}=r;r.meta.answered=!1,e.dispatchEvent(r)}),this}},G=Et;pt(G,"kind");function qe(n){let{lidrefPrefix:t,lidrefSeparator:r}=n.tokens;return{escape(e,i=1){return[...e].map(o=>/\w/.test(o)?o:i===2?`\\\\${o}`:`\\${o}`).join("")},lidrefPrefix(e=0){return e?this.escape(t,e):t},lidrefSeparator(e=0){return e?this.escape(r,e):r},isUuid(e,i=0){return e.startsWith(this.lidrefPrefix(i))&&e.includes(this.lidrefSeparator(i))},toUuid(e,i,o=0){return e.endsWith("-root")?i:`${this.lidrefPrefix(o)}${e}${this.lidrefSeparator(o)}${i}`},uuidToId(e,i=0){return this.isUuid(e)?e.split(this.lidrefSeparator(i))[1]:e},uuidToLidref(e,i=0){return this.isUuid(e)?`${this.lidrefPrefix(i)}${e.split(this.lidrefSeparator(i))[1]}`:e}}}function Kt(n,t,r=null,e=0){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:o}}}}=i,s=qe(o),l=new RegExp(`${r?":scope|":""}#(${s.lidrefPrefix(e+1)})?([\\w]+${s.lidrefSeparator(e+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[c,f]=Jt(n,",").reduce(([m,a],d)=>{let w,O;return d=d.replace(l,(L,p,y,_,h)=>{if(w||(w=[...d.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),w.some(E=>h>E.index&&h+L.length<E.index+E[0].length))return L;if(L===":scope")return O=!0,r;let C=p&&!y;if(p&&y)return`#${s.escape(L.replace("#",""),1)}`;if(C&&o.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${s.toUuid(t,_,1)}`;let T;return o.attr.lid==="id"?T=`:is(#${_},[id^="${s.lidrefPrefix(e)}"][id$="${s.lidrefSeparator(e)}${_}"])`:T=`:is(#${_},[${i.CSS.escape(o.attr.lid)}="${_}"])`,C?`:is(${T}):not(${r?r+" ":""}${o.namespaceSelector} *)`:T}),O?[m,a.concat(d)]:[m.concat(d),a]},[[],[]]),u;return r&&c.length?u=[c.length>1?`${r} :is(${c.join(", ")})`:`${r} ${c[0]}`,f.join(", ")].filter(m=>m).join(", "):u=[...c,...f].join(", "),u}function Ie(n){let t=this;if(!mt(n).has("namespace")){let r=Object.create(null);mt(n).set("namespace",r);let e=[t.Document,t.ShadowRoot].some(i=>n instanceof i);Object.defineProperty(r,Symbol.toStringTag,{get(){return e?"RootNamespaceRegistry":"NamespaceRegistry"}})}return mt(n).get("namespace")}function te(n,t=!1){let r=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:e}}}}=r,i=[r.Document,r.ShadowRoot].some(o=>n instanceof o);return Ie.call(r,i?n:(t?n.parentNode:n)?.closest?.(e.namespaceSelector)||n.getRootNode())}function ee(n){let t=Object.prototype.toString.call(n)==="[object RootNamespaceRegistry]";return(Yt(n)||dt(n))+(t?"-root":"")}function Pt({advanced:n={},...t}){let{config:r,window:e}=Ct.call(this,"scoped-css",t,{api:{styleSheets:"styleSheets"},style:{retention:"retain",mimeTypes:"text/css",strategy:null}});r.styleSelector=(Array.isArray(r.style.mimeTypes)?r.style.mimeTypes:r.style.mimeTypes.split("|")).concat("").reduce((i,o)=>{let s=o?`[type="${e.CSS.escape(o)}"]`:":not([type])";return i.concat(`style${s}`)},[]).join(","),e.webqit.oohtml.Style={compileCache:new Map},je.call(e,r),$e.call(e,r)}function je(n){let t=this,r=new Map;[t.Element.prototype].forEach(e=>{let i="Element";if(n.api.styleSheets in e)throw new Error(`The ${i} prototype already has a "${n.api.styleSheets}" API!`);Object.defineProperty(e,n.api.styleSheets,{get:function(){return r.has(this)||r.set(this,[]),r.get(this)}})}),Object.defineProperty(t.HTMLStyleElement.prototype,"scoped",{configurable:!0,get(){return this.hasAttribute("scoped")},set(e){this.toggleAttribute("scoped",e)}})}function $e(n){let t=this,{webqit:{oohtml:r,realdom:e}}=t,i=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1;t.CSS.supports||(t.CSS.supports=()=>!1);let o=new WeakSet;e.realtime(t.document).query(n.styleSelector,s=>{s.entrants.forEach(l=>{if(o.has(l))return;o.add(l);let c=dt(l.textContent),f=CSS.supports("selector(:has(a,b))"),u=l.scoped&&(f?`:has(> style[rand-${c}])`:`[rand-${c}]`),m=l.scoped&&t.CSSScopeRule&&!1,a=l.scoped&&l.parentNode||l.getRootNode();if(a instanceof t.Element){if(a[n.api.styleSheets].push(l),!i)return;(f?l:a).toggleAttribute(`rand-${c}`,!0)}if(!!i)if(l.scoped&&l.hasAttribute("shared")){let d;(d=r.Style.compileCache.get(c))||(d=Me.call(t,l,null,m,u),r.Style.compileCache.set(c,d)),Object.defineProperty(l,"sheet",{value:d,configurable:!0}),l.textContent=`
|
|
1
|
+
(()=>{var oe=Object.defineProperty;var se=(n,t,r)=>t in n?oe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var pt=(n,t,r)=>(se(n,typeof t!="symbol"?t+"":t,r),r);function x(n){return!Array.isArray(n)&&typeof n=="object"&&n}function g(n){return Array.isArray(n)}function X(n){return typeof n=="function"}function J(n){return n===null||n===""}function R(n){return arguments.length&&(n===void 0||typeof n>"u")}function S(n){return Array.isArray(n)||typeof n=="object"&&n||X(n)}function ht(n){return J(n)||R(n)||n===!1||n===0||S(n)&&!Object.keys(n).length}function b(n){return X(n)||n&&{}.toString.call(n)==="[object function]"}function Y(n){return n instanceof Number||typeof n=="number"}function P(n){return Y(n)||n!==!0&&n!==!1&&n!==null&&n!==""&&!isNaN(n*1)}function Q(n){return n instanceof String||typeof n=="string"&&n!==null}function gt(n){return!Q(n)&&!R(n.length)}function lt(n,...t){return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n}function yt(e,t){t=t||Object.prototype,t=t&&!g(t)?[t]:t;for(var r=[],e=e;e&&(!t||t.indexOf(e)<0)&&e.name!=="default";)r.push(e),e=e?Object.getPrototypeOf(e):null;return r}function wt(n,t){var r=[];return yt(n,t).forEach(e=>{lt(r,...Object.getOwnPropertyNames(e))}),r}function $(n,t,r=!1,e=!1,i=!1){var o=0,s=n.shift();if((P(s)||s===!0||s===!1)&&(o=s,s=n.shift()),!n.length)throw new Error("_merge() requires two or more array/objects.");return n.forEach((l,c)=>{!S(l)&&!b(l)||(r?wt(l):Object.keys(l)).forEach(f=>{if(!!t(f,s,l,c)){var u=s[f],m=l[f];if((g(u)&&g(m)||x(u)&&x(m))&&(o===!0||o>0))s[f]=g(u)&&g(m)?[]:{},$([P(o)?o-1:o,s[f],u,m],t,r,e,i);else if(g(s)&&g(l))e?s[f]=m:s.push(m);else try{i?Object.defineProperty(s,f,Object.getOwnPropertyDescriptor(l,f)):s[f]=l[f]}catch{}}})}),s}function Z(...n){return $(n,(t,r,e)=>!0,!1,!1,!1)}function q(n,...t){if(!n||!["object","function"].includes(typeof n))throw new Error("Argument #1 must be of type object");let r=n[Symbol.for("wq")];if(r||(r=new ct,Object.defineProperty(n,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!t.length)return r;let e,i;for(;e=t.shift();)(i=r)&&!(r=r.get(e))&&(r=new ct,i.set(e,r));return r}var ct=class extends Map{};function A(n,t=!0){return g(n)?n:!t&&x(n)?[n]:n!==!1&&n!==0&&ht(n)?[]:gt(n)?Array.prototype.slice.call(n):x(n)?Object.values(n):[n]}function K(n,t,r={},e={}){t=A(t).slice();for(var i=n;!R(i)&&!J(i)&&t.length;){var o=t.shift();if(!(r.get?r.get(i,o):S(i)?o in i:i[o])){e.exists=!1;return}i=r.get?r.get(i,o):i[o]}return e.exists=!0,i}function _t(n,t,r,e={},i={}){let o=(u,m,a)=>i.set?i.set(u,m,a):(P(t[l])&&g(u)?u.push(a):u[m]=a,!0);t=A(t);for(var s=n,l=0;l<t.length;l++)if(l<t.length-1){if(!s||!S(s)&&!b(s))return!1;var c=K(s,t[l],i);if(!S(c)){if(i.buildTree===!1)return!1;c=b(i.buildTree)?i.buildTree(l):P(t[l+1])?[]:{};var f=o(s,t[l],c);if(!f)return!1}s=c}else return o(s,t[l],r)}var tt=class{constructor(t,r=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!r&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let r=await t();return this._synthesis--,r}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.readCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.writeCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,r,e){this.onread(()=>{let i=t(e),o=s=>{s!==void 0&&this.onwrite(()=>{let l=r(s,e),c=f=>{f!==void 0&&this.cycle(t,r,f)};l instanceof Promise?l.then(c):c(l)})};i instanceof Promise?i.then(o):o(i)})}};function Dt(n){return(n=n.trim())&&n.startsWith("(")&&n.endsWith(")")}function ft(n,t,r,e=!0){r=(Array.isArray(r)?r:[r]).map(s=>(s+"").replace("(",e?"(.//":"(./")).join("|");let i=[],o;try{let s=n.document.evaluate(r,t,null,n.XPathResult.ANY_TYPE);for(;o=s.iterateNext();)i.push(o)}catch{}return i}function Nt(n,t,r){r=(Array.isArray(r)?r:[r]).map(e=>(e+"").replace("(","(self::")).join("|");try{return n.document.evaluate(`${r}`,t,null,n.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function et(n,t,r,e=!1,i=null){let o=i?.get(t)?.get(r);if(typeof o<"u")return o;let s=f=>(i?.has(t)||i?.set(t,new WeakMap),i?.get(t)?.set(r,f),f),l=t.getRootNode(),c=r.getRootNode();return l===c?s(t.contains(r)):e&&c instanceof n.ShadowRoot?s(et(n,t,c.host,e,i)):s(!1)}function Rt(n,t="|"){return[...n].reduce(([r,e,i,o],s)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(s)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(s)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(s)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(s)&&!i[0].endsWith("\\")&&(r=r===s?null:r||s),i[0]+=s,[r,e,i]),[null,0,[""]])[2].reverse()}var I=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Dt(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=Rt(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var G=class{constructor(t,r,e){this.context=t,this.namespace=r,this.window=t.defaultView||t.ownerDocument?.defaultView||e,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(b(t[0])?t=[[],...t]:x(t[0])&&!(t[0]instanceof I)&&t.length===1?t=[[],void 0,t[0]]:x(t[1])&&t.length===2?t=[A(t[0],!1),void 0,t[1]]:t[0]=A(t[0],!1),t[0].filter(r=>typeof r!="string"&&!(r instanceof I)&&!(r instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(r=>r instanceof I?r:new I(r)),t}registry(...t){return q(this.window,"realdom",this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,r,e){let{window:i}=this,o=new Set,s=new WeakMap;for(let[l,c]of this.registry(t)){let f=[].concat(r).filter(m=>et(i,l.context,m.target,l.params.subtree==="cross-roots",s));if(!f.length)continue;let u=[l,Array.isArray(r)?f:f[0]];c?o.add(u):e.call(i,...u)}for(let l of o)e.call(i,...l);o.clear()}disconnectables(t,...r){let e={disconnect(){r.forEach(i=>i&&b(i.disconnect)&&i.disconnect()||b(i)&&i()||x(i)&&(i.disconnected=!0))}};return t&&t.addEventListener("abort",()=>e.disconnect()),e}};var F=class extends G{type="attr";constructor(t,...r){super(t,"attr",...r)}get(t,r=void 0,e={}){let i=typeof t=="string"||t instanceof I;[t=[],r=void 0,e={}]=this.resolveArgs(arguments);let{context:o}=this,s=Ut(o,t);if(!r)return s;let l=e.lifecycleSignals&&this.createSignalGenerator();if(i)for(let c of s){let f=l?l.generate():{};r(c,f,o)}else{let c=l?.generate()||{};r(s,c,o)}if(e.live){l&&(e={...e,signalGenerator:l});let c=this.observe(i?t[0]:t,r,{newValue:!0,...e});return this.disconnectables(e.signal,c)}}observe(t,r,e={}){let i=typeof t=="string"||t instanceof I;if([t=[],r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(i?t[0]:t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:o,window:s,webqit:l}=this;e.eventDetails&&!l.realdom.attrInterceptionHooks?.intercepting&&kt.call(s,"intercept",()=>{});let c=new s.MutationObserver(a=>{a=Ft(a).map(d=>Wt.call(s,d)),Ht.call(s,m,a,o)}),f={attributes:!0,attributeOldValue:e.oldValue,subtree:e.subtree&&!0};t.length&&(f.attributeFilter=t.map(a=>a+"")),c.observe(o,f);let u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),m={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:c};return this.disconnectables(e.signal,c,u)}observeSync(t,r,e={}){let i=typeof t=="string"||t instanceof I;[t,r,e={}]=this.resolveArgs(arguments);let{context:o,window:s}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let l=e.timing==="intercept"?"intercept":"sync";this.registry(l).size||kt.call(s,l,a=>{this.forEachMatchingContext(l,a,Ht)});let c={disconnect(){m.delete(u)}},f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:f,disconnectable:c},m=this.registry(l);return m.set(u,!!u.params.deferred),this.disconnectables(e.signal,c,f)}};function Ft(n){return n.reduce((t,r,e)=>t[e-1]?.attributeName===r.attributeName||q(r.target,"realdom","internalAttrInteractions").get(r.attributeName)?t:t.concat(r),[])}function Ht(n,t){let{context:r,spec:e,callback:i,params:o,atomics:s,originalFilterIsString:l,signalGenerator:c}=n;if(o.subtree||(t=t.filter(a=>a.target===r)),!t.length)return;let f=e.map(a=>a+"");if(o.atomic&&!s.size?t=Ut(r,e,t):o.timing!=="async"&&e.length&&(t=t.filter(a=>f.includes(a.name))),!t.length)return;o.newValue===null&&o.oldValue===null&&o.eventDetails||(t=t.map(a=>{let d;return o.eventDetails||({event:d,...a}=a),!o.oldValue&&"oldValue"in a&&({oldValue:d,...a}=a),!o.newValue&&"value"in a?{value:d,...a}=a:o.newValue&&typeof a.value>"u"&&(a={...a,value:ut(a.target,a.name,()=>a.target.getAttribute(a.name))}),a})),o.atomic&&(t.forEach(a=>s.set(a.name,a)),t=Array.from(s.entries()).map(([,a])=>a));let u=l?t[0]:t,m=c?c.generate():{};i(u,m,r)}function ut(n,t,r){let e=q(n,"realdom","internalAttrInteractions").get(t);q(n,"realdom","internalAttrInteractions").set(t,!0);let i=r();return q(n,"realdom","internalAttrInteractions").set(t,e),i}function Ut(n,t,r=[]){let e={event:null,type:"attribute"};return t.length?t.map(o=>(o=o+"",r.find(s=>s.name===o)||{target:n,name:o,value:ut(n,o,()=>n.getAttribute(o)),...e})):Array.from(n.attributes).map(o=>r.find(s=>s.name===o.nodeName)||{target:n,name:o.nodeName,value:ut(n,o.nodeName,()=>o.nodeValue),...e})}function Wt({target:n,attributeName:t,value:r,oldValue:e}){let s=(this.webqit.realdom.attrInterceptionRecords?.get(n)||{})[t]?.[0]||"mutation";return{target:n,name:t,value:r,oldValue:e,type:"observation",event:s}}function kt(n,t){let r=this,{webqit:e,document:i,Element:o}=r;e.realdom.attrInterceptionHooks||Object.defineProperty(e.realdom,"attrInterceptionHooks",{value:new Map}),e.realdom.attrInterceptionHooks.has(n)||e.realdom.attrInterceptionHooks.set(n,new Set),e.realdom.attrInterceptionHooks.get(n).add(t);let s=()=>e.realdom.attrInterceptionHooks.get(n).delete(t);if(e.realdom.attrInterceptionHooks?.intercepting)return s;console.warn("Attr mutation APIs are now being intercepted."),e.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"attrInterceptionRecords",{value:new Map});let l=(u,m)=>{e.realdom.attrInterceptionRecords.has(u.target)||e.realdom.attrInterceptionRecords.set(u.target,{});let a=e.realdom.attrInterceptionRecords.get(u.target);if(a[u.name]=a[u.name]||[],a[u.name].unshift(u.event),q(u.target,"realdom","internalAttrInteractions").get(u.name))return m();e.realdom.attrInterceptionHooks.get("intercept")?.forEach(w=>w([u]));let d=m();return e.realdom.attrInterceptionHooks.get("sync")?.forEach(w=>w([u])),d};new r.MutationObserver(u=>{u=u.filter(m=>!(r.webqit.realdom.attrInterceptionRecords?.get(m.target)||{})[m.attributeName]?.shift()),u=Ft(u).map(m=>Wt.call(r,m)),u.length&&(e.realdom.attrInterceptionHooks.get("intercept")?.forEach(m=>m(u)),e.realdom.attrInterceptionHooks.get("sync")?.forEach(m=>m(u)))}).observe(i,{attributes:!0,subtree:!0,attributeOldValue:!0});let f=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(u=>{f[u]=o.prototype[u],o.prototype[u]=function(...m){let a,d=ut(this,m[0],()=>this.getAttribute(m[0]));["setAttribute","toggleAttribute"].includes(u)&&(a=m[1]),u==="toggleAttribute"&&a===void 0&&(a=d===null);let w={target:this,name:m[0],value:a,oldValue:d,type:"interception",event:[this,u]};return l(w,()=>f[u].call(this,...m))}}),s}var rt=class extends G{constructor(t,...r){super(t,"tree",...r)}attr(t,r=void 0,e={}){let{context:i,window:o}=this;return new F(i,o).get(...arguments)}query(t,r=void 0,e={}){[t,r=void 0,e={}]=this.resolveArgs(arguments);let{context:i}=this,o=new Map,s=f=>(o.has(f)||o.set(f,{target:f,entrants:[],exits:[],type:"query",event:null}),o.get(f));if(!e.generation||e.generation==="entrants"){if(!t.length)[...i.children].forEach(f=>s(i).entrants.push(f));else if(t.every(f=>f.type==="selector")){let[f,u]=t.reduce(([a,d],w)=>w.kind==="xpath"?[a,d.concat(w)]:[a.concat(w),d],[[],[]]),m=[];e.subtree?(f.length&&m.push(...i.querySelectorAll(f.join(","))),u.length&&m.push(...ft(this.window,i,u))):(f.length&&m.push(...[...i.children].filter(a=>a.matches(f))),u.length&&m.push(...ft(this.window,i,u,!1))),m.forEach(a=>s(a.parentNode||i).entrants.push(a))}}if(!r)return o;let l={disconnected:!1},c=r&&e.lifecycleSignals&&this.createSignalGenerator();for(let[,f]of o){if(l.disconnected)break;let u=c?.generate()||{};r(f,u,i)}if(e.live){c&&(e={...e,signalGenerator:c});let f=this.observe(t,r,e);return this.disconnectables(e.signal,l,f)}return this.disconnectables(e.signal,l,c)}children(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!1})}subtree(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!0})}observe(t,r,e={}){if([t,r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:i,window:o,webqit:s,document:l}=this;e.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(l.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&Gt.call(o,"sync",()=>{});let c=new o.MutationObserver(m=>m.forEach(a=>{vt.call(o,u,Bt.call(o,a),i)}));c.observe(i,{childList:!0,subtree:e.subtree&&!0});let f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:i,spec:t,callback:r,params:e,signalGenerator:f,disconnectable:c};if(e.staticSensitivity){let m=Vt.call(o,u);return this.disconnectables(e.signal,c,f,m)}return this.disconnectables(e.signal,c,f)}observeSync(t,r,e={}){[t,r,e={}]=this.resolveArgs(arguments);let{context:i,window:o}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let s=e.timing==="intercept"?"intercept":"sync";this.registry(s).size||Gt.call(o,s,a=>{this.forEachMatchingContext(s,a,vt)});let l=new o.MutationObserver(a=>a.forEach(d=>{Array.isArray((d=Bt.call(o,d)).event)||vt.call(o,u,d,i)}));l.observe(i,{childList:!0,subtree:e.subtree&&!0});let c={disconnect(){m.delete(u),l.disconnect()}},f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:i,spec:t,callback:r,params:e,signalGenerator:f,disconnectable:c},m=this.registry(s);if(m.set(u,!!u.params.deferred),e.staticSensitivity){let a=Vt.call(o,u);return this.disconnectables(e.signal,c,f,a)}return this.disconnectables(e.signal,c,f)}track(t,r,e={}){return e={subtree:!0,...e},this.observe(t,i=>{i.entrants.length&&r(!0,Array.isArray(t)?i.entrants:i.entrants[0]),i.exits.length&&r(!1,Array.isArray(t)?i.exits:i.exits[0])},e)}};function Vt(n){let t=this,{context:r,spec:e,callback:i,params:o,signalGenerator:s}=n,l=e.filter(d=>d.kind==="css"),c=d=>d.match(/\.([\w-]+)/g)?.length?["class"]:[],f=d=>d.match(/#([\w-]+)/g)?.length?["id"]:[],u=d=>[...d.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(w=>w[1]).concat(c(d)).concat(f(d));if(!(n.$attrs=Array.from(new Set(l.filter(d=>(d+"").includes("[")).reduce((d,w)=>d.concat(u(w+"")),[])))).length)return;let m=new Set,a=new Set;return m.push=d=>(a.delete(d),m.add(d)),a.push=d=>(m.delete(d),a.add(d)),n.$deliveryCache={entrants:m,exits:a},new F(r,t).observe(n.$attrs,d=>{let w=new Map,O=y=>(w.has(y)||w.set(y,{target:y,entrants:[],exits:[],type:"static",event:null}),w.get(y)),L=new WeakMap,p=y=>(L.has(y)||L.set(y,l.some(_=>y.matches(_+""))),L.get(y));for(let y of d)["entrants","exits"].forEach(_=>{o.generation&&_!==o.generation||n.$deliveryCache[_].has(y.target)||(_==="entrants"?!p(y.target):p(y.target))||(n.$deliveryCache[_].push(y.target),O(y.target)[_].push(y.target),O(y.target).event=y.event)});for(let[,y]of w){let _=s?.generate()||{};i(y,_,r)}},{subtree:o.subtree,timing:o.timing,eventDetails:o.eventDetails})}function vt(n,t){let{context:r,spec:e,callback:i,params:o,signalGenerator:s,$deliveryCache:l}=n,c={...t,entrants:[],exits:[]};if(o.eventDetails||delete c.event,["entrants","exits"].forEach(u=>{if(!(o.generation&&u!==o.generation)&&(e.length?c[u]=Oe.call(this,e,o.subtree==="cross-roots",t[u],t.event!=="parse"):c[u]=[...t[u]],!!l))for(let m of c[u])l[u].push(m)}),!c.entrants.length&&!c.exits.length)return;let f=s?.generate()||{};i(c,f,r)}function Oe(n,t,r,e){r=Array.isArray(r)?r:[...r];let i=(o,s)=>{if(s.type==="selector"){let l=s.isXpathAttr?[]:o.filter(c=>s.kind==="xpath"?Nt(this,c,s+""):c.matches&&c.matches(s+""));if((e||s.isXpathAttr)&&(l=o.reduce((c,f)=>s.kind==="xpath"?[...c,...ft(this,f,s,e)]:f.querySelectorAll?[...c,...f.querySelectorAll(s+"")]:c,l)),l.length)return l}else if(o.includes(s.content)||e&&o.some(l=>et(this,l,s.content,t)))return[s.content]};return r.$$searchCache||(r.$$searchCache=new Map),n.reduce((o,s)=>{let l;return r.$$searchCache.has(s.content)?l=r.$$searchCache.get(s.content):(l=i(r,s)||[],s.type==="instance"&&r.$$searchCache.set(s.content,l)),o.concat(l)},[])}function Bt({target:n,addedNodes:t,removedNodes:r}){let e=this,i;return i=A(t).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),null),i=A(r).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),i),i=i||e.document.readyState==="loading"&&"parse"||"mutation",{target:n,entrants:t,exits:r,type:"observation",event:i}}function Gt(n,t){let r=this,{webqit:e,document:i,Node:o,CharacterData:s,Element:l,HTMLElement:c,HTMLTemplateElement:f,DocumentFragment:u}=r;e.realdom.domInterceptionHooks||Object.defineProperty(e.realdom,"domInterceptionHooks",{value:new Map}),e.realdom.domInterceptionNoRecurse||Object.defineProperty(e.realdom,"domInterceptionNoRecurse",{value:new Map}),e.realdom.domInterceptionHooks.has(n)||e.realdom.domInterceptionHooks.set(n,new Set),e.realdom.domInterceptionHooks.get(n).add(t);let m=()=>e.realdom.domInterceptionHooks.get(n).delete(t);if(e.realdom.domInterceptionHooks?.intercepting)return m;console.warn("DOM mutation APIs are now being intercepted."),e.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"domInterceptionRecords",{value:new Map});let a=(p,y,_)=>{e.realdom.domInterceptionNoRecurse.set(p,y);let h=_();return e.realdom.domInterceptionNoRecurse.delete(p),h},d=(p,y)=>{p.entrants.concat(p.exits).forEach(h=>{clearTimeout(e.realdom.domInterceptionRecords.get(h)?.timeout),e.realdom.domInterceptionRecords.set(h,p.event);let C=setTimeout(()=>{e.realdom.domInterceptionRecords.delete(h)},0);Object.defineProperty(p.event,"timeout",{value:C,configurable:!0})}),e.realdom.domInterceptionHooks.get("intercept")?.forEach(h=>h(p));let _=y();return e.realdom.domInterceptionHooks.get("sync")?.forEach(h=>h(p)),_},w={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},O={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(w).reduce((p,y)=>p.concat(y),[])).forEach(p=>{Object.keys(w).forEach(h=>{if(!w[h].includes(p))return;let C=Object.getOwnPropertyDescriptor(r[h].prototype,p);!C||(Object.defineProperty(r[h].prototype,p,"value"in C?{...C,value:y}:{...C,set:_}),O[h][p]=C)});function y(...h){let C=Object.keys(O).find(j=>this instanceof r[j]&&p in O[j]),W=O[C],T=()=>W[p].value.call(this,...h);if(e.realdom.domInterceptionNoRecurse.get(this)===p)return T();let E=[],v=[],H=this;["insertBefore"].includes(p)?v=[h[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(p)?(v=[h[1]],["beforebegin","afterend"].includes(h[0])&&(H=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(p)?(E=[...this.childNodes],v=p==="replaceChildren"?[...h]:[h[0]]):["replaceWith","remove"].includes(p)?(E=[this],v=p==="replaceWith"?[...h]:[],H=this.parentNode):["replaceChild"].includes(p)?(E=[h[1]],v=[h[0]]):["removeChild"].includes(p)?E=[...h]:(v=[...h],["before","after"].includes(p)&&(H=this.parentNode));let st=p;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(p)){let j=this.nodeName;if(p==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(h[0])){if(!this.parentNode)return W[p].value.call(this,...h);j=this.parentNode.nodeName}let k=i.createElement(j.includes("-")?"div":j);W.setHTMLUnsafe.value.call(k,v[0],p==="setHTMLUnsafe"?h[1]:{}),v=[...k.childNodes],p==="insertAdjacentHTML"?(st="insertAdjacentElement",h[1]=new u,a(h[1],"append",()=>h[1].append(...k.childNodes))):(st="replaceChildren",h=[...k.childNodes])}return d({target:H,entrants:v,exits:E,type:"interception",event:[this,p]},()=>W[st].value.call(this,...h))}function _(h){let C=Object.keys(O).find(V=>this instanceof r[V]&&p in O[V]),W=O[C],T=()=>W[p].set.call(this,h);if(this instanceof HTMLScriptElement||e.realdom.domInterceptionNoRecurse.get(this)===p)return T();let E=[],v=[],H=this;if(["outerHTML","outerText"].includes(p)?(E=[this],H=this.parentNode):this instanceof f?(H=this.content,E=[...this.content.childNodes]):E=[...this.childNodes],["outerHTML","innerHTML"].includes(p)){let V=this.nodeName;if(p==="outerHTML"){if(!this.parentNode)return T();V=this.parentNode.nodeName}let j=i.createElement(V.includes("-")?"div":V);if(a(j,p,()=>j[p]=h),v=this instanceof f?[...j.content.childNodes]:[...j.childNodes],this instanceof f&&this.hasAttribute("src")||this instanceof ShadowRoot){let k=B=>B.reduce((D,N)=>N instanceof HTMLScriptElement?D.concat(N):N instanceof f?D.concat(k([N.content])):(D=D.concat(k([...N.querySelectorAll?.("template")||[]].map(ie=>ie.content))),D.concat(...N.querySelectorAll?.("script")||[])),[]);for(let B of k(v)){if(this instanceof ShadowRoot){B.setAttribute("data-handling","manual");continue}let D=i.createElement("script");[...B.attributes].forEach(N=>D.setAttribute(N.name,N.value)),D.textContent=B.textContent,a(B,"replaceWith",()=>B.replaceWith(D))}}p==="outerHTML"?(h=new u,a(h,"append",()=>h.append(...v)),T=()=>a(this,"replaceWith",()=>l.prototype.replaceWith.call(this,h))):this instanceof f?T=()=>a(this.content,"replaceChildren",()=>this.content.replaceChildren(...v)):T=()=>a(this,"replaceChildren",()=>l.prototype.replaceChildren.call(this,...v))}return d({target:H,entrants:v,exits:E,type:"interception",event:[this,p]},T)}}),m}function zt(){ve.call(this),Se.call(this),Ae.call(this)}function ve(){let n=this;n.CSS||(n.CSS={}),n.CSS.escape||(n.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Se(){let n=this;"isConnected"in n.Node.prototype||Object.defineProperty(n.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Ae(){let n=this;n.Element.prototype.matches||(n.Element.prototype.matches=n.Element.prototype.matchesSelector||n.Element.prototype.mozMatchesSelector||n.Element.prototype.msMatchesSelector||n.Element.prototype.oMatchesSelector||n.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),e=r.length;--e>=0&&r.item(e)!==this;);return e>-1})}function Xt(){let n=this;if(n.webqit||(n.webqit={}),n.webqit.realdom)return n.webqit.realdom;n.webqit.realdom={},zt.call(n),n.webqit.realdom.meta=(...r)=>Ce.call(n,...r),n.webqit.realdom.ready=(...r)=>St.call(n,...r),n.webqit.realdom.realtime=(r,e="dom")=>{if(e==="dom")return new rt(r,n);if(e==="attr")return new F(r,n)};let t=new tt(n);return n.webqit.realdom.schedule=(r,...e)=>t[`on${r}`](...e),n.webqit.realdom.synthesizeWhile=(...r)=>t.synthesizeWhile(...r),n.webqit.realdom}function St(...n){let t="interactive",r;Q(n[0])?(t=n[0],b(n[1])&&(r=n[1])):b(n[0])&&(r=n[0]);let e={interactive:["interactive","complete"],complete:["complete"]};if(!e[t])throw new Error(`Invalid ready-state timing: ${t}.`);let i=this;if(!r)return i.webqit.realdom.readyStatePromises||(i.webqit.realdom.readyStatePromises={interactive:new Promise(o=>St.call(this,"interactive",o)),complete:new Promise(o=>St.call(this,"complete",o))}),i.webqit.realdom.readyStatePromises[t];if(e[t].includes(i.document.readyState))return r(i);i.webqit.realdom.readyStateCallbacks||(i.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},i.document.addEventListener("readystatechange",()=>{let o=i.document.readyState;for(let s of i.webqit.realdom.readyStateCallbacks[o].splice(0))s(i)},!1)),i.webqit.realdom.readyStateCallbacks[t].push(r)}function Ce(n){let t=this,r={},e;return(e=t.document.querySelector(`meta[name="${n}"]`))&&(r=(e.content||"").split(";").filter(i=>i).reduce((i,o)=>{let s=o.split("=").map(l=>l.trim());return _t(i,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:P(s[1])?parseInt(s[1]):s[1]),i},{})),{get name(){return n},get content(){return e.content},json(){return JSON.parse(JSON.stringify(r))}}}function mt(n,t){return typeof n!="string"?n:n.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}var U=(n,...t)=>q(n,"oohtml",...t),M={};function Ct(n,t,r){let e=this,i=Xt.call(e);M.window=e,e.webqitConfig||(e.webqitConfig=i.meta("webqit").json()),e.webqit||(e.webqit={}),e.webqit.oohtml||(e.webqit.oohtml={}),e.webqit.oohtml.configs||(e.webqit.oohtml.configs={});let o=n.toUpperCase().replace("-","_");if(!e.webqit.oohtml.configs[o]){e.webqit.oohtml.configs[o]={};let s=e.webqit.oohtml.configs[o];Z(2,s,r,t,i.meta(n).json()),e.webqitConfig.prefix&&Object.keys(s).forEach(l=>{Object.keys(s[l]).forEach(c=>{l==="api"&&typeof s[l][c]=="string"?s[l][c]=`${e.webqitConfig.prefix}${mt(s[l][c])}`:["attr","elements"].includes(l)&&s[l][c]?.startsWith("data-")===!1&&(s[l][c]=`${e.webqitConfig.prefix}-${s[l][c]}`)})})}return{config:e.webqit.oohtml.configs[o],realdom:i,window:e}}function Jt(n,t){return[...n].reduce(([r,e,i],o)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(o)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(o)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(o)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(o)&&!i[0].endsWith("\\")&&(r=r===o?null:r||o),i[0]+=o,[r,e,i]),[null,0,[""]])[2].reverse()}var Pe=()=>(0|Math.random()*9e6).toString(36),At=new Map;function dt(n){let t;return(t=At.get(n))||(t=Pe(),At.set(n,t)),t}function Yt(n){let t;return At.forEach((r,e)=>{r===n&&(t=e)}),t}function Zt(){let{window:n}=M,{webqit:t}=n;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class r extends n.Event{constructor(...i){let o=i.pop();if(typeof o!="function")throw new Error("Callback must be provided.");let s=i.pop();if(!s?.kind)throw new Error('"options.kind" must be specified.');let l=["contextrequest","contextclaim"],c=i.pop()||l[0];if(!l.includes(c))throw new Error(`Invalid event type. Must be one of: ${l.join(",")}`);let{kind:f,detail:u,targetContext:m,live:a,signal:d,diff:w,...O}=s;super(c,{...O,bubbles:O.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>o}),Object.defineProperty(this,"kind",{get:()=>f}),Object.defineProperty(this,"targetContext",{get:()=>m}),Object.defineProperty(this,"detail",{get:()=>u}),Object.defineProperty(this,"live",{get:()=>a}),Object.defineProperty(this,"signal",{get:()=>d}),Object.defineProperty(this,"diff",{get:()=>w}),Object.defineProperty(this,"options",{get:()=>O}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(i){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===i)return;Object.defineProperty(this,"_prevValue",{value:i,configurable:!0})}return this.callback(i)}}return t.DOMContextRequestEvent=r,r}var nt=class extends AbortController{constructor(t){super(),t(r=>{let{window:{webqit:{Observer:e}}}=M;e.defineProperty(this,"value",{value:r,configurable:!0,enumerable:!0})},this)}};var it=class extends Error{};var ot=class{static instance(t){return U(t).get("contexts::instance")||new this(t)}constructor(t){U(t).get("contexts::instance")?.dispose(),U(t).set("contexts::instance",this);let r={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>r})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(r=>typeof t[0]=="function"?t[0](r):r.constructor.kind===t[0]&&(!t[1]||r.detail===t[1]))}attach(t){if(!(t instanceof z))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new it(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new nt((r,e)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(r):t[t.length-1]=r);let i;(i=t.find(s=>typeof s=="object"&&s))&&i.live&&(i.signal&&i.signal.addEventListener("abort",()=>e.abort()),t[t.indexOf(i)]={...i,signal:e.signal});let o=new(Zt())(...t);this["#"].host.dispatchEvent(o)})}};var Et=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=M;return t}get name(){return[M.window.Document,M.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof Et)||t.target===this.host)return;let r=new Set;if(this.subscriptions.forEach(e=>{!t.target.contains(e.target)||!t.detail.matchEvent(e)||(this.subscriptions.delete(e),this.unsubscribed(e),r.add(e))}),r.size)return t.respondWith(r)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:r}=ot.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return r?.forEach(e=>{this.subscriptions.add(e),this.subscribed(e),this.handle(e)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(r=>{this.subscriptions.delete(r),this.unsubscribed(r);let{target:e}=r;r.meta.answered=!1,e.dispatchEvent(r)}),this}},z=Et;pt(z,"kind");function qe(n){let{lidrefPrefix:t,lidrefSeparator:r}=n.tokens;return{escape(e,i=1){return[...e].map(o=>/\w/.test(o)?o:i===2?`\\\\${o}`:`\\${o}`).join("")},lidrefPrefix(e=0){return e?this.escape(t,e):t},lidrefSeparator(e=0){return e?this.escape(r,e):r},isUuid(e,i=0){return e.startsWith(this.lidrefPrefix(i))&&e.includes(this.lidrefSeparator(i))},toUuid(e,i,o=0){return e.endsWith("-root")?i:`${this.lidrefPrefix(o)}${e}${this.lidrefSeparator(o)}${i}`},uuidToId(e,i=0){return this.isUuid(e)?e.split(this.lidrefSeparator(i))[1]:e},uuidToLidref(e,i=0){return this.isUuid(e)?`${this.lidrefPrefix(i)}${e.split(this.lidrefSeparator(i))[1]}`:e}}}function Kt(n,t,r=null,e=0){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:o}}}}=i,s=qe(o),l=new RegExp(`${r?":scope|":""}#(${s.lidrefPrefix(e+1)})?([\\w]+${s.lidrefSeparator(e+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[c,f]=Jt(n,",").reduce(([m,a],d)=>{let w,O;return d=d.replace(l,(L,p,y,_,h)=>{if(w||(w=[...d.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),w.some(E=>h>E.index&&h+L.length<E.index+E[0].length))return L;if(L===":scope")return O=!0,r;let C=p&&!y;if(p&&y)return`#${s.escape(L.replace("#",""),1)}`;if(C&&o.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${s.toUuid(t,_,1)}`;let T;return o.attr.lid==="id"?T=`:is(#${_},[id^="${s.lidrefPrefix(e)}"][id$="${s.lidrefSeparator(e)}${_}"])`:T=`:is(#${_},[${i.CSS.escape(o.attr.lid)}="${_}"])`,C?`:is(${T}):not(${r?r+" ":""}${o.namespaceSelector} *)`:T}),O?[m,a.concat(d)]:[m.concat(d),a]},[[],[]]),u;return r&&c.length?u=[c.length>1?`${r} :is(${c.join(", ")})`:`${r} ${c[0]}`,f.join(", ")].filter(m=>m).join(", "):u=[...c,...f].join(", "),u}function Ie(n){let t=this;if(!U(n).has("namespace")){let r=Object.create(null);U(n).set("namespace",r);let e=[t.Document,t.ShadowRoot].some(i=>n instanceof i);Object.defineProperty(r,Symbol.toStringTag,{get(){return e?"RootNamespaceRegistry":"NamespaceRegistry"}})}return U(n).get("namespace")}function te(n,t=!1){let r=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:e}}}}=r,i=[r.Document,r.ShadowRoot].some(o=>n instanceof o);return Ie.call(r,i?n:(t?n.parentNode:n)?.closest?.(e.namespaceSelector)||n.getRootNode())}function ee(n){let t=Object.prototype.toString.call(n)==="[object RootNamespaceRegistry]";return(Yt(n)||dt(n))+(t?"-root":"")}function Pt({advanced:n={},...t}){let{config:r,window:e}=Ct.call(this,"scoped-css",t,{api:{styleSheets:"styleSheets"},style:{retention:"retain",mimeTypes:"text/css",strategy:null}});r.styleSelector=(Array.isArray(r.style.mimeTypes)?r.style.mimeTypes:r.style.mimeTypes.split("|")).concat("").reduce((i,o)=>{let s=o?`[type="${e.CSS.escape(o)}"]`:":not([type])";return i.concat(`style${s}`)},[]).join(","),e.webqit.oohtml.Style={compileCache:new Map},je.call(e,r),$e.call(e,r)}function je(n){let t=this,r=new Map;[t.Element.prototype].forEach(e=>{let i="Element";if(n.api.styleSheets in e)throw new Error(`The ${i} prototype already has a "${n.api.styleSheets}" API!`);Object.defineProperty(e,n.api.styleSheets,{get:function(){return r.has(this)||r.set(this,[]),r.get(this)}})}),Object.defineProperty(t.HTMLStyleElement.prototype,"scoped",{configurable:!0,get(){return this.hasAttribute("scoped")},set(e){this.toggleAttribute("scoped",e)}})}function $e(n){let t=this,{webqit:{oohtml:r,realdom:e}}=t,i=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1;t.CSS.supports||(t.CSS.supports=()=>!1);let o=new WeakSet;e.realtime(t.document).query(n.styleSelector,s=>{s.entrants.forEach(l=>{if(o.has(l))return;o.add(l);let c=dt(l.textContent),f=CSS.supports("selector(:has(a,b))"),u=l.scoped&&(f?`:has(> style[rand-${c}])`:`[rand-${c}]`),m=l.scoped&&t.CSSScopeRule&&!1,a=l.scoped&&l.parentNode||l.getRootNode();if(a instanceof t.Element){if(a[n.api.styleSheets].push(l),!i)return;(f?l:a).toggleAttribute(`rand-${c}`,!0)}if(!!i)if(l.scoped&&l.hasAttribute("shared")){let d;(d=r.Style.compileCache.get(c))||(d=Me.call(t,l,null,m,u),r.Style.compileCache.set(c,d)),Object.defineProperty(l,"sheet",{value:d,configurable:!0}),l.textContent=`
|
|
2
2
|
/*[ Shared style sheet ]*/
|
|
3
3
|
`}else{let d=()=>{let w=ee(te.call(t,a));Tt.call(this,l.sheet,w,!m&&u)};l.isConnected?d():setTimeout(()=>{d()},0)}})},{id:"scoped-css",live:!0,subtree:"cross-roots",timing:"intercept",generation:"entrants"})}function Me(n,t,r,e){let i=this,o=n.textContent,s,l=r&&e?`@scope (${e}) {
|
|
4
4
|
${o.trim()}
|