@mborecki/find-words 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  2. package/dist/cjs/find-words.cjs.js +25 -0
  3. package/dist/cjs/index-CpayB0Bf.js +3284 -0
  4. package/dist/cjs/index.cjs.js +18 -0
  5. package/dist/cjs/loader.cjs.js +13 -0
  6. package/dist/cjs/mb-find-words_2.cjs.entry.js +235 -0
  7. package/dist/collection/collection-manifest.json +13 -0
  8. package/dist/collection/components/find-words/board.js +265 -0
  9. package/dist/collection/components/find-words/find-words.css +113 -0
  10. package/dist/collection/components/find-words/find-words.js +193 -0
  11. package/dist/collection/components/find-words/types.js +1 -0
  12. package/dist/collection/index.js +10 -0
  13. package/dist/collection/utils/utils.js +14 -0
  14. package/dist/components/index.d.ts +35 -0
  15. package/dist/components/index.js +1 -0
  16. package/dist/components/mb-find-words-board.d.ts +11 -0
  17. package/dist/components/mb-find-words-board.js +1 -0
  18. package/dist/components/mb-find-words.d.ts +11 -0
  19. package/dist/components/mb-find-words.js +1 -0
  20. package/dist/components/p-CttCbs-b.js +1 -0
  21. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  22. package/dist/esm/find-words.js +21 -0
  23. package/dist/esm/index-tKuUvMLJ.js +3276 -0
  24. package/dist/esm/index.js +16 -0
  25. package/dist/esm/loader.js +11 -0
  26. package/dist/esm/mb-find-words_2.entry.js +232 -0
  27. package/dist/find-words/find-words.esm.js +1 -0
  28. package/dist/find-words/index.esm.js +1 -0
  29. package/dist/find-words/p-DQuL1Twl.js +1 -0
  30. package/dist/find-words/p-a991c10e.entry.js +1 -0
  31. package/dist/find-words/p-tKuUvMLJ.js +2 -0
  32. package/dist/index.cjs.js +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/types/components/find-words/board.d.ts +24 -0
  35. package/dist/types/components/find-words/find-words.d.ts +23 -0
  36. package/dist/types/components/find-words/types.d.ts +9 -0
  37. package/dist/types/components.d.ts +105 -0
  38. package/dist/types/index.d.ts +11 -0
  39. package/dist/types/stencil-public-runtime.d.ts +1839 -0
  40. package/dist/types/utils/utils.d.ts +1 -0
  41. package/loader/cdn.js +1 -0
  42. package/loader/index.cjs.js +1 -0
  43. package/loader/index.d.ts +24 -0
  44. package/loader/index.es2017.js +1 -0
  45. package/loader/index.js +2 -0
  46. package/package.json +52 -0
