proto-sudoku-wc 0.0.506 → 0.0.508
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-76f96dfb.js → index-0f8ed4ca.js} +0 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-sudoku-wc.cjs.js +2 -2
- package/dist/cjs/proto-sudoku.cjs.entry.js +16 -9
- package/dist/collection/components/proto-sudoku/proto-sudoku.js +8 -8
- package/dist/collection/utils/store.js +13 -6
- package/dist/esm/{index-db5069a2.js → index-aa4026b4.js} +0 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-sudoku-wc.js +2 -2
- package/dist/esm/proto-sudoku.entry.js +16 -9
- package/dist/proto-sudoku-wc/p-68909a5a.js +2 -0
- package/dist/proto-sudoku-wc/p-9d4cc381.entry.js +2 -0
- package/dist/proto-sudoku-wc/proto-sudoku-wc.esm.js +1 -1
- package/dist/types/components/proto-sudoku/proto-sudoku.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/store.d.ts +1 -1
- package/package.json +2 -2
- package/dist/proto-sudoku-wc/p-802920ff.js +0 -2
- package/dist/proto-sudoku-wc/p-91e11c69.entry.js +0 -2
@@ -203,11 +203,6 @@ const convertToPrivate = (node) => {
|
|
203
203
|
const parsePropertyValue = (propValue, propType) => {
|
204
204
|
// ensure this value is of the correct prop type
|
205
205
|
if (propValue != null && !isComplexType(propValue)) {
|
206
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
207
|
-
// per the HTML spec, any string value means it is a boolean true value
|
208
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
209
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
210
|
-
}
|
211
206
|
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
212
207
|
// could have been passed as a number or boolean
|
213
208
|
// but we still want it as a string
|
package/dist/cjs/loader.cjs.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-0f8ed4ca.js');
|
6
6
|
|
7
7
|
/*
|
8
8
|
Stencil Client Patch Esm v2.19.2 | MIT Licensed | https://stenciljs.com
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
16
16
|
return patchEsm().then(() => {
|
17
|
-
return index.bootstrapLazy([["proto-sudoku.cjs",[[1,"proto-sudoku",{"tag":[1],"
|
17
|
+
return index.bootstrapLazy([["proto-sudoku.cjs",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
18
18
|
});
|
19
19
|
};
|
20
20
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const index = require('./index-
|
3
|
+
const index = require('./index-0f8ed4ca.js');
|
4
4
|
|
5
5
|
/*
|
6
6
|
Stencil Client Patch Browser v2.19.2 | MIT Licensed | https://stenciljs.com
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
15
15
|
};
|
16
16
|
|
17
17
|
patchBrowser().then(options => {
|
18
|
-
return index.bootstrapLazy([["proto-sudoku.cjs",[[1,"proto-sudoku",{"tag":[1],"
|
18
|
+
return index.bootstrapLazy([["proto-sudoku.cjs",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
19
19
|
});
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-0f8ed4ca.js');
|
6
6
|
|
7
7
|
const Alien = props => {
|
8
8
|
const hex = props.hex || 'currentColor';
|
@@ -899,10 +899,17 @@ const processPick = (next) => {
|
|
899
899
|
};
|
900
900
|
// --------------------------------------------------------[ utils ]
|
901
901
|
let api = undefined;
|
902
|
-
const
|
903
|
-
|
904
|
-
|
905
|
-
|
902
|
+
const platformPrefix = {
|
903
|
+
netlify: '/.netlify/functions',
|
904
|
+
vercel: 'https://sudoku-rust-api.vercel.app/api',
|
905
|
+
};
|
906
|
+
const getPrefixFor = (platform) => {
|
907
|
+
const keys = Object.keys(platformPrefix);
|
908
|
+
const target = keys.includes(platform) ? platform : 'vercel';
|
909
|
+
return platformPrefix[target];
|
910
|
+
};
|
911
|
+
const initApi = (platform) => {
|
912
|
+
const prefix = getPrefixFor(platform);
|
906
913
|
api = ky.extend({
|
907
914
|
hooks: {
|
908
915
|
beforeRequest: [
|
@@ -941,8 +948,8 @@ const updateStore = (data, save = true) => {
|
|
941
948
|
processData({ puzzle, ref });
|
942
949
|
};
|
943
950
|
// --------------------------------------------------------[ actions ]
|
944
|
-
const initApp = (
|
945
|
-
initApi(
|
951
|
+
const initApp = (platform) => {
|
952
|
+
initApi(platform);
|
946
953
|
clearStore();
|
947
954
|
// this retrieves the last data we stored in the bag...
|
948
955
|
const data = bag.get();
|
@@ -1196,10 +1203,10 @@ const ProtoSudoku = class {
|
|
1196
1203
|
constructor(hostRef) {
|
1197
1204
|
index.registerInstance(this, hostRef);
|
1198
1205
|
this.tag = 'proto-sudoku';
|
1199
|
-
this.
|
1206
|
+
this.platform = 'vercel';
|
1200
1207
|
}
|
1201
1208
|
componentDidLoad() {
|
1202
|
-
actions.initApp(this.
|
1209
|
+
actions.initApp(this.platform);
|
1203
1210
|
}
|
1204
1211
|
render() {
|
1205
1212
|
return (index.h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, index.h(Eswat2Io, null), index.h(Header, null, "Sudoku"), index.h(SudokuBoard, null), index.h(Keys, null), index.h("hr", { class: "ml-0 mr-0" }), index.h(ToolBar, null), index.h(Alerts, null)));
|
@@ -9,10 +9,10 @@ import { actions } from '../../utils';
|
|
9
9
|
export class ProtoSudoku {
|
10
10
|
constructor() {
|
11
11
|
this.tag = 'proto-sudoku';
|
12
|
-
this.
|
12
|
+
this.platform = 'vercel';
|
13
13
|
}
|
14
14
|
componentDidLoad() {
|
15
|
-
actions.initApp(this.
|
15
|
+
actions.initApp(this.platform);
|
16
16
|
}
|
17
17
|
render() {
|
18
18
|
return (h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, null), h(Header, null, "Sudoku"), h(SudokuBoard, null), h(Keys, null), h("hr", { class: "ml-0 mr-0" }), h(ToolBar, null), h(Alerts, null)));
|
@@ -49,12 +49,12 @@ export class ProtoSudoku {
|
|
49
49
|
"reflect": false,
|
50
50
|
"defaultValue": "'proto-sudoku'"
|
51
51
|
},
|
52
|
-
"
|
53
|
-
"type": "
|
52
|
+
"platform": {
|
53
|
+
"type": "string",
|
54
54
|
"mutable": false,
|
55
55
|
"complexType": {
|
56
|
-
"original": "
|
57
|
-
"resolved": "
|
56
|
+
"original": "string",
|
57
|
+
"resolved": "string",
|
58
58
|
"references": {}
|
59
59
|
},
|
60
60
|
"required": false,
|
@@ -63,9 +63,9 @@ export class ProtoSudoku {
|
|
63
63
|
"tags": [],
|
64
64
|
"text": ""
|
65
65
|
},
|
66
|
-
"attribute": "
|
66
|
+
"attribute": "platform",
|
67
67
|
"reflect": false,
|
68
|
-
"defaultValue": "
|
68
|
+
"defaultValue": "'vercel'"
|
69
69
|
}
|
70
70
|
};
|
71
71
|
}
|
@@ -137,10 +137,17 @@ const processPick = (next) => {
|
|
137
137
|
};
|
138
138
|
// --------------------------------------------------------[ utils ]
|
139
139
|
let api = undefined;
|
140
|
-
const
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
const platformPrefix = {
|
141
|
+
netlify: '/.netlify/functions',
|
142
|
+
vercel: 'https://sudoku-rust-api.vercel.app/api',
|
143
|
+
};
|
144
|
+
const getPrefixFor = (platform) => {
|
145
|
+
const keys = Object.keys(platformPrefix);
|
146
|
+
const target = keys.includes(platform) ? platform : 'vercel';
|
147
|
+
return platformPrefix[target];
|
148
|
+
};
|
149
|
+
const initApi = (platform) => {
|
150
|
+
const prefix = getPrefixFor(platform);
|
144
151
|
api = ky.extend({
|
145
152
|
hooks: {
|
146
153
|
beforeRequest: [
|
@@ -179,8 +186,8 @@ const updateStore = (data, save = true) => {
|
|
179
186
|
processData({ puzzle, ref });
|
180
187
|
};
|
181
188
|
// --------------------------------------------------------[ actions ]
|
182
|
-
const initApp = (
|
183
|
-
initApi(
|
189
|
+
const initApp = (platform) => {
|
190
|
+
initApi(platform);
|
184
191
|
clearStore();
|
185
192
|
// this retrieves the last data we stored in the bag...
|
186
193
|
const data = bag.get();
|
@@ -181,11 +181,6 @@ const convertToPrivate = (node) => {
|
|
181
181
|
const parsePropertyValue = (propValue, propType) => {
|
182
182
|
// ensure this value is of the correct prop type
|
183
183
|
if (propValue != null && !isComplexType(propValue)) {
|
184
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
185
|
-
// per the HTML spec, any string value means it is a boolean true value
|
186
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
187
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
188
|
-
}
|
189
184
|
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
190
185
|
// could have been passed as a number or boolean
|
191
186
|
// but we still want it as a string
|
package/dist/esm/loader.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-aa4026b4.js';
|
2
2
|
|
3
3
|
/*
|
4
4
|
Stencil Client Patch Esm v2.19.2 | MIT Licensed | https://stenciljs.com
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
12
12
|
return patchEsm().then(() => {
|
13
|
-
return bootstrapLazy([["proto-sudoku",[[1,"proto-sudoku",{"tag":[1],"
|
13
|
+
return bootstrapLazy([["proto-sudoku",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
14
14
|
});
|
15
15
|
};
|
16
16
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-aa4026b4.js';
|
2
2
|
|
3
3
|
/*
|
4
4
|
Stencil Client Patch Browser v2.19.2 | MIT Licensed | https://stenciljs.com
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
13
13
|
};
|
14
14
|
|
15
15
|
patchBrowser().then(options => {
|
16
|
-
return bootstrapLazy([["proto-sudoku",[[1,"proto-sudoku",{"tag":[1],"
|
16
|
+
return bootstrapLazy([["proto-sudoku",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
17
17
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-
|
1
|
+
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-aa4026b4.js';
|
2
2
|
|
3
3
|
const Alien = props => {
|
4
4
|
const hex = props.hex || 'currentColor';
|
@@ -895,10 +895,17 @@ const processPick = (next) => {
|
|
895
895
|
};
|
896
896
|
// --------------------------------------------------------[ utils ]
|
897
897
|
let api = undefined;
|
898
|
-
const
|
899
|
-
|
900
|
-
|
901
|
-
|
898
|
+
const platformPrefix = {
|
899
|
+
netlify: '/.netlify/functions',
|
900
|
+
vercel: 'https://sudoku-rust-api.vercel.app/api',
|
901
|
+
};
|
902
|
+
const getPrefixFor = (platform) => {
|
903
|
+
const keys = Object.keys(platformPrefix);
|
904
|
+
const target = keys.includes(platform) ? platform : 'vercel';
|
905
|
+
return platformPrefix[target];
|
906
|
+
};
|
907
|
+
const initApi = (platform) => {
|
908
|
+
const prefix = getPrefixFor(platform);
|
902
909
|
api = ky.extend({
|
903
910
|
hooks: {
|
904
911
|
beforeRequest: [
|
@@ -937,8 +944,8 @@ const updateStore = (data, save = true) => {
|
|
937
944
|
processData({ puzzle, ref });
|
938
945
|
};
|
939
946
|
// --------------------------------------------------------[ actions ]
|
940
|
-
const initApp = (
|
941
|
-
initApi(
|
947
|
+
const initApp = (platform) => {
|
948
|
+
initApi(platform);
|
942
949
|
clearStore();
|
943
950
|
// this retrieves the last data we stored in the bag...
|
944
951
|
const data = bag.get();
|
@@ -1192,10 +1199,10 @@ const ProtoSudoku = class {
|
|
1192
1199
|
constructor(hostRef) {
|
1193
1200
|
registerInstance(this, hostRef);
|
1194
1201
|
this.tag = 'proto-sudoku';
|
1195
|
-
this.
|
1202
|
+
this.platform = 'vercel';
|
1196
1203
|
}
|
1197
1204
|
componentDidLoad() {
|
1198
|
-
actions.initApp(this.
|
1205
|
+
actions.initApp(this.platform);
|
1199
1206
|
}
|
1200
1207
|
render() {
|
1201
1208
|
return (h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, null), h(Header, null, "Sudoku"), h(SudokuBoard, null), h(Keys, null), h("hr", { class: "ml-0 mr-0" }), h(ToolBar, null), h(Alerts, null)));
|
@@ -0,0 +1,2 @@
|
|
1
|
+
let t,e,n=!1,l=null,o=!1;const s={},r=t=>"object"==(t=typeof t)||"function"===t,c=(t,e,...n)=>{let l=null,o=!1,s=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!r(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?i(null,l):l),s=o)};if(u(n),e){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,c,a);const f=i(t,null);return f.l=e,c.length>0&&(f.o=c),f},i=(t,e)=>({i:0,u:t,t:e,h:null,o:null,l:null}),u={},a={forEach:(t,e)=>t.map(f).forEach(e),map:(t,e)=>t.map(f).map(e).map(h)},f=t=>({vattrs:t.l,vchildren:t.o,vkey:t.p,vname:t.$,vtag:t.u,vtext:t.t}),h=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),c(t.vtag,e,...t.vchildren||[])}const e=i(t.vtag,t.vtext);return e.l=t.vattrs,e.o=t.vchildren,e.p=t.vkey,e.$=t.vname,e},p=new WeakMap,y=t=>"sc-"+t.m,$=(t,e,n,l,o,s)=>{if(n!==l){let c=_(t,e),i=e.toLowerCase();if("class"===e){const e=t.classList,o=m(n),s=m(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("ref"===e)l&&l(t);else if(c||"o"!==e[0]||"n"!==e[1]){const i=r(l);if((c||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[e]=l;else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]==o||(t[e]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&s||o)&&!i&&t.setAttribute(e,l=!0===l?"":l)}else e="-"===e[2]?e.slice(3):_(J,i)?i.slice(2):i[2]+e.slice(3),n&&Q.rel(t,e,n,!1),l&&Q.ael(t,e,l,!1)}},d=/\s/,m=t=>t?t.split(d):[],w=(t,e,n,l)=>{const o=11===e.h.nodeType&&e.h.host?e.h.host:e.h,r=t&&t.l||s,c=e.l||s;for(l in r)l in c||$(o,l,r[l],void 0,n,e.i);for(l in c)$(o,l,r[l],c[l],n,e.i)},b=(e,l,o)=>{const s=l.o[o];let r,c,i=0;if(null!==s.t)r=s.h=K.createTextNode(s.t);else{if(n||(n="svg"===s.u),r=s.h=K.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),n&&"foreignObject"===s.u&&(n=!1),w(null,s,n),null!=t&&r["s-si"]!==t&&r.classList.add(r["s-si"]=t),s.o)for(i=0;i<s.o.length;++i)c=b(e,s,i),c&&r.appendChild(c);"svg"===s.u?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},g=(t,n,l,o,s,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===e&&(i=i.shadowRoot);s<=r;++s)o[s]&&(c=b(null,l,s),c&&(o[s].h=c,i.insertBefore(c,n)))},v=(t,e,n,l,o)=>{for(;e<=n;++e)(l=t[e])&&(o=l.h,O(l),o.remove())},j=(t,e)=>t.u===e.u,S=(t,e)=>{const l=e.h=t.h,o=t.o,s=e.o,r=e.u,c=e.t;null===c?(n="svg"===r||"foreignObject"!==r&&n,w(t,e,n),null!==o&&null!==s?((t,e,n,l)=>{let o,s=0,r=0,c=e.length-1,i=e[0],u=e[c],a=l.length-1,f=l[0],h=l[a];for(;s<=c&&r<=a;)null==i?i=e[++s]:null==u?u=e[--c]:null==f?f=l[++r]:null==h?h=l[--a]:j(i,f)?(S(i,f),i=e[++s],f=l[++r]):j(u,h)?(S(u,h),u=e[--c],h=l[--a]):j(i,h)?(S(i,h),t.insertBefore(i.h,u.h.nextSibling),i=e[++s],h=l[--a]):j(u,f)?(S(u,f),t.insertBefore(u.h,i.h),u=e[--c],f=l[++r]):(o=b(e&&e[r],n,r),f=l[++r],o&&i.h.parentNode.insertBefore(o,i.h));s>c?g(t,null==l[a+1]?null:l[a+1].h,n,l,r,a):r>a&&v(e,s,c)})(l,o,e,s):null!==s?(null!==t.t&&(l.textContent=""),g(l,null,e,s,0,s.length-1)):null!==o&&v(o,0,o.length-1),n&&"svg"===r&&(n=!1)):t.t!==c&&(l.data=c)},O=t=>{t.l&&t.l.ref&&t.l.ref(null),t.o&&t.o.map(O)},k=(t,e)=>{e&&!t.g&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.g=e)))},M=(t,e)=>{if(t.i|=16,!(4&t.i))return k(t,t.v),st((()=>C(t,e)));t.i|=512},C=(t,e)=>{const n=t.j;return R(void 0,(()=>x(t,n,e)))},x=async(t,e,n)=>{const l=t.S,o=l["s-rc"];n&&(t=>{const e=t.O,n=t.S,l=e.i,o=((t,e)=>{let n=y(e);const l=I.get(n);if(t=11===t.nodeType?t:K,l)if("string"==typeof l){let e,o=p.get(t=t.head||t);o||p.set(t,o=new Set),o.has(n)||(e=K.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);E(t,e),o&&(o.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>L(t);0===e.length?n():(Promise.all(e).then(n),t.i|=4,e.length=0)}},E=(n,o)=>{try{l=o,o=o.render(),n.i&=-17,n.i|=2,((n,l)=>{const o=n.S,s=n.k||i(null,null),r=(t=>t&&t.u===u)(l)?l:c(null,null,l);e=o.tagName,r.u=null,r.i|=4,n.k=r,r.h=s.h=o.shadowRoot||o,t=o["s-sc"],S(s,r)})(n,o)}catch(t){z(t,n.S)}return l=null,null},P=()=>l,L=t=>{const e=t.S,n=t.j,l=t.v;64&t.i||(t.i|=64,U(e),A(n,"componentDidLoad"),t.M(e),l||T()),t.g&&(t.g(),t.g=void 0),512&t.i&&ot((()=>M(t,!1))),t.i&=-517},N=t=>{{const e=F(t),n=e.S.isConnected;return n&&2==(18&e.i)&&M(e,!1),n}},T=()=>{U(K.documentElement),ot((()=>(t=>{const e=Q.ce("appload",{detail:{namespace:"proto-sudoku-wc"}});return t.dispatchEvent(e),e})(J)))},A=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){z(t)}},R=(t,e)=>t&&t.then?t.then(e):e(),U=t=>t.classList.add("hydrated"),W=(t,e,n)=>{if(e.C){const l=Object.entries(e.C),o=t.prototype;if(l.map((([t,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,t,{get(){return((t,e)=>F(this).P.get(e))(0,t)},set(n){((t,e,n,l)=>{const o=F(t),s=o.P.get(e),c=o.i,i=o.j;n=((t,e)=>null==t||r(t)?t:1&e?t+"":t)(n,l.C[e][0]),8&c&&void 0!==s||n===s||Number.isNaN(s)&&Number.isNaN(n)||(o.P.set(e,n),i&&2==(18&c)&&M(o,!1))})(this,t,n,e)},configurable:!0,enumerable:!0})})),1&n){const e=new Map;o.attributeChangedCallback=function(t,n,l){Q.jmp((()=>{const n=e.get(t);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},t.observedAttributes=l.filter((([t,e])=>15&e[0])).map((([t,n])=>{const l=n[1]||t;return e.set(l,t),l}))}}return t},q=(t,e={})=>{const n=[],l=e.exclude||[],o=J.customElements,s=K.head,r=s.querySelector("meta[charset]"),c=K.createElement("style"),i=[];let u,a=!0;Object.assign(Q,e),Q.L=new URL(e.resourcesUrl||"./",K.baseURI).href,t.map((t=>{t[1].map((e=>{const s={i:e[0],m:e[1],C:e[2],N:e[3]};s.C=e[2];const r=s.m,c=class extends HTMLElement{constructor(t){super(t),V(t=this,s),1&s.i&&t.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):Q.jmp((()=>(t=>{if(0==(1&Q.i)){const e=F(t),n=e.O,l=()=>{};if(!(1&e.i)){e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(e,e.v=n);break}}n.C&&Object.entries(n.C).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,o)=>{if(0==(32&e.i)){{if(e.i|=32,(o=G(n)).then){const t=()=>{};o=await o,t()}o.isProxied||(W(o,n,2),o.isProxied=!0);const t=()=>{};e.i|=8;try{new o(e)}catch(t){z(t)}e.i&=-9,t()}if(o.style){let t=o.style;const e=y(n);if(!I.has(e)){const l=()=>{};((t,e,n)=>{let l=I.get(t);Y&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,I.set(t,l)})(e,t,!!(1&n.i)),l()}}}const s=e.v,r=()=>M(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,e,n)}l()}})(this)))}disconnectedCallback(){Q.jmp((()=>{}))}componentOnReady(){return F(this).T}};s.A=t[0],l.includes(r)||o.get(r)||(n.push(r),o.define(r,W(c,s,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),s.insertBefore(c,r?r.nextSibling:s.firstChild),a=!1,i.length?i.map((t=>t.connectedCallback())):Q.jmp((()=>u=setTimeout(T,30)))},D=new WeakMap,F=t=>D.get(t),H=(t,e)=>D.set(e.j=t,e),V=(t,e)=>{const n={i:0,S:t,O:e,P:new Map};return n.T=new Promise((t=>n.M=t)),t["s-p"]=[],t["s-rc"]=[],D.set(t,n)},_=(t,e)=>e in t,z=(t,e)=>(0,console.error)(t,e),B=new Map,G=t=>{const e=t.m.replace(/-/g,"_"),n=t.A,l=B.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(B.set(n,t),t[e])),z)
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},I=new Map,J="undefined"!=typeof window?window:{},K=J.document||{head:{}},Q={i:0,L:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},X=t=>Promise.resolve(t),Y=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),Z=[],tt=[],et=(t,e)=>n=>{t.push(n),o||(o=!0,e&&4&Q.i?ot(lt):Q.raf(lt))},nt=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){z(t)}t.length=0},lt=()=>{nt(Z),nt(tt),(o=Z.length>0)&&Q.raf(lt)},ot=t=>X().then(t),st=et(tt,!0);export{q as b,N as f,P as g,c as h,X as p,H as r}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{h as t,g as e,f as r,r as o}from"./p-68909a5a.js";const s=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",a=`${n}::data`,i=`${n}::inputs`,l=`${n}::pick`,c=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},d=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...c(i)],f=t=>{d(i,t.join(""))},u=()=>{const t=c(l);return null!==t?t:void 0},p=t=>{d(l,t>=0&&t<81?t:null)},b=t=>!("isConnected"in t)||t.isConnected,w=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(b))})(...e)}),2e3)}})(),g=t=>"function"==typeof t?t():t;class m extends Error{constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(o?`status code ${o}`:"an unknown error")),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class y extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}}const x=t=>null!==t&&"object"==typeof t,v=(...t)=>{for(const e of t)if((!x(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return k({},...t)},C=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[t,e]of s.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},k=(...t)=>{let e={},r={};for(const o of t)if(Array.isArray(o))Array.isArray(e)||(e=[]),e=[...e,...o];else if(x(o)){for(let[t,r]of Object.entries(o))x(r)&&t in e&&(r=k(e[t],r)),e={...e,[t]:r};x(o.headers)&&(r=C(r,o.headers),e.headers=r)}return e},T=(()=>{let t=!1,e=!1;return"function"==typeof globalThis.ReadableStream&&(e=new globalThis.Request("https://a.com",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),j="function"==typeof globalThis.AbortController,M="function"==typeof globalThis.ReadableStream,z="function"==typeof globalThis.FormData,R=["get","post","put","patch","head","delete"],S={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},O=Symbol("stop"),A=t=>R.includes(t)?t.toUpperCase():t,E=[413,429,503],P={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:E,maxRetryAfter:Number.POSITIVE_INFINITY},U=(t={})=>{if("number"==typeof t)return{...P,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...P,...t,afterStatusCodes:E}},B=globalThis.DOMException??Error;function N(t){return new B(t?.reason??"The operation was aborted.")}class q{constructor(t,e={}){if(Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:C(this._input.headers,e.headers),hooks:k({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:A(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:U(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:e.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(j){if(this.abortController=new globalThis.AbortController,this._options.signal){const t=this._options.signal;this._options.signal.addEventListener("abort",(()=>{this.abortController.abort(t.reason)}))}this._options.signal=this.abortController.signal}if(this.request=new globalThis.Request(this._input,this._options),T&&(this.request.duplex="half"),this._options.searchParams){const t="string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);!(z&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}static create(t,e){const r=new q(t,e),o=async()=>{if(r._options.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r._fetch();for(const e of r._options.hooks.afterResponse){const o=await e(r.request,r._options,r._decorateResponse(t.clone()));o instanceof globalThis.Response&&(t=o)}if(r._decorateResponse(t),!t.ok&&r._options.throwHttpErrors){let e=new m(t,r.request,r._options);for(const t of r._options.hooks.beforeError)e=await t(e);throw e}if(r._options.onDownloadProgress){if("function"!=typeof r._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!M)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(t.clone(),r._options.onDownloadProgress)}return t},s=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(const[t,o]of Object.entries(S))s[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const n=(await s).clone();if("json"===t){if(204===n.status)return"";if(0===(await n.clone().arrayBuffer()).byteLength)return"";if(e.parseJson)return e.parseJson(await n.text())}return n[t]()};return s}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof y)){if(t instanceof m){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),2147483647);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{if(e){if(e.aborted)return void o(N(e));e.addEventListener("abort",s,{once:!0})}function s(){o(N(e)),clearTimeout(n)}const n=setTimeout((()=>{e?.removeEventListener("abort",s),r()}),t)}))}(r,{signal:this._options.signal});for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===O)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):async function(t,e,r){return new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new y(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))}))}(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return 204===t.status?(e&&e({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await async function t(){const{done:a,value:i}=await n.read();a?s.close():(e&&(o+=i.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},i)),s.enqueue(i),await t())}()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}}
|
2
|
+
/*! MIT License © Sindre Sorhus */const _=t=>{const e=(e,r)=>q.create(e,v(t,r));for(const r of R)e[r]=(e,o)=>q.create(e,v(t,o,{method:r}));return e.create=t=>_(v(t)),e.extend=e=>_(v(t,e)),e.stop=O,e},H=_(),$={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:D}=(()=>{const t=((t,e=((t,e)=>t!==e))=>{const r=g(t);let o=new Map(Object.entries(null!=r?r:{}));const s={dispose:[],get:[],set:[],reset:[]},n=()=>{var e;o=new Map(Object.entries(null!==(e=g(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},a=t=>(s.get.forEach((e=>e(t))),o.get(t)),i=(t,r)=>{const n=o.get(t);e(r,n,t)&&(o.set(t,r),s.set.forEach((e=>e(t,r,n))))},l="undefined"==typeof Proxy?{}:new Proxy(r,{get:(t,e)=>a(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,r)=>(i(e,r),!0)}),c=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)})(s[t],e)});return{state:l,get:a,set:i,on:c,onChange:(e,r)=>{const o=c("set",((t,o)=>{t===e&&r(o)})),s=c("reset",(()=>r(g(t)[e])));return()=>{o(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{s.dispose.forEach((t=>t())),n()},reset:n,forceUpdate:t=>{const e=o.get(t);s.set.forEach((r=>r(t,e,e)))}}})($,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((t,e,r)=>{const o=t.get(e);o?o.includes(r)||o.push(r):t.set(e,[r])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),w(t)},reset:()=>{t.forEach((t=>t.forEach(r))),w(t)}}})()),t})(),L=new Map([["row",new Map],["column",new Map],["box",new Map]]),I=["1","2","3","4","5","6","7","8","9"],J=t=>{if(void 0!==t&&t.indx!=D.pick){const{isClue:e,indx:r,row:o,column:s,box:n}=t,a=((t,e,r,o)=>{const s=new Map([["row",e],["column",r],["box",o]]),n=new Set;return s.forEach(((e,r)=>{L.get(r).get(e).forEach((e=>{e!==t&&n.add(e)}))})),Array.from(n)})(r,o,s,n),i=e?[]:(t=>{const{list:e}=D,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),I.filter((t=>!r.has(t)))})(a);D.pick=r,D.keys=i,D.locs=a}else D.pick=void 0,D.keys=[],D.locs=[];F(D.pick)};let W;const X={netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},Z=t=>{f(t)},F=t=>{p(t)},K=(t=!1)=>{D.list=[],D.keys=[],D.locs=[],D.loading=t,D.solved=!1,D.error=void 0,D.pick=void 0,D.data=void 0},V=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),d(a,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],s=r?atob(r):void 0,n=s?[...s]:[],a=o.map(((t,e)=>{const r=n[e],o=t===r,s=Math.floor(e/9),a=e%9,i=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(s,a);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=L.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,s,a,i),{key:t,isClue:o,value:r,indx:e,row:s,column:a,box:i}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:s}=o;s||(o.key=e)}))})(a),D.data=t,D.list=a}else D.data=void 0,D.list=[]})({puzzle:r,ref:o})},Y=t=>{D.list=[...t],t.length=0},G={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(X).includes(t)?t:"vercel";return X[e]})(t);W=H.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),K();const e=c(a),r=u();if(e&&(V(e,!1),r>=0)){const{list:t}=D;J(t[r])}},refresh:async()=>{K(!0),Z([]),F(D.pick);try{const t=await W.get("puzzle").json();V(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),D.error=e}finally{D.loading=!1}},select:t=>{J(t)},check:()=>{const{list:t}=D,e=[];let r=0,o=0,s=0;t.forEach((t=>{const{key:n,value:a,isClue:i}=t;i?s+=1:"."!==n&&(n!==a?(r+=1,t.key="."):o+=1),e.push(t.key)}));const n=s+o;Z(o?e:[]),r>0?Y(t):81===n&&(D.solved=!0)},input:t=>{const{pick:e,list:r}=D;r[e].key=t,Y(r)}},Q=(...t)=>t.filter(Boolean).join(" "),tt=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",s=e.size||24;return t("svg",{class:Q(e.class||"","animate-spin"),width:s,height:s,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},et=e=>{const{message:r,salute:o,spinner:n=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(n?tt:s,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},r))},rt=()=>{const{solved:e,loading:r,error:o}=D;return t("div",{class:"flex flex-col"},r||o||e?"":t(et,{message:"Welcome, are you ready to play?..."}),r?t(et,{message:"Loading...",spinner:!0}):"",o?t(et,{message:o,salute:"ERROR"}):"",e?t(et,{message:"You solved the puzzle!!"}):"")},ot=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},st="eswat2",nt=()=>t("a",{class:"absolute top-0 right-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":st,title:st},t(ot,{label:st})),at=(e,r)=>t("h1",{class:Q("text-center uppercase text-clrs-red","mr-0 ml-0 mt-11 mb-11","text-6xl font-thin")},r),it=e=>{const{label:r,callback:o,matched:s=!1}=e;return t("button",{class:Q("rounded-md border border-solid border-clrs-slate4 font-bold","Check ?"===r?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":"New Puzzle"===r?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":s?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},lt=()=>{const{keys:e,list:r,pick:o,solved:s}=D,n=t=>()=>{G.input(t)},a=s?[]:e,i=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},s||!i||i.isClue||"."==i.key?"":t(it,{label:"x",callback:n(".")}),a.map((e=>t(it,{label:e,callback:n(e),matched:i.key===e}))))},ct=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],dt=ct.map((t=>t+1)),ht=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],ft=ht.map((t=>t+9)),ut=e=>{const{cell:r,selected:o,ref:s,solved:n}=e,{key:a,isClue:i,indx:l}=r,c="."!=a?a:"";return t("label",{class:Q(`cell-${l}`,ct.includes(l)?"border-xbr-clrs-navy":"",dt.includes(l)?"border-xbl-clrs-navy":"",ht.includes(l)?"border-xbb-clrs-navy":"",ft.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",o?"border-clrs-red bg-clrs-red-a50 text-clrs-red":s?"border-clrs-gray bg-clrs-green-a50 font-bold":i?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||G.select(t)})(r,n)},c)},pt=()=>{const{list:e,pick:r,locs:o,solved:s}=D;return t("div",{class:Q("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,n)=>{const a=!s&&n===r,i=!s&&o.includes(n);return t(ut,{cell:e,selected:a,ref:i,solved:s})})))},bt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.2.2"),wt=t=>()=>{t.refresh()},gt=t=>()=>{t.check()},mt=()=>{const{list:e,solved:r}=D;return t("div",{class:"flex flex-row"},t(it,{label:"New Puzzle",callback:wt(G)}),81!==e.length||r?"":t(it,{label:"Check ?",callback:gt(G)}),t(bt,null))},yt=class{constructor(t){o(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){G.initApp(this.platform)}render(){return t("div",{id:"app",class:"ds1-main relative max-w-min p-0.5"},t(nt,null),t(at,null,"Sudoku"),t(pt,null),t(lt,null),t("hr",{class:"ml-0 mr-0"}),t(mt,null),t(rt,null))}};yt.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.top-0{top:0px}.right-0{right:0px}.mt-5{margin-top:1.25rem}.mr-2{margin-right:0.5rem}.mr-1{margin-right:0.25rem}.mr-0{margin-right:0px}.ml-0{margin-left:0px}.mt-11{margin-top:2.75rem}.mb-11{margin-bottom:2.75rem}.mt-2{margin-top:0.5rem}.ml-auto{margin-left:auto}.flex{display:flex}.h-24px{height:24px}.h-8{height:2rem}.h-76p5{height:19.125rem}.w-8{width:2rem}.w-76p5{width:19.125rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.p-0\\.5{padding:0.125rem}.p-0{padding:0px}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";export{yt as proto_sudoku}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as o,b as
|
1
|
+
import{p as o,b as p}from"./p-68909a5a.js";(()=>{const p=import.meta.url,r={};return""!==p&&(r.resourcesUrl=new URL(".",p).href),o(r)})().then((o=>p([["p-9d4cc381",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],o)));
|
@@ -7,7 +7,7 @@
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
8
8
|
export namespace Components {
|
9
9
|
interface ProtoSudoku {
|
10
|
-
"
|
10
|
+
"platform": string;
|
11
11
|
"tag": string;
|
12
12
|
}
|
13
13
|
}
|
@@ -24,7 +24,7 @@ declare global {
|
|
24
24
|
}
|
25
25
|
declare namespace LocalJSX {
|
26
26
|
interface ProtoSudoku {
|
27
|
-
"
|
27
|
+
"platform"?: string;
|
28
28
|
"tag"?: string;
|
29
29
|
}
|
30
30
|
interface IntrinsicElements {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { AppStore, PuzzleCell } from './types';
|
2
2
|
declare const state: AppStore;
|
3
3
|
declare const actions: {
|
4
|
-
initApp: (
|
4
|
+
initApp: (platform: string) => void;
|
5
5
|
refresh: () => Promise<void>;
|
6
6
|
select: (cell: PuzzleCell) => void;
|
7
7
|
check: () => void;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "proto-sudoku-wc",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.508",
|
4
4
|
"description": "prototype - a simple Sudoku app rendered in Stencil and Tailwind",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"concurrently": "7.5.0",
|
43
43
|
"cspell": "6.14.0",
|
44
44
|
"cssnano": "5.1.14",
|
45
|
-
"eslint": "8.
|
45
|
+
"eslint": "8.27.0",
|
46
46
|
"jest": "29.2.2",
|
47
47
|
"postcss": "8.4.18",
|
48
48
|
"prettier": "2.7.1",
|
@@ -1,2 +0,0 @@
|
|
1
|
-
let t,e,n=!1,l=null,s=!1;const o={},r=t=>"object"==(t=typeof t)||"function"===t,c=(t,e,...n)=>{let l=null,s=!1,o=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!r(l))&&(l+=""),s&&o?c[c.length-1].t+=l:c.push(s?i(null,l):l),o=s)};if(u(n),e){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,c,a);const f=i(t,null);return f.l=e,c.length>0&&(f.o=c),f},i=(t,e)=>({i:0,u:t,t:e,h:null,o:null,l:null}),u={},a={forEach:(t,e)=>t.map(f).forEach(e),map:(t,e)=>t.map(f).map(e).map(h)},f=t=>({vattrs:t.l,vchildren:t.o,vkey:t.p,vname:t.$,vtag:t.u,vtext:t.t}),h=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),c(t.vtag,e,...t.vchildren||[])}const e=i(t.vtag,t.vtext);return e.l=t.vattrs,e.o=t.vchildren,e.p=t.vkey,e.$=t.vname,e},p=new WeakMap,y=t=>"sc-"+t.m,$=(t,e,n,l,s,o)=>{if(n!==l){let c=_(t,e),i=e.toLowerCase();if("class"===e){const e=t.classList,s=m(n),o=m(l);e.remove(...s.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!s.includes(t))))}else if("ref"===e)l&&l(t);else if(c||"o"!==e[0]||"n"!==e[1]){const i=r(l);if((c||i&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]=l;else{const s=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]==s||(t[e]=s)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&o||s)&&!i&&t.setAttribute(e,l=!0===l?"":l)}else e="-"===e[2]?e.slice(3):_(J,i)?i.slice(2):i[2]+e.slice(3),n&&Q.rel(t,e,n,!1),l&&Q.ael(t,e,l,!1)}},d=/\s/,m=t=>t?t.split(d):[],w=(t,e,n,l)=>{const s=11===e.h.nodeType&&e.h.host?e.h.host:e.h,r=t&&t.l||o,c=e.l||o;for(l in r)l in c||$(s,l,r[l],void 0,n,e.i);for(l in c)$(s,l,r[l],c[l],n,e.i)},b=(e,l,s)=>{const o=l.o[s];let r,c,i=0;if(null!==o.t)r=o.h=K.createTextNode(o.t);else{if(n||(n="svg"===o.u),r=o.h=K.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.u),n&&"foreignObject"===o.u&&(n=!1),w(null,o,n),null!=t&&r["s-si"]!==t&&r.classList.add(r["s-si"]=t),o.o)for(i=0;i<o.o.length;++i)c=b(e,o,i),c&&r.appendChild(c);"svg"===o.u?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},g=(t,n,l,s,o,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===e&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=b(null,l,o),c&&(s[o].h=c,i.insertBefore(c,n)))},v=(t,e,n,l,s)=>{for(;e<=n;++e)(l=t[e])&&(s=l.h,O(l),s.remove())},j=(t,e)=>t.u===e.u,S=(t,e)=>{const l=e.h=t.h,s=t.o,o=e.o,r=e.u,c=e.t;null===c?(n="svg"===r||"foreignObject"!==r&&n,w(t,e,n),null!==s&&null!==o?((t,e,n,l)=>{let s,o=0,r=0,c=e.length-1,i=e[0],u=e[c],a=l.length-1,f=l[0],h=l[a];for(;o<=c&&r<=a;)null==i?i=e[++o]:null==u?u=e[--c]:null==f?f=l[++r]:null==h?h=l[--a]:j(i,f)?(S(i,f),i=e[++o],f=l[++r]):j(u,h)?(S(u,h),u=e[--c],h=l[--a]):j(i,h)?(S(i,h),t.insertBefore(i.h,u.h.nextSibling),i=e[++o],h=l[--a]):j(u,f)?(S(u,f),t.insertBefore(u.h,i.h),u=e[--c],f=l[++r]):(s=b(e&&e[r],n,r),f=l[++r],s&&i.h.parentNode.insertBefore(s,i.h));o>c?g(t,null==l[a+1]?null:l[a+1].h,n,l,r,a):r>a&&v(e,o,c)})(l,s,e,o):null!==o?(null!==t.t&&(l.textContent=""),g(l,null,e,o,0,o.length-1)):null!==s&&v(s,0,s.length-1),n&&"svg"===r&&(n=!1)):t.t!==c&&(l.data=c)},O=t=>{t.l&&t.l.ref&&t.l.ref(null),t.o&&t.o.map(O)},k=(t,e)=>{e&&!t.g&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.g=e)))},M=(t,e)=>{if(t.i|=16,!(4&t.i))return k(t,t.v),ot((()=>C(t,e)));t.i|=512},C=(t,e)=>{const n=t.j;return R(void 0,(()=>x(t,n,e)))},x=async(t,e,n)=>{const l=t.S,s=l["s-rc"];n&&(t=>{const e=t.O,n=t.S,l=e.i,s=((t,e)=>{let n=y(e);const l=I.get(n);if(t=11===t.nodeType?t:K,l)if("string"==typeof l){let e,s=p.get(t=t.head||t);s||p.set(t,s=new Set),s.has(n)||(e=K.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),s&&s.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);E(t,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>L(t);0===e.length?n():(Promise.all(e).then(n),t.i|=4,e.length=0)}},E=(n,s)=>{try{l=s,s=s.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.S,o=n.k||i(null,null),r=(t=>t&&t.u===u)(l)?l:c(null,null,l);e=s.tagName,r.u=null,r.i|=4,n.k=r,r.h=o.h=s.shadowRoot||s,t=s["s-sc"],S(o,r)})(n,s)}catch(t){z(t,n.S)}return l=null,null},P=()=>l,L=t=>{const e=t.S,n=t.j,l=t.v;64&t.i||(t.i|=64,U(e),A(n,"componentDidLoad"),t.M(e),l||T()),t.g&&(t.g(),t.g=void 0),512&t.i&&st((()=>M(t,!1))),t.i&=-517},N=t=>{{const e=F(t),n=e.S.isConnected;return n&&2==(18&e.i)&&M(e,!1),n}},T=()=>{U(K.documentElement),st((()=>(t=>{const e=Q.ce("appload",{detail:{namespace:"proto-sudoku-wc"}});return t.dispatchEvent(e),e})(J)))},A=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){z(t)}},R=(t,e)=>t&&t.then?t.then(e):e(),U=t=>t.classList.add("hydrated"),W=(t,e,n)=>{if(e.C){const l=Object.entries(e.C),s=t.prototype;if(l.map((([t,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,t,{get(){return((t,e)=>F(this).P.get(e))(0,t)},set(n){((t,e,n,l)=>{const s=F(t),o=s.P.get(e),c=s.i,i=s.j;n=((t,e)=>null==t||r(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t)(n,l.C[e][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.P.set(e,n),i&&2==(18&c)&&M(s,!1))})(this,t,n,e)},configurable:!0,enumerable:!0})})),1&n){const e=new Map;s.attributeChangedCallback=function(t,n,l){Q.jmp((()=>{const n=e.get(t);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},t.observedAttributes=l.filter((([t,e])=>15&e[0])).map((([t,n])=>{const l=n[1]||t;return e.set(l,t),l}))}}return t},q=(t,e={})=>{const n=[],l=e.exclude||[],s=J.customElements,o=K.head,r=o.querySelector("meta[charset]"),c=K.createElement("style"),i=[];let u,a=!0;Object.assign(Q,e),Q.L=new URL(e.resourcesUrl||"./",K.baseURI).href,t.map((t=>{t[1].map((e=>{const o={i:e[0],m:e[1],C:e[2],N:e[3]};o.C=e[2];const r=o.m,c=class extends HTMLElement{constructor(t){super(t),V(t=this,o),1&o.i&&t.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):Q.jmp((()=>(t=>{if(0==(1&Q.i)){const e=F(t),n=e.O,l=()=>{};if(!(1&e.i)){e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(e,e.v=n);break}}n.C&&Object.entries(n.C).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,s)=>{if(0==(32&e.i)){{if(e.i|=32,(s=G(n)).then){const t=()=>{};s=await s,t()}s.isProxied||(W(s,n,2),s.isProxied=!0);const t=()=>{};e.i|=8;try{new s(e)}catch(t){z(t)}e.i&=-9,t()}if(s.style){let t=s.style;const e=y(n);if(!I.has(e)){const l=()=>{};((t,e,n)=>{let l=I.get(t);Y&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,I.set(t,l)})(e,t,!!(1&n.i)),l()}}}const o=e.v,r=()=>M(e,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,e,n)}l()}})(this)))}disconnectedCallback(){Q.jmp((()=>{}))}componentOnReady(){return F(this).T}};o.A=t[0],l.includes(r)||s.get(r)||(n.push(r),s.define(r,W(c,o,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),o.insertBefore(c,r?r.nextSibling:o.firstChild),a=!1,i.length?i.map((t=>t.connectedCallback())):Q.jmp((()=>u=setTimeout(T,30)))},D=new WeakMap,F=t=>D.get(t),H=(t,e)=>D.set(e.j=t,e),V=(t,e)=>{const n={i:0,S:t,O:e,P:new Map};return n.T=new Promise((t=>n.M=t)),t["s-p"]=[],t["s-rc"]=[],D.set(t,n)},_=(t,e)=>e in t,z=(t,e)=>(0,console.error)(t,e),B=new Map,G=t=>{const e=t.m.replace(/-/g,"_"),n=t.A,l=B.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(B.set(n,t),t[e])),z)
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},I=new Map,J="undefined"!=typeof window?window:{},K=J.document||{head:{}},Q={i:0,L:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},X=t=>Promise.resolve(t),Y=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),Z=[],tt=[],et=(t,e)=>n=>{t.push(n),s||(s=!0,e&&4&Q.i?st(lt):Q.raf(lt))},nt=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){z(t)}t.length=0},lt=()=>{nt(Z),nt(tt),(s=Z.length>0)&&Q.raf(lt)},st=t=>X().then(t),ot=et(tt,!0);export{q as b,N as f,P as g,c as h,X as p,H as r}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{h as t,g as e,f as r,r as o}from"./p-802920ff.js";const s=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",a=`${n}::data`,i=`${n}::inputs`,l=`${n}::pick`,c=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},d=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...c(i)],f=t=>{d(i,t.join(""))},u=()=>{const t=c(l);return null!==t?t:void 0},p=t=>{d(l,t>=0&&t<81?t:null)},b=t=>!("isConnected"in t)||t.isConnected,w=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(b))})(...e)}),2e3)}})(),g=t=>"function"==typeof t?t():t;class m extends Error{constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(o?`status code ${o}`:"an unknown error")),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class y extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}}const x=t=>null!==t&&"object"==typeof t,v=(...t)=>{for(const e of t)if((!x(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return k({},...t)},C=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[t,e]of s.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},k=(...t)=>{let e={},r={};for(const o of t)if(Array.isArray(o))Array.isArray(e)||(e=[]),e=[...e,...o];else if(x(o)){for(let[t,r]of Object.entries(o))x(r)&&t in e&&(r=k(e[t],r)),e={...e,[t]:r};x(o.headers)&&(r=C(r,o.headers),e.headers=r)}return e},T=(()=>{let t=!1,e=!1;return"function"==typeof globalThis.ReadableStream&&(e=new globalThis.Request("https://a.com",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),j="function"==typeof globalThis.AbortController,M="function"==typeof globalThis.ReadableStream,z="function"==typeof globalThis.FormData,R=["get","post","put","patch","head","delete"],S={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},A=Symbol("stop"),E=t=>R.includes(t)?t.toUpperCase():t,O=[413,429,503],P={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:O,maxRetryAfter:Number.POSITIVE_INFINITY},U=(t={})=>{if("number"==typeof t)return{...P,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...P,...t,afterStatusCodes:O}},B=globalThis.DOMException??Error;function N(t){return new B(t?.reason??"The operation was aborted.")}class q{constructor(t,e={}){if(Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:C(this._input.headers,e.headers),hooks:k({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:E(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:U(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:e.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(j){if(this.abortController=new globalThis.AbortController,this._options.signal){const t=this._options.signal;this._options.signal.addEventListener("abort",(()=>{this.abortController.abort(t.reason)}))}this._options.signal=this.abortController.signal}if(this.request=new globalThis.Request(this._input,this._options),T&&(this.request.duplex="half"),this._options.searchParams){const t="string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);!(z&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}static create(t,e){const r=new q(t,e),o=async()=>{if(r._options.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r._fetch();for(const e of r._options.hooks.afterResponse){const o=await e(r.request,r._options,r._decorateResponse(t.clone()));o instanceof globalThis.Response&&(t=o)}if(r._decorateResponse(t),!t.ok&&r._options.throwHttpErrors){let e=new m(t,r.request,r._options);for(const t of r._options.hooks.beforeError)e=await t(e);throw e}if(r._options.onDownloadProgress){if("function"!=typeof r._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!M)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(t.clone(),r._options.onDownloadProgress)}return t},s=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(const[t,o]of Object.entries(S))s[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const n=(await s).clone();if("json"===t){if(204===n.status)return"";if(0===(await n.clone().arrayBuffer()).byteLength)return"";if(e.parseJson)return e.parseJson(await n.text())}return n[t]()};return s}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof y)){if(t instanceof m){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),2147483647);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{if(e){if(e.aborted)return void o(N(e));e.addEventListener("abort",s,{once:!0})}function s(){o(N(e)),clearTimeout(n)}const n=setTimeout((()=>{e?.removeEventListener("abort",s),r()}),t)}))}(r,{signal:this._options.signal});for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===A)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):async function(t,e,r){return new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new y(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))}))}(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return 204===t.status?(e&&e({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await async function t(){const{done:a,value:i}=await n.read();a?s.close():(e&&(o+=i.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},i)),s.enqueue(i),await t())}()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}}
|
2
|
-
/*! MIT License © Sindre Sorhus */const _=t=>{const e=(e,r)=>q.create(e,v(t,r));for(const r of R)e[r]=(e,o)=>q.create(e,v(t,o,{method:r}));return e.create=t=>_(v(t)),e.extend=e=>_(v(t,e)),e.stop=A,e},H=_(),$={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:D}=(()=>{const t=((t,e=((t,e)=>t!==e))=>{const r=g(t);let o=new Map(Object.entries(null!=r?r:{}));const s={dispose:[],get:[],set:[],reset:[]},n=()=>{var e;o=new Map(Object.entries(null!==(e=g(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},a=t=>(s.get.forEach((e=>e(t))),o.get(t)),i=(t,r)=>{const n=o.get(t);e(r,n,t)&&(o.set(t,r),s.set.forEach((e=>e(t,r,n))))},l="undefined"==typeof Proxy?{}:new Proxy(r,{get:(t,e)=>a(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,r)=>(i(e,r),!0)}),c=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)})(s[t],e)});return{state:l,get:a,set:i,on:c,onChange:(e,r)=>{const o=c("set",((t,o)=>{t===e&&r(o)})),s=c("reset",(()=>r(g(t)[e])));return()=>{o(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{s.dispose.forEach((t=>t())),n()},reset:n,forceUpdate:t=>{const e=o.get(t);s.set.forEach((r=>r(t,e,e)))}}})($,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((t,e,r)=>{const o=t.get(e);o?o.includes(r)||o.push(r):t.set(e,[r])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),w(t)},reset:()=>{t.forEach((t=>t.forEach(r))),w(t)}}})()),t})(),L=new Map([["row",new Map],["column",new Map],["box",new Map]]),I=["1","2","3","4","5","6","7","8","9"],J=t=>{if(void 0!==t&&t.indx!=D.pick){const{isClue:e,indx:r,row:o,column:s,box:n}=t,a=((t,e,r,o)=>{const s=new Map([["row",e],["column",r],["box",o]]),n=new Set;return s.forEach(((e,r)=>{L.get(r).get(e).forEach((e=>{e!==t&&n.add(e)}))})),Array.from(n)})(r,o,s,n),i=e?[]:(t=>{const{list:e}=D,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),I.filter((t=>!r.has(t)))})(a);D.pick=r,D.keys=i,D.locs=a}else D.pick=void 0,D.keys=[],D.locs=[];Z(D.pick)};let W;const X=t=>{f(t)},Z=t=>{p(t)},F=(t=!1)=>{D.list=[],D.keys=[],D.locs=[],D.loading=t,D.solved=!1,D.error=void 0,D.pick=void 0,D.data=void 0},K=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),d(a,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],s=r?atob(r):void 0,n=s?[...s]:[],a=o.map(((t,e)=>{const r=n[e],o=t===r,s=Math.floor(e/9),a=e%9,i=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(s,a);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=L.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,s,a,i),{key:t,isClue:o,value:r,indx:e,row:s,column:a,box:i}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:s}=o;s||(o.key=e)}))})(a),D.data=t,D.list=a}else D.data=void 0,D.list=[]})({puzzle:r,ref:o})},V=t=>{D.list=[...t],t.length=0},Y={initApp:(t=!1)=>{(t=>{W=H.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:t?"/.netlify/functions":"https://sudoku-rust-api.vercel.app/api",timeout:1e4})})(t),F();const e=c(a),r=u();if(e&&(K(e,!1),r>=0)){const{list:t}=D;J(t[r])}},refresh:async()=>{F(!0),X([]),Z(D.pick);try{const t=await W.get("puzzle").json();K(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),D.error=e}finally{D.loading=!1}},select:t=>{J(t)},check:()=>{const{list:t}=D,e=[];let r=0,o=0,s=0;t.forEach((t=>{const{key:n,value:a,isClue:i}=t;i?s+=1:"."!==n&&(n!==a?(r+=1,t.key="."):o+=1),e.push(t.key)}));const n=s+o;X(o?e:[]),r>0?V(t):81===n&&(D.solved=!0)},input:t=>{const{pick:e,list:r}=D;r[e].key=t,V(r)}},G=(...t)=>t.filter(Boolean).join(" "),Q=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",s=e.size||24;return t("svg",{class:G(e.class||"","animate-spin"),width:s,height:s,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},tt=e=>{const{message:r,salute:o,spinner:n=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(n?Q:s,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},r))},et=()=>{const{solved:e,loading:r,error:o}=D;return t("div",{class:"flex flex-col"},r||o||e?"":t(tt,{message:"Welcome, are you ready to play?..."}),r?t(tt,{message:"Loading...",spinner:!0}):"",o?t(tt,{message:o,salute:"ERROR"}):"",e?t(tt,{message:"You solved the puzzle!!"}):"")},rt=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},ot="eswat2",st=()=>t("a",{class:"absolute top-0 right-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":ot,title:ot},t(rt,{label:ot})),nt=(e,r)=>t("h1",{class:G("text-center uppercase text-clrs-red","mr-0 ml-0 mt-11 mb-11","text-6xl font-thin")},r),at=e=>{const{label:r,callback:o,matched:s=!1}=e;return t("button",{class:G("rounded-md border border-solid border-clrs-slate4 font-bold","Check ?"===r?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":"New Puzzle"===r?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":s?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},it=()=>{const{keys:e,list:r,pick:o,solved:s}=D,n=t=>()=>{Y.input(t)},a=s?[]:e,i=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},s||!i||i.isClue||"."==i.key?"":t(at,{label:"x",callback:n(".")}),a.map((e=>t(at,{label:e,callback:n(e),matched:i.key===e}))))},lt=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],ct=lt.map((t=>t+1)),dt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],ht=dt.map((t=>t+9)),ft=e=>{const{cell:r,selected:o,ref:s,solved:n}=e,{key:a,isClue:i,indx:l}=r,c="."!=a?a:"";return t("label",{class:G(`cell-${l}`,lt.includes(l)?"border-xbr-clrs-navy":"",ct.includes(l)?"border-xbl-clrs-navy":"",dt.includes(l)?"border-xbb-clrs-navy":"",ht.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",o?"border-clrs-red bg-clrs-red-a50 text-clrs-red":s?"border-clrs-gray bg-clrs-green-a50 font-bold":i?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||Y.select(t)})(r,n)},c)},ut=()=>{const{list:e,pick:r,locs:o,solved:s}=D;return t("div",{class:G("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,n)=>{const a=!s&&n===r,i=!s&&o.includes(n);return t(ft,{cell:e,selected:a,ref:i,solved:s})})))},pt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.2.2"),bt=t=>()=>{t.refresh()},wt=t=>()=>{t.check()},gt=()=>{const{list:e,solved:r}=D;return t("div",{class:"flex flex-row"},t(at,{label:"New Puzzle",callback:bt(Y)}),81!==e.length||r?"":t(at,{label:"Check ?",callback:wt(Y)}),t(pt,null))},mt=class{constructor(t){o(this,t),this.tag="proto-sudoku",this.netlify=!1}componentDidLoad(){Y.initApp(this.netlify)}render(){return t("div",{id:"app",class:"ds1-main relative max-w-min p-0.5"},t(st,null),t(nt,null,"Sudoku"),t(ut,null),t(it,null),t("hr",{class:"ml-0 mr-0"}),t(gt,null),t(et,null))}};mt.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.top-0{top:0px}.right-0{right:0px}.mt-5{margin-top:1.25rem}.mr-2{margin-right:0.5rem}.mr-1{margin-right:0.25rem}.mr-0{margin-right:0px}.ml-0{margin-left:0px}.mt-11{margin-top:2.75rem}.mb-11{margin-bottom:2.75rem}.mt-2{margin-top:0.5rem}.ml-auto{margin-left:auto}.flex{display:flex}.h-24px{height:24px}.h-8{height:2rem}.h-76p5{height:19.125rem}.w-8{width:2rem}.w-76p5{width:19.125rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.p-0\\.5{padding:0.125rem}.p-0{padding:0px}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";export{mt as proto_sudoku}
|