@mborecki/crossword 0.2.0 → 0.3.0
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/cjs/{index-BlTGwvVC.js → index-rgQMtYdn.js} +23 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mb-crossword.cjs.entry.js +33 -15
- package/dist/cjs/mb-crossword.cjs.js +2 -2
- package/dist/collection/components/crossword/clue-list.js +11 -0
- package/dist/collection/components/crossword/clue.js +3 -2
- package/dist/collection/components/crossword/mb-crossword.css +48 -17
- package/dist/collection/components/crossword/mb-crossword.js +80 -11
- package/dist/components/index.js +1 -1
- package/dist/components/mb-crossword.js +1 -1
- package/dist/esm/{index-BGHKtxML.js → index-Dcm4tLi7.js} +23 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mb-crossword.entry.js +33 -15
- package/dist/esm/mb-crossword.js +3 -3
- package/dist/mb-crossword/mb-crossword.esm.js +1 -1
- package/dist/mb-crossword/{p-BGHKtxML.js → p-Dcm4tLi7.js} +2 -2
- package/dist/mb-crossword/p-d1ad544f.entry.js +1 -0
- package/dist/types/components/crossword/clue-list.d.ts +6 -0
- package/dist/types/components/crossword/clue.d.ts +2 -1
- package/dist/types/components/crossword/mb-crossword.d.ts +4 -1
- package/dist/types/components.d.ts +25 -0
- package/package.json +1 -1
- package/dist/mb-crossword/p-34ea8cf1.entry.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t,e,n,i,s,r,o,l,c,h,f,u,a,p,d,v,m,b=Object.create,w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,$=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,j=t=>{throw TypeError(t)},S=(t,e)=>function(){return e||(0,t[y(t)[0]])((e={exports:{}}).exports,e),e.exports},E=(t,e,n)=>e.has(t)||j("Cannot "+n),M=(t,e,n)=>(E(t,e,"read from private field"),n?n.call(t):e.get(t)),k=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),x=(t,e,n)=>(E(t,e,"write to private field"),e.set(t,n),n),N=(t,e,n)=>(E(t,e,"access private method"),n),P=S({"node_modules/balanced-match/index.js"(t,e){function n(t,e,n){t instanceof RegExp&&(t=i(t,n)),e instanceof RegExp&&(e=i(e,n));var r=s(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function i(t,e){var n=e.match(t);return n?n[0]:null}function s(t,e,n){var i,s,r,o,l,c=n.indexOf(t),h=n.indexOf(e,c+1),f=c;if(c>=0&&h>0){if(t===e)return[c,h];for(i=[],r=n.length;f>=0&&!l;)f==c?(i.push(f),c=n.indexOf(t,f+1)):1==i.length?l=[i.pop(),h]:((s=i.pop())<r&&(r=s,o=h),h=n.indexOf(e,f+1)),f=c<h&&c>=0?c:h;i.length&&(l=[r,o])}return l}e.exports=n,n.range=s}}),R=S({"node_modules/brace-expansion/index.js"(t,e){var n=P();e.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),v(function(t){return t.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(r).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(h)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function h(t){return t.split(i).join("\\").split(s).join("{").split(r).join("}").split(o).join(",").split(l).join(".")}function f(t){if(!t)return[""];var e=[],i=n("{","}",t);if(!i)return t.split(",");var s=i.body,r=i.post,o=i.pre.split(",");o[o.length-1]+="{"+s+"}";var l=f(r);return r.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function u(t){return"{"+t+"}"}function a(t){return/^-?0\d/.test(t)}function p(t,e){return t<=e}function d(t,e){return t>=e}function v(t,e){var i=[],s=n("{","}",t);if(!s)return[t];var o=s.pre,l=s.post.length?v(s.post,!1):[""];if(/\$$/.test(s.pre))for(var h=0;h<l.length;h++)i.push(C=o+"{"+s.body+"}"+l[h]);else{var m,b,w=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=w||g,$=s.body.indexOf(",")>=0;if(!y&&!$)return s.post.match(/,(?!,).*\}/)?v(t=s.pre+"{"+s.body+r+s.post):[t];if(y)m=s.body.split(/\.\./);else if(1===(m=f(s.body)).length&&1===(m=v(m[0],!1).map(u)).length)return l.map((function(t){return s.pre+m[0]+t}));if(y){var O=c(m[0]),j=c(m[1]),S=Math.max(m[0].length,m[1].length),E=3==m.length?Math.abs(c(m[2])):1,M=p;j<O&&(E*=-1,M=d);var k=m.some(a);b=[];for(var x=O;M(x,j);x+=E){var N;if(g)"\\"===(N=String.fromCharCode(x))&&(N="");else if(N=x+"",k){var P=S-N.length;if(P>0){var R=Array(P+1).join("0");N=x<0?"-"+R+N.slice(1):R+N}}b.push(N)}}else{b=[];for(var W=0;W<m.length;W++)b.push.apply(b,v(m[W],!1))}for(W=0;W<b.length;W++)for(h=0;h<l.length;h++){var C=o+b[W]+l[h];(!e||y||C)&&i.push(C)}}return i}}}),W=(t,e)=>{var n;Object.entries(null!=(n=e.i.t)?n:{}).map((([n,[i]])=>{if(31&i||32&i){const i=t[n],s=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);s&&Object.defineProperty(t,n,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.o.has(n)?e.o.get(n):i}}))},C=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},z=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.l=t,512&e.i.h&&W(t,e))},A=(t,e)=>e in t,L=(t,e)=>(0,console.error)(t,e),T=new Map,_=new Map,D="slot-fb{display:contents}slot-fb[hidden]{display:none}",G="undefined"!=typeof window?window:{},U={h:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,i)=>t.addEventListener(e,n,i),rel:(t,e,n,i)=>t.removeEventListener(e,n,i),ce:(t,e)=>new CustomEvent(t,e)},I=t=>Promise.resolve(t),Z=(()=>{try{return!!G.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),F=!!Z&&(()=>!!G.document&&Object.getOwnPropertyDescriptor(G.document.adoptedStyleSheets,"length").writable)(),H=!1,V=[],q=[],B=(t,e)=>n=>{t.push(n),H||(H=!0,e&&4&U.h?K(Y):U.raf(Y))},J=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){L(t)}t.length=0},Y=()=>{J(V),J(q),(H=V.length>0)&&U.raf(Y)},K=t=>I().then(t),Q=B(q,!0),X=t=>"object"==(t=typeof t)||"function"===t,tt=((t,e,n)=>(n=null!=t?b($(t)):{},((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of y(e))O.call(t,n)||undefined===n||w(t,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return t})(w(n,"default",{value:t,enumerable:!0}),t)))(R()),et=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},nt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},it=t=>t.replace(/[[\]\\-]/g,"\\$&"),st=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt=t=>t.join(""),ot=(t,e)=>{const n=e;if("["!==t.charAt(n))throw Error("not in a brace expression");const i=[],s=[];let r=n+1,o=!1,l=!1,c=!1,h=!1,f=n,u="";t:for(;r<t.length;){const e=t.charAt(r);if("!"!==e&&"^"!==e||r!==n+1){if("]"===e&&o&&!c){f=r+1;break}if(o=!0,"\\"!==e||c){if("["===e&&!c)for(const[e,[o,c,h]]of Object.entries(nt))if(t.startsWith(e,r)){if(u)return["$.",!1,t.length-n,!0];r+=e.length,h?s.push(o):i.push(o),l=l||c;continue t}c=!1,u?(e>u?i.push(it(u)+"-"+it(e)):e===u&&i.push(it(e)),u="",r++):t.startsWith("-]",r+1)?(i.push(it(e+"-")),r+=2):t.startsWith("-",r+1)?(u=e,r+=2):(i.push(it(e)),r++)}else c=!0,r++}else h=!0,r++}if(f<r)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-n,!0];if(0===s.length&&1===i.length&&/^\\?.$/.test(i[0])&&!h){const t=2===i[0].length?i[0].slice(-1):i[0];return[st(t),!1,f-n,!1]}const a="["+(h?"^":"")+rt(i)+"]",p="["+(h?"":"^")+rt(s)+"]";return[i.length&&s.length?"("+a+"|"+p+")":i.length?a:p,l,f-n,!0]},lt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),ct=new Set(["!","?","+","*","@"]),ht=t=>ct.has(t),ft="(?!\\.)",ut=new Set(["[","."]),at=new Set(["..","."]),pt=new Set("().*{}+?[]^$\\!"),dt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vt="[^/]",mt=vt+"*?",bt=vt+"+?",wt=class b{constructor(a,p,d={}){k(this,u),((t,e,n)=>{((t,e,n)=>{e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,e+"",n)})(this,"type"),k(this,t),k(this,e),k(this,n,!1),k(this,i,[]),k(this,s),k(this,r),k(this,o),k(this,l,!1),k(this,c),k(this,h),k(this,f,!1),this.type=a,a&&x(this,e,!0),x(this,s,p),x(this,t,M(this,s)?M(M(this,s),t):this),x(this,c,M(this,t)===this?d:M(M(this,t),c)),x(this,o,M(this,t)===this?[]:M(M(this,t),o)),"!"!==a||M(M(this,t),l)||M(this,o).push(this),x(this,r,M(this,s)?M(M(this,s),i).length:0)}get hasMagic(){if(void 0!==M(this,e))return M(this,e);for(const t of M(this,i))if("string"!=typeof t&&(t.type||t.hasMagic))return x(this,e,!0);return M(this,e)}toString(){return void 0!==M(this,h)?M(this,h):x(this,h,this.type?this.type+"("+M(this,i).map((t=>t+"")).join("|")+")":M(this,i).map((t=>t+"")).join(""))}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof b&&M(e,s)===this))throw Error("invalid part: "+e);M(this,i).push(e)}}toJSON(){var e;const n=null===this.type?M(this,i).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...M(this,i).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===M(this,t)||M(M(this,t),l)&&"!"===(null==(e=M(this,s))?void 0:e.type))&&n.push({}),n}isStart(){var e;if(M(this,t)===this)return!0;if(!(null==(e=M(this,s))?void 0:e.isStart()))return!1;if(0===M(this,r))return!0;const n=M(this,s);for(let t=0;t<M(this,r);t++){const e=M(n,i)[t];if(!(e instanceof b&&"!"===e.type))return!1}return!0}isEnd(){var e,n,o;if(M(this,t)===this)return!0;if("!"===(null==(e=M(this,s))?void 0:e.type))return!0;if(!(null==(n=M(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(o=M(this,s))?void 0:o.isEnd();const l=M(this,s)?M(M(this,s),i).length:0;return M(this,r)===l-1}copyIn(t){this.push("string"==typeof t?t:t.clone(this))}clone(t){const e=new b(this.type,t);for(const t of M(this,i))e.copyIn(t);return e}static fromGlob(t,e={}){var n;const i=new b(null,void 0,e);return N(n=b,p,d).call(n,t,i,0,e),i}toMMPattern(){if(this!==M(this,t))return M(this,t).toMMPattern();const n=""+this,[i,s,r,o]=this.toRegExpSource();if(!(r||M(this,e)||M(this,c).nocase&&!M(this,c).nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;const l=(M(this,c).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:n})}get options(){return M(this,c)}toRegExpSource(r){var o;const h=null!=r?r:!!M(this,c).dot;if(M(this,t)===this&&N(this,u,a).call(this),!this.type){const c=this.isStart()&&this.isEnd(),f=M(this,i).map((t=>{var i;const[s,o,l,h]="string"==typeof t?N(i=b,p,m).call(i,t,M(this,e),c):t.toRegExpSource(r);return x(this,e,M(this,e)||l),x(this,n,M(this,n)||h),s})).join("");let u="";if(this.isStart()&&"string"==typeof M(this,i)[0]&&(1!==M(this,i).length||!at.has(M(this,i)[0]))){const t=ut,e=h&&t.has(f.charAt(0))||f.startsWith("\\.")&&t.has(f.charAt(2))||f.startsWith("\\.\\.")&&t.has(f.charAt(4)),n=!h&&!r&&t.has(f.charAt(0));u=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ft:""}let a="";return this.isEnd()&&M(M(this,t),l)&&"!"===(null==(o=M(this,s))?void 0:o.type)&&(a="(?:$|\\/)"),[u+f+a,lt(f),x(this,e,!!M(this,e)),M(this,n)]}const d="*"===this.type||"+"===this.type,w="!"===this.type?"(?:(?!(?:":"(?:";let g=N(this,u,v).call(this,h);if(this.isStart()&&this.isEnd()&&!g&&"!"!==this.type){const t=""+this;return x(this,i,[t]),this.type=null,x(this,e,void 0),[t,lt(""+this),!1,!1]}let y=!d||r||h?"":N(this,u,v).call(this,!0);y===g&&(y=""),y&&(g=`(?:${g})(?:${y})*?`);let $="";return $="!"===this.type&&M(this,f)?(this.isStart()&&!h?ft:"")+bt:w+g+("!"===this.type?"))"+(!this.isStart()||h||r?"":ft)+mt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,lt(g),x(this,e,!!M(this,e)),M(this,n)]}};t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakMap,u=new WeakSet,a=function(){if(this!==M(this,t))throw Error("should only call on root");if(M(this,l))return this;let e;for(x(this,l,!0);e=M(this,o).pop();){if("!"!==e.type)continue;let t=e,n=M(t,s);for(;n;){for(let s=M(t,r)+1;!n.type&&s<M(n,i).length;s++)for(const t of M(e,i)){if("string"==typeof t)throw Error("string part in extglob AST??");t.copyIn(M(n,i)[s])}t=n,n=M(t,s)}}return this},p=new WeakSet,d=function(t,n,s,r){var o,l;let c=!1,h=!1,u=-1,a=!1;if(null===n.type){let e=s,i="";for(;e<t.length;){const s=t.charAt(e++);if(c||"\\"===s)c=!c,i+=s;else if(h)e===u+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||e===u+2&&a||(h=!1),i+=s;else if("["!==s)if(r.noext||!ht(s)||"("!==t.charAt(e))i+=s;else{n.push(i),i="";const l=new wt(s,n);e=N(o=wt,p,d).call(o,t,l,e,r),n.push(l)}else h=!0,u=e,a=!1,i+=s}return n.push(i),e}let v=s+1,m=new wt(null,n);const b=[];let w="";for(;v<t.length;){const e=t.charAt(v++);if(c||"\\"===e)c=!c,w+=e;else if(h)v===u+1?"^"!==e&&"!"!==e||(a=!0):"]"!==e||v===u+2&&a||(h=!1),w+=e;else if("["!==e)if(ht(e)&&"("===t.charAt(v)){m.push(w),w="";const n=new wt(e,m);m.push(n),v=N(l=wt,p,d).call(l,t,n,v,r)}else if("|"!==e){if(")"===e)return""===w&&0===M(n,i).length&&x(n,f,!0),m.push(w),w="",n.push(...b,m),v;w+=e}else m.push(w),w="",b.push(m),m=new wt(null,n);else h=!0,u=v,a=!1,w+=e}return n.type=null,x(n,e,void 0),x(n,i,[t.substring(s-1)]),v},v=function(t){return M(this,i).map((e=>{if("string"==typeof e)throw Error("string type in extglob ast??");const[i,s,r,o]=e.toRegExpSource(t);return x(this,n,M(this,n)||o),i})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},m=function(t,e,n=!1){let i=!1,s="",r=!1;for(let o=0;o<t.length;o++){const l=t.charAt(o);if(i)i=!1,s+=(pt.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,c]=ot(t,o);if(l){s+=n,r=r||i,o+=l-1,e=e||c;continue}}"*"!==l?"?"!==l?s+=dt(l):(s+=vt,e=!0):(s+=n&&"*"===t?bt:mt,e=!0)}else o===t.length-1?s+="\\\\":i=!0}return[s,lt(t),!!e,r]},k(wt,p);var gt=wt,yt=(t,e,n={})=>(et(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Vt(e,n).match(t)),$t=/^\*+([^+@!?\*\[\(]*)$/,Ot=t=>e=>!e.startsWith(".")&&e.endsWith(t),jt=t=>e=>e.endsWith(t),St=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Et=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Mt=/^\*+\.\*+$/,kt=t=>!t.startsWith(".")&&t.includes("."),xt=t=>"."!==t&&".."!==t&&t.includes("."),Nt=/^\.\*+$/,Pt=t=>"."!==t&&".."!==t&&t.startsWith("."),Rt=/^\*+$/,Wt=t=>0!==t.length&&!t.startsWith("."),Ct=t=>0!==t.length&&"."!==t&&".."!==t,zt=/^\?+([^+@!?\*\[\(]*)?$/,At=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Gt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Tt=([t,e=""])=>{const n=Gt([t]);return e?t=>n(t)&&t.endsWith(e):n},_t=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},Dt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Gt=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Ut="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";yt.sep="win32"===Ut?"\\":"/";var It=Symbol("globstar **");yt.GLOBSTAR=It,yt.filter=(t,e={})=>n=>yt(n,t,e);var Zt=(t,e={})=>Object.assign({},t,e);yt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return yt;const e=yt;return Object.assign(((n,i,s={})=>e(n,i,Zt(t,s))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Zt(t,n))}static defaults(n){return e.defaults(Zt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,Zt(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,Zt(t,i))}},unescape:(n,i={})=>e.unescape(n,Zt(t,i)),escape:(n,i={})=>e.escape(n,Zt(t,i)),filter:(n,i={})=>e.filter(n,Zt(t,i)),defaults:n=>e.defaults(Zt(t,n)),makeRe:(n,i={})=>e.makeRe(n,Zt(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Zt(t,i)),match:(n,i,s={})=>e.match(n,i,Zt(t,s)),sep:e.sep,GLOBSTAR:It})};var Ft=(t,e={})=>(et(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,tt.default)(t));yt.braceExpand=Ft,yt.makeRe=(t,e={})=>new Vt(t,e).makeRe(),yt.match=(t,e,n={})=>{const i=new Vt(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var Ht=/[?*]|[+@!]\(.*?\)|\[|\]/,Vt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){et(t),this.options=e=e||{},this.pattern=t,this.platform=e.platform||Ut,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((t=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&Ht.test(t[2])||Ht.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const i=t[n];1===n&&""===i&&""===t[0]||"."!==i&&""!==i||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const i=t[n-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;-1!==(i=n.indexOf("**",i+1));){let s=i;for(;"**"===n[s+1];)s++;s>i&&n.splice(i+1,s-i);const r=n[i+2],o=n[i+3];if(".."!==n[i+1])continue;if(!r||"."===r||".."===r||!o||"."===o||".."===o)continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const i=n[t];1===t&&""===i&&""===n[0]||"."!==i&&""!==i||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let s=0;for(;-1!==(s=n.indexOf("..",s+1));){const t=n[s-1];t&&"."!==t&&".."!==t&&"**"!==t&&(e=!0,n.splice(s-1,2,...1===s&&"**"===n[s+1]?["."]:[]),0===n.length&&n.push(""),s-=2)}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);i&&(t[e]=i,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let i=0,s=0,r=[],o="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])r.push("b"===o?e[s]:t[i]),i++,s++;else if(n&&"**"===t[i]&&e[s]===t[i+1])r.push(t[i]),i++;else if(n&&"**"===e[s]&&t[i]===e[s+1])r.push(e[s]),s++;else if("*"!==t[i]||!e[s]||!this.options.dot&&e[s].startsWith(".")||"**"===e[s]){if("*"!==e[s]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===o)return!1;o="b",r.push(e[s]),i++,s++}else{if("b"===o)return!1;o="a",r.push(t[i]),i++,s++}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),s="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),r=i?3:n?0:void 0,o=!s&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:s?0:void 0;if("number"==typeof r&&"number"==typeof o){const[n,i]=[t[r],e[o]];n.toLowerCase()===i.toLowerCase()&&(e[o]=n,o>r?e=e.slice(o):r>o&&(t=t.slice(r)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var r=0,o=0,l=t.length,c=e.length;r<l&&o<c;r++,o++){this.debug("matchOne loop");var h=e[o],f=t[r];if(this.debug(e,h,f),!1===h)return!1;if(h===It){this.debug("GLOBSTAR",[e,h,f]);var u=r,a=o+1;if(a===c){for(this.debug("** at the end");r<l;r++)if("."===t[r]||".."===t[r]||!i.dot&&"."===t[r].charAt(0))return!1;return!0}for(;u<l;){var p=t[u];if(this.debug("\nglobstar while",t,u,e,a,p),this.matchOne(t.slice(u),e.slice(a),n))return this.debug("globstar found match!",u,l,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,u,e,a);break}this.debug("globstar swallow a segment, and continue"),u++}return!(!n||(this.debug("\n>>> no match, partial?",t,u,e,a),u!==l))}let s;if("string"==typeof h?(s=f===h,this.debug("string match",h,f,s)):(s=h.test(f),this.debug("pattern match",h,f,s)),!s)return!1}if(r===l&&o===c)return!0;if(r===l)return n;if(o===c)return r===l-1&&""===t[r];throw Error("wtf?")}braceExpand(){return Ft(this.pattern,this.options)}parse(t){et(t);const e=this.options;if("**"===t)return It;if(""===t)return"";let n,i=null;(n=t.match(Rt))?i=e.dot?Ct:Wt:(n=t.match($t))?i=(e.nocase?e.dot?Et:St:e.dot?jt:Ot)(n[1]):(n=t.match(zt))?i=(e.nocase?e.dot?Lt:At:e.dot?Tt:_t)(n):(n=t.match(Mt))?i=e.dot?xt:kt:(n=t.match(Nt))&&(i=Pt);const s=gt.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof s&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let s=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))(t):t===It?It:t._src}));return e.forEach(((t,i)=>{const s=e[i+1],r=e[i-1];t===It&&r!==It&&(void 0===r?void 0!==s&&s!==It?e[i+1]="(?:\\/|"+n+"\\/)?"+s:e[i]=n:void 0===s?e[i-1]=r+"(?:\\/|"+n+")?":s!==It&&(e[i-1]=r+"(?:\\/|\\/"+n+"\\/)"+s,e[i+1]=It))})),e.filter((t=>t!==It)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];s="^"+r+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=RegExp(s,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let r=i[i.length-1];if(!r)for(let t=i.length-2;!r&&t>=0;t--)r=i[t];for(let t=0;t<s.length;t++){const o=s[t];let l=i;if(n.matchBase&&1===o.length&&(l=[r]),this.matchOne(l,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return yt.defaults(t).Minimatch}};function qt(t){var e,n,i;return null!=(i=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?i:void 0}yt.AST=gt,yt.Minimatch=Vt,yt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),yt.unescape=lt,((t,e)=>{for(var n in e)w(t,n,{get:e[n],enumerable:!0})})({},{err:()=>Jt,map:()=>Yt,ok:()=>Bt,unwrap:()=>Qt,unwrapErr:()=>Xt});var Bt=t=>({isOk:!0,isErr:!1,value:t}),Jt=t=>({isOk:!1,isErr:!0,value:t});function Yt(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>Bt(t))):Bt(n)}if(t.isErr)return Jt(t.value);throw"should never get here"}var Kt,Qt=t=>{if(t.isOk)return t.value;throw t.value},Xt=t=>{if(t.isErr)return t.value;throw t.value};function te(t){const e={mode:"open"};e.delegatesFocus=!!(16&t.h);const n=this.attachShadow(e);void 0===Kt&&(Kt=null),Kt&&(F?n.adoptedStyleSheets.push(Kt):n.adoptedStyleSheets=[...n.adoptedStyleSheets,Kt])}function ee(t,e,n){let i,s=0,r=[];for(;s<t.length;s++){if(i=t[s],i["s-sr"]&&(!e||i["s-hn"]===e)&&(void 0===n||ne(i)===n)&&(r.push(i),void 0!==n))return r;r=[...r,...ee(i.childNodes,e,n)]}return r}var ne=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;var ie=new WeakMap,se=t=>"sc-"+t.p,re=(t,e,...n)=>{let i=null,s=null,r=!1,o=!1;const l=[],c=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?c(i):null!=i&&"boolean"!=typeof i&&((r="function"!=typeof t&&!X(i))&&(i+=""),r&&o?l[l.length-1].v+=i:l.push(r?oe(null,i):i),o=r)};if(c(n),e){e.key&&(s=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,l,ce);const h=oe(t,null);return h.m=e,l.length>0&&(h.$=l),h.O=s,h},oe=(t,e)=>({h:0,j:t,v:e,S:null,$:null,m:null,O:null}),le={},ce={forEach:(t,e)=>t.map(he).forEach(e),map:(t,e)=>t.map(he).map(e).map(fe)},he=t=>({vattrs:t.m,vchildren:t.$,vkey:t.O,vname:t.M,vtag:t.j,vtext:t.v}),fe=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),re(t.vtag,e,...t.vchildren||[])}const e=oe(t.vtag,t.vtext);return e.m=t.vattrs,e.$=t.vchildren,e.O=t.vkey,e.M=t.vname,e},ue=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};ue("::slotted"),ue(":host"),ue(":host-context");var ae,pe=(t,e)=>null==t||X(t)?t:4&e?"false"!==t&&(""===t||!!t):t,de=(t,e,n,i,s,r)=>{if(n===i)return;let o=A(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,s=me(n);let r=me(i);e.remove(...s.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)i&&null!=i[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in i)n&&i[e]===n[e]||(e.includes("-")?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("key"===e);else if("ref"===e)i&&i(t);else if(o||"o"!==e[0]||"n"!==e[1]){const l=X(i);if(o||l&&null!==i)try{if(t.tagName.includes("-"))t[e]!==i&&(t[e]=i);else{const s=null==i?"":i;"list"===e?o=!1:null!=n&&t[e]==s||("function"==typeof t.__lookupSetter__(e)?t[e]=s:t.setAttribute(e,s))}}catch(t){}null==i||!1===i?!1===i&&""!==t.getAttribute(e)||t.removeAttribute(e):(!o||4&r||s)&&!l&&1===t.nodeType&&t.setAttribute(e,i=!0===i?"":i)}else if(e="-"===e[2]?e.slice(3):A(G,l)?l.slice(2):l[2]+e.slice(3),n||i){const s=e.endsWith(be);e=e.replace(we,""),n&&U.rel(t,e,n,s),i&&U.ael(t,e,i,s)}},ve=/\s/,me=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(ve):[]),be="Capture",we=RegExp(be+"$"),ge=(t,e,n)=>{const i=11===e.S.nodeType&&e.S.host?e.S.host:e.S,s=t&&t.m||{},r=e.m||{};for(const t of ye(Object.keys(s)))t in r||de(i,t,s[t],void 0,n,e.h);for(const t of ye(Object.keys(r)))de(i,t,s[t],r[t],n,e.h)};function ye(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var $e=!1,Oe=(t,e,n)=>{const i=e.$[n];let s,r,o=0;if(null!==i.v)s=i.S=G.document.createTextNode(i.v);else{if(!G.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=i.S=G.document.createElement(i.j),ge(null,i,$e),i.$){const e="template"===i.j?s.content:s;for(o=0;o<i.$.length;++o)r=Oe(t,i,o),r&&e.appendChild(r)}}return s["s-hn"]=ae,s},je=(t,e,n,i,s,r)=>{let o,l=t;for(l.shadowRoot&&l.tagName===ae&&(l=l.shadowRoot),"template"===n.j&&(l=l.content);s<=r;++s)i[s]&&(o=Oe(null,n,s),o&&(i[s].S=o,xe(l,o,e)))},Se=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.S;ke(e),t&&t.remove()}}},Ee=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.O&&e.O&&(t.O=e.O),!0):t.O===e.O),Me=(t,e,n=!1)=>{const i=e.S=t.S,s=t.$,r=e.$,o=e.v;null===o?(ge(t,e,$e),null!==s&&null!==r?((t,e,n,i,s=!1)=>{let r,o,l=0,c=0,h=0,f=0,u=e.length-1,a=e[0],p=e[u],d=i.length-1,v=i[0],m=i[d];const b="template"===n.j?t.content:t;for(;l<=u&&c<=d;)if(null==a)a=e[++l];else if(null==p)p=e[--u];else if(null==v)v=i[++c];else if(null==m)m=i[--d];else if(Ee(a,v,s))Me(a,v,s),a=e[++l],v=i[++c];else if(Ee(p,m,s))Me(p,m,s),p=e[--u],m=i[--d];else if(Ee(a,m,s))Me(a,m,s),xe(b,a.S,p.S.nextSibling),a=e[++l],m=i[--d];else if(Ee(p,v,s))Me(p,v,s),xe(b,p.S,a.S),p=e[--u],v=i[++c];else{for(h=-1,f=l;f<=u;++f)if(e[f]&&null!==e[f].O&&e[f].O===v.O){h=f;break}h>=0?(o=e[h],o.j!==v.j?r=Oe(e&&e[c],n,h):(Me(o,v,s),e[h]=void 0,r=o.S),v=i[++c]):(r=Oe(e&&e[c],n,c),v=i[++c]),r&&xe(a.S.parentNode,r,a.S)}l>u?je(t,null==i[d+1]?null:i[d+1].S,n,i,c,d):c>d&&Se(e,l,u)})(i,s,e,r,n):null!==r?(null!==t.v&&(i.textContent=""),je(i,null,e,r,0,r.length-1)):!n&&null!==s&&Se(s,0,s.length-1)):t.v!==o&&(i.data=o)},ke=t=>{t.m&&t.m.ref&&t.m.ref(null),t.$&&t.$.map(ke)},xe=(t,e,n)=>{if("string"==typeof e["s-sn"]){t.insertBefore(e,n);const{slotNode:i}=function(t,e){var n;if(!(e=e||(null==(n=t["s-ol"])?void 0:n.parentElement)))return{slotNode:null,slotName:""};const i=t["s-sn"]=ne(t)||"";return{slotNode:ee(function(t,e){if("__"+e in t){const n=t["__"+e];return"function"!=typeof n?n:n.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}(e,"childNodes"),e.tagName,i)[0],slotName:i}}(e);return i&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(i),e}return t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n)},Ne=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.k=()=>{e["s-p"].splice(n-1,1),i()})))}},Pe=(t,e)=>{if(t.h|=16,4&t.h)return void(t.h|=512);Ne(t,t.N);const n=()=>Re(t,e);if(!e)return Q(n);queueMicrotask((()=>{n()}))},Re=(t,e)=>{const n=t.$hostElement$,i=t.l;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return e?(t.P.length&&t.P.forEach((t=>t(n))),s=De(i,"componentWillLoad",void 0,n)):s=De(i,"componentWillUpdate",void 0,n),s=We(s,(()=>De(i,"componentWillRender",void 0,n))),We(s,(()=>ze(t,i,e)))},We=(t,e)=>Ce(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Ce=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ze=async(t,e,n)=>{var i;const s=t.$hostElement$,r=s["s-rc"];n&&(t=>{const e=t.i,n=t.$hostElement$,i=e.h,s=((t,e)=>{var n,i,s;const r=se(e),o=_.get(r);if(!G.document)return r;if(t=11===t.nodeType?t:G.document,o)if("string"==typeof o){let s,l=ie.get(t=t.head||t);if(l||ie.set(t,l=new Set),!l.has(r)){s=G.document.createElement("style"),s.innerHTML=o;const c=null!=(n=U.R)?n:qt(G.document);if(null!=c&&s.setAttribute("nonce",c),!(1&e.h))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(Z){const e=new(null!=(i=t.defaultView)?i:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(o),F?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=o+e.innerHTML:t.prepend(s)}else t.append(s);1&e.h&&t.insertBefore(s,null),4&e.h&&(s.innerHTML+=D),l&&l.add(r)}}else{let e=ie.get(t);if(e||ie.set(t,e=new Set),!e.has(r)){const n=null!=(s=t.defaultView)?s:t.ownerDocument.defaultView;let i;if(o.constructor===n.CSSStyleSheet)i=o;else{i=new n.CSSStyleSheet;for(let t=0;t<o.cssRules.length;t++)i.insertRule(o.cssRules[t].cssText,t)}F?t.adoptedStyleSheets.push(i):t.adoptedStyleSheets=[...t.adoptedStyleSheets,i],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&i&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);Ae(t,e,s,n),r&&(r.map((t=>t())),s["s-rc"]=void 0);{const e=null!=(i=s["s-p"])?i:[],n=()=>Le(t);0===e.length?n():(Promise.all(e).then(n),t.h|=4,e.length=0)}},Ae=(t,e,n,i)=>{try{e=e.render(),t.h&=-17,t.h|=2,((t,e,n=!1)=>{const i=t.$hostElement$,s=t.W||oe(null,null),r=(t=>t&&t.j===le)(e)?e:re(null,null,e);if(ae=i.tagName,n&&r.m)for(const t of Object.keys(r.m))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.m[t]=i[t]);r.j=null,r.h|=4,t.W=r,r.S=s.S=i.shadowRoot||i,Me(s,r,n)})(t,e,i)}catch(e){L(e,t.$hostElement$)}return null},Le=t=>{const e=t.$hostElement$,n=t.l,i=t.N;De(n,"componentDidRender",void 0,e),64&t.h?De(n,"componentDidUpdate",void 0,e):(t.h|=64,Ge(e),De(n,"componentDidLoad",void 0,e),t.C(e),i||_e()),t.A(e),t.k&&(t.k(),t.k=void 0),512&t.h&&K((()=>Pe(t,!1))),t.h&=-517},Te=t=>{var e;{const n=C(t),i=null==(e=null==n?void 0:n.$hostElement$)?void 0:e.isConnected;return i&&2==(18&n.h)&&Pe(n,!1),i}},_e=()=>{K((()=>(t=>{const e=U.ce("appload",{detail:{namespace:"mb-crossword"}});return t.dispatchEvent(e),e})(G)))},De=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){L(t,i)}},Ge=t=>t.classList.add("hydrated"),Ue=(t,e,n,i)=>{const s=C(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${i.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,o=s.o.get(e),l=s.h,c=s.l;if(n=pe(n,i.t[e][0]),!(8&l&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n))){if(s.o.set(e,n),i.L){const t=i.L[e];t&&t.map((t=>{try{const[[i,r]]=Object.entries(t);(128&l||1&r)&&(c?c[i](n,o,e):s.P.push((()=>{s.l[i](n,o,e)})))}catch(t){L(t,r)}}))}if(2==(18&l)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,o,e))return;Pe(s,!1)}}},Ie=(t,e,n)=>{var i,s;const r=t.prototype;{t.watchers&&!e.L&&(e.L=t.watchers),t.deserializers&&!e.T&&(e.T=t.deserializers),t.serializers&&!e._&&(e._=t.serializers);const o=Object.entries(null!=(i=e.t)?i:{});if(o.map((([t,[i]])=>{if(31&i||2&n&&32&i){const{get:s,set:o}=Object.getOwnPropertyDescriptor(r,t)||{};s&&(e.t[t][0]|=2048),o&&(e.t[t][0]|=4096),(1&n||!s)&&Object.defineProperty(r,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>C(this).o.get(e))(0,t);const n=C(this),i=n?n.l:r;if(!i)return;return i[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,t,{set(s){const r=C(this);if(r){if(o)return void 0===(32&i?this[t]:r.$hostElement$[t])&&r.o.get(t)&&(s=r.o.get(t)),o.call(this,pe(s,i)),void Ue(this,t,s=32&i?this[t]:r.$hostElement$[t],e);{if(!(1&n&&4096&e.t[t][0]))return Ue(this,t,s,e),void(1&n&&!r.l&&r.P.push((()=>{4096&e.t[t][0]&&r.l[t]!==r.o.get(t)&&(r.l[t]=s)})));const o=()=>{const n=r.l[t];!r.o.get(t)&&n&&r.o.set(t,n),r.l[t]=pe(s,i),Ue(this,t,r.l[t],e)};r.l?o():r.P.push((()=>{o()}))}}}})}else 1&n&&64&i&&Object.defineProperty(r,t,{value(...e){var n;const i=C(this);return null==(n=null==i?void 0:i.D)?void 0:n.then((()=>{var n;return null==(n=i.l)?void 0:n[t](...e)}))}})})),1&n){const n=new Map;r.attributeChangedCallback=function(t,i,s){U.jmp((()=>{var l;const c=n.get(t),h=C(this);if(this.hasOwnProperty(c)&&(s=this[c],delete this[c]),r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const n=null==h?void 0:h.h;if(h&&n&&!(8&n)&&s!==i){const r=h.l,o=null==(l=e.L)?void 0:l[t];null==o||o.forEach((e=>{const[[o,l]]=Object.entries(e);null!=r[o]&&(128&n||1&l)&&r[o].call(r,s,i,t)}))}return}const f=o.find((([t])=>t===c));f&&4&f[1][0]&&(s=null!==s&&"false"!==s);const u=Object.getOwnPropertyDescriptor(r,c);s==this[c]||u.get&&!u.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.L)?s:{}),...o.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},Ze=(t,e)=>{De(t,"connectedCallback",void 0,e)},Fe=(t,e)=>{De(t,"disconnectedCallback",void 0,e||t)},He=(t,e={})=>{var n;if(!G.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const i=[],s=e.exclude||[],r=G.customElements,o=G.document.head,l=o.querySelector("meta[charset]"),c=G.document.createElement("style"),h=[];let f,u=!0;Object.assign(U,e),U.u=new URL(e.resourcesUrl||"./",G.document.baseURI).href;let a=!1;if(t.map((t=>{t[1].map((e=>{var n,o,l;const c={h:e[0],p:e[1],t:e[2],G:e[3]};4&c.h&&(a=!0),c.t=e[2],c.L=null!=(n=e[4])?n:{},c._=null!=(o=e[5])?o:{},c.T=null!=(l=e[6])?l:{};const p=c.p,d=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={h:0,$hostElement$:t,i:e,o:new Map,U:new Map};n.D=new Promise((t=>n.A=t)),n.I=new Promise((t=>n.C=t)),t["s-p"]=[],t["s-rc"]=[],n.P=[];const i=n;t.__stencil__getHostRef=()=>i})(t=this,c),1&c.h)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else te.call(t,c)}connectedCallback(){C(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),f&&(clearTimeout(f),f=null),u?h.push(this):U.jmp((()=>(t=>{if(!(1&U.h)){const e=C(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.h)(null==e?void 0:e.l)?Ze(e.l,t):(null==e?void 0:e.I)&&e.I.then((()=>Ze(e.l,t)));else{e.h|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){Ne(e,e.N=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let i;if(!(32&e.h)){if(e.h|=32,n.Z){const s=((t,e)=>{const n=t.p.replace(/-/g,"_"),i=t.Z;if(!i)return;const s=T.get(i);return s?s[n]:import(`./${i}.entry.js`).then((t=>(T.set(i,t),t[n])),(t=>{L(t,e.$hostElement$)}))
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(s&&"then"in s){const t=()=>{};i=await s,t()}else i=s;if(!i)throw Error(`Constructor for "${n.p}#${e.F}" was not found`);i.isProxied||(n.L=i.watchers,n._=i.serializers,n.T=i.deserializers,
|
|
1
|
+
var t,e,n,i,s,r,o,l,c,h,u,f,a,p,d,v,m,b=Object.create,w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,$=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,j=t=>{throw TypeError(t)},S=(t,e)=>function(){return e||(0,t[y(t)[0]])((e={exports:{}}).exports,e),e.exports},E=(t,e,n)=>e.has(t)||j("Cannot "+n),M=(t,e,n)=>(E(t,e,"read from private field"),n?n.call(t):e.get(t)),k=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),x=(t,e,n)=>(E(t,e,"write to private field"),e.set(t,n),n),N=(t,e,n)=>(E(t,e,"access private method"),n),P=S({"node_modules/balanced-match/index.js"(t,e){function n(t,e,n){t instanceof RegExp&&(t=i(t,n)),e instanceof RegExp&&(e=i(e,n));var r=s(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function i(t,e){var n=e.match(t);return n?n[0]:null}function s(t,e,n){var i,s,r,o,l,c=n.indexOf(t),h=n.indexOf(e,c+1),u=c;if(c>=0&&h>0){if(t===e)return[c,h];for(i=[],r=n.length;u>=0&&!l;)u==c?(i.push(u),c=n.indexOf(t,u+1)):1==i.length?l=[i.pop(),h]:((s=i.pop())<r&&(r=s,o=h),h=n.indexOf(e,u+1)),u=c<h&&c>=0?c:h;i.length&&(l=[r,o])}return l}e.exports=n,n.range=s}}),R=S({"node_modules/brace-expansion/index.js"(t,e){var n=P();e.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),v(function(t){return t.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(r).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(h)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function h(t){return t.split(i).join("\\").split(s).join("{").split(r).join("}").split(o).join(",").split(l).join(".")}function u(t){if(!t)return[""];var e=[],i=n("{","}",t);if(!i)return t.split(",");var s=i.body,r=i.post,o=i.pre.split(",");o[o.length-1]+="{"+s+"}";var l=u(r);return r.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function f(t){return"{"+t+"}"}function a(t){return/^-?0\d/.test(t)}function p(t,e){return t<=e}function d(t,e){return t>=e}function v(t,e){var i=[],s=n("{","}",t);if(!s)return[t];var o=s.pre,l=s.post.length?v(s.post,!1):[""];if(/\$$/.test(s.pre))for(var h=0;h<l.length;h++)i.push(C=o+"{"+s.body+"}"+l[h]);else{var m,b,w=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=w||g,$=s.body.indexOf(",")>=0;if(!y&&!$)return s.post.match(/,(?!,).*\}/)?v(t=s.pre+"{"+s.body+r+s.post):[t];if(y)m=s.body.split(/\.\./);else if(1===(m=u(s.body)).length&&1===(m=v(m[0],!1).map(f)).length)return l.map((function(t){return s.pre+m[0]+t}));if(y){var O=c(m[0]),j=c(m[1]),S=Math.max(m[0].length,m[1].length),E=3==m.length?Math.abs(c(m[2])):1,M=p;j<O&&(E*=-1,M=d);var k=m.some(a);b=[];for(var x=O;M(x,j);x+=E){var N;if(g)"\\"===(N=String.fromCharCode(x))&&(N="");else if(N=x+"",k){var P=S-N.length;if(P>0){var R=Array(P+1).join("0");N=x<0?"-"+R+N.slice(1):R+N}}b.push(N)}}else{b=[];for(var W=0;W<m.length;W++)b.push.apply(b,v(m[W],!1))}for(W=0;W<b.length;W++)for(h=0;h<l.length;h++){var C=o+b[W]+l[h];(!e||y||C)&&i.push(C)}}return i}}}),W=(t,e)=>{var n;Object.entries(null!=(n=e.i.t)?n:{}).map((([n,[i]])=>{if(31&i||32&i){const i=t[n],s=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);s&&Object.defineProperty(t,n,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.o.has(n)?e.o.get(n):i}}))},C=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},z=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.l=t,512&e.i.h&&W(t,e))},A=(t,e)=>e in t,L=(t,e)=>(0,console.error)(t,e),T=new Map,_=new Map,D="slot-fb{display:contents}slot-fb[hidden]{display:none}",G="undefined"!=typeof window?window:{},U={h:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,i)=>t.addEventListener(e,n,i),rel:(t,e,n,i)=>t.removeEventListener(e,n,i),ce:(t,e)=>new CustomEvent(t,e)},I=t=>Promise.resolve(t),Z=(()=>{try{return!!G.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),F=!!Z&&(()=>!!G.document&&Object.getOwnPropertyDescriptor(G.document.adoptedStyleSheets,"length").writable)(),H=!1,V=[],q=[],B=(t,e)=>n=>{t.push(n),H||(H=!0,e&&4&U.h?K(Y):U.raf(Y))},J=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){L(t)}t.length=0},Y=()=>{J(V),J(q),(H=V.length>0)&&U.raf(Y)},K=t=>I().then(t),Q=B(q,!0),X=t=>"object"==(t=typeof t)||"function"===t,tt=((t,e,n)=>(n=null!=t?b($(t)):{},((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of y(e))O.call(t,n)||undefined===n||w(t,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return t})(w(n,"default",{value:t,enumerable:!0}),t)))(R()),et=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},nt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},it=t=>t.replace(/[[\]\\-]/g,"\\$&"),st=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt=t=>t.join(""),ot=(t,e)=>{const n=e;if("["!==t.charAt(n))throw Error("not in a brace expression");const i=[],s=[];let r=n+1,o=!1,l=!1,c=!1,h=!1,u=n,f="";t:for(;r<t.length;){const e=t.charAt(r);if("!"!==e&&"^"!==e||r!==n+1){if("]"===e&&o&&!c){u=r+1;break}if(o=!0,"\\"!==e||c){if("["===e&&!c)for(const[e,[o,c,h]]of Object.entries(nt))if(t.startsWith(e,r)){if(f)return["$.",!1,t.length-n,!0];r+=e.length,h?s.push(o):i.push(o),l=l||c;continue t}c=!1,f?(e>f?i.push(it(f)+"-"+it(e)):e===f&&i.push(it(e)),f="",r++):t.startsWith("-]",r+1)?(i.push(it(e+"-")),r+=2):t.startsWith("-",r+1)?(f=e,r+=2):(i.push(it(e)),r++)}else c=!0,r++}else h=!0,r++}if(u<r)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-n,!0];if(0===s.length&&1===i.length&&/^\\?.$/.test(i[0])&&!h){const t=2===i[0].length?i[0].slice(-1):i[0];return[st(t),!1,u-n,!1]}const a="["+(h?"^":"")+rt(i)+"]",p="["+(h?"":"^")+rt(s)+"]";return[i.length&&s.length?"("+a+"|"+p+")":i.length?a:p,l,u-n,!0]},lt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),ct=new Set(["!","?","+","*","@"]),ht=t=>ct.has(t),ut="(?!\\.)",ft=new Set(["[","."]),at=new Set(["..","."]),pt=new Set("().*{}+?[]^$\\!"),dt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vt="[^/]",mt=vt+"*?",bt=vt+"+?",wt=class b{constructor(a,p,d={}){k(this,f),((t,e,n)=>{((t,e,n)=>{e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,e+"",n)})(this,"type"),k(this,t),k(this,e),k(this,n,!1),k(this,i,[]),k(this,s),k(this,r),k(this,o),k(this,l,!1),k(this,c),k(this,h),k(this,u,!1),this.type=a,a&&x(this,e,!0),x(this,s,p),x(this,t,M(this,s)?M(M(this,s),t):this),x(this,c,M(this,t)===this?d:M(M(this,t),c)),x(this,o,M(this,t)===this?[]:M(M(this,t),o)),"!"!==a||M(M(this,t),l)||M(this,o).push(this),x(this,r,M(this,s)?M(M(this,s),i).length:0)}get hasMagic(){if(void 0!==M(this,e))return M(this,e);for(const t of M(this,i))if("string"!=typeof t&&(t.type||t.hasMagic))return x(this,e,!0);return M(this,e)}toString(){return void 0!==M(this,h)?M(this,h):x(this,h,this.type?this.type+"("+M(this,i).map((t=>t+"")).join("|")+")":M(this,i).map((t=>t+"")).join(""))}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof b&&M(e,s)===this))throw Error("invalid part: "+e);M(this,i).push(e)}}toJSON(){var e;const n=null===this.type?M(this,i).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...M(this,i).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===M(this,t)||M(M(this,t),l)&&"!"===(null==(e=M(this,s))?void 0:e.type))&&n.push({}),n}isStart(){var e;if(M(this,t)===this)return!0;if(!(null==(e=M(this,s))?void 0:e.isStart()))return!1;if(0===M(this,r))return!0;const n=M(this,s);for(let t=0;t<M(this,r);t++){const e=M(n,i)[t];if(!(e instanceof b&&"!"===e.type))return!1}return!0}isEnd(){var e,n,o;if(M(this,t)===this)return!0;if("!"===(null==(e=M(this,s))?void 0:e.type))return!0;if(!(null==(n=M(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(o=M(this,s))?void 0:o.isEnd();const l=M(this,s)?M(M(this,s),i).length:0;return M(this,r)===l-1}copyIn(t){this.push("string"==typeof t?t:t.clone(this))}clone(t){const e=new b(this.type,t);for(const t of M(this,i))e.copyIn(t);return e}static fromGlob(t,e={}){var n;const i=new b(null,void 0,e);return N(n=b,p,d).call(n,t,i,0,e),i}toMMPattern(){if(this!==M(this,t))return M(this,t).toMMPattern();const n=""+this,[i,s,r,o]=this.toRegExpSource();if(!(r||M(this,e)||M(this,c).nocase&&!M(this,c).nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;const l=(M(this,c).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:n})}get options(){return M(this,c)}toRegExpSource(r){var o;const h=null!=r?r:!!M(this,c).dot;if(M(this,t)===this&&N(this,f,a).call(this),!this.type){const c=this.isStart()&&this.isEnd(),u=M(this,i).map((t=>{var i;const[s,o,l,h]="string"==typeof t?N(i=b,p,m).call(i,t,M(this,e),c):t.toRegExpSource(r);return x(this,e,M(this,e)||l),x(this,n,M(this,n)||h),s})).join("");let f="";if(this.isStart()&&"string"==typeof M(this,i)[0]&&(1!==M(this,i).length||!at.has(M(this,i)[0]))){const t=ft,e=h&&t.has(u.charAt(0))||u.startsWith("\\.")&&t.has(u.charAt(2))||u.startsWith("\\.\\.")&&t.has(u.charAt(4)),n=!h&&!r&&t.has(u.charAt(0));f=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ut:""}let a="";return this.isEnd()&&M(M(this,t),l)&&"!"===(null==(o=M(this,s))?void 0:o.type)&&(a="(?:$|\\/)"),[f+u+a,lt(u),x(this,e,!!M(this,e)),M(this,n)]}const d="*"===this.type||"+"===this.type,w="!"===this.type?"(?:(?!(?:":"(?:";let g=N(this,f,v).call(this,h);if(this.isStart()&&this.isEnd()&&!g&&"!"!==this.type){const t=""+this;return x(this,i,[t]),this.type=null,x(this,e,void 0),[t,lt(""+this),!1,!1]}let y=!d||r||h?"":N(this,f,v).call(this,!0);y===g&&(y=""),y&&(g=`(?:${g})(?:${y})*?`);let $="";return $="!"===this.type&&M(this,u)?(this.isStart()&&!h?ut:"")+bt:w+g+("!"===this.type?"))"+(!this.isStart()||h||r?"":ut)+mt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,lt(g),x(this,e,!!M(this,e)),M(this,n)]}};t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,u=new WeakMap,f=new WeakSet,a=function(){if(this!==M(this,t))throw Error("should only call on root");if(M(this,l))return this;let e;for(x(this,l,!0);e=M(this,o).pop();){if("!"!==e.type)continue;let t=e,n=M(t,s);for(;n;){for(let s=M(t,r)+1;!n.type&&s<M(n,i).length;s++)for(const t of M(e,i)){if("string"==typeof t)throw Error("string part in extglob AST??");t.copyIn(M(n,i)[s])}t=n,n=M(t,s)}}return this},p=new WeakSet,d=function(t,n,s,r){var o,l;let c=!1,h=!1,f=-1,a=!1;if(null===n.type){let e=s,i="";for(;e<t.length;){const s=t.charAt(e++);if(c||"\\"===s)c=!c,i+=s;else if(h)e===f+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||e===f+2&&a||(h=!1),i+=s;else if("["!==s)if(r.noext||!ht(s)||"("!==t.charAt(e))i+=s;else{n.push(i),i="";const l=new wt(s,n);e=N(o=wt,p,d).call(o,t,l,e,r),n.push(l)}else h=!0,f=e,a=!1,i+=s}return n.push(i),e}let v=s+1,m=new wt(null,n);const b=[];let w="";for(;v<t.length;){const e=t.charAt(v++);if(c||"\\"===e)c=!c,w+=e;else if(h)v===f+1?"^"!==e&&"!"!==e||(a=!0):"]"!==e||v===f+2&&a||(h=!1),w+=e;else if("["!==e)if(ht(e)&&"("===t.charAt(v)){m.push(w),w="";const n=new wt(e,m);m.push(n),v=N(l=wt,p,d).call(l,t,n,v,r)}else if("|"!==e){if(")"===e)return""===w&&0===M(n,i).length&&x(n,u,!0),m.push(w),w="",n.push(...b,m),v;w+=e}else m.push(w),w="",b.push(m),m=new wt(null,n);else h=!0,f=v,a=!1,w+=e}return n.type=null,x(n,e,void 0),x(n,i,[t.substring(s-1)]),v},v=function(t){return M(this,i).map((e=>{if("string"==typeof e)throw Error("string type in extglob ast??");const[i,s,r,o]=e.toRegExpSource(t);return x(this,n,M(this,n)||o),i})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},m=function(t,e,n=!1){let i=!1,s="",r=!1;for(let o=0;o<t.length;o++){const l=t.charAt(o);if(i)i=!1,s+=(pt.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,c]=ot(t,o);if(l){s+=n,r=r||i,o+=l-1,e=e||c;continue}}"*"!==l?"?"!==l?s+=dt(l):(s+=vt,e=!0):(s+=n&&"*"===t?bt:mt,e=!0)}else o===t.length-1?s+="\\\\":i=!0}return[s,lt(t),!!e,r]},k(wt,p);var gt=wt,yt=(t,e,n={})=>(et(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Vt(e,n).match(t)),$t=/^\*+([^+@!?\*\[\(]*)$/,Ot=t=>e=>!e.startsWith(".")&&e.endsWith(t),jt=t=>e=>e.endsWith(t),St=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Et=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Mt=/^\*+\.\*+$/,kt=t=>!t.startsWith(".")&&t.includes("."),xt=t=>"."!==t&&".."!==t&&t.includes("."),Nt=/^\.\*+$/,Pt=t=>"."!==t&&".."!==t&&t.startsWith("."),Rt=/^\*+$/,Wt=t=>0!==t.length&&!t.startsWith("."),Ct=t=>0!==t.length&&"."!==t&&".."!==t,zt=/^\?+([^+@!?\*\[\(]*)?$/,At=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Gt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Tt=([t,e=""])=>{const n=Gt([t]);return e?t=>n(t)&&t.endsWith(e):n},_t=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},Dt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Gt=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Ut="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";yt.sep="win32"===Ut?"\\":"/";var It=Symbol("globstar **");yt.GLOBSTAR=It,yt.filter=(t,e={})=>n=>yt(n,t,e);var Zt=(t,e={})=>Object.assign({},t,e);yt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return yt;const e=yt;return Object.assign(((n,i,s={})=>e(n,i,Zt(t,s))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Zt(t,n))}static defaults(n){return e.defaults(Zt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,Zt(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,Zt(t,i))}},unescape:(n,i={})=>e.unescape(n,Zt(t,i)),escape:(n,i={})=>e.escape(n,Zt(t,i)),filter:(n,i={})=>e.filter(n,Zt(t,i)),defaults:n=>e.defaults(Zt(t,n)),makeRe:(n,i={})=>e.makeRe(n,Zt(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Zt(t,i)),match:(n,i,s={})=>e.match(n,i,Zt(t,s)),sep:e.sep,GLOBSTAR:It})};var Ft=(t,e={})=>(et(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,tt.default)(t));yt.braceExpand=Ft,yt.makeRe=(t,e={})=>new Vt(t,e).makeRe(),yt.match=(t,e,n={})=>{const i=new Vt(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var Ht=/[?*]|[+@!]\(.*?\)|\[|\]/,Vt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){et(t),this.options=e=e||{},this.pattern=t,this.platform=e.platform||Ut,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((t=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&Ht.test(t[2])||Ht.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const i=t[n];1===n&&""===i&&""===t[0]||"."!==i&&""!==i||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const i=t[n-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;-1!==(i=n.indexOf("**",i+1));){let s=i;for(;"**"===n[s+1];)s++;s>i&&n.splice(i+1,s-i);const r=n[i+2],o=n[i+3];if(".."!==n[i+1])continue;if(!r||"."===r||".."===r||!o||"."===o||".."===o)continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const i=n[t];1===t&&""===i&&""===n[0]||"."!==i&&""!==i||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let s=0;for(;-1!==(s=n.indexOf("..",s+1));){const t=n[s-1];t&&"."!==t&&".."!==t&&"**"!==t&&(e=!0,n.splice(s-1,2,...1===s&&"**"===n[s+1]?["."]:[]),0===n.length&&n.push(""),s-=2)}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);i&&(t[e]=i,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let i=0,s=0,r=[],o="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])r.push("b"===o?e[s]:t[i]),i++,s++;else if(n&&"**"===t[i]&&e[s]===t[i+1])r.push(t[i]),i++;else if(n&&"**"===e[s]&&t[i]===e[s+1])r.push(e[s]),s++;else if("*"!==t[i]||!e[s]||!this.options.dot&&e[s].startsWith(".")||"**"===e[s]){if("*"!==e[s]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===o)return!1;o="b",r.push(e[s]),i++,s++}else{if("b"===o)return!1;o="a",r.push(t[i]),i++,s++}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),s="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),r=i?3:n?0:void 0,o=!s&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:s?0:void 0;if("number"==typeof r&&"number"==typeof o){const[n,i]=[t[r],e[o]];n.toLowerCase()===i.toLowerCase()&&(e[o]=n,o>r?e=e.slice(o):r>o&&(t=t.slice(r)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var r=0,o=0,l=t.length,c=e.length;r<l&&o<c;r++,o++){this.debug("matchOne loop");var h=e[o],u=t[r];if(this.debug(e,h,u),!1===h)return!1;if(h===It){this.debug("GLOBSTAR",[e,h,u]);var f=r,a=o+1;if(a===c){for(this.debug("** at the end");r<l;r++)if("."===t[r]||".."===t[r]||!i.dot&&"."===t[r].charAt(0))return!1;return!0}for(;f<l;){var p=t[f];if(this.debug("\nglobstar while",t,f,e,a,p),this.matchOne(t.slice(f),e.slice(a),n))return this.debug("globstar found match!",f,l,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,f,e,a);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",t,f,e,a),f!==l))}let s;if("string"==typeof h?(s=u===h,this.debug("string match",h,u,s)):(s=h.test(u),this.debug("pattern match",h,u,s)),!s)return!1}if(r===l&&o===c)return!0;if(r===l)return n;if(o===c)return r===l-1&&""===t[r];throw Error("wtf?")}braceExpand(){return Ft(this.pattern,this.options)}parse(t){et(t);const e=this.options;if("**"===t)return It;if(""===t)return"";let n,i=null;(n=t.match(Rt))?i=e.dot?Ct:Wt:(n=t.match($t))?i=(e.nocase?e.dot?Et:St:e.dot?jt:Ot)(n[1]):(n=t.match(zt))?i=(e.nocase?e.dot?Lt:At:e.dot?Tt:_t)(n):(n=t.match(Mt))?i=e.dot?xt:kt:(n=t.match(Nt))&&(i=Pt);const s=gt.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof s&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let s=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))(t):t===It?It:t._src}));return e.forEach(((t,i)=>{const s=e[i+1],r=e[i-1];t===It&&r!==It&&(void 0===r?void 0!==s&&s!==It?e[i+1]="(?:\\/|"+n+"\\/)?"+s:e[i]=n:void 0===s?e[i-1]=r+"(?:\\/|"+n+")?":s!==It&&(e[i-1]=r+"(?:\\/|\\/"+n+"\\/)"+s,e[i+1]=It))})),e.filter((t=>t!==It)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];s="^"+r+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=RegExp(s,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let r=i[i.length-1];if(!r)for(let t=i.length-2;!r&&t>=0;t--)r=i[t];for(let t=0;t<s.length;t++){const o=s[t];let l=i;if(n.matchBase&&1===o.length&&(l=[r]),this.matchOne(l,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return yt.defaults(t).Minimatch}};function qt(t){var e,n,i;return null!=(i=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?i:void 0}yt.AST=gt,yt.Minimatch=Vt,yt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),yt.unescape=lt,((t,e)=>{for(var n in e)w(t,n,{get:e[n],enumerable:!0})})({},{err:()=>Jt,map:()=>Yt,ok:()=>Bt,unwrap:()=>Qt,unwrapErr:()=>Xt});var Bt=t=>({isOk:!0,isErr:!1,value:t}),Jt=t=>({isOk:!1,isErr:!0,value:t});function Yt(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>Bt(t))):Bt(n)}if(t.isErr)return Jt(t.value);throw"should never get here"}var Kt,Qt=t=>{if(t.isOk)return t.value;throw t.value},Xt=t=>{if(t.isErr)return t.value;throw t.value};function te(t){const e={mode:"open"};e.delegatesFocus=!!(16&t.h);const n=this.attachShadow(e);void 0===Kt&&(Kt=null),Kt&&(F?n.adoptedStyleSheets.push(Kt):n.adoptedStyleSheets=[...n.adoptedStyleSheets,Kt])}function ee(t,e,n){let i,s=0,r=[];for(;s<t.length;s++){if(i=t[s],i["s-sr"]&&(!e||i["s-hn"]===e)&&(void 0===n||ne(i)===n)&&(r.push(i),void 0!==n))return r;r=[...r,...ee(i.childNodes,e,n)]}return r}var ne=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;var ie=new WeakMap,se=t=>"sc-"+t.p,re=(t,e,...n)=>{let i=null,s=null,r=!1,o=!1;const l=[],c=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?c(i):null!=i&&"boolean"!=typeof i&&((r="function"!=typeof t&&!X(i))&&(i+=""),r&&o?l[l.length-1].v+=i:l.push(r?oe(null,i):i),o=r)};if(c(n),e){e.key&&(s=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,l,ce);const h=oe(t,null);return h.m=e,l.length>0&&(h.$=l),h.O=s,h},oe=(t,e)=>({h:0,j:t,v:e,S:null,$:null,m:null,O:null}),le={},ce={forEach:(t,e)=>t.map(he).forEach(e),map:(t,e)=>t.map(he).map(e).map(ue)},he=t=>({vattrs:t.m,vchildren:t.$,vkey:t.O,vname:t.M,vtag:t.j,vtext:t.v}),ue=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),re(t.vtag,e,...t.vchildren||[])}const e=oe(t.vtag,t.vtext);return e.m=t.vattrs,e.$=t.vchildren,e.O=t.vkey,e.M=t.vname,e},fe=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};fe("::slotted"),fe(":host"),fe(":host-context");var ae,pe=(t,e)=>null==t||X(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t,de=(t,e)=>{const n=(t=>{var e;return null==(e=C(t))?void 0:e.$hostElement$})(t);return{emit:t=>ve(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},ve=(t,e,n)=>{const i=U.ce(e,n);return t.dispatchEvent(i),i},me=(t,e,n,i,s,r)=>{if(n===i)return;let o=A(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,s=we(n);let r=we(i);e.remove(...s.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)i&&null!=i[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in i)n&&i[e]===n[e]||(e.includes("-")?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("key"===e);else if("ref"===e)i&&i(t);else if(o||"o"!==e[0]||"n"!==e[1]){const l=X(i);if(o||l&&null!==i)try{if(t.tagName.includes("-"))t[e]!==i&&(t[e]=i);else{const s=null==i?"":i;"list"===e?o=!1:null!=n&&t[e]==s||("function"==typeof t.__lookupSetter__(e)?t[e]=s:t.setAttribute(e,s))}}catch(t){}null==i||!1===i?!1===i&&""!==t.getAttribute(e)||t.removeAttribute(e):(!o||4&r||s)&&!l&&1===t.nodeType&&t.setAttribute(e,i=!0===i?"":i)}else if(e="-"===e[2]?e.slice(3):A(G,l)?l.slice(2):l[2]+e.slice(3),n||i){const s=e.endsWith(ge);e=e.replace(ye,""),n&&U.rel(t,e,n,s),i&&U.ael(t,e,i,s)}},be=/\s/,we=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(be):[]),ge="Capture",ye=RegExp(ge+"$"),$e=(t,e,n)=>{const i=11===e.S.nodeType&&e.S.host?e.S.host:e.S,s=t&&t.m||{},r=e.m||{};for(const t of Oe(Object.keys(s)))t in r||me(i,t,s[t],void 0,n,e.h);for(const t of Oe(Object.keys(r)))me(i,t,s[t],r[t],n,e.h)};function Oe(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var je=!1,Se=(t,e,n)=>{const i=e.$[n];let s,r,o=0;if(null!==i.v)s=i.S=G.document.createTextNode(i.v);else{if(!G.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=i.S=G.document.createElement(i.j),$e(null,i,je),i.$){const e="template"===i.j?s.content:s;for(o=0;o<i.$.length;++o)r=Se(t,i,o),r&&e.appendChild(r)}}return s["s-hn"]=ae,s},Ee=(t,e,n,i,s,r)=>{let o,l=t;for(l.shadowRoot&&l.tagName===ae&&(l=l.shadowRoot),"template"===n.j&&(l=l.content);s<=r;++s)i[s]&&(o=Se(null,n,s),o&&(i[s].S=o,Pe(l,o,e)))},Me=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.S;Ne(e),t&&t.remove()}}},ke=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.O&&e.O&&(t.O=e.O),!0):t.O===e.O),xe=(t,e,n=!1)=>{const i=e.S=t.S,s=t.$,r=e.$,o=e.v;null===o?($e(t,e,je),null!==s&&null!==r?((t,e,n,i,s=!1)=>{let r,o,l=0,c=0,h=0,u=0,f=e.length-1,a=e[0],p=e[f],d=i.length-1,v=i[0],m=i[d];const b="template"===n.j?t.content:t;for(;l<=f&&c<=d;)if(null==a)a=e[++l];else if(null==p)p=e[--f];else if(null==v)v=i[++c];else if(null==m)m=i[--d];else if(ke(a,v,s))xe(a,v,s),a=e[++l],v=i[++c];else if(ke(p,m,s))xe(p,m,s),p=e[--f],m=i[--d];else if(ke(a,m,s))xe(a,m,s),Pe(b,a.S,p.S.nextSibling),a=e[++l],m=i[--d];else if(ke(p,v,s))xe(p,v,s),Pe(b,p.S,a.S),p=e[--f],v=i[++c];else{for(h=-1,u=l;u<=f;++u)if(e[u]&&null!==e[u].O&&e[u].O===v.O){h=u;break}h>=0?(o=e[h],o.j!==v.j?r=Se(e&&e[c],n,h):(xe(o,v,s),e[h]=void 0,r=o.S),v=i[++c]):(r=Se(e&&e[c],n,c),v=i[++c]),r&&Pe(a.S.parentNode,r,a.S)}l>f?Ee(t,null==i[d+1]?null:i[d+1].S,n,i,c,d):c>d&&Me(e,l,f)})(i,s,e,r,n):null!==r?(null!==t.v&&(i.textContent=""),Ee(i,null,e,r,0,r.length-1)):!n&&null!==s&&Me(s,0,s.length-1)):t.v!==o&&(i.data=o)},Ne=t=>{t.m&&t.m.ref&&t.m.ref(null),t.$&&t.$.map(Ne)},Pe=(t,e,n)=>{if("string"==typeof e["s-sn"]){t.insertBefore(e,n);const{slotNode:i}=function(t,e){var n;if(!(e=e||(null==(n=t["s-ol"])?void 0:n.parentElement)))return{slotNode:null,slotName:""};const i=t["s-sn"]=ne(t)||"";return{slotNode:ee(function(t,e){if("__"+e in t){const n=t["__"+e];return"function"!=typeof n?n:n.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}(e,"childNodes"),e.tagName,i)[0],slotName:i}}(e);return i&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(i),e}return t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n)},Re=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.k=()=>{e["s-p"].splice(n-1,1),i()})))}},We=(t,e)=>{if(t.h|=16,4&t.h)return void(t.h|=512);Re(t,t.N);const n=()=>Ce(t,e);if(!e)return Q(n);queueMicrotask((()=>{n()}))},Ce=(t,e)=>{const n=t.$hostElement$,i=t.l;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return e?(t.P.length&&t.P.forEach((t=>t(n))),s=Ue(i,"componentWillLoad",void 0,n)):s=Ue(i,"componentWillUpdate",void 0,n),s=ze(s,(()=>Ue(i,"componentWillRender",void 0,n))),ze(s,(()=>Le(t,i,e)))},ze=(t,e)=>Ae(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Ae=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Le=async(t,e,n)=>{var i;const s=t.$hostElement$,r=s["s-rc"];n&&(t=>{const e=t.i,n=t.$hostElement$,i=e.h,s=((t,e)=>{var n,i,s;const r=se(e),o=_.get(r);if(!G.document)return r;if(t=11===t.nodeType?t:G.document,o)if("string"==typeof o){let s,l=ie.get(t=t.head||t);if(l||ie.set(t,l=new Set),!l.has(r)){s=G.document.createElement("style"),s.innerHTML=o;const c=null!=(n=U.R)?n:qt(G.document);if(null!=c&&s.setAttribute("nonce",c),!(1&e.h))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(Z){const e=new(null!=(i=t.defaultView)?i:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(o),F?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=o+e.innerHTML:t.prepend(s)}else t.append(s);1&e.h&&t.insertBefore(s,null),4&e.h&&(s.innerHTML+=D),l&&l.add(r)}}else{let e=ie.get(t);if(e||ie.set(t,e=new Set),!e.has(r)){const n=null!=(s=t.defaultView)?s:t.ownerDocument.defaultView;let i;if(o.constructor===n.CSSStyleSheet)i=o;else{i=new n.CSSStyleSheet;for(let t=0;t<o.cssRules.length;t++)i.insertRule(o.cssRules[t].cssText,t)}F?t.adoptedStyleSheets.push(i):t.adoptedStyleSheets=[...t.adoptedStyleSheets,i],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&i&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);Te(t,e,s,n),r&&(r.map((t=>t())),s["s-rc"]=void 0);{const e=null!=(i=s["s-p"])?i:[],n=()=>_e(t);0===e.length?n():(Promise.all(e).then(n),t.h|=4,e.length=0)}},Te=(t,e,n,i)=>{try{e=e.render(),t.h&=-17,t.h|=2,((t,e,n=!1)=>{const i=t.$hostElement$,s=t.W||oe(null,null),r=(t=>t&&t.j===le)(e)?e:re(null,null,e);if(ae=i.tagName,n&&r.m)for(const t of Object.keys(r.m))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.m[t]=i[t]);r.j=null,r.h|=4,t.W=r,r.S=s.S=i.shadowRoot||i,xe(s,r,n)})(t,e,i)}catch(e){L(e,t.$hostElement$)}return null},_e=t=>{const e=t.$hostElement$,n=t.l,i=t.N;Ue(n,"componentDidRender",void 0,e),64&t.h?Ue(n,"componentDidUpdate",void 0,e):(t.h|=64,Ie(e),Ue(n,"componentDidLoad",void 0,e),t.C(e),i||Ge()),t.A(e),t.k&&(t.k(),t.k=void 0),512&t.h&&K((()=>We(t,!1))),t.h&=-517},De=t=>{var e;{const n=C(t),i=null==(e=null==n?void 0:n.$hostElement$)?void 0:e.isConnected;return i&&2==(18&n.h)&&We(n,!1),i}},Ge=()=>{K((()=>ve(G,"appload",{detail:{namespace:"mb-crossword"}})))},Ue=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){L(t,i)}},Ie=t=>t.classList.add("hydrated"),Ze=(t,e,n,i)=>{const s=C(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${i.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,o=s.o.get(e),l=s.h,c=s.l;if(n=pe(n,i.t[e][0]),!(8&l&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n))){if(s.o.set(e,n),i.L){const t=i.L[e];t&&t.map((t=>{try{const[[i,r]]=Object.entries(t);(128&l||1&r)&&(c?c[i](n,o,e):s.P.push((()=>{s.l[i](n,o,e)})))}catch(t){L(t,r)}}))}if(2==(18&l)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,o,e))return;We(s,!1)}}},Fe=(t,e,n)=>{var i,s;const r=t.prototype;{t.watchers&&!e.L&&(e.L=t.watchers),t.deserializers&&!e.T&&(e.T=t.deserializers),t.serializers&&!e._&&(e._=t.serializers);const o=Object.entries(null!=(i=e.t)?i:{});if(o.map((([t,[i]])=>{if(31&i||2&n&&32&i){const{get:s,set:o}=Object.getOwnPropertyDescriptor(r,t)||{};s&&(e.t[t][0]|=2048),o&&(e.t[t][0]|=4096),(1&n||!s)&&Object.defineProperty(r,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>C(this).o.get(e))(0,t);const n=C(this),i=n?n.l:r;if(!i)return;return i[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,t,{set(s){const r=C(this);if(r){if(o)return void 0===(32&i?this[t]:r.$hostElement$[t])&&r.o.get(t)&&(s=r.o.get(t)),o.call(this,pe(s,i)),void Ze(this,t,s=32&i?this[t]:r.$hostElement$[t],e);{if(!(1&n&&4096&e.t[t][0]))return Ze(this,t,s,e),void(1&n&&!r.l&&r.P.push((()=>{4096&e.t[t][0]&&r.l[t]!==r.o.get(t)&&(r.l[t]=s)})));const o=()=>{const n=r.l[t];!r.o.get(t)&&n&&r.o.set(t,n),r.l[t]=pe(s,i),Ze(this,t,r.l[t],e)};r.l?o():r.P.push((()=>{o()}))}}}})}else 1&n&&64&i&&Object.defineProperty(r,t,{value(...e){var n;const i=C(this);return null==(n=null==i?void 0:i.D)?void 0:n.then((()=>{var n;return null==(n=i.l)?void 0:n[t](...e)}))}})})),1&n){const n=new Map;r.attributeChangedCallback=function(t,i,s){U.jmp((()=>{var l;const c=n.get(t),h=C(this);if(this.hasOwnProperty(c)&&(s=this[c],delete this[c]),r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const n=null==h?void 0:h.h;if(h&&n&&!(8&n)&&s!==i){const r=h.l,o=null==(l=e.L)?void 0:l[t];null==o||o.forEach((e=>{const[[o,l]]=Object.entries(e);null!=r[o]&&(128&n||1&l)&&r[o].call(r,s,i,t)}))}return}const u=o.find((([t])=>t===c));u&&4&u[1][0]&&(s=null!==s&&"false"!==s);const f=Object.getOwnPropertyDescriptor(r,c);s==this[c]||f.get&&!f.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.L)?s:{}),...o.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},He=(t,e)=>{Ue(t,"connectedCallback",void 0,e)},Ve=(t,e)=>{Ue(t,"disconnectedCallback",void 0,e||t)},qe=(t,e={})=>{var n;if(!G.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const i=[],s=e.exclude||[],r=G.customElements,o=G.document.head,l=o.querySelector("meta[charset]"),c=G.document.createElement("style"),h=[];let u,f=!0;Object.assign(U,e),U.u=new URL(e.resourcesUrl||"./",G.document.baseURI).href;let a=!1;if(t.map((t=>{t[1].map((e=>{var n,o,l;const c={h:e[0],p:e[1],t:e[2],G:e[3]};4&c.h&&(a=!0),c.t=e[2],c.L=null!=(n=e[4])?n:{},c._=null!=(o=e[5])?o:{},c.T=null!=(l=e[6])?l:{};const p=c.p,d=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={h:0,$hostElement$:t,i:e,o:new Map,U:new Map};n.D=new Promise((t=>n.A=t)),n.I=new Promise((t=>n.C=t)),t["s-p"]=[],t["s-rc"]=[],n.P=[];const i=n;t.__stencil__getHostRef=()=>i})(t=this,c),1&c.h)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else te.call(t,c)}connectedCallback(){C(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),u&&(clearTimeout(u),u=null),f?h.push(this):U.jmp((()=>(t=>{if(!(1&U.h)){const e=C(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.h)(null==e?void 0:e.l)?He(e.l,t):(null==e?void 0:e.I)&&e.I.then((()=>He(e.l,t)));else{e.h|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){Re(e,e.N=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let i;if(!(32&e.h)){if(e.h|=32,n.Z){const s=((t,e)=>{const n=t.p.replace(/-/g,"_"),i=t.Z;if(!i)return;const s=T.get(i);return s?s[n]:import(`./${i}.entry.js`).then((t=>(T.set(i,t),t[n])),(t=>{L(t,e.$hostElement$)}))
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(s&&"then"in s){const t=()=>{};i=await s,t()}else i=s;if(!i)throw Error(`Constructor for "${n.p}#${e.F}" was not found`);i.isProxied||(n.L=i.watchers,n._=i.serializers,n.T=i.deserializers,Fe(i,n,2),i.isProxied=!0);const r=()=>{};e.h|=8;try{new i(e)}catch(e){L(e,t)}e.h&=-9,e.h|=128,r(),He(e.l,t)}else i=t.constructor,customElements.whenDefined(t.localName).then((()=>e.h|=128));if(i&&i.style){let t;"string"==typeof i.style&&(t=i.style);const e=se(n);if(!_.has(e)){const i=()=>{};((t,e,n)=>{let i=_.get(t);Z&&n?(i=i||new CSSStyleSheet,"string"==typeof i?i=e:i.replaceSync(e)):i=e,_.set(t,i)})(e,t,!!(1&n.h)),i()}}}const s=e.N,r=()=>We(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(t,e,n)}i()}})(this))))}disconnectedCallback(){U.jmp((()=>(async t=>{if(!(1&U.h)){const e=C(t);(null==e?void 0:e.l)?Ve(e.l,t):(null==e?void 0:e.I)&&e.I.then((()=>Ve(e.l,t)))}ie.has(t)&&ie.delete(t),t.shadowRoot&&ie.has(t.shadowRoot)&&ie.delete(t.shadowRoot)})(this))),U.raf((()=>{var t;const e=C(this);if(!e)return;const n=h.findIndex((t=>t===this));n>-1&&h.splice(n,1),(null==(t=null==e?void 0:e.W)?void 0:t.S)instanceof Node&&!e.W.S.isConnected&&delete e.W.S}))}componentOnReady(){var t;return null==(t=C(this))?void 0:t.I}};c.Z=t[0],s.includes(p)||r.get(p)||(i.push(p),r.define(p,Fe(d,c,1)))}))})),i.length>0&&(a&&(c.textContent+=D),c.textContent+=i.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",c.innerHTML.length)){c.setAttribute("data-styles","");const t=null!=(n=U.R)?n:qt(G.document);null!=t&&c.setAttribute("nonce",t),o.insertBefore(c,l?l.nextSibling:o.firstChild)}f=!1,h.length?h.map((t=>t.connectedCallback())):U.jmp((()=>u=setTimeout(Ge,30)))},Be=t=>U.R=t;export{qe as b,de as c,De as f,re as h,I as p,z as r,Be as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as i,f as r}from"./p-Dcm4tLi7.js";import{V as s,a as l,i as a,b as o}from"./p-Dn3GSx6U.js";function n({isCurrent:e,word:i,onPointerDown:r,preview:s,showPreview:l,tagName:a}){return t(a??"div",{onPointerDown:r,part:"clue",class:{"--current":e}},i.clue,l&&t("span",{class:"preview"},s))}function c({data:e,isInCurrentClue:i,isSelected:r,isSpecial:s,onPointerDown:l}){return t("div",{onPointerDown:l,part:"cell",class:{"--blocked":e.isBlocked,"--in-current-clue":i,"--selected":r,"--alt":!((e.x+e.y)%2),"--special":s},style:{"--x":`${e.x}`,"--y":`${e.y}`}},t("div",{class:"_inner",style:{position:"absolute",width:"100%"}},e.value))}const h=({type:e},i)=>"p"===e?t("p",{part:"clue-list"},i.map(((e,i)=>t("p",{key:i},e)))):"ol"===e?t("ol",{part:"clue-list"},i):void 0,d=class{constructor(t){e(this,t),this.clueSelected=i(this,"clueSelected")}init=!0;data;showCluePreview=!0;clueListStyle="ol";clueSelected;textInput;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;componentWillLoad(){console.log("componentWillLoad",this.init,this.data),this.init&&this.data&&this.initGame()}watchData(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(t=this.data){if(console.log("initGame"),!t.words)throw new Error("Words definition missing");this.hWords=[],this.vWords=[],t.words.forEach(((t,e)=>{const i=Math.random();void 0===t.id&&(t.id=`${i}_${e}`),"horizontal"===t.orientation&&(this.hWords=[...this.hWords,t]),"vertical"===t.orientation&&(this.vWords=[...this.vWords,t])})),this.specialBorders=t.specialBorders??[],this.specialCells=t.specialCells??[],this.labels=t.labels??[],this.buildBoard()}async checkAnswer(){const t=this.cells.filter((t=>!t.isBlocked));return console.log(t),t.forEach((t=>{console.log(`${t.value} === ${t.answer}`,`${t.x},${t.y}`,t.value===t.answer)})),t.every((t=>t.value===t.answer))}specialBorders=[];specialCells=[];labels=[];boardWidth=0;boardHeight=0;cells=[];buildBoard(){let t=0,e=0;this.allWords.forEach((i=>{"horizontal"===i.orientation&&(t=Math.max(t,i.x+i.word.length),e=Math.max(e,i.y+1)),"vertical"===i.orientation&&(t=Math.max(t,i.x+1),e=Math.max(e,i.y+i.word.length))}));const i=Array(e*t).fill(null).map(((e,i)=>{const[r,l]=s(i,t);return{index:i,x:r,y:l,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((e=>{if("horizontal"===e.orientation)for(let r=0;r<e.word.length;r++){const s=l.from(e),a=o(new l(s.x+r,s.y),t);i[a].isBlocked=!1,i[a].answer=e.word[r]}if("vertical"===e.orientation)for(let r=0;r<e.word.length;r++){const s=l.from(e),a=o(new l(s.x,s.y+r),t);i[a].isBlocked=!1,i[a].answer=e.word[r]}})),this.cells=i,this.boardWidth=t,this.boardHeight=e}getClueById(t){return this.allWords.find((e=>e.id===t))??null}isInClue(t,e=this.currentClue){return null!==e&&(t.x===e.x||t.y===e.y)&&("horizontal"===e.orientation?!(t.y!==e.y||t.x<e.x||t.x>=e.x+e.word.length):"vertical"===e.orientation?!(t.x!==e.x||t.y<e.y||t.y>=e.y+e.word.length):void 0)}isSelectedCell(t){return!!this.selectedCell&&t.x===this.selectedCell.x&&t.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t-1]?.id??null}inputLetter(t){this.selectedCell&&(this.selectedCell.value=t,this.selectNextCell(),r(this))}backspace(){this.selectedCell&&(this.selectedCell.value?(this.selectedCell.value="",this.selectPrevCell()):(this.selectPrevCell(),this.selectedCell.value=""),r(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(e=this.selectedCell,p(this.currentClue).eq(l.from(e))){const t=this.getNextClueId(),e=this.getClueById(t);return e?void this.selectClueByXY(l.from(e)):void 0}var e;"horizontal"===t&&this.selectClueByXY(new l(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new l(this.selectedCell.x,this.selectedCell.y+1))}selectPrevCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(e=this.selectedCell,l.from(this.currentClue).eq(l.from(e))){const t=this.getPrevClueId(),e=this.getClueById(t);if(e){const t=p(e);return console.log(t),void this.selectClueByXY(t)}}var e;"horizontal"===t&&this.selectClueByXY(new l(this.selectedCell.x-1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new l(this.selectedCell.x,this.selectedCell.y-1))}onFocusin(){this.isFocused=!0,this.currentClueId||(this.currentClueId=this.allWords[0]?.id??null),this.textInput.focus()}onFocusOut(){this.isFocused=!1}async selectClue(t,{row:e,col:i}={}){if(!t)return;this.currentClueId=t;const r=this.allWords.find((e=>e.id===t));r||(this.currentClueId=null,this.currentClue=null),this.currentClue=r;const s=[r.x,r.y];void 0!==e&&"vertical"===r.orientation&&e>=r.y&&e<r.y+r.word.length&&(s[1]=e),void 0!==i&&"horizontal"===r.orientation&&i>=r.x&&i<r.x+r.word.length&&(s[0]=i),this.selectCellByXY(l.from(s))}selectCellByXY(t){const e=o(t,this.boardWidth);this.selectedCell=this.cells[e]??null}findNonblockedCell(t,e){const i=new l(t[0]+e[0],t[1]+e[1]),r=this.boardWidth*this.boardHeight;let s=0;for(;this.isCellBlocked(i)&&s<r;)s++,i[0]+=e[0],i[1]+=e[1],i[0]<0&&(i[0]=this.boardWidth-1),i[0]>=this.boardWidth&&(i[0]=0),i[1]<0&&(i[1]=this.boardHeight-1),i[1]>=this.boardHeight&&(i[1]=0);return i}isCellBlocked(t){const e=this.cells[o(t,this.boardWidth)];return e?.isBlocked??!0}selectClueByXY(t){const e=this.allWords.filter((e=>this.isInClue(t,e)));if(e.length)if(this.selectedCell&&2===e.length&&t.eq(l.from(this.selectedCell))){const i=e.find((t=>t.orientation!==this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}else{const i=e.find((t=>t.orientation===this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}}getCluePreview(t){if(!t)return"_";const e=Array(t.word.length).fill("_");for(let i=0;i<t.word.length;i++){const r=new l(t.x,t.y).add("vertical"===t.orientation?new l(0,1*i):new l(1*i,0)),s=this.cells[o(r,this.boardWidth)];s.value&&(e[i]=s.value)}return e.join("")}onKeyPress(t){if(console.log(t),"Tab"===t.key){const e=t.shiftKey?this.getPrevClueId():this.getNextClueId();e&&(t.preventDefault(),this.selectClue(e))}if(this.selectedCell)switch(t.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(-1,0))),void t.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(1,0))),void t.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(0,-1))),void t.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(0,1))),void t.preventDefault();case"Backspace":console.log("BACKSPACE!"),this.backspace()}}onInput(t){a(t)&&this.inputLetter(t.data.toLowerCase()[0]),this.textInput.value=""}render(){const e=Boolean(this.vWords.length),i=Boolean(this.hWords.length),r="none"===this.clueListStyle,s=i&&e;return t("div",{key:"0aa26f6435a57c206eba0d518313d6248d922eaa",part:"main",class:{"--focused":this.isFocused,"--only-board":r},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this)},t("input",{key:"e15789ff3feb48df30117b501b440142ba3eccf7",type:"text",class:"dummy",ref:t=>this.textInput=t,onKeyDown:this.onKeyPress.bind(this),onInput:this.onInput.bind(this)}),r?"":t("div",{part:"clues",class:{twoLists:s,oneList:!s}},i?t(h,{type:this.clueListStyle},this.hWords.map((e=>{const i=e.id===this.currentClueId;return t(n,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):"",e?t(h,{type:this.clueListStyle},this.vWords.map((e=>{const i=e.id===this.currentClueId;return t(n,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):""),t("div",{key:"08ffd76832a1c9c9dfddf8424e9e014d104444a0",part:"board",style:{"--board-width":`${this.boardWidth}`,"grid-template-columns":`repeat(${this.boardWidth}, 1fr)`,aspectRatio:""+this.boardWidth/this.boardHeight}},this.cells.filter((t=>!t.isBlocked)).map((e=>{const i=this.isInClue(e),r=this.isSelectedCell(e),s=this.specialCells.some((t=>t.x===e.x&&t.y===e.y));return t(c,{isSpecial:s,onPointerDown:()=>this.selectClueByXY(l.from(e)),isInCurrentClue:i,isSelected:r,data:e})})),this.specialBorders.map(((e,i)=>t("div",{key:i,part:"special-border",class:{top:Boolean(4096&e.border),right:Boolean(256&e.border),bottom:Boolean(16&e.border),left:Boolean(1&e.border)},style:{"--x":`${e.x}`,"--y":`${e.y}`}}))),this.labels.map((e=>t("div",{part:"label",style:{"--x":`${e.x}`,"--y":`${e.y}`},onPointerDown:()=>this.selectClue(e.clueId)},t("div",{class:"_inner"},e.text))))))}static get delegatesFocus(){return!0}static get watchers(){return{data:[{watchData:0}]}}};function p(t){return new l(t.x+("horizontal"===t.orientation?t.word.length-1:0),t.y+("vertical"===t.orientation?t.word.length-1:0))}d.style='*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}*[part=main].--only-board{grid-template-columns:1fr;grid-template-areas:"board"}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0.2;z-index:100;grid-area:board;border:none;outline:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue-list]{margin:0;padding:0}[part=clue].--current{background:var(--clue-current-background, lightcyan);position:sticky;bottom:0;left:0;right:0}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}li[part=clue]{--_clue-padding:var(--clue-padding, .5em);border-radius:var(--clue-radius, 0.5em);padding:var(--_clue-padding);list-style-position:inside;padding-left:calc(1em + var(--_clue-padding));text-indent:-1em;margin:0}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--_cell-border-width:var(--cell-border-width, 2px);--cell-width-temp:calc((100cqw - var(--_cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--_cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell].--special.--selected:before{content:"";background:var(--cell-selected-background, lightblue);position:absolute;top:0;left:0;right:0;bottom:0;clip-path:polygon(100% 0, 100% 100%, 50% 100%)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--_cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--_cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--_cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;border:var(--_cell-border-width) solid transparent;--label-place-content:center end}[part=label] ._inner{position:absolute;top:var(--label-padding, 10cqh);left:var(--label-padding, 10cqh);right:var(--label-padding, 10cqh);bottom:var(--label-padding, 10cqh);display:grid;place-content:var(--label-place-content, center);text-transform:uppercase;font-size:var(--label-font-size, 60cqh)}';export{d as mb_crossword}
|
|
@@ -5,5 +5,6 @@ export interface Props {
|
|
|
5
5
|
onPointerDown(event: PointerEvent): void;
|
|
6
6
|
preview: string;
|
|
7
7
|
showPreview: boolean;
|
|
8
|
+
tagName?: 'div' | 'li' | 'span';
|
|
8
9
|
}
|
|
9
|
-
export declare function Clue({ isCurrent, word, onPointerDown, preview, showPreview }: Props): any;
|
|
10
|
+
export declare function Clue({ isCurrent, word, onPointerDown, preview, showPreview, tagName }: Props): any;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
1
2
|
import { CellData, PuzzleData, PuzzleClue, Border, SpecialCell, PuzzleLabel } from './types';
|
|
2
3
|
import { Vec2 } from '@mb-puzzle/vec2';
|
|
3
4
|
export declare class MBCrossword {
|
|
4
5
|
init: boolean;
|
|
5
6
|
data: PuzzleData;
|
|
6
7
|
showCluePreview: boolean;
|
|
8
|
+
clueListStyle: 'p' | 'ol' | 'none';
|
|
9
|
+
clueSelected: EventEmitter<string>;
|
|
7
10
|
textInput: HTMLInputElement;
|
|
8
11
|
hWords: PuzzleClue[];
|
|
9
12
|
vWords: PuzzleClue[];
|
|
@@ -40,7 +43,7 @@ export declare class MBCrossword {
|
|
|
40
43
|
selectClue(id: string, { row, col }?: {
|
|
41
44
|
row?: number;
|
|
42
45
|
col?: number;
|
|
43
|
-
}): void
|
|
46
|
+
}): Promise<void>;
|
|
44
47
|
selectCellByXY(v: Vec2): void;
|
|
45
48
|
findNonblockedCell(source: Vec2, vector: Vec2): Vec2;
|
|
46
49
|
isCellBlocked(v: Vec2): boolean;
|
|
@@ -10,20 +10,40 @@ export { PuzzleData } from "./components/crossword/types";
|
|
|
10
10
|
export namespace Components {
|
|
11
11
|
interface MbCrossword {
|
|
12
12
|
"checkAnswer": () => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* @default 'ol'
|
|
15
|
+
*/
|
|
16
|
+
"clueListStyle": 'p' | 'ol' | 'none';
|
|
13
17
|
"data": PuzzleData;
|
|
14
18
|
/**
|
|
15
19
|
* @default true
|
|
16
20
|
*/
|
|
17
21
|
"init": boolean;
|
|
18
22
|
"initGame": (data?: PuzzleData) => Promise<void>;
|
|
23
|
+
"selectClue": (id: string, { row, col }?: { row?: number; col?: number; }) => Promise<void>;
|
|
19
24
|
/**
|
|
20
25
|
* @default true
|
|
21
26
|
*/
|
|
22
27
|
"showCluePreview": boolean;
|
|
23
28
|
}
|
|
24
29
|
}
|
|
30
|
+
export interface MbCrosswordCustomEvent<T> extends CustomEvent<T> {
|
|
31
|
+
detail: T;
|
|
32
|
+
target: HTMLMbCrosswordElement;
|
|
33
|
+
}
|
|
25
34
|
declare global {
|
|
35
|
+
interface HTMLMbCrosswordElementEventMap {
|
|
36
|
+
"clueSelected": string;
|
|
37
|
+
}
|
|
26
38
|
interface HTMLMbCrosswordElement extends Components.MbCrossword, HTMLStencilElement {
|
|
39
|
+
addEventListener<K extends keyof HTMLMbCrosswordElementEventMap>(type: K, listener: (this: HTMLMbCrosswordElement, ev: MbCrosswordCustomEvent<HTMLMbCrosswordElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
40
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
41
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
42
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
43
|
+
removeEventListener<K extends keyof HTMLMbCrosswordElementEventMap>(type: K, listener: (this: HTMLMbCrosswordElement, ev: MbCrosswordCustomEvent<HTMLMbCrosswordElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
44
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
45
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
46
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
27
47
|
}
|
|
28
48
|
var HTMLMbCrosswordElement: {
|
|
29
49
|
prototype: HTMLMbCrosswordElement;
|
|
@@ -35,11 +55,16 @@ declare global {
|
|
|
35
55
|
}
|
|
36
56
|
declare namespace LocalJSX {
|
|
37
57
|
interface MbCrossword {
|
|
58
|
+
/**
|
|
59
|
+
* @default 'ol'
|
|
60
|
+
*/
|
|
61
|
+
"clueListStyle"?: 'p' | 'ol' | 'none';
|
|
38
62
|
"data"?: PuzzleData;
|
|
39
63
|
/**
|
|
40
64
|
* @default true
|
|
41
65
|
*/
|
|
42
66
|
"init"?: boolean;
|
|
67
|
+
"onClueSelected"?: (event: MbCrosswordCustomEvent<string>) => void;
|
|
43
68
|
/**
|
|
44
69
|
* @default true
|
|
45
70
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,f as i}from"./p-BGHKtxML.js";import{V as r,a as s,i as l,b as o}from"./p-Dn3GSx6U.js";function a({isCurrent:e,word:i,onPointerDown:r,preview:s,showPreview:l}){return t("p",{onPointerDown:r,part:"clue",class:{"--current":e}},i.clue,l&&t("span",{class:"preview"},s))}function n({data:e,isInCurrentClue:i,isSelected:r,isSpecial:s,onPointerDown:l}){return t("div",{onPointerDown:l,part:"cell",class:{"--blocked":e.isBlocked,"--in-current-clue":i,"--selected":r,"--alt":!((e.x+e.y)%2),"--special":s},style:{"--x":`${e.x}`,"--y":`${e.y}`}},t("div",{class:"_inner",style:{position:"absolute",width:"100%"}},e.value))}const c=class{constructor(t){e(this,t)}init=!0;data;showCluePreview=!0;textInput;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;componentWillLoad(){console.log("componentWillLoad",this.init,this.data),this.init&&this.data&&this.initGame()}watchData(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(t=this.data){if(console.log("initGame"),!t.words)throw new Error("Words definition missing");this.hWords=[],this.vWords=[],t.words.forEach(((t,e)=>{const i=Math.random();void 0===t.id&&(t.id=`${i}_${e}`),"horizontal"===t.orientation&&(this.hWords=[...this.hWords,t]),"vertical"===t.orientation&&(this.vWords=[...this.vWords,t])})),this.specialBorders=t.specialBorders??[],this.specialCells=t.specialCells??[],this.labels=t.labels??[],this.buildBoard()}async checkAnswer(){const t=this.cells.filter((t=>!t.isBlocked));return console.log(t),t.forEach((t=>{console.log(`${t.value} === ${t.answer}`,`${t.x},${t.y}`,t.value===t.answer)})),t.every((t=>t.value===t.answer))}specialBorders=[];specialCells=[];labels=[];boardWidth=0;boardHeight=0;cells=[];buildBoard(){let t=0,e=0;this.allWords.forEach((i=>{"horizontal"===i.orientation&&(t=Math.max(t,i.x+i.word.length),e=Math.max(e,i.y+1)),"vertical"===i.orientation&&(t=Math.max(t,i.x+1),e=Math.max(e,i.y+i.word.length))}));const i=Array(e*t).fill(null).map(((e,i)=>{const[s,l]=r(i,t);return{index:i,x:s,y:l,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((e=>{if("horizontal"===e.orientation)for(let r=0;r<e.word.length;r++){const l=s.from(e),a=o(new s(l.x+r,l.y),t);i[a].isBlocked=!1,i[a].answer=e.word[r]}if("vertical"===e.orientation)for(let r=0;r<e.word.length;r++){const l=s.from(e),a=o(new s(l.x,l.y+r),t);i[a].isBlocked=!1,i[a].answer=e.word[r]}})),this.cells=i,this.boardWidth=t,this.boardHeight=e}getClueById(t){return this.allWords.find((e=>e.id===t))??null}isInClue(t,e=this.currentClue){return null!==e&&(t.x===e.x||t.y===e.y)&&("horizontal"===e.orientation?!(t.y!==e.y||t.x<e.x||t.x>=e.x+e.word.length):"vertical"===e.orientation?!(t.x!==e.x||t.y<e.y||t.y>=e.y+e.word.length):void 0)}isSelectedCell(t){return!!this.selectedCell&&t.x===this.selectedCell.x&&t.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t-1]?.id??null}inputLetter(t){this.selectedCell&&(this.selectedCell.value=t,this.selectNextCell(),i(this))}backspace(){this.selectedCell&&(this.selectedCell.value?(this.selectedCell.value="",this.selectPrevCell()):(this.selectPrevCell(),this.selectedCell.value=""),i(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(e=this.selectedCell,h(this.currentClue).eq(s.from(e))){const t=this.getNextClueId(),e=this.getClueById(t);return e?void this.selectClueByXY(s.from(e)):void 0}var e;"horizontal"===t&&this.selectClueByXY(new s(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new s(this.selectedCell.x,this.selectedCell.y+1))}selectPrevCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(e=this.selectedCell,s.from(this.currentClue).eq(s.from(e))){const t=this.getPrevClueId(),e=this.getClueById(t);if(e){const t=h(e);return console.log(t),void this.selectClueByXY(t)}}var e;"horizontal"===t&&this.selectClueByXY(new s(this.selectedCell.x-1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new s(this.selectedCell.x,this.selectedCell.y-1))}onFocusin(){this.isFocused=!0,this.currentClueId||(this.currentClueId=this.allWords[0]?.id??null),this.textInput.focus()}onFocusOut(){this.isFocused=!1}selectClue(t,{row:e,col:i}={}){if(!t)return;this.currentClueId=t;const r=this.allWords.find((e=>e.id===t));r||(this.currentClueId=null,this.currentClue=null),this.currentClue=r;const l=[r.x,r.y];void 0!==e&&"vertical"===r.orientation&&e>=r.y&&e<r.y+r.word.length&&(l[1]=e),void 0!==i&&"horizontal"===r.orientation&&i>=r.x&&i<r.x+r.word.length&&(l[0]=i),this.selectCellByXY(s.from(l))}selectCellByXY(t){const e=o(t,this.boardWidth);this.selectedCell=this.cells[e]??null}findNonblockedCell(t,e){const i=new s(t[0]+e[0],t[1]+e[1]),r=this.boardWidth*this.boardHeight;let l=0;for(;this.isCellBlocked(i)&&l<r;)l++,i[0]+=e[0],i[1]+=e[1],i[0]<0&&(i[0]=this.boardWidth-1),i[0]>=this.boardWidth&&(i[0]=0),i[1]<0&&(i[1]=this.boardHeight-1),i[1]>=this.boardHeight&&(i[1]=0);return i}isCellBlocked(t){const e=this.cells[o(t,this.boardWidth)];return e?.isBlocked??!0}selectClueByXY(t){const e=this.allWords.filter((e=>this.isInClue(t,e)));if(e.length)if(this.selectedCell&&2===e.length&&t.eq(s.from(this.selectedCell))){const i=e.find((t=>t.orientation!==this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}else{const i=e.find((t=>t.orientation===this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}}getCluePreview(t){if(!t)return"_";const e=Array(t.word.length).fill("_");for(let i=0;i<t.word.length;i++){const r=new s(t.x,t.y).add("vertical"===t.orientation?new s(0,1*i):new s(1*i,0)),l=this.cells[o(r,this.boardWidth)];l.value&&(e[i]=l.value)}return e.join("")}onKeyPress(t){if(console.log(t),"Tab"===t.key){const e=t.shiftKey?this.getPrevClueId():this.getNextClueId();e&&(t.preventDefault(),this.selectClue(e))}if(this.selectedCell)switch(t.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new s(this.selectedCell.x,this.selectedCell.y),new s(-1,0))),void t.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new s(this.selectedCell.x,this.selectedCell.y),new s(1,0))),void t.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new s(this.selectedCell.x,this.selectedCell.y),new s(0,-1))),void t.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new s(this.selectedCell.x,this.selectedCell.y),new s(0,1))),void t.preventDefault();case"Backspace":console.log("BACKSPACE!"),this.backspace()}}onInput(t){l(t)&&this.inputLetter(t.data.toLowerCase()[0]),this.textInput.value=""}render(){const e=Boolean(this.vWords.length),i=Boolean(this.hWords.length),r=i&&e;return t("div",{key:"87d88806305c6102eeb76c3984d4b9c2ad2d9759",part:"main",class:{"--focused":this.isFocused},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this)},t("input",{key:"49cdb053a4d2c4ad2c7eb881488b18c68e31fe65",type:"text",class:"dummy",ref:t=>this.textInput=t,onKeyDown:this.onKeyPress.bind(this),onInput:this.onInput.bind(this)}),t("div",{key:"0ca71a907f70e17a6d2d10bff9462bd0b2284007",part:"clues",class:{twoLists:r,oneList:!r}},i?t("div",{part:"clue-list"},this.hWords.map((e=>{const i=e.id===this.currentClueId;return t(a,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id)})}))):"",e?t("div",{part:"clue-list"},this.vWords.map((e=>{const i=e.id===this.currentClueId;return t(a,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id)})}))):""),t("div",{key:"ea16dca25fe7884d25f9748f98740ad83e25293e",part:"board",style:{"--board-width":`${this.boardWidth}`,"grid-template-columns":`repeat(${this.boardWidth}, 1fr)`,aspectRatio:""+this.boardWidth/this.boardHeight}},this.cells.filter((t=>!t.isBlocked)).map((e=>{const i=this.isInClue(e),r=this.isSelectedCell(e),l=this.specialCells.some((t=>t.x===e.x&&t.y===e.y));return t(n,{isSpecial:l,onPointerDown:()=>this.selectClueByXY(s.from(e)),isInCurrentClue:i,isSelected:r,data:e})})),this.specialBorders.map(((e,i)=>t("div",{key:i,part:"special-border",class:{top:Boolean(4096&e.border),right:Boolean(256&e.border),bottom:Boolean(16&e.border),left:Boolean(1&e.border)},style:{"--x":`${e.x}`,"--y":`${e.y}`}}))),this.labels.map((e=>t("div",{part:"label",style:{"--x":`${e.x}`,"--y":`${e.y}`},onPointerDown:()=>this.selectClue(e.clueId)},t("div",{class:"_inner"},e.text))))),t("div",{key:"d391413e7be3dee148f2f5e6d8fbf22742278a0c",part:"preview"},"Tu bedzie podgląd: ",this.currentClueId))}static get delegatesFocus(){return!0}static get watchers(){return{data:[{watchData:0}]}}};function h(t){return new s(t.x+("horizontal"===t.orientation?t.word.length-1:0),t.y+("vertical"===t.orientation?t.word.length-1:0))}c.style='*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0.2;z-index:100;grid-area:board;border:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue].--current{background:var(--clue-current-background, lightcyan);position:sticky;bottom:0;left:0;right:0}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--cell-border-width:2px;--cell-width-temp:calc((100cqw - var(--cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;place-content:center;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1}[part=label] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:60cqh}';export{c as mb_crossword}
|