@@ -0,0 +1,193 @@
1
+ import { h } from "@stencil/core";
2
+ export class MbFindWords {
3
+ /**
4
+ *
5
+ */
6
+ init = true;
7
+ board;
8
+ boardData;
9
+ boardEl;
10
+ isInitialized = false;
11
+ answers = [];
12
+ currentSelected = '';
13
+ componentWillLoad() {
14
+ console.log('componentDidLoad', this.init);
15
+ if (this.init && this.board) {
16
+ this.initGame();
17
+ }
18
+ }
19
+ watchBoard() {
20
+ if (this.init) {
21
+ this.initGame();
22
+ }
23
+ }
24
+ async initGame(board = this.board) {
25
+ if (!board) {
26
+ throw new Error('Missing board definition');
27
+ }
28
+ this.boardData = board;
29
+ console.log('initGame', this.boardData);
30
+ this.initAnswers();
31
+ this.isInitialized = true;
32
+ }
33
+ initAnswers() {
34
+ this.answers = this.boardData.answers.map(a => {
35
+ return {
36
+ value: a,
37
+ found: false
38
+ };
39
+ });
40
+ }
41
+ onSelectedChanged(event) {
42
+ this.currentSelected = event.detail;
43
+ }
44
+ isSelectionCorrect = false;
45
+ watchIsDuringCorrect(value) {
46
+ if (value) {
47
+ setTimeout(() => {
48
+ this.boardEl?.resetSelection();
49
+ this.isSelectionCorrect = false;
50
+ }, 1000);
51
+ }
52
+ }
53
+ watchCurrentSelected(value) {
54
+ const matchingAnswer = this.answers.find(a => {
55
+ return a.value.toLowerCase() === value.toLowerCase();
56
+ });
57
+ if (matchingAnswer) {
58
+ console.log('znalezione!');
59
+ this.answers = this.answers.map(a => a === matchingAnswer ? { ...a, found: true } : a);
60
+ this.isSelectionCorrect = true;
61
+ }
62
+ }
63
+ render() {
64
+ return h("div", { key: 'eee958199c326614530edf1e642f6b0791091a02' }, this.isInitialized
65
+ ? h("div", { part: "main", class: "main" }, h("div", { part: "answers", class: "answers" }, h("ul", null, this.answers.map(a => {
66
+ return h("li", { key: a.value, class: { "answer--found": a.found } }, a.value);
67
+ }))), h("div", { part: "preview", class: {
68
+ preview: true,
69
+ 'preview--correct': this.isSelectionCorrect
70
+ } }, h("span", null, "\u00A0"), this.currentSelected), h("div", { class: "board" }, h("mb-find-words-board", { part: "board", isSelectionCorrect: this.isSelectionCorrect, ref: (el) => this.boardEl = el, letters: this.boardData.letters, width: this.boardData.width })))
71
+ : h("div", null, "\u0141adowanie..."));
72
+ }
73
+ static get is() { return "mb-find-words"; }
74
+ static get encapsulation() { return "shadow"; }
75
+ static get originalStyleUrls() {
76
+ return {
77
+ "$": ["find-words.scss"]
78
+ };
79
+ }
80
+ static get styleUrls() {
81
+ return {
82
+ "$": ["find-words.css"]
83
+ };
84
+ }
85
+ static get properties() {
86
+ return {
87
+ "init": {
88
+ "type": "boolean",
89
+ "mutable": false,
90
+ "complexType": {
91
+ "original": "boolean",
92
+ "resolved": "boolean",
93
+ "references": {}
94
+ },
95
+ "required": false,
96
+ "optional": false,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ },
101
+ "getter": false,
102
+ "setter": false,
103
+ "reflect": false,
104
+ "attribute": "init",
105
+ "defaultValue": "true"
106
+ },
107
+ "board": {
108
+ "type": "unknown",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "BoardDefinition",
112
+ "resolved": "BoardDefinition",
113
+ "references": {
114
+ "BoardDefinition": {
115
+ "location": "import",
116
+ "path": "./types",
117
+ "id": "src/components/find-words/types.ts::BoardDefinition",
118
+ "referenceLocation": "BoardDefinition"
119
+ }
120
+ }
121
+ },
122
+ "required": false,
123
+ "optional": false,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": ""
127
+ },
128
+ "getter": false,
129
+ "setter": false
130
+ }
131
+ };
132
+ }
133
+ static get states() {
134
+ return {
135
+ "isInitialized": {},
136
+ "answers": {},
137
+ "currentSelected": {},
138
+ "isSelectionCorrect": {}
139
+ };
140
+ }
141
+ static get methods() {
142
+ return {
143
+ "initGame": {
144
+ "complexType": {
145
+ "signature": "(board?: BoardDefinition) => Promise<void>",
146
+ "parameters": [{
147
+ "name": "board",
148
+ "type": "BoardDefinition",
149
+ "docs": ""
150
+ }],
151
+ "references": {
152
+ "Promise": {
153
+ "location": "global",
154
+ "id": "global::Promise"
155
+ },
156
+ "BoardDefinition": {
157
+ "location": "import",
158
+ "path": "./types",
159
+ "id": "src/components/find-words/types.ts::BoardDefinition",
160
+ "referenceLocation": "BoardDefinition"
161
+ }
162
+ },
163
+ "return": "Promise<void>"
164
+ },
165
+ "docs": {
166
+ "text": "",
167
+ "tags": []
168
+ }
169
+ }
170
+ };
171
+ }
172
+ static get watchers() {
173
+ return [{
174
+ "propName": "board",
175
+ "methodName": "watchBoard"
176
+ }, {
177
+ "propName": "isSelectionCorrect",
178
+ "methodName": "watchIsDuringCorrect"
179
+ }, {
180
+ "propName": "currentSelected",
181
+ "methodName": "watchCurrentSelected"
182
+ }];
183
+ }
184
+ static get listeners() {
185
+ return [{
186
+ "name": "selectedChanged",
187
+ "method": "onSelectedChanged",
188
+ "target": undefined,
189
+ "capture": false,
190
+ "passive": false
191
+ }];
192
+ }
193
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview entry point for your component library
3
+ *
4
+ * This is the entry point for your component library. Use this file to export utilities,
5
+ * constants or data structure that accompany your components.
6
+ *
7
+ * DO NOT use this file to export your components. Instead, use the recommended approaches
8
+ * to consume components of this package as outlined in the `README.md`.
9
+ */
10
+ export { areSiblings } from './utils/utils';
@@ -0,0 +1,14 @@
1
+ export function areSiblings(index1, index2, width) {
2
+ if (width < 1) {
3
+ throw new Error("Board width must be positive");
4
+ }
5
+ if (index1 === index2)
6
+ return false;
7
+ const row1 = Math.floor(index1 / width);
8
+ const row2 = Math.floor(index2 / width);
9
+ const col1 = index1 % width;
10
+ const col2 = index2 % width;
11
+ const d1 = Math.abs(row1 - row2);
12
+ const d2 = Math.abs(col1 - col2);
13
+ return d1 <= 1 && d2 <= 1;
14
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
7
+ /**
8
+ * Used to manually set the base path where assets can be found.
9
+ * If the script is used as "module", it's recommended to use "import.meta.url",
10
+ * such as "setAssetPath(import.meta.url)". Other options include
11
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
12
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
13
+ * But do note that this configuration depends on how your script is bundled, or lack of
14
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
15
+ * will have to ensure the static assets are copied to its build directory.
16
+ */
17
+ export declare const setAssetPath: (path: string) => void;
18
+
19
+ /**
20
+ * Used to specify a nonce value that corresponds with an application's CSP.
21
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
22
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
23
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
24
+ * will result in the same behavior.
25
+ */
26
+ export declare const setNonce: (nonce: string) => void
27
+
28
+ export interface SetPlatformOptions {
29
+ raf?: (c: FrameRequestCallback) => number;
30
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
31
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
32
+ }
33
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
34
+
35
+ export * from '../types';
@@ -0,0 +1 @@
1
+ var t,e,n,i,s,r,o,l,h,c,f,u,a,p,d,v,w,b=Object.create,m=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},M=(t,e,n)=>e.has(t)||j("Cannot "+n),E=(t,e,n)=>(M(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)=>(M(t,e,"write to private field"),e.set(t,n),n),N=(t,e,n)=>(M(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,h=n.indexOf(t),c=n.indexOf(e,h+1),f=h;if(h>=0&&c>0){if(t===e)return[h,c];for(i=[],r=n.length;f>=0&&!l;)f==h?(i.push(f),h=n.indexOf(t,f+1)):1==i.length?l=[i.pop(),c]:((s=i.pop())<r&&(r=s,o=c),c=n.indexOf(e,f+1)),f=h<c&&h>=0?h:c;i.length&&(l=[r,o])}return l}e.exports=n,n.range=s}}),W=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(c)):[]};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 h(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function c(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 c=0;c<l.length;c++)i.push(A=o+"{"+s.body+"}"+l[c]);else{var w,b,m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=m||g,$=s.body.indexOf(",")>=0;if(!y&&!$)return s.post.match(/,(?!,).*\}/)?v(t=s.pre+"{"+s.body+r+s.post):[t];if(y)w=s.body.split(/\.\./);else if(1===(w=f(s.body)).length&&1===(w=v(w[0],!1).map(u)).length)return l.map((function(t){return s.pre+w[0]+t}));if(y){var O=h(w[0]),j=h(w[1]),S=Math.max(w[0].length,w[1].length),M=3==w.length?Math.abs(h(w[2])):1,E=p;j<O&&(M*=-1,E=d);var k=w.some(a);b=[];for(var x=O;E(x,j);x+=M){var N;if(g)"\\"===(N=String.fromCharCode(x))&&(N="");else if(N=x+"",k){var P=S-N.length;if(P>0){var W=Array(P+1).join("0");N=x<0?"-"+W+N.slice(1):W+N}}b.push(N)}}else{b=[];for(var R=0;R<w.length;R++)b.push.apply(b,v(w[R],!1))}for(R=0;R<b.length;R++)for(c=0;c<l.length;c++){var A=o+b[R]+l[c];(!e||y||A)&&i.push(A)}}return i}}}),R=(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}}))},A=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},C=(t,e)=>e in t,z=(t,e)=>(0,console.error)(t,e),L=new Map,_="undefined"!=typeof window?window:{},T=_.HTMLElement||class{},D={l:0,h:"",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)},U=(()=>{try{return!!_.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),F=!!U&&(()=>!!_.document&&Object.getOwnPropertyDescriptor(_.document.adoptedStyleSheets,"length").writable)(),G=!1,I=[],Z=[],H=(t,e)=>n=>{t.push(n),G||(G=!0,e&&4&D.l?q(V):D.raf(V))},B=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){z(t)}t.length=0},V=()=>{B(I),B(Z),(G=I.length>0)&&D.raf(V)},q=t=>Promise.resolve(void 0).then(t),J=H(Z,!0),Y=t=>{const e=new URL(t,D.h);return e.origin!==_.location.origin?e.href:e.pathname},K=t=>D.h=t,Q=t=>"object"==(t=typeof t)||"function"===t,X=((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||m(t,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return t})(m(n,"default",{value:t,enumerable:!0}),t)))(W()),tt=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},et={"[: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]},nt=t=>t.replace(/[[\]\\-]/g,"\\$&"),it=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),st=t=>t.join(""),rt=(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,h=!1,c=!1,f=n,u="";t:for(;r<t.length;){const e=t.charAt(r);if("!"!==e&&"^"!==e||r!==n+1){if("]"===e&&o&&!h){f=r+1;break}if(o=!0,"\\"!==e||h){if("["===e&&!h)for(const[e,[o,h,c]]of Object.entries(et))if(t.startsWith(e,r)){if(u)return["$.",!1,t.length-n,!0];r+=e.length,c?s.push(o):i.push(o),l=l||h;continue t}h=!1,u?(e>u?i.push(nt(u)+"-"+nt(e)):e===u&&i.push(nt(e)),u="",r++):t.startsWith("-]",r+1)?(i.push(nt(e+"-")),r+=2):t.startsWith("-",r+1)?(u=e,r+=2):(i.push(nt(e)),r++)}else h=!0,r++}else c=!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])&&!c){const t=2===i[0].length?i[0].slice(-1):i[0];return[it(t),!1,f-n,!1]}const a="["+(c?"^":"")+st(i)+"]",p="["+(c?"":"^")+st(s)+"]";return[i.length&&s.length?"("+a+"|"+p+")":i.length?a:p,l,f-n,!0]},ot=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),lt=new Set(["!","?","+","*","@"]),ht=t=>lt.has(t),ct="(?!\\.)",ft=new Set(["[","."]),ut=new Set(["..","."]),at=new Set("().*{}+?[]^$\\!"),pt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),dt="[^/]",vt=dt+"*?",wt=dt+"+?",bt=class b{constructor(a,p,d={}){k(this,u),((t,e,n)=>{((t,e,n)=>{e in t?m(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,h),k(this,c),k(this,f,!1),this.type=a,a&&x(this,e,!0),x(this,s,p),x(this,t,E(this,s)?E(E(this,s),t):this),x(this,h,E(this,t)===this?d:E(E(this,t),h)),x(this,o,E(this,t)===this?[]:E(E(this,t),o)),"!"!==a||E(E(this,t),l)||E(this,o).push(this),x(this,r,E(this,s)?E(E(this,s),i).length:0)}get hasMagic(){if(void 0!==E(this,e))return E(this,e);for(const t of E(this,i))if("string"!=typeof t&&(t.type||t.hasMagic))return x(this,e,!0);return E(this,e)}toString(){return void 0!==E(this,c)?E(this,c):x(this,c,this.type?this.type+"("+E(this,i).map((t=>t+"")).join("|")+")":E(this,i).map((t=>t+"")).join(""))}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof b&&E(e,s)===this))throw Error("invalid part: "+e);E(this,i).push(e)}}toJSON(){var e;const n=null===this.type?E(this,i).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...E(this,i).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===E(this,t)||E(E(this,t),l)&&"!"===(null==(e=E(this,s))?void 0:e.type))&&n.push({}),n}isStart(){var e;if(E(this,t)===this)return!0;if(!(null==(e=E(this,s))?void 0:e.isStart()))return!1;if(0===E(this,r))return!0;const n=E(this,s);for(let t=0;t<E(this,r);t++){const e=E(n,i)[t];if(!(e instanceof b&&"!"===e.type))return!1}return!0}isEnd(){var e,n,o;if(E(this,t)===this)return!0;if("!"===(null==(e=E(this,s))?void 0:e.type))return!0;if(!(null==(n=E(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(o=E(this,s))?void 0:o.isEnd();const l=E(this,s)?E(E(this,s),i).length:0;return E(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 E(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!==E(this,t))return E(this,t).toMMPattern();const n=""+this,[i,s,r,o]=this.toRegExpSource();if(!(r||E(this,e)||E(this,h).nocase&&!E(this,h).nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;const l=(E(this,h).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:n})}get options(){return E(this,h)}toRegExpSource(r){var o;const c=null!=r?r:!!E(this,h).dot;if(E(this,t)===this&&N(this,u,a).call(this),!this.type){const h=this.isStart()&&this.isEnd(),f=E(this,i).map((t=>{var i;const[s,o,l,c]="string"==typeof t?N(i=b,p,w).call(i,t,E(this,e),h):t.toRegExpSource(r);return x(this,e,E(this,e)||l),x(this,n,E(this,n)||c),s})).join("");let u="";if(this.isStart()&&"string"==typeof E(this,i)[0]&&(1!==E(this,i).length||!ut.has(E(this,i)[0]))){const t=ft,e=c&&t.has(f.charAt(0))||f.startsWith("\\.")&&t.has(f.charAt(2))||f.startsWith("\\.\\.")&&t.has(f.charAt(4)),n=!c&&!r&&t.has(f.charAt(0));u=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ct:""}let a="";return this.isEnd()&&E(E(this,t),l)&&"!"===(null==(o=E(this,s))?void 0:o.type)&&(a="(?:$|\\/)"),[u+f+a,ot(f),x(this,e,!!E(this,e)),E(this,n)]}const d="*"===this.type||"+"===this.type,m="!"===this.type?"(?:(?!(?:":"(?:";let g=N(this,u,v).call(this,c);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,ot(""+this),!1,!1]}let y=!d||r||c?"":N(this,u,v).call(this,!0);y===g&&(y=""),y&&(g=`(?:${g})(?:${y})*?`);let $="";return $="!"===this.type&&E(this,f)?(this.isStart()&&!c?ct:"")+wt:m+g+("!"===this.type?"))"+(!this.isStart()||c||r?"":ct)+vt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,ot(g),x(this,e,!!E(this,e)),E(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,h=new WeakMap,c=new WeakMap,f=new WeakMap,u=new WeakSet,a=function(){if(this!==E(this,t))throw Error("should only call on root");if(E(this,l))return this;let e;for(x(this,l,!0);e=E(this,o).pop();){if("!"!==e.type)continue;let t=e,n=E(t,s);for(;n;){for(let s=E(t,r)+1;!n.type&&s<E(n,i).length;s++)for(const t of E(e,i)){if("string"==typeof t)throw Error("string part in extglob AST??");t.copyIn(E(n,i)[s])}t=n,n=E(t,s)}}return this},p=new WeakSet,d=function(t,n,s,r){var o,l;let h=!1,c=!1,u=-1,a=!1;if(null===n.type){let e=s,i="";for(;e<t.length;){const s=t.charAt(e++);if(h||"\\"===s)h=!h,i+=s;else if(c)e===u+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||e===u+2&&a||(c=!1),i+=s;else if("["!==s)if(r.noext||!ht(s)||"("!==t.charAt(e))i+=s;else{n.push(i),i="";const l=new bt(s,n);e=N(o=bt,p,d).call(o,t,l,e,r),n.push(l)}else c=!0,u=e,a=!1,i+=s}return n.push(i),e}let v=s+1,w=new bt(null,n);const b=[];let m="";for(;v<t.length;){const e=t.charAt(v++);if(h||"\\"===e)h=!h,m+=e;else if(c)v===u+1?"^"!==e&&"!"!==e||(a=!0):"]"!==e||v===u+2&&a||(c=!1),m+=e;else if("["!==e)if(ht(e)&&"("===t.charAt(v)){w.push(m),m="";const n=new bt(e,w);w.push(n),v=N(l=bt,p,d).call(l,t,n,v,r)}else if("|"!==e){if(")"===e)return""===m&&0===E(n,i).length&&x(n,f,!0),w.push(m),m="",n.push(...b,w),v;m+=e}else w.push(m),m="",b.push(w),w=new bt(null,n);else c=!0,u=v,a=!1,m+=e}return n.type=null,x(n,e,void 0),x(n,i,[t.substring(s-1)]),v},v=function(t){return E(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,E(this,n)||o),i})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},w=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+=(at.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,h]=rt(t,o);if(l){s+=n,r=r||i,o+=l-1,e=e||h;continue}}"*"!==l?"?"!==l?s+=pt(l):(s+=dt,e=!0):(s+=n&&"*"===t?wt:vt,e=!0)}else o===t.length-1?s+="\\\\":i=!0}return[s,ot(t),!!e,r]},k(bt,p);var mt=bt,gt=(t,e,n={})=>(tt(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Ht(e,n).match(t)),yt=/^\*+([^+@!?\*\[\(]*)$/,$t=t=>e=>!e.startsWith(".")&&e.endsWith(t),Ot=t=>e=>e.endsWith(t),jt=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),St=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Mt=/^\*+\.\*+$/,Et=t=>!t.startsWith(".")&&t.includes("."),kt=t=>"."!==t&&".."!==t&&t.includes("."),xt=/^\.\*+$/,Nt=t=>"."!==t&&".."!==t&&t.startsWith("."),Pt=/^\*+$/,Wt=t=>0!==t.length&&!t.startsWith("."),Rt=t=>0!==t.length&&"."!==t&&".."!==t,At=/^\?+([^+@!?\*\[\(]*)?$/,Ct=([t,e=""])=>{const n=Tt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},zt=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},_t=([t,e=""])=>{const n=Tt([t]);return e?t=>n(t)&&t.endsWith(e):n},Tt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Dt=([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";gt.sep="win32"===Ut?"\\":"/";var Ft=Symbol("globstar **");gt.GLOBSTAR=Ft,gt.filter=(t,e={})=>n=>gt(n,t,e);var Gt=(t,e={})=>Object.assign({},t,e);gt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return gt;const e=gt;return Object.assign(((n,i,s={})=>e(n,i,Gt(t,s))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Gt(t,n))}static defaults(n){return e.defaults(Gt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,Gt(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,Gt(t,i))}},unescape:(n,i={})=>e.unescape(n,Gt(t,i)),escape:(n,i={})=>e.escape(n,Gt(t,i)),filter:(n,i={})=>e.filter(n,Gt(t,i)),defaults:n=>e.defaults(Gt(t,n)),makeRe:(n,i={})=>e.makeRe(n,Gt(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Gt(t,i)),match:(n,i,s={})=>e.match(n,i,Gt(t,s)),sep:e.sep,GLOBSTAR:Ft})};var It=(t,e={})=>(tt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,X.default)(t));gt.braceExpand=It,gt.makeRe=(t,e={})=>new Ht(t,e).makeRe(),gt.match=(t,e,n={})=>{const i=new Ht(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var Zt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ht=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){tt(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]&&Zt.test(t[2])||Zt.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,h=e.length;r<l&&o<h;r++,o++){this.debug("matchOne loop");var c=e[o],f=t[r];if(this.debug(e,c,f),!1===c)return!1;if(c===Ft){this.debug("GLOBSTAR",[e,c,f]);var u=r,a=o+1;if(a===h){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 c?(s=f===c,this.debug("string match",c,f,s)):(s=c.test(f),this.debug("pattern match",c,f,s)),!s)return!1}if(r===l&&o===h)return!0;if(r===l)return n;if(o===h)return r===l-1&&""===t[r];throw Error("wtf?")}braceExpand(){return It(this.pattern,this.options)}parse(t){tt(t);const e=this.options;if("**"===t)return Ft;if(""===t)return"";let n,i=null;(n=t.match(Pt))?i=e.dot?Rt:Wt:(n=t.match(yt))?i=(e.nocase?e.dot?St:jt:e.dot?Ot:$t)(n[1]):(n=t.match(At))?i=(e.nocase?e.dot?zt:Ct:e.dot?Lt:_t)(n):(n=t.match(Mt))?i=e.dot?kt:Et:(n=t.match(xt))&&(i=Nt);const s=mt.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===Ft?Ft:t._src}));return e.forEach(((t,i)=>{const s=e[i+1],r=e[i-1];t===Ft&&r!==Ft&&(void 0===r?void 0!==s&&s!==Ft?e[i+1]="(?:\\/|"+n+"\\/)?"+s:e[i]=n:void 0===s?e[i-1]=r+"(?:\\/|"+n+")?":s!==Ft&&(e[i-1]=r+"(?:\\/|\\/"+n+"\\/)"+s,e[i+1]=Ft))})),e.filter((t=>t!==Ft)).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 gt.defaults(t).Minimatch}};gt.AST=mt,gt.Minimatch=Ht,gt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),gt.unescape=ot,((t,e)=>{for(var n in e)m(t,n,{get:e[n],enumerable:!0})})({},{err:()=>Vt,map:()=>qt,ok:()=>Bt,unwrap:()=>Yt,unwrapErr:()=>Kt});var Bt=t=>({isOk:!0,isErr:!1,value:t}),Vt=t=>({isOk:!1,isErr:!0,value:t});function qt(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 Vt(t.value);throw"should never get here"}var Jt,Yt=t=>{if(t.isOk)return t.value;throw t.value},Kt=t=>{if(t.isErr)return t.value;throw t.value};function Qt(){const t=this.attachShadow({mode:"open"});void 0===Jt&&(Jt=null),Jt&&(F?t.adoptedStyleSheets.push(Jt):t.adoptedStyleSheets=[...t.adoptedStyleSheets,Jt])}function Xt(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||te(i)===n)&&(r.push(i),void 0!==n))return r;r=[...r,...Xt(i.childNodes,e,n)]}return r}var te=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;var ee=new WeakMap,ne=t=>"sc-"+t.u,ie=(t,e,...n)=>{let i=null,s=null,r=!1,o=!1;const l=[],h=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?h(i):null!=i&&"boolean"!=typeof i&&((r="function"!=typeof t&&!Q(i))&&(i+=""),r&&o?l[l.length-1].p+=i:l.push(r?se(null,i):i),o=r)};if(h(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(" "))}}const c=se(t,null);return c.v=e,l.length>0&&(c.m=l),c.$=s,c},se=(t,e)=>({l:0,O:t,p:e,j:null,m:null,v:null,$:null}),re={},oe=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};oe("::slotted"),oe(":host"),oe(":host-context");var le,he=(t,e)=>null==t||Q(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,ce=(t,e)=>{const n=t;return{emit:t=>fe(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},fe=(t,e,n)=>{const i=D.ce(e,n);return t.dispatchEvent(i),i},ue=(t,e,n,i,s,r)=>{if(n===i)return;let o=C(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,s=pe(n);let r=pe(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(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){const l=Q(i);if((o||l&&null!==i)&&!s)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):C(_,l)?l.slice(2):l[2]+e.slice(3),n||i){const s=e.endsWith(de);e=e.replace(ve,""),n&&D.rel(t,e,n,s),i&&D.ael(t,e,i,s)}},ae=/\s/,pe=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(ae):[]),de="Capture",ve=RegExp(de+"$"),we=(t,e,n)=>{const i=11===e.j.nodeType&&e.j.host?e.j.host:e.j,s=t&&t.v||{},r=e.v||{};for(const t of be(Object.keys(s)))t in r||ue(i,t,s[t],void 0,n,e.l);for(const t of be(Object.keys(r)))ue(i,t,s[t],r[t],n,e.l)};function be(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var me=!1,ge=(t,e,n)=>{const i=e.m[n];let s,r,o=0;if(null!==i.p)s=i.j=_.document.createTextNode(i.p);else{if(me||(me="svg"===i.O),!_.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.j=_.document.createElementNS(me?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.O),me&&"foreignObject"===i.O&&(me=!1),we(null,i,me),i.m){const e="template"===i.O?s.content:s;for(o=0;o<i.m.length;++o)r=ge(t,i,o),r&&e.appendChild(r)}"svg"===i.O?me=!1:"foreignObject"===s.tagName&&(me=!0)}return s["s-hn"]=le,s},ye=(t,e,n,i,s,r)=>{let o,l=t;for(l.shadowRoot&&l.tagName===le&&(l=l.shadowRoot),"template"===n.O&&(l=l.content);s<=r;++s)i[s]&&(o=ge(null,n,s),o&&(i[s].j=o,Me(l,o,e)))},$e=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.j;Se(e),t&&t.remove()}}},Oe=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),je=(t,e,n=!1)=>{const i=e.j=t.j,s=t.m,r=e.m,o=e.O,l=e.p;null===l?(we(t,e,me="svg"===o||"foreignObject"!==o&&me),null!==s&&null!==r?((t,e,n,i,s=!1)=>{let r,o,l=0,h=0,c=0,f=0,u=e.length-1,a=e[0],p=e[u],d=i.length-1,v=i[0],w=i[d];const b="template"===n.O?t.content:t;for(;l<=u&&h<=d;)if(null==a)a=e[++l];else if(null==p)p=e[--u];else if(null==v)v=i[++h];else if(null==w)w=i[--d];else if(Oe(a,v,s))je(a,v,s),a=e[++l],v=i[++h];else if(Oe(p,w,s))je(p,w,s),p=e[--u],w=i[--d];else if(Oe(a,w,s))je(a,w,s),Me(b,a.j,p.j.nextSibling),a=e[++l],w=i[--d];else if(Oe(p,v,s))je(p,v,s),Me(b,p.j,a.j),p=e[--u],v=i[++h];else{for(c=-1,f=l;f<=u;++f)if(e[f]&&null!==e[f].$&&e[f].$===v.$){c=f;break}c>=0?(o=e[c],o.O!==v.O?r=ge(e&&e[h],n,c):(je(o,v,s),e[c]=void 0,r=o.j),v=i[++h]):(r=ge(e&&e[h],n,h),v=i[++h]),r&&Me(a.j.parentNode,r,a.j)}l>u?ye(t,null==i[d+1]?null:i[d+1].j,n,i,h,d):h>d&&$e(e,l,u)})(i,s,e,r,n):null!==r?(null!==t.p&&(i.textContent=""),ye(i,null,e,r,0,r.length-1)):!n&&null!==s&&$e(s,0,s.length-1),me&&"svg"===o&&(me=!1)):t.p!==l&&(i.data=l)},Se=t=>{t.v&&t.v.ref&&t.v.ref(null),t.m&&t.m.map(Se)},Me=(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"]=te(t)||"";return{slotNode:Xt(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)},Ee=(t,e,n=!1)=>{const i=t.$hostElement$,s=t.S||se(null,null),r=(t=>t&&t.O===re)(e)?e:ie(null,null,e);if(le=i.tagName,n&&r.v)for(const t of Object.keys(r.v))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.v[t]=i[t]);r.O=null,r.l|=4,t.S=r,r.j=s.j=i.shadowRoot||i,je(s,r,n)},ke=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.M=()=>{e["s-p"].splice(n-1,1),i()})))}},xe=(t,e)=>{if(t.l|=16,4&t.l)return void(t.l|=512);ke(t,t.k);const n=()=>Ne(t,e);if(!e)return J(n);queueMicrotask((()=>{n()}))},Ne=(t,e)=>{const n=t.$hostElement$,i=n;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 s=Le(i,e?"componentWillLoad":"componentWillUpdate",void 0,n),s=Pe(s,(()=>Le(i,"componentWillRender",void 0,n))),Pe(s,(()=>Re(t,i,e)))},Pe=(t,e)=>We(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),We=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Re=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.l,s=((t,e)=>{var n,i,s;const r=ne(e),o=L.get(r);if(!_.document)return r;if(t=11===t.nodeType?t:_.document,o)if("string"==typeof o){let s,l=ee.get(t=t.head||t);if(l||ee.set(t,l=new Set),!l.has(r)){s=_.document.createElement("style"),s.innerHTML=o;const h=null!=(n=D.N)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=_.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=h&&s.setAttribute("nonce",h),!(1&e.l))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(U){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.l&&t.insertBefore(s,null),4&e.l&&(s.innerHTML+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),l&&l.add(r)}}else{let e=ee.get(t);if(e||ee.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=()=>Ce(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},Ae=(t,e,n,i)=>{try{e=e.render(),t.l&=-17,t.l|=2,Ee(t,e,i)}catch(e){z(e,t.$hostElement$)}return null},Ce=t=>{const e=t.$hostElement$,n=e,i=t.k;Le(n,"componentDidRender",void 0,e),64&t.l?Le(n,"componentDidUpdate",void 0,e):(t.l|=64,_e(e),Le(n,"componentDidLoad",void 0,e),t.P(e),i||ze()),t.M&&(t.M(),t.M=void 0),512&t.l&&q((()=>xe(t,!1))),t.l&=-517},ze=()=>{q((()=>fe(_,"appload",{detail:{namespace:"find-words"}})))},Le=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){z(t,i)}},_e=t=>t.classList.add("hydrated"),Te=(t,e,n,i)=>{const s=A(t);if(!s)return;const r=t,o=s.o.get(e),l=s.l,h=r;if(!((n=he(n,i.t[e][0]))===o||Number.isNaN(o)&&Number.isNaN(n))){if(s.o.set(e,n),i.W){const t=i.W[e];t&&t.map((t=>{try{const[[i,r]]=Object.entries(t);(128&l||1&r)&&(h?h[i](n,o,e):s.R.push((()=>{s.A[i](n,o,e)})))}catch(t){z(t,r)}}))}if(2==(18&l)){if(h.componentShouldUpdate&&!1===h.componentShouldUpdate(n,o,e))return;xe(s,!1)}}},De=(t,e)=>{var n,i;const s=t.prototype;{t.watchers&&!e.W&&(e.W=t.watchers),t.deserializers&&!e.C&&(e.C=t.deserializers),t.serializers&&!e.L&&(e.L=t.serializers);const r=Object.entries(null!=(n=e.t)?n:{});r.map((([t,[n]])=>{if(31&n||32&n){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,t)||{};i&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),Object.defineProperty(s,t,{get(){return i?i.apply(this):((t,e)=>A(this).o.get(e))(0,t)},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(i){const s=A(this);if(s){if(r)return void 0===(32&n?this[t]:s.$hostElement$[t])&&s.o.get(t)&&(i=s.o.get(t)),r.call(this,he(i,n)),void Te(this,t,i=32&n?this[t]:s.$hostElement$[t],e);Te(this,t,i,e)}}})}}));{const n=new Map;s.attributeChangedCallback=function(t,i,o){D.jmp((()=>{var l;const h=n.get(t),c=A(this);if(this.hasOwnProperty(h),s.hasOwnProperty(h)&&"number"==typeof this[h]&&this[h]==o)return;if(null==h){const n=null==c?void 0:c.l;if(c&&n&&!(8&n)&&o!==i){const s=this,r=null==(l=e.W)?void 0:l[t];null==r||r.forEach((e=>{const[[r,l]]=Object.entries(e);null!=s[r]&&(128&n||1&l)&&s[r].call(s,o,i,t)}))}return}const f=r.find((([t])=>t===h));f&&4&f[1][0]&&(o=null!==o&&"false"!==o);const u=Object.getOwnPropertyDescriptor(s,h);o==this[h]||u.get&&!u.set||(this[h]=o)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.W)?i:{}),...r.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},Ue=(t,e)=>{const n={l:e[0],u:e[1]};n.t=e[2],n._=e[3],n.W=t.W,n.C=t.C,n.L=t.L;const i=t.prototype.connectedCallback,s=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const n={l:0,$hostElement$:t,i:e,o:new Map,T:new Map};n.D=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[];const i=n;t.__stencil__getHostRef=()=>i,512&e.l&&R(t,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){const t=A(this);if(!t)return;Fe(this,t,n._),this.__hasHostListenerAttached=!0}(t=>{if(!(1&D.l)){const e=A(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.l)Fe(t,e,n._),(null==e?void 0:e.A)||(null==e?void 0:e.D)&&e.D.then((()=>{}));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){ke(e,e.k=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.l)&&(e.l|=32,i=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128)),i&&i.style)){let t;"string"==typeof i.style&&(t=i.style);const e=ne(n);if(!L.has(e)){const i=()=>{};((t,e,n)=>{let i=L.get(t);U&&n?(i=i||new CSSStyleSheet,"string"==typeof i?i=e:i.replaceSync(e)):i=e,L.set(t,i)})(e,t,!!(1&n.l)),i()}}const s=e.k,r=()=>xe(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(t,e,n)}i()}})(this),i&&i.call(this)},disconnectedCallback(){(async t=>{if(!(1&D.l)){const e=A(t);(null==e?void 0:e.U)&&(e.U.map((t=>t())),e.U=void 0)}ee.has(t)&&ee.delete(t),t.shadowRoot&&ee.has(t.shadowRoot)&&ee.delete(t.shadowRoot)})(this),s&&s.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.u}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else Qt.call(this,n)}}),t.is=n.u,De(t,n)},Fe=(t,e,n)=>{n&&_.document&&n.map((([n,i,s])=>{const r=t,o=Ge(e,s),l=Ie(n);D.ael(r,i,o,l),(e.U=e.U||[]).push((()=>D.rel(r,i,o,l)))}))},Ge=(t,e)=>n=>{try{t.$hostElement$[e](n)}catch(e){z(e,t.$hostElement$)}},Ie=t=>({passive:!!(1&t),capture:!!(2&t)}),Ze=t=>D.N=t,He=t=>Object.assign(D,t);function Be(t,e){Ee({$hostElement$:e},t)}function Ve(t){return t}function qe(t,e,n){if(n<1)throw Error("Board width must be positive");if(t===e)return!1;const i=t%n,s=e%n;return Math.abs(Math.floor(t/n)-Math.floor(e/n))<=1&&Math.abs(i-s)<=1}export{T as H,qe as areSiblings,ce as c,Y as getAssetPath,ie as h,Ue as p,Be as render,K as setAssetPath,Ze as setNonce,He as setPlatformOptions,Ve as t}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface MbFindWordsBoard extends Components.MbFindWordsBoard, HTMLElement {}
4
+ export const MbFindWordsBoard: {
5
+ prototype: MbFindWordsBoard;
6
+ new (): MbFindWordsBoard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{B as s,d as t}from"./p-CttCbs-b.js";const o=s,p=t;export{o as MbFindWordsBoard,p as defineCustomElement}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface MbFindWords extends Components.MbFindWords, HTMLElement {}
4
+ export const MbFindWords: {
5
+ prototype: MbFindWords;
6
+ new (): MbFindWords;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{t as e,p as t,H as r,h as i}from"./index.js";import{d as n}from"./p-CttCbs-b.js";const s=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}init=!0;board;boardData;boardEl;isInitialized=!1;answers=[];currentSelected="";componentWillLoad(){console.log("componentDidLoad",this.init),this.init&&this.board&&this.initGame()}watchBoard(){this.init&&this.initGame()}async initGame(e=this.board){if(!e)throw Error("Missing board definition");this.boardData=e,console.log("initGame",this.boardData),this.initAnswers(),this.isInitialized=!0}initAnswers(){this.answers=this.boardData.answers.map((e=>({value:e,found:!1})))}onSelectedChanged(e){this.currentSelected=e.detail}isSelectionCorrect=!1;watchIsDuringCorrect(e){e&&setTimeout((()=>{this.boardEl?.resetSelection(),this.isSelectionCorrect=!1}),1e3)}watchCurrentSelected(e){const t=this.answers.find((t=>t.value.toLowerCase()===e.toLowerCase()));t&&(console.log("znalezione!"),this.answers=this.answers.map((e=>e===t?{...e,found:!0}:e)),this.isSelectionCorrect=!0)}render(){return i("div",{key:"eee958199c326614530edf1e642f6b0791091a02"},this.isInitialized?i("div",{part:"main",class:"main"},i("div",{part:"answers",class:"answers"},i("ul",null,this.answers.map((e=>i("li",{key:e.value,class:{"answer--found":e.found}},e.value))))),i("div",{part:"preview",class:{preview:!0,"preview--correct":this.isSelectionCorrect}},i("span",null," "),this.currentSelected),i("div",{class:"board"},i("mb-find-words-board",{part:"board",isSelectionCorrect:this.isSelectionCorrect,ref:e=>this.boardEl=e,letters:this.boardData.letters,width:this.boardData.width}))):i("div",null,"Ładowanie..."))}static get watchers(){return{board:[{watchBoard:0}],isSelectionCorrect:[{watchIsDuringCorrect:0}],currentSelected:[{watchCurrentSelected:0}]}}static get style(){return':host{display:block;--_mb-default-font:Verdana, Geneva, Tahoma, sans-serif;--_mb-font:var(--mb-font, var(--_mb-default-font));--_mb-color:var(--mb-color, black);--_mb-background:var(--mb-background, white);--_mb-board-font-family:var(--mb-board-font-family, var(--_mb-font));--_mb-answers-font-family:var(--mb-answers-font-family, var(--_mb-font));--_mb-preview-font-family:var(--mb-preview-font-family, var(--_mb-font))}.main{display:grid;grid-template-columns:1fr;grid-template-areas:"preview" "board" "answers";grid-template-rows:min-content 80vw min-content}@media (min-width: 576px){.main{grid-template-columns:1fr 1fr;grid-template-areas:"answers preview" "answers board";grid-template-rows:min-content minmax(300px, 80vh)}}.answers{grid-area:answers;font-family:var(--_mb-answers-font-family)}.answers ul{list-style:none;font-size:22px;text-transform:uppercase}.answer--found{text-decoration:line-through;color:green}.preview{grid-area:preview;min-height:1.5em;font-family:var(--_mb-preview-font-family);text-transform:uppercase;font-size:30px;text-align:center}.preview--correct{color:green}.board{display:grid;place-content:center;overflow:hidden;position:relative;grid-area:board;font-family:var(--_mb-board-font-family);container-type:size}mb-find-words-board{display:block;aspect-ratio:1;width:min(100cqh, 100cqw)}.grid{position:relative;display:grid;grid-template-columns:repeat(var(--grid-width, 6), 1fr);touch-action:none}.grid svg{display:block;position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:-1}.grid svg polyline,.grid svg path{stroke:lightskyblue;fill:none;stroke-width:40px;stroke-linecap:round;stroke-linejoin:round;transition:all 0.3s}.cell{display:grid;aspect-ratio:1;place-content:center;container-type:size;user-select:none}.cell__inner{font-size:80cqh;text-transform:uppercase}.cell--selected{font-weight:bold}.cell--selected.cell--correct{color:green}'}},[513,"mb-find-words",{init:[4],board:[16],isInitialized:[32],answers:[32],currentSelected:[32],isSelectionCorrect:[32],initGame:[64]},[[0,"selectedChanged","onSelectedChanged"]],{board:[{watchBoard:0}],isSelectionCorrect:[{watchIsDuringCorrect:0}],currentSelected:[{watchCurrentSelected:0}]}]);function a(){"undefined"!=typeof customElements&&["mb-find-words","mb-find-words-board"].forEach((t=>{switch(t){case"mb-find-words":customElements.get(e(t))||customElements.define(e(t),s);break;case"mb-find-words-board":customElements.get(e(t))||n()}}))}a();const o=s,d=a;export{o as MbFindWords,d as defineCustomElement}
@@ -0,0 +1 @@
1
+ import{t as e,p as t,H as s,c as i,areSiblings as l,h as n}from"./index.js";const c=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectedChanged=i(this,"selectedChanged")}letters="";width=1;isSelectionCorrect=!1;get el(){return this}cellEls=[];componentDidLoad(){this.cellEls=Array.from(this.el.querySelectorAll(".cell"))}onCellClicked(e){this.selectCell(e)}onCellEntered(e,t){1!==e.buttons&&"touch"!==e.pointerType||this.selectCell(t)}selectCell(e){if(!this.isSelectionCorrect){if(null===this.head)return this.head=e,void(this.selectedCells=[e]);if(this.selectedCells.includes(e)){const t=this.selectedCells.findIndex((t=>t===e));return this.selectedCells=this.selectedCells.slice(0,t+1),void(this.head=e)}l(this.head,e,this.width)?(this.head=e,this.selectedCells=[...this.selectedCells,e]):this.resetSelection()}}async resetSelection(){this.selectedCells=[],this.head=null}async setSelectionAsCorrect(){this.isSelectionCorrect=!0}selectedCells=[];head=null;path="";buildPolyline(e){if(0===e.length)return this.setPoliline([]);if(1===e.length){const t=this.cellCenterPosition(e[0]);this.setPoliline([t])}else{const t=e.map((e=>this.cellCenterPosition(e)));this.setPoliline(t)}}setPoliline(e){if(0===e.length)return void(this.path="");const t=e[e.length-1],s=[...e,...Array(this.letters.length-e.length).fill([...t])];this.path=s.reduce(((e,t,s)=>0===s?`M ${t[0]} ${t[1]} `:e+`L ${t[0]} ${t[1]}`),"")}cellCenterPosition(e){const t=this.el.getBoundingClientRect();if(!this.cellEls[e])return[0,0];const s=this.cellEls[e].getBoundingClientRect();return[s.x+s.width/2-t.x,s.y+s.height/2-t.y]}selectedChanged;emitSelectedChanged(){const e=this.selectedCells.map((e=>this.letters[e])).join("");this.selectedChanged.emit(e)}handleTouchEvents(e){if("touch"!==e.pointerType)return;const t=this.cellEls.findIndex((t=>{const s=t.getBoundingClientRect(),i=.2*s.width;return s.x+i<e.x&&s.y+i<e.y&&e.x<s.right-i&&e.y<s.bottom-i}));t>=0&&this.selectCell(t)}render(){return n("div",{key:"b8805e0252a0e6c5c5be4eaf58706488a4d94e81",class:{grid:!0},style:{"--grid-width":`${this.width}`},onPointerMove:e=>this.handleTouchEvents(e)},n("svg",{key:"2b9af43e52c23db96f8e73da079799d6b7a766e2"},n("path",{key:"5ff2ac1961a3527d31c8ec9c0fa5587d96b4b9cf",d:this.path})),this.letters.split("").map(((e,t)=>{const s=this.selectedCells.includes(t);return n("div",{class:{cell:!0,"cell--selected":s,"cell--correct":this.isSelectionCorrect},part:"cell",key:t},n("div",{class:"cell__inner",onPointerDown:()=>this.onCellClicked(t),onPointerEnter:e=>this.onCellEntered(e,t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||this.onCellClicked(t)},role:"button",tabindex:"0","aria-label":`Letter ${e}, ${s?"selected":"not selected"}`},e))})))}static get watchers(){return{selectedCells:[{buildPolyline:0},{emitSelectedChanged:0}]}}},[512,"mb-find-words-board",{letters:[1],width:[2],isSelectionCorrect:[4,"is-selection-correct"],selectedCells:[32],path:[32],resetSelection:[64],setSelectionAsCorrect:[64]},void 0,{selectedCells:[{buildPolyline:0},{emitSelectedChanged:0}]}]);function r(){"undefined"!=typeof customElements&&["mb-find-words-board"].forEach((t=>{"mb-find-words-board"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}r();export{c as B,r as d}
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,21 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-tKuUvMLJ.js';
2
+ export { s as setNonce } from './index-tKuUvMLJ.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.41.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+
9
+ var patchBrowser = () => {
10
+ const importMeta = import.meta.url;
11
+ const opts = {};
12
+ if (importMeta !== "") {
13
+ opts.resourcesUrl = new URL(".", importMeta).href;
14
+ }
15
+ return promiseResolve(opts);
16
+ };
17
+
18
+ patchBrowser().then(async (options) => {
19
+ await globalScripts();
20
+ return bootstrapLazy([["mb-find-words_2",[[513,"mb-find-words",{"init":[4],"board":[16],"isInitialized":[32],"answers":[32],"currentSelected":[32],"isSelectionCorrect":[32],"initGame":[64]},[[0,"selectedChanged","onSelectedChanged"]],{"board":[{"watchBoard":0}],"isSelectionCorrect":[{"watchIsDuringCorrect":0}],"currentSelected":[{"watchCurrentSelected":0}]}],[512,"mb-find-words-board",{"letters":[1],"width":[2],"isSelectionCorrect":[4,"is-selection-correct"],"selectedCells":[32],"path":[32],"resetSelection":[64],"setSelectionAsCorrect":[64]},null,{"selectedCells":[{"buildPolyline":0},{"emitSelectedChanged":0}]}]]]], options);
21
+ });