diff --git a/.gitignore b/.gitignore index 7daeddd..c93d5bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target node_modules +uploads +dist diff --git a/Cargo.lock b/Cargo.lock index 6bc3748..00d71b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,6 +143,24 @@ dependencies = [ "syn", ] +[[package]] +name = "actix-multipart" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9edfb0e7663d7fe18c8d5b668c9c1bcf79176b1dcc9d4da9592503209a6bfb0" +dependencies = [ + "actix-utils", + "actix-web", + "bytes", + "derive_more", + "futures-core", + "httparse", + "local-waker", + "log", + "mime", + "twoway", +] + [[package]] name = "actix-router" version = "0.5.0" @@ -1282,6 +1300,7 @@ dependencies = [ "actix-files", "actix-http", "actix-identity", + "actix-multipart", "actix-rt", "actix-utils", "actix-web", @@ -2080,12 +2099,28 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "twoway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" +dependencies = [ + "memchr", + "unchecked-index", +] + [[package]] name = "typenum" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +[[package]] +name = "unchecked-index" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" + [[package]] name = "unicase" version = "2.6.0" diff --git a/Cargo.toml b/Cargo.toml index 6482612..c8462df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,26 +5,27 @@ edition = "2021" [dependencies] actix = { version = "*" } -actix-web = { version = "*" } -actix-http = { version = "3.2.1" } actix-cors = { version = "*" } +actix-files = { version = "*" } +actix-http = { version = "3.2.1" } +actix-identity = { version = "0.4.0" } +actix-multipart = { version = "0.4.0" } actix-rt = { version = "*" } actix-utils = { version = "3.0.0" } -actix-files = { version = "*" } -actix-identity = { version = "0.4.0" } +actix-web = { version = "*" } +argon2 = { version = "0.4.1" } askama = { version = "*" } -validator = { version = "0.14", features = ["derive"] } +chrono = { version = "*", features = ["serde"] } +futures = { version = "0.3.21", features = ["async-await", "std"] } +futures-util = { version = "0.3.21", features = [] } +gumdrop = { version = "*" } +password-hash = { version = "0.4.2" } +rand = { version = "0.8.5", features = [] } serde = { version = "*", features = ["derive"] } serde_json = { version = "*" } sqlx = { version = "*", features = ["runtime-actix-rustls", "postgres", "uuid", "chrono"] } -uuid = { version = "*", features = ["serde"] } -chrono = { version = "*", features = ["serde"] } -gumdrop = { version = "*" } tracing = { version = "*" } -tracing-subscriber = { version = "*" } tracing-actix-web = { version = "*" } -argon2 = { version = "0.4.1" } -password-hash = { version = "0.4.2" } -rand = { version = "0.8.5", features = [] } -futures = { version = "0.3.21", features = ["async-await", "std"] } -futures-util = { version = "0.3.21", features = [] } +tracing-subscriber = { version = "*" } +uuid = { version = "*", features = ["serde"] } +validator = { version = "0.14", features = ["derive"] } diff --git a/assets/templates/business-items.html b/assets/templates/business-items.html index b3ac821..05505a8 100644 --- a/assets/templates/business-items.html +++ b/assets/templates/business-items.html @@ -2,7 +2,11 @@ {% block content %} {% for item in items %} - + {% endfor %} diff --git a/client/dist/app.js b/client/dist/app.js index e57df0d..ab59f04 100644 --- a/client/dist/app.js +++ b/client/dist/app.js @@ -1266,6 +1266,14 @@ customElements.define("register-form", class extends HTMLElement { } }); customElements.define("image-input", class extends HTMLElement { + static get observedAttributes() { + return [ + "width", + "height", + "account-id", + "url" + ]; + } constructor(){ super(); let b = this[S] = this.attachShadow({ @@ -1275,7 +1283,7 @@ customElements.define("image-input", class extends HTMLElement { @@ -1284,13 +1292,31 @@ customElements.define("image-input", class extends HTMLElement { -
+
+ +
+
+ +
- `; + `, b.querySelector("#save").addEventListener("click", (a)=>{ + a.preventDefault(), a.stopPropagation(); + let b = atob(g.toDataURL("image/webp", 1.0).split(",")[1]), c = []; + for(let d = 0; d < b.length; d++)c.push(b.charCodeAt(d)); + let e = new Blob([ + new Uint8Array(c) + ], { + type: "image/webp" + }), f = new FormData; + f.append(`${crypto.randomUUID()}.webp`, e), fetch("/upload", { + method: "POST", + body: f + }).then((a)=>a.json()).then(({ path: a })=>this.url = a); + }); let c = new FileReader(), d = b.querySelector("#file"), e = b.querySelector("#view"), f = b.querySelector("img"), g = b.querySelector("canvas"), h = g.getContext("2d"); f.addEventListener("load", ()=>{ let a, b; - f.width > f.height ? (a = 200, b = 200 * f.height / f.width) : (a = 200 * f.width / f.height, b = 200), console.log(f.width, f.height), console.log(a, b), f.width = a, f.height = b, h.fillStyle = "#F00", h.rect(0, 0, 200, 200), h.drawImage(f, 0, 0, a, b); + f.width > f.height ? (a = 200, b = 200 * f.height / f.width) : (a = 200 * f.width / f.height, b = 200), this.setAttribute("width", a), this.setAttribute("height", b), f.width = a, f.height = b, h.clearRect(0, 0, 200, 200), h.drawImage(f, 0, 0, a, b); }), d.addEventListener("change", (a)=>{ a.stopPropagation(), c.addEventListener("loadend", (a)=>{ a.total === a.loaded && (f.src = a.target.result || ""); @@ -1299,6 +1325,37 @@ customElements.define("image-input", class extends HTMLElement { a.stopPropagation(), d.click(); }); } + connectedCallback() { + this.account_id = this.account_id, this.url = this.url; + } + attributeChangedCallback(a, b, c) { + if (b !== c) switch(a){ + case "account-id": + return this.account_id = c; + case "url": + return this.url = c; + } + } + get account_id() { + return this.getAttribute("account-id"); + } + set account_id(a) { + this.setAttribute("account-id", a); + } + get width() { + let a = parseInt(this.getAttribute("width")); + return isNaN(a) ? 0 : a; + } + get height() { + let a = parseInt(this.getAttribute("height")); + return isNaN(a) ? 0 : a; + } + get url() { + return this.getAttribute("url"); + } + set url(b) { + this.setAttribute("url", b), this[S].querySelector("img").src = b; + } }); customElements.define("business-item", class extends HTMLElement { static get observedAttributes() { @@ -1326,28 +1383,35 @@ customElements.define("business-item", class extends HTMLElement { `; } connectedCallback() { - this.filter = this.getAttribute("filter"); + this.name = this.name, this.price = this.price, this.picture_url = this.picture_url; } attributeChangedCallback(a, b, c) { - if (b !== c && "filter" === a) return this.filter = c; + if (b !== c) switch(a){ + case "name": + return this.name = c; + case "price": + return this.price = c / 100.0; + case "picture-url": + return this.picture_url = c; + } } get name() { return this.getAttribute("name"); } - set name(a) { - this.setAttribute("name", a), this.querySelector("#name").textContent = a; + set name(b) { + this.setAttribute("name", b), this[S].querySelector("#name").textContent = b; } get price() { return this.getAttribute("price"); } - set price(a) { - this.setAttribute("price", a), this.querySelector("price-input").value = a; + set price(b) { + this.setAttribute("price", b), this[S].querySelector("price-input").value = b; } get picture_url() { return this.getAttribute("picture-url"); } - set picture_url(a) { - this.setAttribute("picture-url", a), this.querySelector("image-input").src = a; + set picture_url(b) { + this.setAttribute("picture-url", b), this[S].querySelector("image-input").src = b; } }); customElements.define("business-items", class extends HTMLElement { diff --git a/client/dist/app.js.map b/client/dist/app.js.map index fe27799..3e38bf9 100644 --- a/client/dist/app.js.map +++ b/client/dist/app.js.map @@ -1 +1 @@ -{"version":3,"sources":["/home/eraden/code/eraden/oswilno-light/client/src/shared.js","/home/eraden/code/eraden/oswilno-light/client/src/form-navigation.js","/home/eraden/code/eraden/oswilno-light/client/src/local-businesses/local-business-item.js","/home/eraden/code/eraden/oswilno-light/client/src/local-businesses/local-business.js","/home/eraden/code/eraden/oswilno-light/client/src/local-businesses.js","/home/eraden/code/eraden/oswilno-light/client/src/login-form.js","/home/eraden/code/eraden/oswilno-light/client/src/ow-account.js","/home/eraden/code/eraden/oswilno-light/client/src/nav/ow-nav.js","/home/eraden/code/eraden/oswilno-light/client/src/nav/ow-path.js","/home/eraden/code/eraden/oswilno-light/client/src/price/price-view.js","/home/eraden/code/eraden/oswilno-light/client/src/price/price-input.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-basic-form.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-item-form-row.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-items-form.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-business-form.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-submit-form.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-user-type.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form/register-user-form.js","/home/eraden/code/eraden/oswilno-light/client/src/register-form.js","/home/eraden/code/eraden/oswilno-light/client/src/shared/image-input.js","/home/eraden/code/eraden/oswilno-light/client/src/business-items/business-item.js","/home/eraden/code/eraden/oswilno-light/client/src/business-items.js","/home/eraden/code/eraden/oswilno-light/client/src/app.js"],"sourcesContent":["export const S = Symbol();\n\nexport const FORM_STYLE = `\nform {\n display: block;\n}\nform legend {\n margin: 16px 0;\n font-weight: bold;\n font-size: 20px;\n}\nform.inline div {\n display: flex;\n}\nform > div {\n display: block;\n margin-bottom: 1rem;\n}\ninput, textarea {\n font-size: 16px;\n\n border: none;\n border-bottom-style: none;\n border-bottom-width: medium;\n border-bottom: 1px solid rgba(0,0,0,.1);\n border-radius: 2px;\n padding: 0;\n \n height: 36px;\n background: #fff;\n color: rgba(0,0,0,.8);\n font-size: 14px;\n \n box-shadow: none !important;\n\n display: block;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n padding: .375rem .75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n background-clip: padding-box;\n transition: border-color .15s ease-in-out , -webkit-box-shadow .15s ease-in-out;\n transition: border-color .15s ease-in-out , box-shadow .15s ease-in-out;\n transition: border-color .15s ease-in-out , box-shadow .15s ease-in-out , -webkit-box-shadow .15s ease-in-out;\n}\ninput[type=\"text\"],\ninput[type=\"number\"],\ninput[type=\"email\"],\ninput[type=\"password\"],\ntextarea {\n width: calc(100% - 1.5rem - 2px);\n}\nlabel {\n color: #000;\n text-transform: uppercase;\n font-size: 12px;\n font-weight: 600;\n \n display: inline-block;\n margin-bottom: .5rem;\n}\ninput[type=\"button\"], input[type=\"submit\"] {\n padding: 12px 16px;\n cursor: pointer;\n border: none;\n border-width: 1px;\n border-radius: 5px;\n font-size: 14px;\n font-weight: 400;\n box-shadow: 0 10px 20px -6px rgba(0,0,0,.12);\n position: relative;\n margin-bottom: 20px;\n transition: .3s;\n \n background: #46b5d1;\n color: #fff;\n \n display: inline-block;\n font-weight: 400;\n text-align: center;\n vertical-align: middle;\n user-select: none;\n padding: .375rem .75rem;\n font-size: 1rem;\n line-height: 1.5;\n transition: color .15s ease-in-out,\n background-color .15s ease-in-out,\n border-color .15s ease-in-out,\n box-shadow .15s ease-in-out,\n width: auto;\n height: calc(1.5em + 0.75rem + 2px);\n padding: .375rem .75rem;\n \n border: 1px solid #495057;\n color: #495057;\n background: white;\n}\n`;\n\nexport class PseudoForm extends HTMLElement {\n reportValidity() {\n return this[S].querySelector('form').reportValidity();\n }\n\n checkValidity() {\n return this[S].querySelector('form').checkValidity();\n }\n\n get elements() {\n return this[S].querySelector('form').elements;\n }\n}\n\nexport const fireFbReady = () => {\n fbReady = true;\n for (const fn of fbQueue) fn();\n};\nexport const runFbReady = (fn) => {\n if (!fbReady) fbQueue.push(fn);\n else fn();\n};\nconst fbQueue = [];\nlet fbReady = false;\n","import { S, FORM_STYLE } from \"./shared\";\n\ncustomElements.define('form-navigation', class extends HTMLElement {\n static get observedAttributes() {\n return ['next', 'prev']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n `;\n shadow.querySelector('#prev').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.prev();\n });\n shadow.querySelector('#next').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.next();\n });\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'next': {\n this[S].querySelector('#next').className = newV === 'hidden' ? 'hidden' : '';\n break;\n }\n case 'prev': {\n this[S].querySelector('#prev').className = newV === 'hidden' ? 'hidden' : '';\n break;\n }\n }\n }\n\n next() {\n this.dispatchEvent(new CustomEvent('form:next', {\n bubbles: true,\n composed: true,\n detail: this.parentElement\n }));\n }\n\n prev() {\n this.dispatchEvent(new CustomEvent('form:prev', {\n bubbles: true,\n composed: true,\n detail: this.parentElement\n }));\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('local-business-item', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'price']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n

\n \n
\n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#name').textContent = this.getAttribute('name');\n this[S].querySelector('#price').value = this.price();\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'name':\n return this[S].querySelector('#name').textContent = newV;\n case 'price':\n return this[S].querySelector('#price').value = newV;\n }\n }\n\n price(s) {\n const n = parseInt(s || this.getAttribute('price'));\n return isNaN(n) ? 0 : n;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('local-business', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'service-id', 'state']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n

\n \n
\n \n
\n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#name').textContent = this.getAttribute('name');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'name':\n return this[S].querySelector('#name').textContent = newV;\n }\n }\n\n get name() {\n return this.getAttribute('name') || ''\n }\n});\n","import { S } from \"./shared\";\n\nimport \"./local-businesses/local-business-item\";\nimport \"./local-businesses/local-business\";\n\ncustomElements.define('local-businesses', class extends HTMLElement {\n static get observedAttributes() {\n return ['filter']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n
\n
\n \n
\n `;\n {\n const filter = shadow.querySelector('#filter');\n let t = null;\n filter.addEventListener('change', ev => {\n ev.stopPropagation();\n this.filter = ev.target.value;\n });\n filter.addEventListener('keyup', ev => {\n ev.stopPropagation();\n const value = ev.target.value;\n\n if (t) clearTimeout(t);\n t = setTimeout(() => {\n this.filter = value;\n t = null;\n }, 1000 / 3);\n });\n }\n }\n\n connectedCallback() {\n this.filter = this.getAttribute('filter');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'filter':\n return this.filter = newV;\n }\n }\n\n get filter() {\n return this.getAttribute('filter');\n }\n\n set filter(value) {\n if (!value || value === '') {\n this.removeAttribute('filter');\n for (const el of this.querySelectorAll('local-service')) {\n el.removeAttribute('local-services-visible');\n }\n } else {\n this.setAttribute('filter', value);\n for (const el of this.querySelectorAll('local-service')) {\n if (!el.name) continue;\n if (el.name.includes(value)) {\n el.setAttribute('local-services-visible', 'visible');\n } else {\n el.setAttribute('local-services-visible', 'invisible');\n }\n }\n }\n }\n});\n","import { FORM_STYLE, S } from \"./shared\";\n\ncustomElements.define('login-form', class extends HTMLElement {\n static get observedAttributes() {\n return []\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n `;\n }\n\n connectedCallback() {\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n }\n }\n});\n","import { S, FORM_STYLE } from \"./shared\";\n\ncustomElements.define('ow-account', class extends HTMLElement {\n static get observedAttributes() {\n return ['mode', \"id\", \"name\", 'email', \"facebook-id\"]\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n \n
\n
\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n `;\n shadow.querySelector('#switch-login > a').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'login';\n });\n shadow.querySelector('#switch-register > a').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'register';\n });\n }\n\n connectedCallback() {\n if (this.mode === '') this.mode = 'login';\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'mode': {\n this.mode = newV;\n break;\n }\n case 'id': {\n this.id = newV;\n break;\n }\n case 'name': {\n this.name = newV;\n break;\n }\n case 'email': {\n this.email = newV;\n break;\n }\n case 'facebook-id': {\n this.facebook_id = newV;\n break;\n }\n }\n }\n\n get mode() {\n return this.getAttribute('mode') || '';\n }\n\n set mode(value) {\n value = ['login', 'register', 'display'].includes(value) ? value : 'login';\n this.setAttribute('mode', value);\n }\n\n get name() {\n return this.getAttribute('name') || '';\n }\n\n set name(v) {\n this.setAttribute('name', v);\n this[S].querySelector('#display #name').value = v;\n }\n\n get email() {\n return this.getAttribute('email') || '';\n }\n\n set email(v) {\n this.setAttribute('email', v);\n this[S].querySelector('#display #email').value = v;\n }\n\n get facebook_id() {\n return this.getAttribute('facebook-id');\n }\n\n set facebook_id(v) {\n this.setAttribute('facebook-id', v);\n this[S].querySelector('#display #facebook_id').value = v;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('ow-nav', class extends HTMLElement {\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n
\n `;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('ow-path', class extends HTMLElement {\n static get observedAttributes() {\n return ['selected', 'path'];\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n `;\n }\n\n connectedCallback() {\n this.selected = this.getAttribute('selected');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'selected':\n return this.selected = newV;\n case 'path':\n return this.path = newV;\n }\n }\n\n get selected() {\n return this.getAttribute('selected') === 'selected';\n }\n\n set selected(value) {\n if (value === 'selected') this.setAttribute('selected', 'selected');\n else this.removeAttribute('selected');\n }\n\n get path() {\n return this.getAttribute('path') || ''\n }\n\n set path(value) {\n if (!value || value === '') {\n this.removeAttribute('path');\n return;\n }\n this.setAttribute('path', value);\n this[S].querySelector('a').setAttribute('href', value);\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('price-view', class extends HTMLElement {\n static get observedAttributes() {\n return ['value', 'currency']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#price').textContent = this.formatted;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'price': {\n this.value = newV;\n break;\n }\n }\n }\n\n get formatted() {\n let v = this.value;\n let major = Math.ceil(v / 100);\n let minor = v % 100;\n let formatted = `${ major },${ minor < 10 ? `0${ minor }` : minor }`;\n return `${ formatted }${ this.currency }`\n }\n\n get value() {\n const n = parseInt(this.getAttribute('value'));\n return isNaN(n) ? 0 : n;\n }\n\n set value(v) {\n this.setAttribute('value', v);\n this[S].querySelector('#price').textContent = this.formatted;\n }\n\n get currency() {\n return this.getAttribute('currency') || 'PLN';\n }\n});\n","import { S, FORM_STYLE } from \"../shared\";\n\ncustomElements.define('price-input', class extends HTMLElement {\n static get observedAttributes() {\n return ['value', 'currency', 'required', 'name']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n \n
\n `;\n\n const price = shadow.querySelector('#price');\n price.addEventListener('change', ev => {\n ev.stopPropagation();\n this.value = price.value;\n });\n }\n\n connectedCallback() {\n this[S].querySelector('#currency').textContent = this.currency;\n this[S].querySelector('#price').value = this.value;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n const price = this[S].querySelector('#price');\n switch (name) {\n case 'price': {\n this.value = newV;\n break;\n }\n case 'currency': {\n this.currency = newV;\n break;\n }\n case 'required': {\n newV\n ? price.setAttribute('required', 'required')\n : price.removeAttribute('required');\n break;\n }\n case 'readonly': {\n newV\n ? price.setAttribute('readonly', 'readonly')\n : price.removeAttribute('readonly');\n break;\n }\n case 'name': {\n this.setAttribute('name', newV);\n break;\n }\n }\n }\n\n get value() {\n return this[S].querySelector('#price').value * 100;\n }\n\n set value(v) {\n this.setAttribute('value', v);\n this[S].querySelector('#price').value = v;\n }\n\n get currency() {\n return this.getAttribute('currency') || 'PLN';\n }\n\n set currency(value) {\n this.setAttribute('currency', value);\n this[S].querySelector('#currency').textContent = this.currency;\n }\n\n reportValidity() {\n return this[S].querySelector('input').reportValidity();\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n set name(value) {\n this.setAttribute('name', value);\n }\n});\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-basic-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n `;\n\n const form = shadow.querySelector('form');\n form.addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n shadow.querySelector('form-navigation').next();\n })\n }\n});\n","import { S, FORM_STYLE, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-item-form-row', class extends PseudoForm {\n static get observedAttributes() {\n return ['idx', 'name']\n }\n\n constructor() {\n super();\n this[S] = this.attachShadow({ mode: 'closed' });\n\n this.addEventListener('item:removed', () => {\n this.setAttribute('removed', 'removed');\n const parent = this.parentElement;\n this.remove();\n parent.dispatchEvent(new CustomEvent('item:removed', { bubbles: true, composed: true }));\n });\n }\n\n connectedCallback() {\n const idx = this.getAttribute('idx');\n this[S].innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n \n
\n
\n
\n `;\n this[S].querySelector('form').addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.reportValidity();\n });\n this[S].querySelector('.remove').addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.dispatchEvent(new CustomEvent('item:removed', { bubbles: true, composed: false }));\n });\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'idx': {\n this.updateNames();\n break;\n }\n }\n }\n\n get inputs() {\n return [\n extract(this[S].querySelector('.item-name')),\n extract(this[S].querySelector('.item-price')),\n ];\n }\n\n updateNames() {\n const idx = this.getAttribute('idx');\n for (const el of this[S].querySelectorAll('.field')) {\n const id = el.id;\n el.querySelector('input, price-input').setAttribute('name', `items[${ idx }][${ id }]`);\n }\n }\n\n get idx() {\n return this.getAttribute('idx');\n }\n\n set idx(idx) {\n this.setAttribute('idx', idx);\n }\n\n reportValidity() {\n return super.reportValidity() && this[S].querySelector('price-input').reportValidity();\n }\n});\n\nconst extract = ({ name, value }) => ({ name, value })\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\nimport \"./register-item-form-row\"\n\nconst updateItems = (form) => {\n let idx = 0;\n for (const el of form.querySelectorAll('register-item-form-row')) {\n el.idx = idx++;\n }\n return idx;\n}\n\ncustomElements.define('register-items-form', class extends PseudoForm {\n static get observedAttributes() {\n return []\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n \n
\n
\n \n
\n \n
\n `;\n this.addEventListener('item:removed', ev => {\n ev.stopPropagation();\n updateItems(this)\n });\n this.addEventListener('form:next', ev => {\n for (const el of this.querySelectorAll('item-form-row')) {\n if (!el.reportValidity()) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n });\n shadow.querySelector('#add-item').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.appendChild(document.createElement('register-item-form-row'));\n updateItems(this)\n });\n }\n\n get inputs() {\n return [...this.querySelectorAll(\"register-item-form-row\")].map(form => form.inputs)\n }\n});\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-business-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({mode: \"closed\"});\n\n shadow.innerHTML = `\n \n
\n
\n \n
\n
\n \n \n
\n \n
\n `;\n\n shadow.querySelector('form').addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n shadow.querySelector('form-navigation').next();\n });\n }\n})\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-submit-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n \n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n \n
\n \n \n
\n
\n `;\n }\n\n updateField(name, value) {\n this[S].querySelector(`[id=\"hidden-${ name }\"]`).value = value;\n this[S].querySelector(`[id=\"preview-${ name }\"]`).value = value;\n }\n\n setItems(items) {\n const host = this[S].querySelector('#items');\n host.innerHTML = ``;\n for (const row of items) {\n const el = host.appendChild(document.createElement('div'));\n el.className = 'item-view';\n const [name, price] = row;\n\n el.innerHTML = `\n \n \n \n `;\n }\n }\n\n set accountType(v) {\n this[S].querySelector('#account_type').value = v;\n }\n});\n","customElements.define('register-user-type', class extends HTMLElement {\n constructor() {\n super();\n\n const shadow = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n \n `;\n\n const user = shadow.querySelector('#user');\n user.addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.dispatchEvent(new CustomEvent('account:type:user', { bubbles: true, composed: true }));\n });\n const service = shadow.querySelector('#local-service');\n service.addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.dispatchEvent(new CustomEvent('account:type:local-service', { bubbles: true, composed: true }));\n });\n }\n});\n","import { S, FORM_STYLE } from \"../shared\";\n\ncustomElements.define('register-user-form', class extends HTMLElement {\n static get observedAttributes() {\n return ['mode']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n \n \n
\n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n `;\n\n const form = shadow.querySelector('form');\n\n shadow.querySelector('#fb-icon').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'facebook';\n FB.login((res) => {\n if (res.status === 'connected') {\n FB.api(\"/me?fields=id,name,email\", ({ id, name, email, ...rest }) => {\n console.log(id, name, email, rest);\n form.querySelector('#email').value = email;\n form.querySelector('#login').value = name;\n form.querySelector('#password').value = crypto.randomUUID();\n form.querySelector('#facebook_id').value = id;\n form.submit();\n });\n }\n }, { scope: 'public_profile,email', return_scopes: true });\n });\n\n shadow.querySelector('#email-icon').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.mode = 'email';\n });\n }\n\n connectedCallback() {\n this.mode = '';\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'mode': {\n if (newV !== 'email' && newV !== 'facebook' && newV !== '')\n return;\n this.mode = newV;\n break;\n }\n }\n }\n\n get mode() {\n return this.getAttribute('mode') || ''\n }\n\n set mode(v) {\n this.setAttribute('mode', v);\n }\n});\n","import { S, FORM_STYLE } from \"./shared\";\n\nimport \"./register-form/register-basic-form\";\nimport \"./register-form/register-item-form-row.js\";\nimport \"./register-form/register-items-form.js\";\nimport \"./register-form/register-business-form\";\nimport \"./register-form/register-submit-form\";\nimport \"./register-form/register-user-type\";\nimport \"./register-form/register-user-form\";\n\nconst copyForm = (form, finalForm) => {\n form.reportValidity();\n\n for (const el of form.elements) {\n if (el.name === '') continue;\n if (!el.reportValidity()) {\n return false;\n }\n }\n const inputs = form.inputs;\n if (inputs)\n finalForm.setItems(inputs);\n else\n for (const el of form.elements) {\n if (el.name === '') continue;\n finalForm.updateField(el.name, el.value);\n }\n return true;\n};\n\ncustomElements.define('register-form', class extends HTMLElement {\n static get observedAttributes() {\n return ['step']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n
\n \n \n \n \n \n \n
\n `;\n\n const finalForm = shadow.querySelector('#step-4');\n this[S].addEventListener('account:type:user', ev => {\n ev.stopPropagation();\n finalForm.accountType = 'User';\n this.step = 40;\n });\n this[S].addEventListener('account:type:local-service', ev => {\n ev.stopPropagation();\n finalForm.accountType = 'Business';\n this.step = 1;\n });\n this[S].addEventListener('form:next', ev => {\n ev.stopPropagation();\n const form = shadow.querySelector(`#step-${ this.step }`);\n if (copyForm(form, finalForm)) {\n this.step = this.step + 1;\n }\n });\n this[S].addEventListener('form:prev', ev => {\n ev.stopPropagation();\n this.step = this.step - 1;\n });\n {\n finalForm.addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n });\n }\n }\n\n connectedCallback() {\n this.step = 0;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n }\n }\n\n get step() {\n const step = parseInt(this.getAttribute('step'));\n return isNaN(step) ? 1 : step;\n }\n\n set step(n) {\n if (n < 0) return;\n this.setAttribute('step', n);\n }\n});\n","import { S } from \"../shared.js\";\n\ncustomElements.define('image-input', class extends HTMLElement {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \"\"\n
\n
\n
\n `;\n\n const f = new FileReader();\n const input = shadow.querySelector('#file');\n const view = shadow.querySelector('#view');\n const img = shadow.querySelector('img');\n const canvas = shadow.querySelector('canvas');\n const ctx = canvas.getContext('2d');\n\n img.addEventListener('load', () => {\n let width, height;\n if (img.width > img.height) {\n width = 200;\n height = (img.height * 200) / img.width;\n } else {\n width = (img.width * 200) / img.height;\n height = 200;\n }\n console.log(img.width, img.height);\n console.log(width, height);\n img.width = width;\n img.height = height;\n // ctx.drawImage(img, 0, 0);\n ctx.fillStyle = '#F00';\n ctx.rect(0, 0, 200, 200);\n ctx.drawImage(img, 0, 0, width, height);\n });\n input.addEventListener('change', ev => {\n ev.stopPropagation();\n\n f.addEventListener('loadend', (readerEvent) => {\n if (readerEvent.total !== readerEvent.loaded)\n return;\n img.src = readerEvent.target.result || '';\n });\n f.readAsDataURL(ev.target.files[0]);\n });\n\n view.addEventListener('click', ev => {\n ev.stopPropagation();\n input.click();\n });\n }\n});\n","import { S } from \"../shared.js\";\nimport \"../shared/image-input\";\n\ncustomElements.define('business-item', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'price', 'picture-url']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n `;\n }\n\n connectedCallback() {\n this.filter = this.getAttribute('filter');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'filter':\n return this.filter = newV;\n }\n }\n\n get name() {\n return this.getAttribute('name');\n }\n set name(v) {\n this.setAttribute('name', v);\n this.querySelector('#name').textContent = v;\n }\n\n\n get price() {\n return this.getAttribute('price');\n }\n set price(v) {\n this.setAttribute('price', v);\n this.querySelector('price-input').value = v;\n }\n\n\n get picture_url() {\n return this.getAttribute('picture-url');\n }\n set picture_url(v) {\n this.setAttribute('picture-url', v);\n this.querySelector('image-input').src = v;\n }\n});\n","import { S } from \"./shared\"\n\nimport \"./business-items/business-item\";\n\ncustomElements.define('business-items', class extends HTMLElement {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n \n `;\n }\n});\n","import \"./form-navigation.js\";\nimport \"./local-businesses.js\";\nimport \"./login-form.js\";\nimport \"./ow-account.js\";\nimport \"./nav/ow-nav.js\";\nimport \"./nav/ow-path.js\";\nimport \"./price/price-view\";\nimport \"./price/price-input\";\nimport \"./register-form.js\";\nimport \"./business-items\";\n\nimport { fireFbReady } from \"./shared.js\";\n\nif (!document.querySelector('#facebook-jssdk')) {\n window.fbAsyncInit = () => {\n FB.init({\n appId: '1293538251053124',\n cookie: true,\n xfbml: true,\n version: 'v14.0'\n });\n FB.AppEvents.logPageView();\n fireFbReady();\n };\n\n const js = document.createElement('script');\n js.id = 'facebook-jssdk';\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n document.head.appendChild(js);\n}\n"],"names":[],"mappings":"AAAO,MAAM,CAAC,GAAG,MAAM,EAAE,AAAC;AAEnB,MAAM,UAAU,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkG3B,CAAC,AAAC;AAEK,MAAM,UAAU,SAAS,WAAW;IACvC,cAAc,GAAG;QACb,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,CAAC;KACzD;IAED,aAAa,GAAG;QACZ,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;KACxD;IAED,IAAI,QAAQ,GAAG;QACX,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;KACjD;CACJ;AAEM,MAAM,WAAW,GAAG,IAAM;IAE7B,KAAK,IAAM,CAAE,KADH,CAAA,CAAI,EACG,CAAO,EAAE,CAAE,EAAE,CAAC;CAClC,AAAC;AAKF,IAAM,CAAO,GAAG,EAAE,AAAC;AC1HnB,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,WAAW;IAC9D,WAAW,kBAAkB,GAAG;QAC5B,OAAO;YA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WAAW;IAC7D,aAAc;QACV,KAAK,EAAE,CAAC;QAER,IAAM,CAAM,GAAG,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC;YAAE,IAAI,EAAE,QAAQ;SAAE,CAAC,AAAC;QAE/D,CAAM,CAAC,SAAS,GAAG,CAAC;;;;;QAKpB,CAAC,CAAC;KACL;CACJ,CAAC,CAAC;ACJH,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAC,EAAE;IAC5C,MAAM,CAAC,WAAW,GAAG,IAAM;QACvB,EAAE,CAAC,IAAI,CAAC;YACJ,KAAK,EAAI,kBAAkB;YAC3B,MAAM,EAAG,CAAA,CAAI;YACb,KAAK,EAAI,CAAA,CAAI;YACb,OAAO,EAAE,OAAO;SACnB,CAAC,EACF,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,EAC1B,aAAa;KAChB,CAAA;IAED,IAAM,CAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,AAAC;IAC5C,CAAE,CAAC,EAAE,GAAG,gBAAgB,EACxB,CAAE,CAAC,GAAG,GAAG,2CAA2C,EACpD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAE,CAAC;CAChC"} \ No newline at end of file +{"version":3,"sources":["/home/eraden/code/eraden/oswilno/client/src/shared.js","/home/eraden/code/eraden/oswilno/client/src/form-navigation.js","/home/eraden/code/eraden/oswilno/client/src/local-businesses/local-business-item.js","/home/eraden/code/eraden/oswilno/client/src/local-businesses/local-business.js","/home/eraden/code/eraden/oswilno/client/src/local-businesses.js","/home/eraden/code/eraden/oswilno/client/src/login-form.js","/home/eraden/code/eraden/oswilno/client/src/ow-account.js","/home/eraden/code/eraden/oswilno/client/src/nav/ow-nav.js","/home/eraden/code/eraden/oswilno/client/src/nav/ow-path.js","/home/eraden/code/eraden/oswilno/client/src/price/price-view.js","/home/eraden/code/eraden/oswilno/client/src/price/price-input.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-basic-form.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-item-form-row.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-items-form.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-business-form.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-submit-form.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-user-type.js","/home/eraden/code/eraden/oswilno/client/src/register-form/register-user-form.js","/home/eraden/code/eraden/oswilno/client/src/register-form.js","/home/eraden/code/eraden/oswilno/client/src/shared/image-input.js","/home/eraden/code/eraden/oswilno/client/src/business-items/business-item.js","/home/eraden/code/eraden/oswilno/client/src/business-items.js","/home/eraden/code/eraden/oswilno/client/src/app.js"],"sourcesContent":["export const S = Symbol();\n\nexport const FORM_STYLE = `\nform {\n display: block;\n}\nform legend {\n margin: 16px 0;\n font-weight: bold;\n font-size: 20px;\n}\nform.inline div {\n display: flex;\n}\nform > div {\n display: block;\n margin-bottom: 1rem;\n}\ninput, textarea {\n font-size: 16px;\n\n border: none;\n border-bottom-style: none;\n border-bottom-width: medium;\n border-bottom: 1px solid rgba(0,0,0,.1);\n border-radius: 2px;\n padding: 0;\n \n height: 36px;\n background: #fff;\n color: rgba(0,0,0,.8);\n font-size: 14px;\n \n box-shadow: none !important;\n\n display: block;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n padding: .375rem .75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n background-clip: padding-box;\n transition: border-color .15s ease-in-out , -webkit-box-shadow .15s ease-in-out;\n transition: border-color .15s ease-in-out , box-shadow .15s ease-in-out;\n transition: border-color .15s ease-in-out , box-shadow .15s ease-in-out , -webkit-box-shadow .15s ease-in-out;\n}\ninput[type=\"text\"],\ninput[type=\"number\"],\ninput[type=\"email\"],\ninput[type=\"password\"],\ntextarea {\n width: calc(100% - 1.5rem - 2px);\n}\nlabel {\n color: #000;\n text-transform: uppercase;\n font-size: 12px;\n font-weight: 600;\n \n display: inline-block;\n margin-bottom: .5rem;\n}\ninput[type=\"button\"], input[type=\"submit\"] {\n padding: 12px 16px;\n cursor: pointer;\n border: none;\n border-width: 1px;\n border-radius: 5px;\n font-size: 14px;\n font-weight: 400;\n box-shadow: 0 10px 20px -6px rgba(0,0,0,.12);\n position: relative;\n margin-bottom: 20px;\n transition: .3s;\n \n background: #46b5d1;\n color: #fff;\n \n display: inline-block;\n font-weight: 400;\n text-align: center;\n vertical-align: middle;\n user-select: none;\n padding: .375rem .75rem;\n font-size: 1rem;\n line-height: 1.5;\n transition: color .15s ease-in-out,\n background-color .15s ease-in-out,\n border-color .15s ease-in-out,\n box-shadow .15s ease-in-out,\n width: auto;\n height: calc(1.5em + 0.75rem + 2px);\n padding: .375rem .75rem;\n \n border: 1px solid #495057;\n color: #495057;\n background: white;\n}\n`;\n\nexport class PseudoForm extends HTMLElement {\n reportValidity() {\n return this[S].querySelector('form').reportValidity();\n }\n\n checkValidity() {\n return this[S].querySelector('form').checkValidity();\n }\n\n get elements() {\n return this[S].querySelector('form').elements;\n }\n}\n\nexport const fireFbReady = () => {\n fbReady = true;\n for (const fn of fbQueue) fn();\n};\nexport const runFbReady = (fn) => {\n if (!fbReady) fbQueue.push(fn);\n else fn();\n};\nconst fbQueue = [];\nlet fbReady = false;\n","import { S, FORM_STYLE } from \"./shared\";\n\ncustomElements.define('form-navigation', class extends HTMLElement {\n static get observedAttributes() {\n return ['next', 'prev']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n `;\n shadow.querySelector('#prev').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.prev();\n });\n shadow.querySelector('#next').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.next();\n });\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'next': {\n this[S].querySelector('#next').className = newV === 'hidden' ? 'hidden' : '';\n break;\n }\n case 'prev': {\n this[S].querySelector('#prev').className = newV === 'hidden' ? 'hidden' : '';\n break;\n }\n }\n }\n\n next() {\n this.dispatchEvent(new CustomEvent('form:next', {\n bubbles: true,\n composed: true,\n detail: this.parentElement\n }));\n }\n\n prev() {\n this.dispatchEvent(new CustomEvent('form:prev', {\n bubbles: true,\n composed: true,\n detail: this.parentElement\n }));\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('local-business-item', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'price']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n

\n \n
\n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#name').textContent = this.getAttribute('name');\n this[S].querySelector('#price').value = this.price();\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'name':\n return this[S].querySelector('#name').textContent = newV;\n case 'price':\n return this[S].querySelector('#price').value = newV;\n }\n }\n\n price(s) {\n const n = parseInt(s || this.getAttribute('price'));\n return isNaN(n) ? 0 : n;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('local-business', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'service-id', 'state']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n

\n \n
\n \n
\n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#name').textContent = this.getAttribute('name');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'name':\n return this[S].querySelector('#name').textContent = newV;\n }\n }\n\n get name() {\n return this.getAttribute('name') || ''\n }\n});\n","import { S } from \"./shared\";\n\nimport \"./local-businesses/local-business-item\";\nimport \"./local-businesses/local-business\";\n\ncustomElements.define('local-businesses', class extends HTMLElement {\n static get observedAttributes() {\n return ['filter']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n
\n
\n \n
\n `;\n {\n const filter = shadow.querySelector('#filter');\n let t = null;\n filter.addEventListener('change', ev => {\n ev.stopPropagation();\n this.filter = ev.target.value;\n });\n filter.addEventListener('keyup', ev => {\n ev.stopPropagation();\n const value = ev.target.value;\n\n if (t) clearTimeout(t);\n t = setTimeout(() => {\n this.filter = value;\n t = null;\n }, 1000 / 3);\n });\n }\n }\n\n connectedCallback() {\n this.filter = this.getAttribute('filter');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'filter':\n return this.filter = newV;\n }\n }\n\n get filter() {\n return this.getAttribute('filter');\n }\n\n set filter(value) {\n if (!value || value === '') {\n this.removeAttribute('filter');\n for (const el of this.querySelectorAll('local-service')) {\n el.removeAttribute('local-services-visible');\n }\n } else {\n this.setAttribute('filter', value);\n for (const el of this.querySelectorAll('local-service')) {\n if (!el.name) continue;\n if (el.name.includes(value)) {\n el.setAttribute('local-services-visible', 'visible');\n } else {\n el.setAttribute('local-services-visible', 'invisible');\n }\n }\n }\n }\n});\n","import { FORM_STYLE, S } from \"./shared\";\n\ncustomElements.define('login-form', class extends HTMLElement {\n static get observedAttributes() {\n return []\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n `;\n }\n\n connectedCallback() {\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n }\n }\n});\n","import { S, FORM_STYLE } from \"./shared\";\n\ncustomElements.define('ow-account', class extends HTMLElement {\n static get observedAttributes() {\n return ['mode', \"id\", \"name\", 'email', \"facebook-id\"]\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n \n
\n
\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n `;\n shadow.querySelector('#switch-login > a').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'login';\n });\n shadow.querySelector('#switch-register > a').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'register';\n });\n }\n\n connectedCallback() {\n if (this.mode === '') this.mode = 'login';\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'mode': {\n this.mode = newV;\n break;\n }\n case 'id': {\n this.id = newV;\n break;\n }\n case 'name': {\n this.name = newV;\n break;\n }\n case 'email': {\n this.email = newV;\n break;\n }\n case 'facebook-id': {\n this.facebook_id = newV;\n break;\n }\n }\n }\n\n get mode() {\n return this.getAttribute('mode') || '';\n }\n\n set mode(value) {\n value = ['login', 'register', 'display'].includes(value) ? value : 'login';\n this.setAttribute('mode', value);\n }\n\n get name() {\n return this.getAttribute('name') || '';\n }\n\n set name(v) {\n this.setAttribute('name', v);\n this[S].querySelector('#display #name').value = v;\n }\n\n get email() {\n return this.getAttribute('email') || '';\n }\n\n set email(v) {\n this.setAttribute('email', v);\n this[S].querySelector('#display #email').value = v;\n }\n\n get facebook_id() {\n return this.getAttribute('facebook-id');\n }\n\n set facebook_id(v) {\n this.setAttribute('facebook-id', v);\n this[S].querySelector('#display #facebook_id').value = v;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('ow-nav', class extends HTMLElement {\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n
\n `;\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('ow-path', class extends HTMLElement {\n static get observedAttributes() {\n return ['selected', 'path'];\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n `;\n }\n\n connectedCallback() {\n this.selected = this.getAttribute('selected');\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'selected':\n return this.selected = newV;\n case 'path':\n return this.path = newV;\n }\n }\n\n get selected() {\n return this.getAttribute('selected') === 'selected';\n }\n\n set selected(value) {\n if (value === 'selected') this.setAttribute('selected', 'selected');\n else this.removeAttribute('selected');\n }\n\n get path() {\n return this.getAttribute('path') || ''\n }\n\n set path(value) {\n if (!value || value === '') {\n this.removeAttribute('path');\n return;\n }\n this.setAttribute('path', value);\n this[S].querySelector('a').setAttribute('href', value);\n }\n});\n","import { S } from \"../shared\";\n\ncustomElements.define('price-view', class extends HTMLElement {\n static get observedAttributes() {\n return ['value', 'currency']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n \n `;\n }\n\n connectedCallback() {\n this[S].querySelector('#price').textContent = this.formatted;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'price': {\n this.value = newV;\n break;\n }\n }\n }\n\n get formatted() {\n let v = this.value;\n let major = Math.ceil(v / 100);\n let minor = v % 100;\n let formatted = `${ major },${ minor < 10 ? `0${ minor }` : minor }`;\n return `${ formatted }${ this.currency }`\n }\n\n get value() {\n const n = parseInt(this.getAttribute('value'));\n return isNaN(n) ? 0 : n;\n }\n\n set value(v) {\n this.setAttribute('value', v);\n this[S].querySelector('#price').textContent = this.formatted;\n }\n\n get currency() {\n return this.getAttribute('currency') || 'PLN';\n }\n});\n","import { S, FORM_STYLE } from \"../shared\";\n\ncustomElements.define('price-input', class extends HTMLElement {\n static get observedAttributes() {\n return ['value', 'currency', 'required', 'name']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n \n \n
\n `;\n\n const price = shadow.querySelector('#price');\n price.addEventListener('change', ev => {\n ev.stopPropagation();\n this.value = price.value;\n });\n }\n\n connectedCallback() {\n this[S].querySelector('#currency').textContent = this.currency;\n this[S].querySelector('#price').value = this.value;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n const price = this[S].querySelector('#price');\n switch (name) {\n case 'price': {\n this.value = newV;\n break;\n }\n case 'currency': {\n this.currency = newV;\n break;\n }\n case 'required': {\n newV\n ? price.setAttribute('required', 'required')\n : price.removeAttribute('required');\n break;\n }\n case 'readonly': {\n newV\n ? price.setAttribute('readonly', 'readonly')\n : price.removeAttribute('readonly');\n break;\n }\n case 'name': {\n this.setAttribute('name', newV);\n break;\n }\n }\n }\n\n get value() {\n return this[S].querySelector('#price').value * 100;\n }\n\n set value(v) {\n this.setAttribute('value', v);\n this[S].querySelector('#price').value = v;\n }\n\n get currency() {\n return this.getAttribute('currency') || 'PLN';\n }\n\n set currency(value) {\n this.setAttribute('currency', value);\n this[S].querySelector('#currency').textContent = this.currency;\n }\n\n reportValidity() {\n return this[S].querySelector('input').reportValidity();\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n set name(value) {\n this.setAttribute('name', value);\n }\n});\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-basic-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n `;\n\n const form = shadow.querySelector('form');\n form.addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n shadow.querySelector('form-navigation').next();\n })\n }\n});\n","import { S, FORM_STYLE, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-item-form-row', class extends PseudoForm {\n static get observedAttributes() {\n return ['idx', 'name']\n }\n\n constructor() {\n super();\n this[S] = this.attachShadow({ mode: 'closed' });\n\n this.addEventListener('item:removed', () => {\n this.setAttribute('removed', 'removed');\n const parent = this.parentElement;\n this.remove();\n parent.dispatchEvent(new CustomEvent('item:removed', { bubbles: true, composed: true }));\n });\n }\n\n connectedCallback() {\n const idx = this.getAttribute('idx');\n this[S].innerHTML = `\n \n
\n
\n \n \n
\n
\n \n \n \n
\n
\n
\n `;\n this[S].querySelector('form').addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.reportValidity();\n });\n this[S].querySelector('.remove').addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.dispatchEvent(new CustomEvent('item:removed', { bubbles: true, composed: false }));\n });\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'idx': {\n this.updateNames();\n break;\n }\n }\n }\n\n get inputs() {\n return [\n extract(this[S].querySelector('.item-name')),\n extract(this[S].querySelector('.item-price')),\n ];\n }\n\n updateNames() {\n const idx = this.getAttribute('idx');\n for (const el of this[S].querySelectorAll('.field')) {\n const id = el.id;\n el.querySelector('input, price-input').setAttribute('name', `items[${ idx }][${ id }]`);\n }\n }\n\n get idx() {\n return this.getAttribute('idx');\n }\n\n set idx(idx) {\n this.setAttribute('idx', idx);\n }\n\n reportValidity() {\n return super.reportValidity() && this[S].querySelector('price-input').reportValidity();\n }\n});\n\nconst extract = ({ name, value }) => ({ name, value })\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\nimport \"./register-item-form-row\"\n\nconst updateItems = (form) => {\n let idx = 0;\n for (const el of form.querySelectorAll('register-item-form-row')) {\n el.idx = idx++;\n }\n return idx;\n}\n\ncustomElements.define('register-items-form', class extends PseudoForm {\n static get observedAttributes() {\n return []\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n \n
\n
\n \n
\n \n
\n `;\n this.addEventListener('item:removed', ev => {\n ev.stopPropagation();\n updateItems(this)\n });\n this.addEventListener('form:next', ev => {\n for (const el of this.querySelectorAll('item-form-row')) {\n if (!el.reportValidity()) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n });\n shadow.querySelector('#add-item').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.appendChild(document.createElement('register-item-form-row'));\n updateItems(this)\n });\n }\n\n get inputs() {\n return [...this.querySelectorAll(\"register-item-form-row\")].map(form => form.inputs)\n }\n});\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-business-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({mode: \"closed\"});\n\n shadow.innerHTML = `\n \n
\n
\n \n
\n
\n \n \n
\n \n
\n `;\n\n shadow.querySelector('form').addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n shadow.querySelector('form-navigation').next();\n });\n }\n})\n","import { FORM_STYLE, S, PseudoForm } from \"../shared\";\n\ncustomElements.define('register-submit-form', class extends PseudoForm {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n \n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n \n
\n \n \n
\n
\n `;\n }\n\n updateField(name, value) {\n this[S].querySelector(`[id=\"hidden-${ name }\"]`).value = value;\n this[S].querySelector(`[id=\"preview-${ name }\"]`).value = value;\n }\n\n setItems(items) {\n const host = this[S].querySelector('#items');\n host.innerHTML = ``;\n for (const row of items) {\n const el = host.appendChild(document.createElement('div'));\n el.className = 'item-view';\n const [name, price] = row;\n\n el.innerHTML = `\n \n \n \n `;\n }\n }\n\n set accountType(v) {\n this[S].querySelector('#account_type').value = v;\n }\n});\n","customElements.define('register-user-type', class extends HTMLElement {\n constructor() {\n super();\n\n const shadow = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n \n `;\n\n const user = shadow.querySelector('#user');\n user.addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.dispatchEvent(new CustomEvent('account:type:user', { bubbles: true, composed: true }));\n });\n const service = shadow.querySelector('#local-service');\n service.addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n this.dispatchEvent(new CustomEvent('account:type:local-service', { bubbles: true, composed: true }));\n });\n }\n});\n","import { S, FORM_STYLE } from \"../shared\";\n\ncustomElements.define('register-user-form', class extends HTMLElement {\n static get observedAttributes() {\n return ['mode']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n \n \n
\n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n `;\n\n const form = shadow.querySelector('form');\n\n shadow.querySelector('#fb-icon').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n this.mode = 'facebook';\n FB.login((res) => {\n if (res.status === 'connected') {\n FB.api(\"/me?fields=id,name,email\", ({ id, name, email, ...rest }) => {\n console.log(id, name, email, rest);\n form.querySelector('#email').value = email;\n form.querySelector('#login').value = name;\n form.querySelector('#password').value = crypto.randomUUID();\n form.querySelector('#facebook_id').value = id;\n form.submit();\n });\n }\n }, { scope: 'public_profile,email', return_scopes: true });\n });\n\n shadow.querySelector('#email-icon').addEventListener('click', ev => {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.mode = 'email';\n });\n }\n\n connectedCallback() {\n this.mode = '';\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'mode': {\n if (newV !== 'email' && newV !== 'facebook' && newV !== '')\n return;\n this.mode = newV;\n break;\n }\n }\n }\n\n get mode() {\n return this.getAttribute('mode') || ''\n }\n\n set mode(v) {\n this.setAttribute('mode', v);\n }\n});\n","import { S, FORM_STYLE } from \"./shared\";\n\nimport \"./register-form/register-basic-form\";\nimport \"./register-form/register-item-form-row.js\";\nimport \"./register-form/register-items-form.js\";\nimport \"./register-form/register-business-form\";\nimport \"./register-form/register-submit-form\";\nimport \"./register-form/register-user-type\";\nimport \"./register-form/register-user-form\";\n\nconst copyForm = (form, finalForm) => {\n form.reportValidity();\n\n for (const el of form.elements) {\n if (el.name === '') continue;\n if (!el.reportValidity()) {\n return false;\n }\n }\n const inputs = form.inputs;\n if (inputs)\n finalForm.setItems(inputs);\n else\n for (const el of form.elements) {\n if (el.name === '') continue;\n finalForm.updateField(el.name, el.value);\n }\n return true;\n};\n\ncustomElements.define('register-form', class extends HTMLElement {\n static get observedAttributes() {\n return ['step']\n }\n\n constructor() {\n super();\n const shadow = this[S] = this.attachShadow({ mode: 'closed' });\n shadow.innerHTML = `\n \n
\n
\n
\n \n \n \n \n \n \n
\n `;\n\n const finalForm = shadow.querySelector('#step-4');\n this[S].addEventListener('account:type:user', ev => {\n ev.stopPropagation();\n finalForm.accountType = 'User';\n this.step = 40;\n });\n this[S].addEventListener('account:type:local-service', ev => {\n ev.stopPropagation();\n finalForm.accountType = 'Business';\n this.step = 1;\n });\n this[S].addEventListener('form:next', ev => {\n ev.stopPropagation();\n const form = shadow.querySelector(`#step-${ this.step }`);\n if (copyForm(form, finalForm)) {\n this.step = this.step + 1;\n }\n });\n this[S].addEventListener('form:prev', ev => {\n ev.stopPropagation();\n this.step = this.step - 1;\n });\n {\n finalForm.addEventListener('submit', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n });\n }\n }\n\n connectedCallback() {\n this.step = 0;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n }\n }\n\n get step() {\n const step = parseInt(this.getAttribute('step'));\n return isNaN(step) ? 1 : step;\n }\n\n set step(n) {\n if (n < 0) return;\n this.setAttribute('step', n);\n }\n});\n","import { S } from \"../shared.js\";\n\ncustomElements.define('image-input', class extends HTMLElement {\n static get observedAttributes() {\n return ['width', 'height', \"account-id\", \"url\"]\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \"\"\n
\n
\n \n
\n
\n \n
\n
\n `;\n\n shadow.querySelector('#save').addEventListener('click', ev => {\n ev.preventDefault();\n ev.stopPropagation();\n const blobBin = atob(canvas.toDataURL(\"image/webp\", 1.0).split(',')[1]);\n const array = [];\n for (let i = 0; i < blobBin.length; i++) {\n array.push(blobBin.charCodeAt(i));\n }\n const file = new Blob([new Uint8Array(array)], { type: 'image/webp' });\n const form = new FormData;\n form.append(`${ crypto.randomUUID() }.webp`, file);\n fetch(\"/upload\", {\n method: \"POST\",\n body: form,\n }).then(res => res.json()).then(({ path }) => this.url = path);\n });\n\n const f = new FileReader();\n const input = shadow.querySelector('#file');\n const view = shadow.querySelector('#view');\n const img = shadow.querySelector('img');\n const canvas = shadow.querySelector('canvas');\n const ctx = canvas.getContext('2d');\n\n img.addEventListener('load', () => {\n let width, height;\n if (img.width > img.height) {\n width = 200;\n height = (img.height * 200) / img.width;\n } else {\n width = (img.width * 200) / img.height;\n height = 200;\n }\n this.setAttribute('width', width);\n this.setAttribute('height', height);\n\n img.width = width;\n img.height = height;\n ctx.clearRect(0, 0, 200, 200);\n ctx.drawImage(img, 0, 0, width, height);\n });\n input.addEventListener('change', ev => {\n ev.stopPropagation();\n\n f.addEventListener('loadend', (readerEvent) => {\n if (readerEvent.total !== readerEvent.loaded)\n return;\n img.src = readerEvent.target.result || '';\n });\n f.readAsDataURL(ev.target.files[0]);\n });\n\n view.addEventListener('click', ev => {\n ev.stopPropagation();\n input.click();\n });\n }\n\n connectedCallback() {\n this.account_id = this.account_id;\n this.url = this.url;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'account-id':\n return this.account_id = newV;\n case 'url':\n return this.url = newV;\n }\n }\n\n get account_id() {\n return this.getAttribute('account-id');\n }\n\n set account_id(v) {\n this.setAttribute('account-id', v);\n }\n\n get width() {\n const v = parseInt(this.getAttribute('width'));\n return isNaN(v) ? 0 : v;\n }\n\n get height() {\n const v = parseInt(this.getAttribute('height'));\n return isNaN(v) ? 0 : v;\n }\n\n get url() {\n return this.getAttribute('url');\n }\n\n set url(v) {\n this.setAttribute('url', v);\n this[S].querySelector('img').src = v;\n }\n});\n","import { S } from \"../shared.js\";\nimport \"../shared/image-input\";\n\ncustomElements.define('business-item', class extends HTMLElement {\n static get observedAttributes() {\n return ['name', 'price', 'picture-url']\n }\n\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n
\n
\n \n \n
\n `;\n }\n\n connectedCallback() {\n this.name = this.name;\n this.price = this.price;\n this.picture_url = this.picture_url;\n }\n\n attributeChangedCallback(name, oldV, newV) {\n if (oldV === newV) return;\n switch (name) {\n case 'name': return this.name = newV;\n case 'price': return this.price = newV / 100.0;\n case 'picture-url': return this.picture_url = newV;\n }\n }\n\n get name() {\n return this.getAttribute('name');\n }\n set name(v) {\n this.setAttribute('name', v);\n this[S].querySelector('#name').textContent = v;\n }\n\n\n get price() {\n return this.getAttribute('price');\n }\n set price(v) {\n this.setAttribute('price', v);\n this[S].querySelector('price-input').value = v;\n }\n\n\n get picture_url() {\n return this.getAttribute('picture-url');\n }\n set picture_url(v) {\n this.setAttribute('picture-url', v);\n this[S].querySelector('image-input').src = v;\n }\n});\n","import { S } from \"./shared\"\n\nimport \"./business-items/business-item\";\n\ncustomElements.define('business-items', class extends HTMLElement {\n constructor() {\n super();\n\n const shadow = this[S] = this.attachShadow({ mode: \"closed\" });\n\n shadow.innerHTML = `\n \n \n `;\n }\n});\n","import \"./form-navigation.js\";\nimport \"./local-businesses.js\";\nimport \"./login-form.js\";\nimport \"./ow-account.js\";\nimport \"./nav/ow-nav.js\";\nimport \"./nav/ow-path.js\";\nimport \"./price/price-view\";\nimport \"./price/price-input\";\nimport \"./register-form.js\";\nimport \"./business-items\";\n\nimport { fireFbReady } from \"./shared.js\";\n\nif (!document.querySelector('#facebook-jssdk')) {\n window.fbAsyncInit = () => {\n FB.init({\n appId: '1293538251053124',\n cookie: true,\n xfbml: true,\n version: 'v14.0'\n });\n FB.AppEvents.logPageView();\n fireFbReady();\n };\n\n const js = document.createElement('script');\n js.id = 'facebook-jssdk';\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n document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W,GAAG,IAAM;QACvB,EAAE,CAAC,IAAI,CAAC;YACJ,KAAK,EAAI,kBAAkB;YAC3B,MAAM,EAAG,CAAA,CAAI;YACb,KAAK,EAAI,CAAA,CAAI;YACb,OAAO,EAAE,OAAO;SACnB,CAAC,EACF,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,EAC1B,aAAa;KAChB,CAAA;IAED,IAAM,CAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,AAAC;IAC5C,CAAE,CAAC,EAAE,GAAG,gBAAgB,EACxB,CAAE,CAAC,GAAG,GAAG,2CAA2C,EACpD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAE,CAAC;CAChC"} \ No newline at end of file diff --git a/client/src/business-items/business-item.js b/client/src/business-items/business-item.js index 3077b9d..6f88274 100644 --- a/client/src/business-items/business-item.js +++ b/client/src/business-items/business-item.js @@ -25,14 +25,17 @@ customElements.define('business-item', class extends HTMLElement { } connectedCallback() { - this.filter = this.getAttribute('filter'); + this.name = this.name; + this.price = this.price; + this.picture_url = this.picture_url; } attributeChangedCallback(name, oldV, newV) { if (oldV === newV) return; switch (name) { - case 'filter': - return this.filter = newV; + case 'name': return this.name = newV; + case 'price': return this.price = newV / 100.0; + case 'picture-url': return this.picture_url = newV; } } @@ -41,7 +44,7 @@ customElements.define('business-item', class extends HTMLElement { } set name(v) { this.setAttribute('name', v); - this.querySelector('#name').textContent = v; + this[S].querySelector('#name').textContent = v; } @@ -50,7 +53,7 @@ customElements.define('business-item', class extends HTMLElement { } set price(v) { this.setAttribute('price', v); - this.querySelector('price-input').value = v; + this[S].querySelector('price-input').value = v; } @@ -59,6 +62,6 @@ customElements.define('business-item', class extends HTMLElement { } set picture_url(v) { this.setAttribute('picture-url', v); - this.querySelector('image-input').src = v; + this[S].querySelector('image-input').src = v; } }); diff --git a/client/src/shared/image-input.js b/client/src/shared/image-input.js index 1633556..b274818 100644 --- a/client/src/shared/image-input.js +++ b/client/src/shared/image-input.js @@ -1,6 +1,10 @@ import { S } from "../shared.js"; customElements.define('image-input', class extends HTMLElement { + static get observedAttributes() { + return ['width', 'height', "account-id", "url"] + } + constructor() { super(); @@ -10,7 +14,7 @@ customElements.define('image-input', class extends HTMLElement { @@ -19,10 +23,32 @@ customElements.define('image-input', class extends HTMLElement { -
+
+ +
+
+ +
`; + shadow.querySelector('#save').addEventListener('click', ev => { + ev.preventDefault(); + ev.stopPropagation(); + const blobBin = atob(canvas.toDataURL("image/webp", 1.0).split(',')[1]); + const array = []; + for (let i = 0; i < blobBin.length; i++) { + array.push(blobBin.charCodeAt(i)); + } + const file = new Blob([new Uint8Array(array)], { type: 'image/webp' }); + const form = new FormData; + form.append(`${ crypto.randomUUID() }.webp`, file); + fetch("/upload", { + method: "POST", + body: form, + }).then(res => res.json()).then(({ path }) => this.url = path); + }); + const f = new FileReader(); const input = shadow.querySelector('#file'); const view = shadow.querySelector('#view'); @@ -39,13 +65,12 @@ customElements.define('image-input', class extends HTMLElement { width = (img.width * 200) / img.height; height = 200; } - console.log(img.width, img.height); - console.log(width, height); + this.setAttribute('width', width); + this.setAttribute('height', height); + img.width = width; img.height = height; - // ctx.drawImage(img, 0, 0); - ctx.fillStyle = '#F00'; - ctx.rect(0, 0, 200, 200); + ctx.clearRect(0, 0, 200, 200); ctx.drawImage(img, 0, 0, width, height); }); input.addEventListener('change', ev => { @@ -64,4 +89,46 @@ customElements.define('image-input', class extends HTMLElement { input.click(); }); } + + connectedCallback() { + this.account_id = this.account_id; + this.url = this.url; + } + + attributeChangedCallback(name, oldV, newV) { + if (oldV === newV) return; + switch (name) { + case 'account-id': + return this.account_id = newV; + case 'url': + return this.url = newV; + } + } + + get account_id() { + return this.getAttribute('account-id'); + } + + set account_id(v) { + this.setAttribute('account-id', v); + } + + get width() { + const v = parseInt(this.getAttribute('width')); + return isNaN(v) ? 0 : v; + } + + get height() { + const v = parseInt(this.getAttribute('height')); + return isNaN(v) ? 0 : v; + } + + get url() { + return this.getAttribute('url'); + } + + set url(v) { + this.setAttribute('url', v); + this[S].querySelector('img').src = v; + } }); diff --git a/migrations/20220707203500_add_picture_url.sql b/migrations/20220707203500_add_picture_url.sql new file mode 100644 index 0000000..90cc24b --- /dev/null +++ b/migrations/20220707203500_add_picture_url.sql @@ -0,0 +1,2 @@ +ALTER TABLE local_business_items + ADD COLUMN picture_url TEXT NOT NULL UNIQUE; diff --git a/src/model/db.rs b/src/model/db.rs index b56cdc8..26697b9 100644 --- a/src/model/db.rs +++ b/src/model/db.rs @@ -78,4 +78,5 @@ pub struct LocalBusinessItem { pub name: String, pub price: i64, pub item_order: i32, + pub picture_url: String, } diff --git a/src/model/view.rs b/src/model/view.rs index c9249d8..04962ec 100644 --- a/src/model/view.rs +++ b/src/model/view.rs @@ -49,19 +49,21 @@ impl Page { pub struct BusinessItemInput { pub name: String, pub price: u32, + pub picture_url: String, } impl BusinessItemInput { - pub fn new>(name: S, price: u32) -> Self { + pub fn new, P: Into>(name: S, price: u32, picture_url: P) -> Self { Self { name: name.into(), price, + picture_url: picture_url.into(), } } } #[derive(Debug, Serialize, Deserialize)] -pub struct LocalService { +pub struct LocalBusiness { pub id: i32, pub owner_id: i32, pub name: String, @@ -70,7 +72,7 @@ pub struct LocalService { pub items: Vec, } -impl<'v> From<(db::LocalBusiness, &'v mut Vec)> for LocalService { +impl<'v> From<(db::LocalBusiness, &'v mut Vec)> for LocalBusiness { fn from((service, items): (db::LocalBusiness, &'v mut Vec)) -> Self { Self { id: service.id, diff --git a/src/routes/unrestricted.rs b/src/routes/unrestricted.rs index 78f51df..902ffae 100644 --- a/src/routes/unrestricted.rs +++ b/src/routes/unrestricted.rs @@ -6,14 +6,17 @@ use actix_files::Files; use actix_web::web::{Data, ServiceConfig}; use actix_web::*; use askama::Template; +use futures_util::stream::StreamExt as _; use serde::Deserialize; +use serde::Serialize; use std::collections::HashMap; +use std::path::PathBuf; use tracing::*; #[derive(Template)] #[template(path = "index.html")] pub struct IndexTemplate { - services: Vec, + services: Vec, account: Option, error: Option, page: Page, @@ -68,7 +71,8 @@ SELECT local_business_id, name, price, - item_order + item_order, + picture_url FROM local_business_items ORDER BY item_order DESC "#, @@ -88,7 +92,7 @@ ORDER BY item_order DESC use crate::model::view::*; services .into_iter() - .map(|service| LocalService::from((service, &mut items))) + .map(|service| LocalBusiness::from((service, &mut items))) .collect() }; @@ -160,7 +164,7 @@ fn process_items(items: &mut Vec, names: HashMap Some((idx, s.to_string(), value)), + Some(s @ ("name" | "price" | "picture_url")) => Some((idx, s.to_string(), value)), _ => None, } }) @@ -177,6 +181,9 @@ fn process_items(items: &mut Vec, names: HashMap { item.price = value.parse().unwrap_or_default(); } + "picture_url" => { + item.picture_url = value; + } _ => {} }; memo @@ -304,15 +311,16 @@ RETURNING id, owner_id, name, description, state for (idx, item) in form.items.unwrap_or_default().iter().enumerate() { let res: sqlx::Result = sqlx::query_as( r#" -INSERT INTO local_business_items (local_business_id, name, price, item_order) -VALUES ($1, $2, $3, $4) -RETURNING id, local_business_id, name, price, item_order +INSERT INTO local_business_items (local_business_id, name, price, item_order, picture_url) +VALUES ($1, $2, $3, $4, $5) +RETURNING id, local_business_id, name, price, item_order, picture_url "#, ) .bind(business.id) .bind(&item.name) .bind(item.price as i32) .bind(idx as i32) + .bind(item.picture_url) .fetch_one(&mut t) .await; match res { @@ -427,8 +435,47 @@ WHERE email = $1 ) } +#[derive(Serialize)] +struct UploadResponse { + path: String, +} + +#[post("/upload")] +async fn upload( + mut payload: actix_multipart::Multipart, + id: Identity, +) -> Result { + let path = PathBuf::new().join( + id.identity() + .map(|id| format!("./uploads/{id}")) + .unwrap_or_else(|| "./uploads/tmp".into()), + ); + std::fs::create_dir_all(&path)?; + + if let Some(item) = payload.next().await { + let mut field = item?; + let name = field.name(); + tracing::info!("Writing file {:?}", name); + let path = path.join(name); + + while let Some(chunk) = field.next().await { + let chunk = chunk?; + std::fs::write(&path, chunk)?; + } + + Ok(HttpResponse::Ok().json(UploadResponse { + path: path.to_str().unwrap_or_default().into(), + })) + } else { + Ok(HttpResponse::BadRequest().finish()) + } +} + pub fn configure(config: &mut ServiceConfig) { + std::fs::create_dir_all("./uploads").expect("Failed to create ./uploads directory"); + config + .service(Files::new("/uploads", "./uploads")) .service(Files::new("/assets/images", "./assets/images")) .service(Files::new("/assets/css", "./assets/css")) .service( @@ -441,7 +488,8 @@ pub fn configure(config: &mut ServiceConfig) { .service(account_page) .service(register) .service(logout) - .service(login); + .service(login) + .service(upload); } #[cfg(test)]