@webqit/oohtml 1.10.0-0 → 1.10.2
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/html-imports.js +2 -2
- package/dist/html-imports.js.map +2 -2
- package/dist/html-modules.js +2 -2
- package/dist/html-modules.js.map +2 -2
- package/dist/main.js +1 -1
- package/dist/main.js.map +2 -2
- package/dist/namespaced-html.js +2 -2
- package/dist/namespaced-html.js.map +1 -1
- package/dist/state-api.js +1 -1
- package/dist/state-api.js.map +1 -1
- package/dist/subscript.js +5 -5
- package/dist/subscript.js.map +1 -1
- package/package.json +1 -1
- package/src/html-modules/index.js +9 -9
- package/src/util.js +9 -4
package/dist/html-imports.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{function ot(t,e,r=!1){if(e=="")return t;var o=r?t.lastIndexOf(e):t.indexOf(e);return o===-1?"":t.substr(o+e.length)}function it(t,e){return t.reduce((r,o,i)=>r||e(o,i),!1)}function vt(t,e,r=!1){if(e=="")return t;var o=r?t.lastIndexOf(e):t.indexOf(e);return o===-1?t:t.substr(0,o)}function F(t){return arguments.length&&(t===void 0||typeof t>"u")}function z(t){return typeof t=="function"}function v(t){return z(t)||t&&{}.toString.call(t)==="[object function]"}function nt(t,...e){return e.forEach(r=>{t.indexOf(r)<0&&t.push(r)}),t}function h(t){return Array.isArray(t)}function Q(t){return t instanceof String||typeof t=="string"&&t!==null}function Ot(t){return!Q(t)&&!F(t.length)}function st(t){return t===null||t===""}function w(t){return Array.isArray(t)||typeof t=="object"&&t||z(t)}function wt(t){return st(t)||F(t)||t===!1||t===0||w(t)&&!Object.keys(t).length}function x(t){return!Array.isArray(t)&&typeof t=="object"&&t}function S(t,e=!0){return h(t)?t:!e&&x(t)?[t]:t!==!1&&t!==0&&wt(t)?[]:Ot(t)?Array.prototype.slice.call(t):x(t)?Object.values(t):[t]}function bt(t,e,r=null){return h(e)?t.filter(o=>r?e.filter(i=>r(o,i)).length:e.indexOf(o)===-1):[]}function ft(t,e,r=!1){for(var o=t.indexOf(e);o>-1&&(r||r===!1);)t.splice(o,1),r>0&&r--,o=t.indexOf(e);return t}function I(t,e=1){var r=0;t.forEach(i=>{r++});var o=t.slice(t.length-r,e);return arguments.length>1?o:o[0]}function U(t){return t instanceof Number||typeof t=="number"}function W(t){return U(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}var Ut=function(t,e=1,r=!0){return!W(e)||e<=0||(!h(t)&&x(t)&&r&&(t=Object.values(t)),!h(t))?t:t.reduce((o,i)=>h(i)||x(i)&&r?o.concat(Ut(h(i)?i:Object.values(i),e-1,r)):o.concat(i),[])},At=Ut;function G(t){return t===!0||t===!1}function T(t,e=1){return arguments.length>1?I(t.slice().reverse(),e).reverse():I(t.slice().reverse())}function J(t,e){var r=void 0;return w(t)&&Object.keys(t).forEach((o,i)=>{r!==!1&&(r=e(W(o)?parseFloat(o):o,t[o],i))}),r}function K(t){let e=(r,o,i)=>i.indexOf(r)===o;return t.filter(e)}function _(t,...e){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(t);if(!r){if(r=new Map,e[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(t,r)}for(var o,i;o=e.shift();)if((i=r)&&!(r=r.get(o))){if(r=new Map,e[0]===!1)return r;i.set(o,r)}return r}function ut(t){return x(t)&&Object.getPrototypeOf(t)===Object.prototype}function Ct(o,e){e=e||Object.prototype,e=e&&!h(e)?[e]:e;for(var r=[],o=o;o&&(!e||e.indexOf(o)<0)&&o.name!=="default";)r.push(o),o=o?Object.getPrototypeOf(o):null;return r}function St(t,e){var r=[];return Ct(t,e).forEach(o=>{nt(r,...Object.getOwnPropertyNames(o))}),r}function M(t,e,r=!1,o=!1,i=!1){var s=0,n=t.shift();if((W(n)||n===!0||n===!1)&&(s=n,n=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((f,u)=>{!w(f)&&!v(f)||(r?St(f):Object.getOwnPropertyNames(f)).forEach(m=>{if(!!e(m,n,f,u)){var p=n[m],a=f[m];if((h(p)&&h(a)||x(p)&&x(a))&&(s===!0||s>0))n[m]=h(p)&&h(a)?[]:{},M([W(s)?s-1:s,n[m],p,a],e,r,o,i);else if(h(n)&&h(f))o?n[m]=a:n.push(a);else try{i?Object.defineProperty(n,m,Object.getOwnPropertyDescriptor(f,m)):n[m]=f[m]}catch{}}})}),n}function R(...t){return M(t,(e,r,o)=>!0,!1,!1,!1)}function Z(t,e,r=!0,o=!0,i=!1,s=!1){if(h(t)&&h(e)){var n=[],f=!0;return t.forEach(u=>{if(!!f){var m=!1;J(e,(p,a)=>{(!m||o&&w(u))&&(m=r(u,a),(h(m)&&!m.length||x(m)&&!Object.keys(m).length)&&(m=!1),w(m)&&o&&(u=m))}),w(m)?n.push(o?m:u):G(m)?i&&!m||!i&&m?n.push(u):s&&(f=!1):n.push(m)}}),n}if(x(t)&&x(e)){var n={},f=!0;return Object.keys(t).forEach(p=>{if(!!f){var a=r(t[p],e[p]);(h(a)&&!a.length||x(a)&&!Object.keys(a).length)&&(a=!1),w(a)?n[p]=o?a:t[p]:G(a)?i&&!a||!i&&a?n[p]=t[p]:s&&(f=!1):n[p]=a}}),n}}function mt(t,e=[]){return M([{},t],(r,o,i)=>{if(!v(i[r]))return v(e)?e(r):h(e)&&e.length?e.indexOf(r)>-1:!0},!1,!1,!1)}var Et=function(t,e,r=!0,o=1){if(h(t)&&h(e)&&t.length!==e.length)return!r;if(x(t)&&x(e)){var i=Object.keys(t),s=Object.keys(e);if(!i.length&&!s.length)return ut(t)&&ut(e)?r:t===e===r;if(!Et(i,s))return!r}if(o>0&&(h(t)&&h(e)||x(t)&&x(e))){var n=Z(t,e,(f,u)=>Et(f,u,r,o-1),!1,!1,!0);return h(n)?n.length===t.length&&n.length===e.length:x(n)&&x(t)?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).length===Object.keys(e).length:n}return v(r)?r(t,e):U(t)&&U(e)&&isNaN(t)&&isNaN(e)?r:t===e===r},Nt=Et;function P(t){return!Array.isArray(t)&&typeof t=="object"&&t}function Ht(t){var e=typeof t.InstallTrigger<"u";if(e)return"firefox";var r=/constructor/i.test(t.HTMLElement)||function(m){return m.toString()==="[object SafariRemoteNotification]"}(!t.safari||typeof t.safari<"u"&&t.safari.pushNotification);if(r)return"safari";var o=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime),i=o&&t.navigator.userAgent.indexOf("Edg")!=-1,s=!!t.opr&&!!t.opr.addons||!!t.opera||t.navigator.userAgent.indexOf(" OPR/")>=0,n=!!t.document.documentMode,f=!n&&!!t.StyleMedia,u=(o||s)&&!!t.CSS;return f?"edge":n?"ie":s?"opera":i?"ie-chromium":o?"chrome":"unknown"}function Vt(t){var e=t.getComputedStyle(t.document.documentElement,""),r=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||e.Olink===""&&["","o"])[1],o=("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1];return{api:o,prefix:r,css:"-"+r+"-"}}function D(){if(!(P(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let t=P(this)&&this.window?this.window:window;if(t.WebQit||(t.WebQit={}),!t.WebQit.window){let e,r;Object.defineProperty(t.WebQit,"window",{get:()=>t}),Object.defineProperty(t.WebQit,"vendor",{value:{getName:()=>(e||(e=Ht(t)),e),getPrefix:()=>(r||(r=Vt(t)),r)}})}return t.WebQit}function at(t){return typeof t=="function"}function N(t){return Array.isArray(t)||typeof t=="object"&&t||at(t)}function jt(t){return t instanceof Number||typeof t=="number"}function L(t){return jt(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}var tt=class{constructor(e,r=!0){this.window=e,this.async=r,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((e,r)=>{e&&!e()&&(this.readCallbacks[r]=null)}),this.writeCallbacks.forEach((e,r)=>{e&&!e()&&(this.writeCallbacks[r]=null)}),this._run()})}onread(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.readCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.readCallbacks.push(e)}onwrite(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.writeCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.writeCallbacks.push(e)}cycle(e,r,o){this.onread(()=>{var i=e(o);if(i){var s=n=>{this.onwrite(()=>{var f=r(n,o);if(f){var u=m=>{this.cycle(e,r,m)};f instanceof Promise?f.then(u):u()}})};i instanceof Promise?i.then(s):s()}})}};function q(t){return t instanceof String||typeof t=="string"&&t!==null}function H(t){return Array.isArray(t)}function X(t){return arguments.length&&(t===void 0||typeof t>"u")}function zt(t){return!q(t)&&!X(t.length)}function lt(t){return t===null||t===""}function Jt(t){return lt(t)||X(t)||t===!1||t===0||N(t)&&!Object.keys(t).length}function b(t,e=!0){return H(t)?t:!e&&P(t)?[t]:t!==!1&&t!==0&&Jt(t)?[]:zt(t)?Array.prototype.slice.call(t):P(t)?Object.values(t):[t]}function et(t){let e=D.call(this);e.DOM.isDOMReady||e.window.document.readyState==="complete"?t(e.window):(e.window.domReadyCallbacks||(e.window.domReadyCallbacks=[],e.window.document.addEventListener("DOMContentLoaded",()=>{e.DOM.isDOMReady=!0,e.window.domReadyCallbacks.splice(0).forEach(r=>r(e.window))},!1)),e.window.domReadyCallbacks.push(t))}var rt=class{constructor(e){this.window=e}onAdded(e,r,o={}){return o.on="added",this.onPresenceChange(e,(i,s,n,f,u)=>{r(i,s,n,f,u)},o)}onRemoved(e,r,o={}){return o.on="removed",this.onPresenceChange(e,(i,s,n,f,u)=>{r(i,s,n,f,u)},o)}onPresent(e,r,o={}){et.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(e,(i,s)=>{i.forEach(n=>r(n,s))},o),q(e)?b(this.window.document.querySelectorAll(e)).forEach(i=>r(i,1)):e.parentNode&&r(e,1)})}onAbsent(e,r,o={}){et.call(this.window,()=>{this.window.MutationObserver&&onRemoved(e,(i,s)=>{i.forEach(n=>r(n,s))},o),q(e)?b(this.window.document.querySelectorAll(e)).length===0&&r(null,0):e.parentNode||r(e,0)})}onPresenceChange(e,r,o={}){e=b(e,!1);var i=(a,d)=>{if(d=d.filter(g=>g.matches),q(a)){var l=d.filter(g=>g.matches(a));if(o.observeIndirectMutation!==!1&&(l=d.reduce((g,O)=>g.concat(b(O.querySelectorAll(a))),l),l.length))return l}else{if(d.includes(a))return[a];if(o.observeIndirectMutation!==!1&&d.length){for(var c=a;c=c.parentNode;)if(d.includes(c))return[a]}}},s=(a,d)=>(d.$$searchCache||(d.$$searchCache=new Map),a.reduce((l,c)=>{var g;return d.$$searchCache.has(c)?g=d.$$searchCache.get(c):(g=i(c,d,q(c))||[],d.$$searchCache.set(c,g)),l.concat(g)},[])),n=new Set,f=new Set,u=(a,d,l)=>{d&&o.on==="removed"||!d&&o.on==="added"||(a=s(e,a)).length&&(o.maintainCallState?(a.forEach(c=>{d?(n.add(c),f.delete(c)):(n.delete(c),f.add(c))}),r(a,d,l,n,f)):r(a,d,l))},m=o.context||this.window.document.documentElement,p=this._observe(m,(a,d,l,c)=>{o.ignoreTransients||(u(a,0,!0),u(a.concat(d),1,!0),u(d,0,!0)),u(c,0),u(l,1)});return p}onAttrChange(e,r,o=[]){var i=new this.window.MutationObserver(r),s={attributes:!0,attributeOldValue:!0};return o&&(s.attributeFilter=o),i.observe(e,s),i}onTreeChange(e,r,o=!1){var i=new this.window.MutationObserver(r),s={childList:!0,subtree:o};return i.observe(e,s),i}onMutation(e,r,o){var i=new this.window.MutationObserver(r);return i.observe(e,o),i}_observe(e,r){if(!Mt.has(e)){let i=new Set,s=new this.window.MutationObserver(n=>{if(!!i.size){var f=n.reduce((a,d)=>a.concat(b(d.addedNodes)),[]),u=n.reduce((a,d)=>a.concat(b(d.removedNodes)),[]),m=[],p=[];f=new Set(f),u=new Set(u),f.forEach(a=>{u.has(a)&&(u.delete(a),f.delete(a),a.isConnected?m.push(a):p.push(a))}),f=[...f],u=[...u],i.forEach(a=>a(m,p,f,u))}});s.observe(e,{childList:!0,subtree:!0}),Mt.set(e,{callbacks:i,observer:s})}let o=Mt.get(e);return o.callbacks.add(r),{disconnect(){o.callbacks.delete(r)},reconnect(){o.callbacks.add(r)}}}},Mt=new Map;function Zt(t){ve(t),Oe(t),we(t)}function ve(t){t.CSS||(t.CSS={}),t.CSS.escape||(t.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}function Oe(t){"isConnected"in t.Node.prototype||Object.defineProperty(t.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function we(t){t.Element.prototype.matches||(t.Element.prototype.matches=t.Element.prototype.matchesSelector||t.Element.prototype.mozMatchesSelector||t.Element.prototype.msMatchesSelector||t.Element.prototype.oMatchesSelector||t.Element.prototype.webkitMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),o=r.length;--o>=0&&r.item(o)!==this;);return o>-1})}function ct(t,e=null,r=!1){let o=D.call(this);if(q(t)){var i;if(t.trim().startsWith("<")){var s=o.window.document.createElement("div");s.innerHTML=t,i=r?b(s.children):s.firstChild}else i=r?b(Yt.call(this,t,e)):Pt.call(this,t,e);return i}return t instanceof o.window.Element?r?[t]:t:r?b(t):t}function Xt(t,e=null){return ct.call(this,t,e,!0)}function Pt(t,e=null,r=!1){let o=D.call(this);e=e||o.window.document;var i,s=r?"querySelectorAll":"querySelector";try{i=e[s](t)}catch{try{i=e[s](t.replace(/\:is\(/g,":matches("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-webkit-any("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-moz-any("))}catch(m){throw m}}}}return i}function Yt(t,e=null){return Pt.call(this,t,e,!0)}function V(t){return at(t)||t&&{}.toString.call(t)==="[object function]"}function B(t,e,r={},o={}){e=b(e).slice();for(var i=t;!X(i)&&!lt(i)&&e.length;){var s=e.shift();if(!(r.get?r.get(i,s):N(i)?s in i:i[s])){o.exists=!1;return}i=r.get?r.get(i,s):i[s]}return o.exists=!0,i}function pt(t,e,r,o={},i={}){let s=(p,a,d)=>i.set?i.set(p,a,d):(L(e[f])&&H(p)?p.push(d):p[a]=d,!0);e=b(e);for(var n=t,f=0;f<e.length;f++)if(f<e.length-1){if(!n||!N(n)&&!V(n))return!1;var u=B(n,e[f],i);if(!N(u)){if(i.buildTree===!1)return!1;u=V(i.buildTree)?i.buildTree(f):L(e[f+1])?[]:{};var m=s(n,e[f],u);if(!m)return!1}n=u}else return s(n,e[f],r)}function Gt(t,e,r=!1,o={}){e=b(e);var i=!1;do{var s=e.pop(),s=s===""?0:s,n=t;e.length&&(n=B(t,e,{},o)),(N(n)||V(n))&&(o.has?o.has(n,s):s in n)&&(o.deleteProperty?i=o.deleteProperty(n,s):o.del?i=o.del(n,s):(delete n[s],i=!0))}while(i&&r&&e.length&&(N(n)||V(n))&&!(o.keys?o.keys(n):Object.keys(n)).length);return i}function $t(t,e,r={}){var o={};return B(t,e,r,o),o.exists}function Ft(t,e=!1){let r=D.call(this);var o={};return!(o.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&e&&(o.el=r.window.document.createElement("meta"),o.el.setAttribute("name",t),r.window.document.head.append(o.el)),o.el&&(o.vars=(o.el.getAttribute("content")||"").split(";").filter(i=>i).reduce((i,s)=>{var n=s.split("=").map(f=>f.trim());return pt(i,n[0].split("."),n[1]==="true"?!0:n[1]==="false"?!1:L(n[1])?parseInt(n[1]):n[1]),i},{})),o.get=function(i){return B(this.vars,i.split("."))},o.set=function(i,s=null,n=!1){var f=P(i)?i:{[i]:s===!0?"true":s};if(n=arguments.length<3?s:n,Object.keys(f).forEach(u=>{if(f[u]===!1)Gt(this.vars,u.split("."));else if(P(f[u]))Object.keys(f[u]).forEach(p=>{var a=(u+"."+p).split(".");(!n||!$t(this.vars,a))&&pt(this.vars,a,f[u][p])});else{var m=u.split(".");(!n||!$t(this.vars,m))&&pt(this.vars,m,f[u])}}),e){let u=(m,p)=>Object.keys(p).reduce((a,d)=>{var l=(m?m+".":"")+d;return P(p[d])?a.push(...u(l,p[d])):a.push(l+"="+p[d]),a},[]);this.el.setAttribute("content",u("",this.vars).join(";"))}return!0},o.defaults=function(i,s=null){return this.set(i,s,!0)},o}function ht(){let t=D.call(this);return t.DOM||(t.DOM={},Zt(t.window),t.DOM.reflow=new tt(t.window),t.DOM.mutations=new rt(t.window),t.DOM.meta=Ft.bind(t.window),t.DOM.query=ct.bind(t.window),t.DOM.queryAll=Xt.bind(t.window),t.DOM.ready=et.bind(t.window)),t}function Wt(t,e){return vt(t,e,!0)}function dt(t,e,r){return Wt(ot(t,e),r)}function Dt(t,e,r){return t.startsWith(e)&&t.endsWith(r)}var y=class{static lex(e,r,o={}){if(!Q(e=e+""))throw new Error("Argument1 must be a string!");var i=m=>({delims:m.delims.slice(),options:mt(m.options),nesting:m.nesting.slice(),maxDepth:m.maxDepth,comments:m.comments.slice(),tokens:m.tokens.slice(),matches:m.matches.slice(),matchesi:mt(m.matchesi)});if(y.$cache[e]&&o.cache!==!1)for(var s=0;s<y.$cache[e].length;s++){var n=y.$cache[e][s];if(Nt(n.delims,r))return i(n)}var f=new y(e,o),u=f.lex(r);return o.cache!==!1&&(y.$cache[e]=y.$cache[e]||[],y.$cache[e].push(u)),i(u)}static split(e,r,o){return y.lex(e,r,o).tokens}static match(e,r,o){return y.lex(e,r,o).matches}constructor(e,r){if(!Q(e))throw new Error("Lexer requires the first argument to be a string.");this.$str=e,this.$options=r||{},this.$options.blocks||(this.$options.blocks=y.$blocks),this.$options.quotes||(this.$options.quotes=y.$quotes),this.$options.comments||(this.$options.comments=y.$comments)}lex(e,r){for(var o={delims:S(e),options:R(!0,{},this.$options,r||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},i=0;typeof i=="number";)i=this._evalCharsAt(o,i);if(o.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+At(o.nesting).join(", "));return o}_evalCharsAt(e,r){if(!(r>=this.$str.length)){var o=1,i={},s={},n={};if(e.openComment||(s=this._testQuotes(e,r)),e.openQuote||(i=this._testComments(e,r)),e.openComment||i.ending)if(!e.nesting.length&&!n.ending){var f=i.starting||i.ending||this.$str[r];o=f.length,this._push(e,f,"comments",i.starting)}else this._push(e,this.$str[r]);else if(e.openQuote||s.ending)this._push(e,this.$str[r]);else{if(e.options.limit&&e.matches.length===e.options.limit)return this._push(e,this.$str[r]),r+1;n=this._testNesting(e,r);var n=this._testNesting(e,r),u=this._testChars(e.options.stopChars||[],e,r);if(!e.nesting.length&&u!==!1){e.options.stopChar=u,e.options.stopCharForward=this.$str.substr(r);return}if(!e.delims.length)e.nesting.length===2&&n.starting?(e.matches.push(null),this._push(e,n.starting),o=n.starting.length):!e.nesting.length&&n.ending?(this._push(e,n.ending),o=n.ending.length,e.matches.push(null)):this._push(e,this.$str[r]);else if(!e.nesting.length&&!n.ending){this._push(e,"");var m=this._testChars(e.delims,e,r);if(m!==!1&&(e.matches.push(m),e.matchesi[r]=m,o=m.length||1,!e.options.preserveDelims)){var p=r+(m.length||1);return p===this.$str.length&&this._push(e,""),p}this._push(e,m||this.$str[r])}else{var f=n.starting||n.ending||this.$str[r];o=f.length,this._push(e,f)}}return r+o}}_testQuotes(e,r){var o={};return(e.options.quotes||[]).forEach(i=>{this.$str.substr(r,1)===i&&(e.openQuote?i===e.openQuote&&(e.openQuote=!1,o.ending=i):(e.openQuote=i,o.starting=i))}),o}_testComments(e,r){var o={};return(e.options.comments||[]).forEach(i=>{if(e.openComment){if(T(i)===T(e.openComment)){var n=T(i);this.$str.substr(r).startsWith(n)&&(e.openComment=!1,o.ending=n)}}else{var s=I(i);this.$str.substr(r).startsWith(s)&&(e.openComment=i,o.starting=s)}}),o}_testNesting(e,r){var o={};return(e.options.blocks||[]).forEach(i=>{var s=I(i);if(this.$str.substr(r).startsWith(s))e.nesting=e.nesting.concat([i]),o.starting=s;else if(e.nesting.length&&T(i)===T(T(e.nesting))){var n=T(i);this.$str.substr(r).startsWith(n)&&(e.nesting=e.nesting.slice(0,-1),o.ending=n)}}),e.maxDepth=Math.max(e.maxDepth,e.nesting.length),o}_testChars(e,r,o){for(var i=0;i<e.length;i++){var s=e[i];if(v(s)){var n=s(this.$str.substr(0,o),this.$str.substr(o),r.tokens.slice());if(n!==!1)return n}if(r.options.useRegex){var f=this.$str.substr(o).match(new RegExp("^"+s,r.options.useRegex!==!0?r.options.useRegex:""));if(f)return f[0]}if(!r.options.ci&&this.$str.substr(o,s.length)===s||r.options.ci&&this.$str.substr(o,s.length).toLowerCase()===s.toLowerCase())return s}return!1}_push(e,r,o="tokens",i=!1){var s=e.matches.length;if(F(e.tokens[s])&&(e.tokens[s]=""),o==="comments"){e.tokens[s].comments||(e.tokens[s]=new String(e.tokens[s]),e.tokens[s].comments=[]);var n=e.tokens[s].comments.length-(!e.tokens[s].comments.length||i?0:1);e.tokens[s].comments[n]=(e.tokens[s].comments[n]||"")+r}else{var f=e.tokens[s].comments;e.tokens[s]=e.tokens[s]+r}}split(e,r,o){return this.lex(r,o).tokens}match(e,r,o){return this.lex(r,o).matches}regParse(e,r){return this.lex(e,R({useRegex:!0},r||{}))}regSplit(e,r){return this.regParse(e,r).tokens}regMatch(e,r){return this.regParse(e,r).matches}};y.$blocks=[["(",")"],["[","]"],["{","}"]];y.$quotes=['"',"'","`"];y.$comments=[["/*","*/"],["//",`
|
|
2
|
-
`]];y.$cache=Object.create(null);function te(t,e={}){let r=ht.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(R(3,t,e)),r.OOHTML.meta}function ee(t,e,r,o=null){var i=e.split("#")[0].split("/").map(s=>s.trim()).filter(s=>s);return oe(t,i,r,o)}function gt(t){var e=y.split(t.trim(),[":"]);t=e.shift();var r=e.reduce((o,i)=>{var[s,n]=y.split(i.trim(),[]);return o[s]=dt(n,"(",")"),o},{});return[t,r]}function re(t,e){return e=e.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),t=t.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),t.length?t.reduce((r,o,i)=>r?y.split(o.trim(),["|","+"]).reduce((s,f)=>{var[f,u]=gt(f);f=f.trim();var m=f===e[i];if(!m&&("deep"in u||"deepest"in u)){var p=e.slice(i+1).reduce((d,
|
|
1
|
+
(()=>{function ot(t,e,r=!1){if(e=="")return t;var o=r?t.lastIndexOf(e):t.indexOf(e);return o===-1?"":t.substr(o+e.length)}function it(t,e){return t.reduce((r,o,i)=>r||e(o,i),!1)}function vt(t,e,r=!1){if(e=="")return t;var o=r?t.lastIndexOf(e):t.indexOf(e);return o===-1?t:t.substr(0,o)}function F(t){return arguments.length&&(t===void 0||typeof t>"u")}function z(t){return typeof t=="function"}function v(t){return z(t)||t&&{}.toString.call(t)==="[object function]"}function nt(t,...e){return e.forEach(r=>{t.indexOf(r)<0&&t.push(r)}),t}function h(t){return Array.isArray(t)}function Q(t){return t instanceof String||typeof t=="string"&&t!==null}function Ot(t){return!Q(t)&&!F(t.length)}function st(t){return t===null||t===""}function b(t){return Array.isArray(t)||typeof t=="object"&&t||z(t)}function bt(t){return st(t)||F(t)||t===!1||t===0||b(t)&&!Object.keys(t).length}function x(t){return!Array.isArray(t)&&typeof t=="object"&&t}function S(t,e=!0){return h(t)?t:!e&&x(t)?[t]:t!==!1&&t!==0&&bt(t)?[]:Ot(t)?Array.prototype.slice.call(t):x(t)?Object.values(t):[t]}function wt(t,e,r=null){return h(e)?t.filter(o=>r?e.filter(i=>r(o,i)).length:e.indexOf(o)===-1):[]}function ft(t,e,r=!1){for(var o=t.indexOf(e);o>-1&&(r||r===!1);)t.splice(o,1),r>0&&r--,o=t.indexOf(e);return t}function I(t,e=1){var r=0;t.forEach(i=>{r++});var o=t.slice(t.length-r,e);return arguments.length>1?o:o[0]}function U(t){return t instanceof Number||typeof t=="number"}function W(t){return U(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}var Ut=function(t,e=1,r=!0){return!W(e)||e<=0||(!h(t)&&x(t)&&r&&(t=Object.values(t)),!h(t))?t:t.reduce((o,i)=>h(i)||x(i)&&r?o.concat(Ut(h(i)?i:Object.values(i),e-1,r)):o.concat(i),[])},At=Ut;function G(t){return t===!0||t===!1}function T(t,e=1){return arguments.length>1?I(t.slice().reverse(),e).reverse():I(t.slice().reverse())}function J(t,e){var r=void 0;return b(t)&&Object.keys(t).forEach((o,i)=>{r!==!1&&(r=e(W(o)?parseFloat(o):o,t[o],i))}),r}function K(t){let e=(r,o,i)=>i.indexOf(r)===o;return t.filter(e)}function g(t,...e){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(t);if(!r){if(r=new Map,e[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(t,r)}for(var o,i;o=e.shift();)if((i=r)&&!(r=r.get(o))){if(r=new Map,e[0]===!1)return r;i.set(o,r)}return r}function ut(t){return x(t)&&Object.getPrototypeOf(t)===Object.prototype}function Ct(o,e){e=e||Object.prototype,e=e&&!h(e)?[e]:e;for(var r=[],o=o;o&&(!e||e.indexOf(o)<0)&&o.name!=="default";)r.push(o),o=o?Object.getPrototypeOf(o):null;return r}function St(t,e){var r=[];return Ct(t,e).forEach(o=>{nt(r,...Object.getOwnPropertyNames(o))}),r}function M(t,e,r=!1,o=!1,i=!1){var s=0,n=t.shift();if((W(n)||n===!0||n===!1)&&(s=n,n=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((f,u)=>{!b(f)&&!v(f)||(r?St(f):Object.getOwnPropertyNames(f)).forEach(m=>{if(!!e(m,n,f,u)){var p=n[m],l=f[m];if((h(p)&&h(l)||x(p)&&x(l))&&(s===!0||s>0))n[m]=h(p)&&h(l)?[]:{},M([W(s)?s-1:s,n[m],p,l],e,r,o,i);else if(h(n)&&h(f))o?n[m]=l:n.push(l);else try{i?Object.defineProperty(n,m,Object.getOwnPropertyDescriptor(f,m)):n[m]=f[m]}catch{}}})}),n}function R(...t){return M(t,(e,r,o)=>!0,!1,!1,!1)}function Z(t,e,r=!0,o=!0,i=!1,s=!1){if(h(t)&&h(e)){var n=[],f=!0;return t.forEach(u=>{if(!!f){var m=!1;J(e,(p,l)=>{(!m||o&&b(u))&&(m=r(u,l),(h(m)&&!m.length||x(m)&&!Object.keys(m).length)&&(m=!1),b(m)&&o&&(u=m))}),b(m)?n.push(o?m:u):G(m)?i&&!m||!i&&m?n.push(u):s&&(f=!1):n.push(m)}}),n}if(x(t)&&x(e)){var n={},f=!0;return Object.keys(t).forEach(p=>{if(!!f){var l=r(t[p],e[p]);(h(l)&&!l.length||x(l)&&!Object.keys(l).length)&&(l=!1),b(l)?n[p]=o?l:t[p]:G(l)?i&&!l||!i&&l?n[p]=t[p]:s&&(f=!1):n[p]=l}}),n}}function mt(t,e=[]){return M([{},t],(r,o,i)=>{if(!v(i[r]))return v(e)?e(r):h(e)&&e.length?e.indexOf(r)>-1:!0},!1,!1,!1)}var Et=function(t,e,r=!0,o=1){if(h(t)&&h(e)&&t.length!==e.length)return!r;if(x(t)&&x(e)){var i=Object.keys(t),s=Object.keys(e);if(!i.length&&!s.length)return ut(t)&&ut(e)?r:t===e===r;if(!Et(i,s))return!r}if(o>0&&(h(t)&&h(e)||x(t)&&x(e))){var n=Z(t,e,(f,u)=>Et(f,u,r,o-1),!1,!1,!0);return h(n)?n.length===t.length&&n.length===e.length:x(n)&&x(t)?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).length===Object.keys(e).length:n}return v(r)?r(t,e):U(t)&&U(e)&&isNaN(t)&&isNaN(e)?r:t===e===r},Nt=Et;function P(t){return!Array.isArray(t)&&typeof t=="object"&&t}function Ht(t){var e=typeof t.InstallTrigger<"u";if(e)return"firefox";var r=/constructor/i.test(t.HTMLElement)||function(m){return m.toString()==="[object SafariRemoteNotification]"}(!t.safari||typeof t.safari<"u"&&t.safari.pushNotification);if(r)return"safari";var o=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime),i=o&&t.navigator.userAgent.indexOf("Edg")!=-1,s=!!t.opr&&!!t.opr.addons||!!t.opera||t.navigator.userAgent.indexOf(" OPR/")>=0,n=!!t.document.documentMode,f=!n&&!!t.StyleMedia,u=(o||s)&&!!t.CSS;return f?"edge":n?"ie":s?"opera":i?"ie-chromium":o?"chrome":"unknown"}function Vt(t){var e=t.getComputedStyle(t.document.documentElement,""),r=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||e.Olink===""&&["","o"])[1],o=("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1];return{api:o,prefix:r,css:"-"+r+"-"}}function q(){if(!(P(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let t=P(this)&&this.window?this.window:window;if(t.WebQit||(t.WebQit={}),!t.WebQit.window){let e,r;Object.defineProperty(t.WebQit,"window",{get:()=>t}),Object.defineProperty(t.WebQit,"vendor",{value:{getName:()=>(e||(e=Ht(t)),e),getPrefix:()=>(r||(r=Vt(t)),r)}})}return t.WebQit}function lt(t){return typeof t=="function"}function N(t){return Array.isArray(t)||typeof t=="object"&&t||lt(t)}function jt(t){return t instanceof Number||typeof t=="number"}function L(t){return jt(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}var tt=class{constructor(e,r=!0){this.window=e,this.async=r,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((e,r)=>{e&&!e()&&(this.readCallbacks[r]=null)}),this.writeCallbacks.forEach((e,r)=>{e&&!e()&&(this.writeCallbacks[r]=null)}),this._run()})}onread(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.readCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.readCallbacks.push(e)}onwrite(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.writeCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.writeCallbacks.push(e)}cycle(e,r,o){this.onread(()=>{var i=e(o);if(i){var s=n=>{this.onwrite(()=>{var f=r(n,o);if(f){var u=m=>{this.cycle(e,r,m)};f instanceof Promise?f.then(u):u()}})};i instanceof Promise?i.then(s):s()}})}};function D(t){return t instanceof String||typeof t=="string"&&t!==null}function H(t){return Array.isArray(t)}function X(t){return arguments.length&&(t===void 0||typeof t>"u")}function zt(t){return!D(t)&&!X(t.length)}function at(t){return t===null||t===""}function Jt(t){return at(t)||X(t)||t===!1||t===0||N(t)&&!Object.keys(t).length}function w(t,e=!0){return H(t)?t:!e&&P(t)?[t]:t!==!1&&t!==0&&Jt(t)?[]:zt(t)?Array.prototype.slice.call(t):P(t)?Object.values(t):[t]}function et(t){let e=q.call(this);e.DOM.isDOMReady||e.window.document.readyState==="complete"?t(e.window):(e.window.domReadyCallbacks||(e.window.domReadyCallbacks=[],e.window.document.addEventListener("DOMContentLoaded",()=>{e.DOM.isDOMReady=!0,e.window.domReadyCallbacks.splice(0).forEach(r=>r(e.window))},!1)),e.window.domReadyCallbacks.push(t))}var rt=class{constructor(e){this.window=e}onAdded(e,r,o={}){return o.on="added",this.onPresenceChange(e,(i,s,n,f,u)=>{r(i,s,n,f,u)},o)}onRemoved(e,r,o={}){return o.on="removed",this.onPresenceChange(e,(i,s,n,f,u)=>{r(i,s,n,f,u)},o)}onPresent(e,r,o={}){et.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(e,(i,s)=>{i.forEach(n=>r(n,s))},o),D(e)?w(this.window.document.querySelectorAll(e)).forEach(i=>r(i,1)):e.parentNode&&r(e,1)})}onAbsent(e,r,o={}){et.call(this.window,()=>{this.window.MutationObserver&&onRemoved(e,(i,s)=>{i.forEach(n=>r(n,s))},o),D(e)?w(this.window.document.querySelectorAll(e)).length===0&&r(null,0):e.parentNode||r(e,0)})}onPresenceChange(e,r,o={}){e=w(e,!1);var i=(l,d)=>{if(d=d.filter(_=>_.matches),D(l)){var a=d.filter(_=>_.matches(l));if(o.observeIndirectMutation!==!1&&(a=d.reduce((_,O)=>_.concat(w(O.querySelectorAll(l))),a),a.length))return a}else{if(d.includes(l))return[l];if(o.observeIndirectMutation!==!1&&d.length){for(var c=l;c=c.parentNode;)if(d.includes(c))return[l]}}},s=(l,d)=>(d.$$searchCache||(d.$$searchCache=new Map),l.reduce((a,c)=>{var _;return d.$$searchCache.has(c)?_=d.$$searchCache.get(c):(_=i(c,d,D(c))||[],d.$$searchCache.set(c,_)),a.concat(_)},[])),n=new Set,f=new Set,u=(l,d,a)=>{d&&o.on==="removed"||!d&&o.on==="added"||(l=s(e,l)).length&&(o.maintainCallState?(l.forEach(c=>{d?(n.add(c),f.delete(c)):(n.delete(c),f.add(c))}),r(l,d,a,n,f)):r(l,d,a))},m=o.context||this.window.document.documentElement,p=this._observe(m,(l,d,a,c)=>{o.ignoreTransients||(u(l,0,!0),u(l.concat(d),1,!0),u(d,0,!0)),u(c,0),u(a,1)});return p}onAttrChange(e,r,o=[]){var i=new this.window.MutationObserver(r),s={attributes:!0,attributeOldValue:!0};return o&&(s.attributeFilter=o),i.observe(e,s),i}onTreeChange(e,r,o=!1){var i=new this.window.MutationObserver(r),s={childList:!0,subtree:o};return i.observe(e,s),i}onMutation(e,r,o){var i=new this.window.MutationObserver(r);return i.observe(e,o),i}_observe(e,r){if(!Mt.has(e)){let i=new Set,s=new this.window.MutationObserver(n=>{if(!!i.size){var f=n.reduce((l,d)=>l.concat(w(d.addedNodes)),[]),u=n.reduce((l,d)=>l.concat(w(d.removedNodes)),[]),m=[],p=[];f=new Set(f),u=new Set(u),f.forEach(l=>{u.has(l)&&(u.delete(l),f.delete(l),l.isConnected?m.push(l):p.push(l))}),f=[...f],u=[...u],i.forEach(l=>l(m,p,f,u))}});s.observe(e,{childList:!0,subtree:!0}),Mt.set(e,{callbacks:i,observer:s})}let o=Mt.get(e);return o.callbacks.add(r),{disconnect(){o.callbacks.delete(r)},reconnect(){o.callbacks.add(r)}}}},Mt=new Map;function Zt(t){ve(t),Oe(t),be(t)}function ve(t){t.CSS||(t.CSS={}),t.CSS.escape||(t.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}function Oe(t){"isConnected"in t.Node.prototype||Object.defineProperty(t.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function be(t){t.Element.prototype.matches||(t.Element.prototype.matches=t.Element.prototype.matchesSelector||t.Element.prototype.mozMatchesSelector||t.Element.prototype.msMatchesSelector||t.Element.prototype.oMatchesSelector||t.Element.prototype.webkitMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),o=r.length;--o>=0&&r.item(o)!==this;);return o>-1})}function ct(t,e=null,r=!1){let o=q.call(this);if(D(t)){var i;if(t.trim().startsWith("<")){var s=o.window.document.createElement("div");s.innerHTML=t,i=r?w(s.children):s.firstChild}else i=r?w(Yt.call(this,t,e)):Pt.call(this,t,e);return i}return t instanceof o.window.Element?r?[t]:t:r?w(t):t}function Xt(t,e=null){return ct.call(this,t,e,!0)}function Pt(t,e=null,r=!1){let o=q.call(this);e=e||o.window.document;var i,s=r?"querySelectorAll":"querySelector";try{i=e[s](t)}catch{try{i=e[s](t.replace(/\:is\(/g,":matches("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-webkit-any("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-moz-any("))}catch(m){throw m}}}}return i}function Yt(t,e=null){return Pt.call(this,t,e,!0)}function V(t){return lt(t)||t&&{}.toString.call(t)==="[object function]"}function k(t,e,r={},o={}){e=w(e).slice();for(var i=t;!X(i)&&!at(i)&&e.length;){var s=e.shift();if(!(r.get?r.get(i,s):N(i)?s in i:i[s])){o.exists=!1;return}i=r.get?r.get(i,s):i[s]}return o.exists=!0,i}function pt(t,e,r,o={},i={}){let s=(p,l,d)=>i.set?i.set(p,l,d):(L(e[f])&&H(p)?p.push(d):p[l]=d,!0);e=w(e);for(var n=t,f=0;f<e.length;f++)if(f<e.length-1){if(!n||!N(n)&&!V(n))return!1;var u=k(n,e[f],i);if(!N(u)){if(i.buildTree===!1)return!1;u=V(i.buildTree)?i.buildTree(f):L(e[f+1])?[]:{};var m=s(n,e[f],u);if(!m)return!1}n=u}else return s(n,e[f],r)}function Gt(t,e,r=!1,o={}){e=w(e);var i=!1;do{var s=e.pop(),s=s===""?0:s,n=t;e.length&&(n=k(t,e,{},o)),(N(n)||V(n))&&(o.has?o.has(n,s):s in n)&&(o.deleteProperty?i=o.deleteProperty(n,s):o.del?i=o.del(n,s):(delete n[s],i=!0))}while(i&&r&&e.length&&(N(n)||V(n))&&!(o.keys?o.keys(n):Object.keys(n)).length);return i}function $t(t,e,r={}){var o={};return k(t,e,r,o),o.exists}function Ft(t,e=!1){let r=q.call(this);var o={};return!(o.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&e&&(o.el=r.window.document.createElement("meta"),o.el.setAttribute("name",t),r.window.document.head.append(o.el)),o.el&&(o.vars=(o.el.getAttribute("content")||"").split(";").filter(i=>i).reduce((i,s)=>{var n=s.split("=").map(f=>f.trim());return pt(i,n[0].split("."),n[1]==="true"?!0:n[1]==="false"?!1:L(n[1])?parseInt(n[1]):n[1]),i},{})),o.get=function(i){return k(this.vars,i.split("."))},o.set=function(i,s=null,n=!1){var f=P(i)?i:{[i]:s===!0?"true":s};if(n=arguments.length<3?s:n,Object.keys(f).forEach(u=>{if(f[u]===!1)Gt(this.vars,u.split("."));else if(P(f[u]))Object.keys(f[u]).forEach(p=>{var l=(u+"."+p).split(".");(!n||!$t(this.vars,l))&&pt(this.vars,l,f[u][p])});else{var m=u.split(".");(!n||!$t(this.vars,m))&&pt(this.vars,m,f[u])}}),e){let u=(m,p)=>Object.keys(p).reduce((l,d)=>{var a=(m?m+".":"")+d;return P(p[d])?l.push(...u(a,p[d])):l.push(a+"="+p[d]),l},[]);this.el.setAttribute("content",u("",this.vars).join(";"))}return!0},o.defaults=function(i,s=null){return this.set(i,s,!0)},o}function ht(){let t=q.call(this);return t.DOM||(t.DOM={},Zt(t.window),t.DOM.reflow=new tt(t.window),t.DOM.mutations=new rt(t.window),t.DOM.meta=Ft.bind(t.window),t.DOM.query=ct.bind(t.window),t.DOM.queryAll=Xt.bind(t.window),t.DOM.ready=et.bind(t.window)),t}function Wt(t,e){return vt(t,e,!0)}function dt(t,e,r){return Wt(ot(t,e),r)}function qt(t,e,r){return t.startsWith(e)&&t.endsWith(r)}var y=class{static lex(e,r,o={}){if(!Q(e=e+""))throw new Error("Argument1 must be a string!");var i=m=>({delims:m.delims.slice(),options:mt(m.options),nesting:m.nesting.slice(),maxDepth:m.maxDepth,comments:m.comments.slice(),tokens:m.tokens.slice(),matches:m.matches.slice(),matchesi:mt(m.matchesi)});if(y.$cache[e]&&o.cache!==!1)for(var s=0;s<y.$cache[e].length;s++){var n=y.$cache[e][s];if(Nt(n.delims,r))return i(n)}var f=new y(e,o),u=f.lex(r);return o.cache!==!1&&(y.$cache[e]=y.$cache[e]||[],y.$cache[e].push(u)),i(u)}static split(e,r,o){return y.lex(e,r,o).tokens}static match(e,r,o){return y.lex(e,r,o).matches}constructor(e,r){if(!Q(e))throw new Error("Lexer requires the first argument to be a string.");this.$str=e,this.$options=r||{},this.$options.blocks||(this.$options.blocks=y.$blocks),this.$options.quotes||(this.$options.quotes=y.$quotes),this.$options.comments||(this.$options.comments=y.$comments)}lex(e,r){for(var o={delims:S(e),options:R(!0,{},this.$options,r||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},i=0;typeof i=="number";)i=this._evalCharsAt(o,i);if(o.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+At(o.nesting).join(", "));return o}_evalCharsAt(e,r){if(!(r>=this.$str.length)){var o=1,i={},s={},n={};if(e.openComment||(s=this._testQuotes(e,r)),e.openQuote||(i=this._testComments(e,r)),e.openComment||i.ending)if(!e.nesting.length&&!n.ending){var f=i.starting||i.ending||this.$str[r];o=f.length,this._push(e,f,"comments",i.starting)}else this._push(e,this.$str[r]);else if(e.openQuote||s.ending)this._push(e,this.$str[r]);else{if(e.options.limit&&e.matches.length===e.options.limit)return this._push(e,this.$str[r]),r+1;n=this._testNesting(e,r);var n=this._testNesting(e,r),u=this._testChars(e.options.stopChars||[],e,r);if(!e.nesting.length&&u!==!1){e.options.stopChar=u,e.options.stopCharForward=this.$str.substr(r);return}if(!e.delims.length)e.nesting.length===2&&n.starting?(e.matches.push(null),this._push(e,n.starting),o=n.starting.length):!e.nesting.length&&n.ending?(this._push(e,n.ending),o=n.ending.length,e.matches.push(null)):this._push(e,this.$str[r]);else if(!e.nesting.length&&!n.ending){this._push(e,"");var m=this._testChars(e.delims,e,r);if(m!==!1&&(e.matches.push(m),e.matchesi[r]=m,o=m.length||1,!e.options.preserveDelims)){var p=r+(m.length||1);return p===this.$str.length&&this._push(e,""),p}this._push(e,m||this.$str[r])}else{var f=n.starting||n.ending||this.$str[r];o=f.length,this._push(e,f)}}return r+o}}_testQuotes(e,r){var o={};return(e.options.quotes||[]).forEach(i=>{this.$str.substr(r,1)===i&&(e.openQuote?i===e.openQuote&&(e.openQuote=!1,o.ending=i):(e.openQuote=i,o.starting=i))}),o}_testComments(e,r){var o={};return(e.options.comments||[]).forEach(i=>{if(e.openComment){if(T(i)===T(e.openComment)){var n=T(i);this.$str.substr(r).startsWith(n)&&(e.openComment=!1,o.ending=n)}}else{var s=I(i);this.$str.substr(r).startsWith(s)&&(e.openComment=i,o.starting=s)}}),o}_testNesting(e,r){var o={};return(e.options.blocks||[]).forEach(i=>{var s=I(i);if(this.$str.substr(r).startsWith(s))e.nesting=e.nesting.concat([i]),o.starting=s;else if(e.nesting.length&&T(i)===T(T(e.nesting))){var n=T(i);this.$str.substr(r).startsWith(n)&&(e.nesting=e.nesting.slice(0,-1),o.ending=n)}}),e.maxDepth=Math.max(e.maxDepth,e.nesting.length),o}_testChars(e,r,o){for(var i=0;i<e.length;i++){var s=e[i];if(v(s)){var n=s(this.$str.substr(0,o),this.$str.substr(o),r.tokens.slice());if(n!==!1)return n}if(r.options.useRegex){var f=this.$str.substr(o).match(new RegExp("^"+s,r.options.useRegex!==!0?r.options.useRegex:""));if(f)return f[0]}if(!r.options.ci&&this.$str.substr(o,s.length)===s||r.options.ci&&this.$str.substr(o,s.length).toLowerCase()===s.toLowerCase())return s}return!1}_push(e,r,o="tokens",i=!1){var s=e.matches.length;if(F(e.tokens[s])&&(e.tokens[s]=""),o==="comments"){e.tokens[s].comments||(e.tokens[s]=new String(e.tokens[s]),e.tokens[s].comments=[]);var n=e.tokens[s].comments.length-(!e.tokens[s].comments.length||i?0:1);e.tokens[s].comments[n]=(e.tokens[s].comments[n]||"")+r}else{var f=e.tokens[s].comments;e.tokens[s]=e.tokens[s]+r}}split(e,r,o){return this.lex(r,o).tokens}match(e,r,o){return this.lex(r,o).matches}regParse(e,r){return this.lex(e,R({useRegex:!0},r||{}))}regSplit(e,r){return this.regParse(e,r).tokens}regMatch(e,r){return this.regParse(e,r).matches}};y.$blocks=[["(",")"],["[","]"],["{","}"]];y.$quotes=['"',"'","`"];y.$comments=[["/*","*/"],["//",`
|
|
2
|
+
`]];y.$cache=Object.create(null);function te(t,e={}){let r=ht.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(R(3,t,e)),r.OOHTML.meta}function ee(t,e,r,o=null){var i=e.split("#")[0].split("/").map(s=>s.trim()).filter(s=>s);return oe(t,i,r,o)}function gt(t){var e=y.split(t.trim(),[":"]);t=e.shift();var r=e.reduce((o,i)=>{var[s,n]=y.split(i.trim(),[]);return o[s]=dt(n,"(",")"),o},{});return[t,r]}function re(t,e){return e=e.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),t=t.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),t.length?t.reduce((r,o,i)=>r?y.split(o.trim(),["|","+"]).reduce((s,f)=>{var[f,u]=gt(f);f=f.trim();var m=f===e[i];if(!m&&("deep"in u||"deepest"in u)){var p=e.slice(i+1).reduce((d,a,c)=>d>-1&&"deep"in u?d:a===f?c:d,-1);if(p>-1){var l=e.splice(i,p+1);m=!0}}return s||m},!1):!1,!0):!1}var Kt=(t,e)=>y.split(t.trim(),["|","+"],{preserveDelims:!0}).reduce((r,o)=>{var i;return(o.startsWith("|")||o.startsWith("+"))&&(i=o.substr(0,1),o=o.substr(1).trim()),r.theEnd||i==="|"&&r.length?(r.theEnd=!0,r):r.concat(e(o.trim()))},[]).filter(r=>r),Dt=(t,e,r)=>{let o=i=>i.reduce((s,n)=>s.concat(...r(n).values()),[]);return Kt(e,s=>{var[s,n]=gt(s);return t.reduce((f,u)=>{var m=r(u);s==="*"&&(s="("+m.keys().join("+")+")");var p=qt(s,"(",")")?Dt([u],dt(s,"(",")"),r):S(m.get(s),!1),l=[],d=a=>`${a}${l.map(c=>`:${c}(${n[c]})`).join("")}`;return Object.keys(n).forEach(a=>{if(a==="deep"||a==="deepest")for(var c=[u];(a==="deepest"||!p.length)&&(c=o(c)).length;){var _=Dt(c,d(s),r);_.length&&(p=_)}else(a==="having"||a==="not-having")&&(p=p.filter(O=>{var A=Kt(n[a],C=>r(O,C));return a==="not-having"?!A.length:A.length})),l.push(a)}),f.concat(p)},[])})},oe=function(t,e,r,o=null,i=0){if(!e.length)return[];let s=e.shift(),n;s.endsWith(".")&&(n=!0,s=s.substr(0,s.length-1).trim());let f=Dt(t,s,r);if(f.forEach(u=>{g(u,"oohtml").has("queryCallback")&&g(u,"oohtml").get("queryCallback")()}),f.length&&n)return f;if(e.length){let u=oe(f,e.slice(),r,o,i+1);return u===-1?o(f,i,!0):u}return o?o(f,i):f};function _t(t={}){let e=ht.call(this);if(t.onDomReady){e.DOM.ready(()=>{_t.call(this,{...t,onDomReady:!1})});return}let r=e.window,o=e.window.document,i=e.DOM.mutations,s=[],n=te.call(this,{element:{import:"import"},attr:{importid:"name",exportsearch:"exportsearch"}},t.params);ie.push(n.get("attr.importid"),n.get("attr.moduleref"));let f="["+r.CSS.escape(n.get("attr.moduleref"))+"]",u="["+r.CSS.escape(n.get("attr.exportgroup"))+"]",m,p=class{static create(a){return g(this.el,"oohtml").get("instance")||new p(a)}constructor(a){this.el=a,g(this.el,"oohtml").set("instance",this);let[c,_]=gt(a.getAttribute(n.get("attr.importid"))||"default");g(this.el,"oohtml").set("importID",c),g(this.el,"oohtml").set("importModifiers",_)}hydrate(a,c,_){g(this.el,"oohtml").set("anchorNode",a),g(this.el,"oohtml").set("slottedElements",c),g(this.el,"oohtml").set("compositionBlock",_),this._bindSlotted(c),this._connectToCompositionBlock()}connectedCallback(){g(this.el,"oohtml").has("anchorNode")||(g(this.el,"oohtml").set("anchorNode",n.get("isomorphic")?o.createComment(this.el.outerHTML):o.createTextNode("")),g(this.el,"oohtml").set("compositionBlock",this.el.hasAttribute(n.get("attr.moduleref"))?this.el.getAttribute(n.get("attr.moduleref")).trim().startsWith("~")?this.el.parentNode.closest(u):null:this.el.parentNode.closest(f)),this._connectToCompositionBlock()),e.DOM.ready.call(e,()=>{this.resolve("connected")})}_connectToCompositionBlock(){this.compositionBlock&&g(this.compositionBlock,"oohtml","imports").set(this.importID,this.el)}_bindSlotted(a){a.forEach(c=>{c.importReference=this.el}),g(this.el,"oohtml").set("slottedObserver",i.onRemoved(a,(c,_,O,A,C)=>{C&&C.size===a.length&&g(this.el,"oohtml").get("slottedObserver").disconnect(),c.forEach(E=>{E.parentNode||ft(this.slottedElements,E),E.importReference===this.el&&delete E.importReference}),this.slottedElements.length||this.anchorNode.isConnected&&this.anchorNode.replaceWith(this.el)},{maintainCallState:!0,ignoreTransients:!0}))}resolve(a=null){if(!it(s,E=>this.el.closest(E))){var c=(E,j,It)=>{var ne=this.importID,xt=this.importModifiers,[se,Rt]="search"in xt||It!==null?("search"in xt?xt.search:It).split("-").filter($=>$).map($=>parseInt($||0)).concat([0,1e3]):[0,0];let fe=$=>$.reduce((B,Y)=>B.concat(g(Y,"oohtml","exports").get(ne)||[]),[]);return ee(E,j,function($,B){var Y=g($,"oohtml","templates");return arguments.length===1?Y:B.startsWith(":")?g($,"oohtml","exports").get(B.substr(1)):Y.get(B)},function($,B,Y){var kt=fe($);return!kt.length&&B>se&&Rt?(Rt--,-1):kt})},_,O;if(this.el.hasAttribute(n.get("attr.moduleref")))this.compositionBlock&&g(this.compositionBlock,"oohtml","imports").get(this.importID)===this.el&&g(this.compositionBlock,"oohtml","imports").delete(this.importID),_=this.el;else{if(!this.compositionBlock){console.warn("Scoped slots must be found within template contexts. ["+this.importID+"]",this.el);return}_=this.compositionBlock}var A=_.getAttribute(n.get("attr.moduleref")).trim(),C=this.el.getAttribute(n.get("attr.exportsearch"));_&&(O=c([A.startsWith("~")?this.compositionBlock:o],A,C)).length?wt(O,g(this.el,"oohtml").get("originalSlottedElements")||[]).length&&(g(this.el,"oohtml").set("originalSlottedElements",O),this.fill(O)):(g(this.el,"oohtml").set("originalSlottedElements",null),this.empty())}}fill(a){a=S(a,!1).map(c=>c.cloneNode(!0)),this.empty(!0),this.el.isConnected&&this.el.replaceWith(this.anchorNode),a.forEach(c=>{g(c,"oohtml","templates").set("~",this.el),Ae(c,this.el),c.getAttribute(n.get("attr.exportgroup"))||c.setAttribute(n.get("attr.exportgroup"),this.importID),this.anchorNode.before(c)}),this._bindSlotted(a),this.slottedElements.push(...a)}empty(a=!1){if(this.slottedElements){var c=this.slottedElements;a&&g(this.el,"oohtml").has("slottedObserver")&&(g(this.el,"oohtml").get("slottedObserver").disconnect(),c=this.slottedElements.splice(0)),c.forEach(_=>_.remove())}}get importID(){return g(this.el,"oohtml").get("importID")}get importModifiers(){return g(this.el,"oohtml").get("importModifiers")}get anchorNode(){return g(this.el,"oohtml").get("anchorNode")}get compositionBlock(){return g(this.el,"oohtml").get("compositionBlock")}get slottedElements(){return g(this.el,"oohtml").has("slottedElements")||g(this.el,"oohtml").set("slottedElements",[]),g(this.el,"oohtml").get("slottedElements")}get exports(){return g(this.el,"oohtml").get("exports")}static get observedAttributes(){return[n.get("attr.importid")]}};i.onPresent(n.get("element.import"),a=>{var c=p.create(a);c.connectedCallback()});let l=(a,c,_=null)=>{let O=(C,E)=>!c||E===c||c===!0&&(C.importModifiers&&"search"in C.importModifiers||C.el.getAttribute(n.get("attr.exportsearch")));if(a.matches(n.get("element.import"))){var A=p.create(a);O(A,A.importID)&&A.resolve(_)}else g(a,"oohtml","imports").forEach((C,E)=>{var j=p.create(C);O(j,E)&&j.resolve(`Resolution scope: ${_}`)})};i.onPresent(f,a=>{it(s,c=>a.closest(c))||i.onAttrChange(a,c=>{c[0].target.getAttribute(c[0].attributeName)!==c[0].oldValue&&l(a,null,`Attr-Change: ${c[0].attributeName}`)},[n.get("attr.moduleref"),n.get("attr.importid")])}),o.addEventListener("templatemutation",a=>{!a.detail.path||S(o.querySelectorAll("["+r.CSS.escape(n.get("attr.moduleref"))+"]")).forEach(c=>{re(c.getAttribute(n.get("attr.moduleref")),a.detail.path)&&(l(c,!0,`'templatemutation' event: ${a.detail.path}, search()`),a.detail.addedExports.concat(a.detail.removedExports).forEach(_=>{l(c,_.name,`'templatemutation' event: ${a.detail.path}, ${_.name}`)}))})});let d=()=>{S(o.querySelectorAll(u)).forEach(a=>{if(!g(a.parentNode,"oohtml").get("importsCan")&&!a.importReference){var c=[];a.parentNode.childNodes.forEach(_=>{var O;if(_.nodeType===1&&_.matches(u))c.push(_);else if(_.nodeType===8&&(O=_.nodeValue.trim())&&O.startsWith("<"+n.get("element.import"))&&O.endsWith("</"+n.get("element.import")+">")){var A,C=o.createElement("div");if(C.innerHTML=O,(A=C.firstChild).matches(n.get("element.import"))){var E=A.hasAttribute(n.get("attr.moduleref"))?A.getAttribute(n.get("attr.moduleref")).trim().startsWith("~")?_.parentNode.closest(u):null:_.parentNode.closest(f),j=p.create(A);j.hydrate(_,c,E),c=[]}}}),g(a.parentNode,"oohtml").set("importsCan",!0)}})};e.DOM.ready.call(e,()=>{n.get("isomorphic")&&d()})}function Ae(t,e,r=[],o=!0){r=r.concat(ie),t.hasAttribute("noinherit")&&(r=r.concat((t.getAttribute("noinherit")||"*").split(" ").map(f=>f.trim())));var i=Se.concat(["role","class"]);if(K(i).forEach(f=>{var u,m;if(!r.includes(f)&&!r.includes("*")&&(u=e.getAttribute(f))){if(m=t.getAttribute(f))var p=o?[m,u]:[u,m];else var p=[u];t.setAttribute(f,K(p.join(" ").split(" ").map(l=>l.trim())).join(" ")),r.push(f)}}),K(Ce.concat("style")).forEach(f=>{var u,m;if(!r.includes(f)&&!r.includes("*")&&(u=e.getAttribute(f))){if(m=t.getAttribute(f)){var p=o?[m,u]:[u,m];p[0].trim().endsWith(";")||(p[0]=p[0]+";")}else var p=[u];t.setAttribute(f,p.join(" ")),r.push(f)}}),!r.includes("*"))for(var s=0;s<e.attributes.length;s++){var n=e.attributes[s];!r.includes(n.name)&&(!t.hasAttribute(n.name)||o)&&t.setAttribute(n.name,n.value)}return t}var ie=["nocompose"],Ce=[],Se=[];_t.call(window);})();
|
|
3
3
|
//# sourceMappingURL=html-imports.js.map
|