diff --git a/static/components/chat-dialog/chat-dialog.html b/static/components/chat-dialog/chat-dialog.html deleted file mode 100644 index 5f15ec0..0000000 --- a/static/components/chat-dialog/chat-dialog.html +++ /dev/null @@ -1,95 +0,0 @@ -
- - - - - - - - - - - Close - - -
- - - - - - - - - - -
-
- - - -
- - - -
-
-
diff --git a/static/components/chat-dialog/chat-dialog.js b/static/components/chat-dialog/chat-dialog.js deleted file mode 100644 index 9d304c8..0000000 --- a/static/components/chat-dialog/chat-dialog.js +++ /dev/null @@ -1,224 +0,0 @@ -async function chatDialog(path) { - const template = await loadTemplateAsync(path) - - Vue.component('chat-dialog', { - name: 'chat-dialog', - template, - - props: ['account', 'merchant', 'relays', 'pool'], - data: function () { - return { - dialog: false, - isChat: true, - loading: false, - messagesMap: new Map(), - nostrMessages: [], - newMessage: '', - ordersTable: { - columns: [ - { - name: 'id', - align: 'left', - label: 'ID', - field: 'id' - }, - { - name: 'created_at', - align: 'left', - label: 'Created/Updated', - field: 'created_at', - sortable: true - }, - { - name: 'paid', - align: 'left', - label: 'Paid', - field: 'paid', - sortable: true - }, - { - name: 'shipped', - align: 'left', - label: 'Shipped', - field: 'shipped', - sortable: true - }, - { - name: 'invoice', - align: 'left', - label: 'Invoice', - field: row => - row.payment_options && - row.payment_options.find(p => p.type == 'ln')?.link - } - ], - pagination: { - rowsPerPage: 10 - } - } - } - }, - computed: { - sortedMessages() { - return this.nostrMessages.sort((a, b) => b.created_at - a.created_at) - }, - ordersList() { - let orders = this.nostrMessages - .filter(o => o.json) - .sort((a, b) => b.created_at - a.created_at) - .reduce((acc, cur) => { - const obj = cur.json - const key = obj.id - const curGroup = acc[key] ?? {created_at: cur.timestamp} - return {...acc, [key]: {...curGroup, ...obj}} - }, {}) - - return Object.values(orders) - } - }, - methods: { - async startDialog() { - this.dialog = true - await this.startPool() - }, - async closeDialog() { - this.dialog = false - await this.sub.unsub() - }, - async startPool() { - this.loading = true - let relays = Array.from(this.relays) - let filters = [ - { - kinds: [4], - authors: [this.account.pubkey] - }, - { - kinds: [4], - '#p': [this.account.pubkey] - } - ] - let events = await this.pool.list(relays, filters) - - for (const event of events) { - await this.processMessage(event) - } - - this.nostrMessages = Array.from(this.messagesMap.values()) - this.loading = false - - let sub = this.pool.sub( - relays, - filters.map(f => ({...f, since: Date.now() / 1000})) - ) - sub.on('event', async event => { - await this.processMessage(event) - this.nostrMessages = Array.from(this.messagesMap.values()) - }) - this.sub = sub - }, - async processMessage(event) { - let mine = event.pubkey == this.account.pubkey - let sender = mine ? this.merchant : event.pubkey - - try { - let plaintext - if (this.account.privkey) { - plaintext = await NostrTools.nip04.decrypt( - this.account.privkey, - sender, - event.content - ) - } else if (this.account.useExtension && this.hasNip07) { - plaintext = await window.nostr.nip04.decrypt(sender, event.content) - } - if (plaintext) { - let {text, json} = this.filterJsonMsg(plaintext) - this.messagesMap.set(event.id, { - created_at: event.created_at, - msg: text, - timestamp: timeFromNow(event.created_at * 1000), - sender: `${mine ? 'Me' : 'Merchant'}`, - json - }) - } - return null - } catch { - console.debug('Unable to decrypt message! Not for us...') - return null - } - }, - filterJsonMsg(text) { - let json = null - - if (!isJson(text)) return {text, json} - - json = JSON.parse(text) - if (json.message) { - text = json.message - } else if (json.items) { - text = `Order placed!
OrderID: ${json.id}` - } else if (json.payment_options) { - text = `Invoice for order: ${json.id}
LN ⚡︎` - } - - return {text, json} - }, - async sendMessage() { - if (this.newMessage && this.newMessage.length < 1) return - let event = { - ...(await NostrTools.getBlankEvent()), - kind: 4, - created_at: Math.floor(Date.now() / 1000), - tags: [['p', this.merchant]], - pubkey: this.account.pubkey, - content: await this.encryptMsg() - } - event.id = NostrTools.getEventHash(event) - event.sig = this.signEvent(event) - - let pub = this.pool.publish(Array.from(this.relays), event) - pub.on('ok', () => console.debug(`Event was sent`)) - pub.on('failed', error => console.error(error)) - this.newMessage = '' - }, - async encryptMsg() { - try { - let cypher - if (this.account.privkey) { - cypher = await NostrTools.nip04.encrypt( - this.account.privkey, - this.merchant, - this.newMessage - ) - } else if (this.account.useExtension && this.hasNip07) { - cypher = await window.nostr.nip04.encrypt( - this.merchant, - this.newMessage - ) - } - return cypher - } catch (e) { - console.error(e) - } - }, - async signEvent(event) { - if (this.account.privkey) { - event.sig = await NostrTools.signEvent(event, this.account.privkey) - } else if (this.account.useExtension && this.hasNip07) { - event = await window.nostr.signEvent(event) - } - return event - } - }, - created() { - setTimeout(() => { - if (window.nostr) { - this.hasNip07 = true - } - }, 1000) - } - }) -} diff --git a/static/components/customer-market/customer-market.html b/static/components/customer-market/customer-market.html deleted file mode 100644 index d862ac8..0000000 --- a/static/components/customer-market/customer-market.html +++ /dev/null @@ -1,17 +0,0 @@ -
- - - -
-
- -
-
- -
-
- \ No newline at end of file diff --git a/static/components/customer-market/customer-market.js b/static/components/customer-market/customer-market.js deleted file mode 100644 index 9540597..0000000 --- a/static/components/customer-market/customer-market.js +++ /dev/null @@ -1,66 +0,0 @@ -async function customerMarket(path) { - const template = await loadTemplateAsync(path) - Vue.component('customer-market', { - name: 'customer-market', - template, - - props: ['filtered-products', 'search-text', 'filter-categories'], - data: function () { - return { - search: null, - partialProducts: [], - productsPerPage: 12, - startIndex: 0, - lastProductIndex: 0, - showProducts: true, - } - }, - watch: { - searchText: function () { - this.refreshProducts() - }, - filteredProducts: function () { - this.refreshProducts() - }, - filterCategories: function () { - this.refreshProducts() - } - }, - methods: { - refreshProducts: function () { - this.showProducts = false - this.partialProducts = [] - - this.startIndex = 0 - this.lastProductIndex = Math.min(this.filteredProducts.length, this.productsPerPage) - this.partialProducts.push(...this.filteredProducts.slice(0, this.lastProductIndex)) - - setTimeout(() => { this.showProducts = true }, 0) - }, - - addToCart(item) { - this.$emit('add-to-cart', item) - }, - changePageM(page, opts) { - this.$emit('change-page', page, opts) - }, - - onLoad(_, done) { - setTimeout(() => { - if (this.startIndex >= this.filteredProducts.length) { - done() - return - } - this.startIndex = this.lastProductIndex - this.lastProductIndex = Math.min(this.filteredProducts.length, this.lastProductIndex + this.productsPerPage) - this.partialProducts.push(...this.filteredProducts.slice(this.startIndex, this.lastProductIndex)) - done() - }, 100) - } - }, - created() { - this.lastProductIndex = Math.min(this.filteredProducts.length, 24) - this.partialProducts.push(...this.filteredProducts.slice(0, this.lastProductIndex)) - } - }) -} diff --git a/static/components/customer-orders/customer-orders.html b/static/components/customer-orders/customer-orders.html deleted file mode 100644 index b28af48..0000000 --- a/static/components/customer-orders/customer-orders.html +++ /dev/null @@ -1,145 +0,0 @@ -
- - - No orders! - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - Order ID: - - - - - - - - - - Products - - - - - - - - - - - - - {{ product.orderedQuantity}} x {{ product.name}} - -
-

{{ product.description }}

-
-
-
-
- -
- - - - Shipping Zone: - - - - - Message: - - - - - Invoice: - - - - - - - -
- - -
- -
-
-
- - - -
- -
- -
\ No newline at end of file diff --git a/static/components/customer-orders/customer-orders.js b/static/components/customer-orders/customer-orders.js deleted file mode 100644 index 0aa943a..0000000 --- a/static/components/customer-orders/customer-orders.js +++ /dev/null @@ -1,94 +0,0 @@ -async function customerOrders(path) { - const template = await loadTemplateAsync(path) - - Vue.component('customer-orders', { - name: 'orders', - template, - - props: ['orders', 'products', 'stalls', 'merchants'], - data: function () { - return {} - }, - computed: { - merchantOrders: function () { - return Object.keys(this.orders) - .map(pubkey => ({ - pubkey, - profile: this.merchantProfile(pubkey), - orders: this.orders[pubkey].map(this.enrichOrder) - } - )) - } - }, - methods: { - enrichOrder: function (order) { - const stall = this.stallForOrder(order) - return { - ...order, - stallName: stall?.name || 'Stall', - shippingZone: stall?.shipping?.find(s => s.id === order.shipping_id) || { id: order.shipping_id, name: order.shipping_id }, - invoice: this.invoiceForOrder(order), - products: this.getProductsForOrder(order) - } - }, - stallForOrder: function (order) { - try { - const productId = order.items && order.items[0]?.product_id - if (!productId) return - const product = this.products.find(p => p.id === productId) - if (!product) return - const stall = this.stalls.find(s => s.id === product.stall_id) - if (!stall) return - return stall - } catch (error) { - console.log(error) - } - - }, - invoiceForOrder: function (order) { - try { - const lnPaymentOption = order?.payment_options?.find(p => p.type === 'ln') - if (!lnPaymentOption?.link) return - return decode(lnPaymentOption.link) - } catch (error) { - console.warn(error) - } - }, - - merchantProfile: function (pubkey) { - const merchant = this.merchants.find(m => m.publicKey === pubkey) - return merchant?.profile - }, - - getProductsForOrder: function (order) { - if (!order?.items?.length) return [] - - return order.items.map(i => { - const product = this.products.find(p => p.id === i.product_id) || { id: i.product_id, name: i.product_id } - return { - ...product, - orderedQuantity: i.quantity - } - }) - }, - - showInvoice: function (order) { - if (order.paid) return - const invoice = order?.payment_options?.find(p => p.type === 'ln').link - if (!invoice) return - this.$emit('show-invoice', invoice) - }, - - formatCurrency: function (value, unit) { - return formatCurrency(value, unit) - }, - - fromNow: function (date) { - if (!date) return '' - return moment(date * 1000).fromNow() - } - }, - created() { - } - }) -} diff --git a/static/components/customer-stall-list/customer-stall-list.html b/static/components/customer-stall-list/customer-stall-list.html deleted file mode 100644 index 2ecc7cb..0000000 --- a/static/components/customer-stall-list/customer-stall-list.html +++ /dev/null @@ -1,60 +0,0 @@ -
-
- - -
- - - -
-
- - -
-
{{ stall.name }}
-
- -
- - - -
- - products - -
-
- - -
- - - -
-
-   -
- -
-

{{ stall.description || '' }}

-
- - -
- - - - -
- - Visit Stall - -
-
-
-
-
\ No newline at end of file diff --git a/static/components/customer-stall-list/customer-stall-list.js b/static/components/customer-stall-list/customer-stall-list.js deleted file mode 100644 index 386c838..0000000 --- a/static/components/customer-stall-list/customer-stall-list.js +++ /dev/null @@ -1,27 +0,0 @@ -async function customerStallList(path) { - const template = await loadTemplateAsync(path) - - Vue.component('customer-stall-list', { - name: 'customer-stall-list', - template, - - props: ['stalls'], - data: function () { - return { - showStalls: true - } - }, - watch: { - stalls() { - this.showProducts = false - setTimeout(() => { this.showProducts = true }, 0) - } - }, - computed: {}, - methods: { - - }, - created() { - } - }) -} diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html deleted file mode 100644 index a57c40a..0000000 --- a/static/components/customer-stall/customer-stall.html +++ /dev/null @@ -1,18 +0,0 @@ -
-
-
-
- -
- -
- -
-
-
-
- -
-
- -
\ No newline at end of file diff --git a/static/components/customer-stall/customer-stall.js b/static/components/customer-stall/customer-stall.js deleted file mode 100644 index 0a9cd3a..0000000 --- a/static/components/customer-stall/customer-stall.js +++ /dev/null @@ -1,37 +0,0 @@ -async function customerStall(path) { - const template = await loadTemplateAsync(path) - - Vue.component('customer-stall', { - name: 'customer-stall', - template, - - props: [ - 'stall', - 'products', - 'product-detail', - ], - data: function () { - return { - } - }, - computed: { - product() { - if (this.productDetail) { - return this.products.find(p => p.id == this.productDetail) - } - }, - }, - methods: { - changePageS(page, opts) { - if (page === 'stall' && opts?.product) { - document.getElementById('product-focus-area')?.scrollIntoView() - } - this.$emit('change-page', page, opts) - }, - addToCart(item) { - this.$emit('add-to-cart', item) - }, - - } - }) -} diff --git a/static/components/market-config/market-config.html b/static/components/market-config/market-config.html deleted file mode 100644 index 59b6082..0000000 --- a/static/components/market-config/market-config.html +++ /dev/null @@ -1,191 +0,0 @@ - - -
-
- - - - - - -
-
-
- - -
-
- - - - - - - - - - - - Note - -
-
    -
  • - Here all the mercants of the marketplace are listed. - -
  • -
  • - - You can easily add a new merchant by - entering its public key in the input below. - -
  • -
  • - - When a merchant is added all its products and stalls will be available in the Market page. - -
  • -
-
-
-
- - - -
-
-
- - - - - - - - - - - - - - {{ profile?.name}} - -
-

{{ publicKey }}

-
-
- {{ publicKey }} -
- - - - -
-
-
-
- -
-
- - - - - - - - - - - - - {{ relay}} - - - - - - - -
-
-
- - - - - - - - - - Note - -
-
    -
  • - Here one can customize the look and feel of the Market. - -
  • -
  • - - When the Market Profile is shared (via naddr ) these customisations will be - available to the - customers. - -
  • -
-
-
-
- - - -
-
-
Information
- - - - -
- UI Configurations -
- - - - - - - - - -
- -
- -
-
-
- - -
- - -
-
- -
\ No newline at end of file diff --git a/static/components/market-config/market-config.js b/static/components/market-config/market-config.js deleted file mode 100644 index f271571..0000000 --- a/static/components/market-config/market-config.js +++ /dev/null @@ -1,111 +0,0 @@ -async function marketConfig(path) { - const template = await loadTemplateAsync(path) - Vue.component('market-config', { - name: 'market-config', - props: ['merchants', 'relays', 'config-ui', 'read-notes'], - template, - - data: function () { - return { - tab: 'merchants', - merchantPubkey: null, - relayUrl: null, - configData: { - identifier: null, - name: null, - about: null, - ui: { - picture: null, - banner: null, - theme: null, - darkMode: false - } - }, - themeOptions: [ - 'classic', - 'bitcoin', - 'flamingo', - 'cyber', - 'freedom', - 'mint', - 'autumn', - 'monochrome', - 'salvador' - ] - } - }, - methods: { - addMerchant: async function () { - if (!isValidKey(this.merchantPubkey, 'npub')) { - this.$q.notify({ - message: 'Invalid Public Key!', - type: 'warning' - }) - return - } - const publicKey = isValidKeyHex(this.merchantPubkey) ? this.merchantPubkey : NostrTools.nip19.decode(this.merchantPubkey).data - this.$emit('add-merchant', publicKey) - this.merchantPubkey = null - }, - removeMerchant: async function (publicKey) { - this.$emit('remove-merchant', publicKey) - }, - addRelay: async function () { - const relayUrl = (this.relayUrl || '').trim() - if (!relayUrl.startsWith('wss://') && !relayUrl.startsWith('ws://')) { - this.relayUrl = null - this.$q.notify({ - timeout: 5000, - type: 'warning', - message: `Invalid relay URL.`, - caption: "Should start with 'wss://'' or 'ws://'" - }) - return - } - try { - new URL(relayUrl); - this.$emit('add-relay', relayUrl) - } catch (error) { - this.$q.notify({ - timeout: 5000, - type: 'warning', - message: `Invalid relay URL.`, - caption: `Error: ${error}` - }) - } - - - this.relayUrl = null - }, - removeRelay: async function (relay) { - this.$emit('remove-relay', relay) - }, - updateUiConfig: function () { - const { name, about, ui } = this.configData - console.log('### this.info', { name, about, ui }) - this.$emit('ui-config-update', { name, about, ui }) - }, - publishNaddr() { - this.$emit('publish-naddr') - }, - clearAllData() { - this.$emit('clear-all-data') - }, - markNoteAsRead(noteId) { - this.$emit('note-read', noteId) - } - }, - created: async function () { - if (this.configUi) { - this.configData = { - ...this.configData, - ...this.configUi, - ui: { - ...this.configData.ui, ...(this.configUi.ui || {}) - } - } - } - - } - }) -} diff --git a/static/components/product-card/product-card.html b/static/components/product-card/product-card.html deleted file mode 100644 index df7c1df..0000000 --- a/static/components/product-card/product-card.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Add to cart -
-
{{ product.name }}
-
- -
- - -
- - {{ product.price }} sats BTC {{ (product.price / - 1e8).toFixed(8) }} - - - {{ product.formatedPrice }} - - {{ product.quantity }} left -
-
- - - -
-
-   -
- -
-

{{ product.description }}

-
- - -
- - -
{{ product.stallName }}
-
- - - - -
- - Visit Stall - - - View details - - -
-
-
\ No newline at end of file diff --git a/static/components/product-card/product-card.js b/static/components/product-card/product-card.js deleted file mode 100644 index 5e049df..0000000 --- a/static/components/product-card/product-card.js +++ /dev/null @@ -1,14 +0,0 @@ -async function productCard(path) { - const template = await loadTemplateAsync(path) - Vue.component('product-card', { - name: 'product-card', - template, - - props: ['product', 'change-page', 'add-to-cart', 'is-stall'], - data: function () { - return {} - }, - methods: {}, - created() {} - }) -} diff --git a/static/components/product-detail/product-detail.html b/static/components/product-detail/product-detail.html deleted file mode 100644 index e852e9c..0000000 --- a/static/components/product-detail/product-detail.html +++ /dev/null @@ -1,83 +0,0 @@ -
-
-
- - - - -
-
- -
-
-
- - -
-
-
{{ product.name }}
-
- {{cat}} -
-
{{ product.description }}
-
- - {{ product.price }} satsBTC {{ (product.price / 1e8).toFixed(8) }} - - - {{ product.formatedPrice }} - - {{ product.quantity > 0 ? `In stock. ${product.quantity} left.` : 'Out of stock.' }} -
-
- - -
-
- -
-
-
-
-
diff --git a/static/components/product-detail/product-detail.js b/static/components/product-detail/product-detail.js deleted file mode 100644 index d55b653..0000000 --- a/static/components/product-detail/product-detail.js +++ /dev/null @@ -1,17 +0,0 @@ -async function productDetail(path) { - const template = await loadTemplateAsync(path) - Vue.component('product-detail', { - name: 'product-detail', - template, - - props: ['product', 'add-to-cart'], - data: function () { - return { - slide: 1 - } - }, - computed: {}, - methods: {}, - created() {} - }) -} diff --git a/static/components/shopping-cart-checkout/shopping-cart-checkout.html b/static/components/shopping-cart-checkout/shopping-cart-checkout.html deleted file mode 100644 index ee7ae91..0000000 --- a/static/components/shopping-cart-checkout/shopping-cart-checkout.html +++ /dev/null @@ -1,153 +0,0 @@ -
- - - - - - - - - - - - - - - - - By - - - - - - - - - -
-
- Message: -
-
- -
-
- -
-
- Address: -
-
- - -
-
- -
-
- Email: -
-
- -
-
- -
-
- Npub: -
-
- -
-
- - -
- - - -
-
- Subtotal: -
-
- {{formatCurrency(cartTotal, stall.currency)}} -
-
- -
-
-
-
- Shipping: -
-
- {{formatCurrency(shippingZone.cost, stall.currency)}} -
-
- - - - - - - - -
- -
- -
-
- Total: -
-
- {{formatCurrency(cartTotalWithShipping, stall.currency)}} -
-
- -
-
- - -
- - - - - Payment Method - - -
- - - -
- - Back - - - Place Order - -
-
- - Back - - - Confirm - -
- -
-
- - -
\ No newline at end of file diff --git a/static/components/shopping-cart-checkout/shopping-cart-checkout.js b/static/components/shopping-cart-checkout/shopping-cart-checkout.js deleted file mode 100644 index fa30f8f..0000000 --- a/static/components/shopping-cart-checkout/shopping-cart-checkout.js +++ /dev/null @@ -1,127 +0,0 @@ -async function shoppingCartCheckout(path) { - const template = await loadTemplateAsync(path) - - Vue.component('shopping-cart-checkout', { - name: 'shopping-cart-checkout', - template, - - props: ['cart', 'stall', 'customer-pubkey'], - data: function () { - return { - orderConfirmed: false, - paymentMethod: 'ln', - shippingZone: null, - contactData: { - email: null, - npub: null, - address: null, - message: null - }, - paymentOptions: [ - { - label: 'Lightning Network', - value: 'ln' - }, - { - label: 'BTC Onchain', - value: 'btc' - }, - { - label: 'Cashu', - value: 'cashu' - } - ] - } - }, - computed: { - cartTotal() { - if (!this.cart.products?.length) return 0 - return this.cart.products.reduce((t, p) => p.price + t, 0) - }, - cartTotalWithShipping() { - if (!this.shippingZone) return this.cartTotal - return this.cartTotal + this.shippingZone.cost - }, - shippingZoneLabel() { - if (!this.shippingZone) { - return 'Shipping Zone' - } - const zoneName = this.shippingZone.name.substring(0, 10) - if (this.shippingZone?.name.length < 10) { - return zoneName - } - return zoneName + '...' - } - }, - methods: { - formatCurrency: function (value, unit) { - return formatCurrency(value, unit) - }, - selectShippingZone: function (zone) { - this.shippingZone = zone - }, - - confirmOrder: function () { - if (!this.shippingZone) { - this.$q.notify({ - timeout: 5000, - type: 'warning', - message: 'Please select a shipping zone!', - }) - return - } - this.orderConfirmed = true - }, - async placeOrder() { - if (!this.shippingZone) { - this.$q.notify({ - timeout: 5000, - type: 'warning', - message: 'Please select a shipping zone!', - }) - return - } - if (!this.customerPubkey) { - this.$emit('login-required') - return - } - const order = { - address: this.contactData.address, - message: this.contactData.message, - contact: { - nostr: this.contactData.npub, - email: this.contactData.email - }, - items: Array.from(this.cart.products, p => { - return { product_id: p.id, quantity: p.orderedQuantity } - }), - shipping_id: this.shippingZone.id, - type: 0 - } - const created_at = Math.floor(Date.now() / 1000) - order.id = await hash( - [this.customerPubkey, created_at, JSON.stringify(order)].join(':') - ) - - const event = { - ...(await NostrTools.getBlankEvent()), - kind: 4, - created_at, - tags: [['p', this.stall.pubkey]], - pubkey: this.customerPubkey - } - - this.$emit('place-order', { event, order, cartId: this.cart.id }) - - }, - goToShoppingCart: function () { - this.$emit('change-page', 'shopping-cart-list') - } - }, - created() { - if (this.stall.shipping?.length === 1) { - this.shippingZone = this.stall.shipping[0] - } - } - }) -} diff --git a/static/components/shopping-cart-list/shopping-cart-list.html b/static/components/shopping-cart-list/shopping-cart-list.html deleted file mode 100644 index 8a5cfe3..0000000 --- a/static/components/shopping-cart-list/shopping-cart-list.html +++ /dev/null @@ -1,98 +0,0 @@ -
- - - No products in cart! - - -
- - - - - - - - - - - - - - - - - - By - - - -
- - Clear Cart - -
-
-
- - - - - - - - - - - - - - - - - {{ product.name}} - -
-

{{ product.description }}

-
-
-
- - {{ formatCurrency(product.price, product.currency)}} - - - - - - - - - {{ formatCurrency(product.price * product.orderedQuantity, product.currency)}} - - - -
- -
-
- -
- -
-
-
- - - - - - Total: {{cartTotalFormatted(cart)}} - - Proceed to Checkout - - -
- -
- -
\ No newline at end of file diff --git a/static/components/shopping-cart-list/shopping-cart-list.js b/static/components/shopping-cart-list/shopping-cart-list.js deleted file mode 100644 index 570bd05..0000000 --- a/static/components/shopping-cart-list/shopping-cart-list.js +++ /dev/null @@ -1,37 +0,0 @@ -async function shoppingCartList(path) { - const template = await loadTemplateAsync(path) - - Vue.component('shopping-cart-list', { - name: 'shopping-cart-list', - template, - - props: ['carts'], - data: function () { - return {} - }, - computed: {}, - methods: { - formatCurrency: function (value, unit) { - return formatCurrency(value, unit) - }, - cartTotalFormatted(cart) { - if (!cart.products?.length) return "" - const total = cart.products.reduce((t, p) => p.price + t, 0) - return formatCurrency(total, cart.products[0].currency) - }, - removeProduct: function (stallId, productId) { - this.$emit('remove-from-cart', { stallId, productId }) - }, - removeCart: function (stallId) { - this.$emit('remove-cart', stallId) - }, - quantityChanged: function (product) { - this.$emit('add-to-cart', product) - }, - proceedToCheckout: function(cart){ - this.$emit('checkout-cart', cart) - } - }, - created() { } - }) -} diff --git a/static/components/shopping-cart/shopping-cart.html b/static/components/shopping-cart/shopping-cart.html deleted file mode 100644 index b23c69c..0000000 --- a/static/components/shopping-cart/shopping-cart.html +++ /dev/null @@ -1,61 +0,0 @@ - - - {{ cart.size }} - - - - - - - - - - - - - - - - - - {{ p.name }} - - - - - {{p.currency != 'sat' ? p.formatedPrice : p.price + 'sats'}} - - - - - - -
- -
diff --git a/static/components/shopping-cart/shopping-cart.js b/static/components/shopping-cart/shopping-cart.js deleted file mode 100644 index 19ca32b..0000000 --- a/static/components/shopping-cart/shopping-cart.js +++ /dev/null @@ -1,61 +0,0 @@ -async function shoppingCart(path) { - const template = await loadTemplateAsync(path) - - Vue.component('shopping-cart', { - name: 'shopping-cart', - template, - - props: [ - 'cart', - 'cart-menu', - 'add-to-cart', - 'remove-from-cart', - 'update-qty', - 'reset-cart', - 'products' - ], - data: function () { - return {} - }, - computed: {}, - methods: { - add(id) { - this.$emit( - 'add-to-cart', - this.products.find(p => p.id == id) - ) - }, - remove(id) { - this.$emit( - 'remove-from-cart', - this.products.find(p => p.id == id) - ) - }, - removeProduct(id) { - this.$emit( - 'remove-from-cart', - this.products.find(p => p.id == id), - true - ) - }, - addQty(id, qty) { - if (qty == 0) { - return this.removeProduct(id) - } - let product = this.products.find(p => p.id == id) - if (product.quantity < qty) { - this.$q.notify({ - type: 'warning', - message: `${product.name} only has ${product.quantity} units!`, - icon: 'production_quantity_limits' - }) - let objIdx = this.cartMenu.findIndex(pr => pr.id == id) - this.cartMenu[objIdx].quantity = this.cart.products.get(id).quantity - return - } - this.$emit('update-qty', id, qty) - } - }, - created() {} - }) -} diff --git a/static/components/stall-details/stall-details.js b/static/components/stall-details/stall-details.js index 6a41a43..b77ef5e 100644 --- a/static/components/stall-details/stall-details.js +++ b/static/components/stall-details/stall-details.js @@ -1,8 +1,6 @@ async function stallDetails(path) { const template = await loadTemplateAsync(path) - const pica = window.pica() - Vue.component('stall-details', { name: 'stall-details', template, diff --git a/static/components/user-chat/user-chat.html b/static/components/user-chat/user-chat.html deleted file mode 100644 index d8844d2..0000000 --- a/static/components/user-chat/user-chat.html +++ /dev/null @@ -1,8 +0,0 @@ - -
-
- User Chat -
-
- -
\ No newline at end of file diff --git a/static/components/user-chat/user-chat.js b/static/components/user-chat/user-chat.js deleted file mode 100644 index 250ca0b..0000000 --- a/static/components/user-chat/user-chat.js +++ /dev/null @@ -1,19 +0,0 @@ -async function userChat(path) { - const template = await loadTemplateAsync(path) - Vue.component('user-chat', { - name: 'user-chat', - props: ['user',], - template, - - data: function () { - return { - } - }, - methods: { - - }, - created: async function () { - - } - }) -} diff --git a/static/components/user-config/user-config.html b/static/components/user-config/user-config.html deleted file mode 100644 index 54cc5f1..0000000 --- a/static/components/user-config/user-config.html +++ /dev/null @@ -1,47 +0,0 @@ - - -
-
- - - -
- -
- -
-
- -
-
- - - -
- -
- -
-
-
- - -
- -
-
- No Account -
-
- - -
\ No newline at end of file diff --git a/static/components/user-config/user-config.js b/static/components/user-config/user-config.js deleted file mode 100644 index 9ca33f8..0000000 --- a/static/components/user-config/user-config.js +++ /dev/null @@ -1,30 +0,0 @@ -async function userConfig(path) { - const template = await loadTemplateAsync(path) - Vue.component('user-config', { - name: 'user-config', - props: ['account'], - template, - - data: function () { - return { - } - }, - methods: { - logout: async function () { - LNbits.utils - .confirmDialog( - 'Please make sure you save your private key! You will not be able to recover it later!' - ) - .onOk(async () => { - this.$emit('logout') - }) - }, - copyText(text) { - this.$emit('copy-text', text) - } - }, - created: async function () { - - } - }) -} diff --git a/static/js/market.js b/static/js/market.js deleted file mode 100644 index 2f8bb29..0000000 --- a/static/js/market.js +++ /dev/null @@ -1,977 +0,0 @@ -const market = async () => { - Vue.component(VueQrcode.name, VueQrcode) - - const NostrTools = window.NostrTools - - const defaultRelays = [ - 'wss://relay.damus.io', - 'wss://relay.snort.social', - 'wss://nostr-pub.wellorder.net', - 'wss://nostr.zebedee.cloud', - 'wss://nostr.walletofsatoshi.com' - ] - const eventToObj = event => { - try { - event.content = JSON.parse(event.content) || null - } catch { - event.content = null - } - - - return { - ...event, - ...Object.values(event.tags).reduce((acc, tag) => { - let [key, value] = tag - if (key == 't') { - return { ...acc, [key]: [...(acc[key] || []), value] } - } else { - return { ...acc, [key]: value } - } - }, {}) - } - } - await Promise.all([ - productCard('static/components/product-card/product-card.html'), - customerMarket('static/components/customer-market/customer-market.html'), - customerStall('static/components/customer-stall/customer-stall.html'), - customerStallList('static/components/customer-stall-list/customer-stall-list.html'), - productDetail('static/components/product-detail/product-detail.html'), - shoppingCart('static/components/shopping-cart/shopping-cart.html'), - shoppingCartList('static/components/shopping-cart-list/shopping-cart-list.html'), - shoppingCartCheckout('static/components/shopping-cart-checkout/shopping-cart-checkout.html'), - customerOrders('static/components/customer-orders/customer-orders.html'), - chatDialog('static/components/chat-dialog/chat-dialog.html'), - marketConfig('static/components/market-config/market-config.html'), - userConfig('static/components/user-config/user-config.html'), - userChat('static/components/user-chat/user-chat.html') - ]) - - new Vue({ - el: '#vue', - mixins: [windowMixin], - data: function () { - return { - account: null, - accountMetadata: null, - accountDialog: { - show: false, - data: { - watchOnly: false, - key: null - } - }, - - merchants: [], - shoppingCarts: [], - checkoutCart: null, - checkoutStall: null, - - activePage: 'market', - activeOrderId: null, - dmSubscriptions: {}, - - qrCodeDialog: { - data: { - payment_request: null, - message: null, - }, - dismissMsg: null, - show: false - }, - - - filterCategories: [], - groupByStall: false, - - relays: new Set(), - events: [], - stalls: [], - products: [], - orders: {}, - - bannerImage: null, - logoImage: null, - isLoading: false, - - - profiles: new Map(), - searchText: null, - inputPubkey: null, - inputRelay: null, - activePage: 'market', - activeStall: null, - activeProduct: null, - pool: null, - config: { - opts: null - }, - - - defaultBanner: '/nostrmarket/static/images/nostr-cover.png', - defaultLogo: '/nostrmarket/static/images/nostr-avatar.png', - readNotes: { - merchants: false, - marketUi: false - } - } - }, - watch: { - config(n, o) { - if (!n?.opts?.ui?.banner) { - this.bannerImage = this.defaultBanner - } else { - this.bannerImage = null - setTimeout(() => { - this.bannerImage = this.sanitizeImageSrc(n?.opts?.ui?.banner, this.defaultBanner), 1 - }) - } - if (!n?.opts?.ui?.picture) { - this.logoImage = this.defaultLogo - } else { - this.logoImage = null - setTimeout(() => { - this.logoImage = this.sanitizeImageSrc(n?.opts?.ui?.picture, this.defaultLogo), 1 - }) - } - - }, - searchText(n, o) { - if (!n) return - if (n.toLowerCase().startsWith('naddr')) { - try { - const { type, data } = NostrTools.nip19.decode(n) - if (type !== 'naddr' || data.kind !== 30019) return - LNbits.utils - .confirmDialog('Do you want to import this market profile?') - .onOk(async () => { - await this.checkMarketNaddr(n) - this.searchText = '' - }) - } catch { } - - } - } - }, - computed: { - - filterProducts() { - let products = this.products.filter(p => this.hasCategory(p.categories)) - if (this.activeStall) { - products = products.filter(p => p.stall_id == this.activeStall) - } - if (!this.searchText || this.searchText.length < 2) return products - const searchText = this.searchText.toLowerCase() - return products.filter(p => ( - p.name.toLowerCase().includes(searchText) || - (p.description && - p.description.toLowerCase().includes(searchText)) || - (p.categories && - p.categories.toString().toLowerCase().includes(searchText)) - ) - ) - }, - filterStalls() { - const stalls = this.stalls - .map(s => ( - { - ...s, - categories: this.allStallCatgories(s.id), - images: this.allStallImages(s.id).slice(0, 8), - productCount: this.products.filter(p => p.stall_id === s.id).length - })) - .filter(p => this.hasCategory(p.categories)) - - if (!this.searchText || this.searchText.length < 2) return stalls - - const searchText = this.searchText.toLowerCase() - return this.stalls.filter(s => ( - s.name.toLowerCase().includes(searchText) || - (s.description && - s.description.toLowerCase().includes(searchText)) || - (s.categories && - s.categories.toString().toLowerCase().includes(searchText)) - )) - }, - stallName() { - return this.stalls.find(s => s.id == this.activeStall)?.name || 'Stall' - }, - productName() { - return ( - this.products.find(p => p.id == this.activeProduct)?.name || 'Product' - ) - }, - hasExtension() { - return window.nostr - }, - isValidAccountKey() { - return isValidKey(this.accountDialog.data.key) - }, - - - allCartsItemCount() { - return this.shoppingCarts.map(s => s.products).flat().reduce((t, p) => t + p.orderedQuantity, 0) - }, - - allCategories() { - const categories = this.products.map(p => p.categories).flat().filter(c => !!c) - const countedCategories = categories.reduce((all, c) => { - all[c] = (all[c] || 0) + 1 - return all - }, {}) - const x = Object.keys(countedCategories) - .map(category => ({ - category, - count: countedCategories[category], - selected: this.filterCategories.indexOf(category) !== -1 - })) - .sort((a, b) => b.count - a.count) - return x - } - }, - - async created() { - this.bannerImage = this.defaultBanner - this.logoImage = this.defaultLogo - - this.restoreFromStorage() - - const params = new URLSearchParams(window.location.search) - - await this.checkMarketNaddr(params.get('naddr')) - await this.handleQueryParams(params) - - - // Get notes from Nostr - await this.initNostr() - - - - await this.listenForIncommingDms(this.merchants.map(m => ({ publicKey: m.publicKey, since: this.lastDmForPubkey(m.publicKey) }))) - this.isLoading = false - }, - methods: { - async handleQueryParams(params) { - const merchantPubkey = params.get('merchant') - const stallId = params.get('stall') - const productId = params.get('product') - - // What component to render on start - if (stallId) { - this.setActivePage('customer-stall') - if (productId) { - this.activeProduct = productId - } - this.activeStall = stallId - } - if (merchantPubkey && !(this.merchants.find(m => m.publicKey === merchantPubkey))) { - await LNbits.utils - .confirmDialog( - `We found a merchant pubkey in your request. Do you want to add it to the merchants list?` - ) - .onOk(async () => { - await this.merchants.push({ publicKey: merchantPubkey, profile: null }) - }) - } - - }, - restoreFromStorage() { - this.merchants = this.$q.localStorage.getItem('nostrmarket.merchants') || [] - this.shoppingCarts = this.$q.localStorage.getItem('nostrmarket.shoppingCarts') || [] - - this.account = this.$q.localStorage.getItem('nostrmarket.account') || null - - const uiConfig = this.$q.localStorage.getItem('nostrmarket.marketplaceConfig') || { ui: { darkMode: false } } - - // trigger the `watch` logic - this.config = { ...this.config, opts: { ...this.config.opts, ...uiConfig } } - this.applyUiConfigs(this.config) - - - const prefix = 'nostrmarket.orders.' - const orderKeys = this.$q.localStorage.getAllKeys().filter(k => k.startsWith(prefix)) - orderKeys.forEach(k => { - const pubkey = k.substring(prefix.length) - this.orders[pubkey] = this.$q.localStorage.getItem(k) - }) - - const relays = this.$q.localStorage.getItem('nostrmarket.relays') - this.relays = new Set(relays?.length ? relays : defaultRelays) - - const readNotes = this.$q.localStorage.getItem('nostrmarket.readNotes') || {} - this.readNotes = { ...this.readNotes, ...readNotes } - }, - applyUiConfigs(config = {}) { - const { name, about, ui } = config?.opts || {} - this.$q.localStorage.set('nostrmarket.marketplaceConfig', { name, about, ui }) - if (config.opts?.ui?.theme) { - document.body.setAttribute('data-theme', this.config.opts.ui.theme) - this.$q.localStorage.set('lnbits.theme', this.config.opts.ui.theme) - } - const newDarkMode = config.opts?.ui?.darkMode - if (newDarkMode !== undefined) { - const oldDarkMode = this.$q.localStorage.getItem('lnbits.darkMode') - if (newDarkMode !== oldDarkMode) { - this.$q.dark.toggle() - this.$q.localStorage.set('lnbits.darkMode', newDarkMode) - } - - } - }, - - async createAccount(useExtension = false) { - let nip07 - if (useExtension) { - await this.getFromExtension() - nip07 = true - } - if (isValidKey(this.accountDialog.data.key, 'nsec')) { - let { key, watchOnly } = this.accountDialog.data - if (key.startsWith('n')) { - let { type, data } = NostrTools.nip19.decode(key) - key = data - } - const privkey = watchOnly ? null : key - const pubkey = watchOnly ? key : NostrTools.getPublicKey(key) - this.$q.localStorage.set('nostrmarket.account', { - privkey, - pubkey, - nsec: NostrTools.nip19.nsecEncode(key), - npub: NostrTools.nip19.npubEncode(pubkey), - - useExtension: nip07 ?? false - }) - this.accountDialog.data = { - watchOnly: false, - key: null - } - this.accountDialog.show = false - this.account = this.$q.localStorage.getItem('nostrmarket.account') - } - this.accountDialog.show = false - }, - generateKeyPair() { - this.accountDialog.data.key = NostrTools.generatePrivateKey() - this.accountDialog.data.watchOnly = false - }, - async getFromExtension() { - this.accountDialog.data.key = await window.nostr.getPublicKey() - this.accountDialog.data.watchOnly = true - return - }, - openAccountDialog() { - this.accountDialog.show = true - }, - - - async updateUiConfig(data) { - const { name, about, ui } = data - this.config = { ...this.config, opts: { ...this.config.opts, name, about, ui } } - this.applyUiConfigs(this.config) - }, - - async updateData(events) { - console.log('### updateData', events) - if (events.length < 1) { - this.$q.notify({ - message: 'No matches were found!' - }) - return - } - let products = new Map() - let stalls = new Map() - const deleteEventsIds = events - .filter(e => e.kind === 5) - .map(e => (e.tags || []).filter(t => t[0] === 'e')) - .flat() - .map(t => t[1]) - .filter(t => !!t) - - - this.stalls.forEach(s => stalls.set(s.id, s)) - this.products.forEach(p => products.set(p.id, p)) - - events.map(eventToObj).map(e => { - if (e.kind == 0) { - this.profiles.set(e.pubkey, e.content) - if (e.pubkey == this.account?.pubkey) { - this.accountMetadata = this.profiles.get(this.account.pubkey) - } - this.merchants.filter(m => m.publicKey === e.pubkey).forEach(m => m.profile = e.content) - return - } else if (e.kind == 5) { - console.log('### delete event', e) - } else if (e.kind == 30018) { - //it's a product `d` is the prod. id - products.set(e.d, { ...e.content, pubkey: e.pubkey, id: e.d, categories: e.t, eventId: e.id }) - } else if (e.kind == 30017) { - // it's a stall `d` is the stall id - stalls.set(e.d, { ...e.content, pubkey: e.pubkey, id: e.d, pubkey: e.pubkey }) - } - }) - - this.stalls = await Array.from(stalls.values()) - - this.products = Array.from(products.values()) - .map(obj => { - const stall = this.stalls.find(s => s.id == obj.stall_id) - if (!stall) return - obj.stallName = stall.name - obj.images = obj.images || [obj.image] - if (obj.currency != 'sat') { - obj.formatedPrice = this.getAmountFormated( - obj.price, - obj.currency - ) - } - return obj - }) - .filter(p => p && (deleteEventsIds.indexOf(p.eventId)) === -1) - console.log('### this.products', this.products) - }, - - async initNostr() { - this.isLoading = true - this.pool = new NostrTools.SimplePool() - - const relays = Array.from(this.relays) - - const authors = this.merchants.map(m => m.publicKey) - const events = await this.pool.list(relays, [{ kinds: [0, 30017, 30018], authors }]) - if (!events || events.length == 0) return - await this.updateData(events) - - const lastEvent = events.sort((a, b) => b.created_at - a.created_at)[0] - this.poolSubscribe(lastEvent.created_at) - this.isLoading = false - }, - async poolSubscribe(since) { - const authors = this.merchants.map(m => m.publicKey) - this.pool - .sub(Array.from(this.relays), [{ kinds: [0, 5, 30017, 30018], authors, since }]) - .on( - 'event', - event => { - this.updateData([event]) - }, - { id: 'masterSub' } //pass ID to cancel previous sub - ) - }, - - async checkMarketNaddr(naddr) { - if (!naddr) return - - try { - const { type, data } = NostrTools.nip19.decode(naddr) - if (type !== 'naddr' || data.kind !== 30019) return // just double check - this.config = { - d: data.identifier, - pubkey: data.pubkey, - relays: data.relays - } - } catch (err) { - console.error(err) - return - } - - - try { - // add relays to the set - const pool = new NostrTools.SimplePool() - this.config.relays.forEach(r => this.relays.add(r)) - const event = await pool.get(this.config.relays, { - kinds: [30019], - limit: 1, - authors: [this.config.pubkey], - '#d': [this.config.d] - }) - - if (!event) return - - this.config = { ... this.config, opts: JSON.parse(event.content) } - - this.addMerchants(this.config.opts?.merchants) - this.applyUiConfigs(this.config) - - } catch (error) { - console.warn(error) - } - }, - - - navigateTo(page, opts = { stall: null, product: null, pubkey: null }) { - console.log("### navigateTo", page, opts) - - const { stall, product, pubkey } = opts - const url = new URL(window.location) - - const merchantPubkey = pubkey || this.stalls.find(s => s.id == stall)?.pubkey - url.searchParams.set('merchant', merchantPubkey) - - if (page === 'stall' || page === 'product') { - if (stall) { - this.activeStall = stall - this.setActivePage('customer-stall') - url.searchParams.set('stall', stall) - - this.activeProduct = product - if (product) { - url.searchParams.set('product', product) - } else { - url.searchParams.delete('product') - } - } - } else { - this.activeStall = null - this.activeProduct = null - - url.searchParams.delete('merchant') - url.searchParams.delete('stall') - url.searchParams.delete('product') - - this.setActivePage('market') - } - - window.history.pushState({}, '', url) - // this.activePage = page - }, - copyUrl: function () { - this.copyText(window.location) - }, - copyText: function (text) { - var notify = this.$q.notify - Quasar.utils.copyToClipboard(text).then(function () { - notify({ - message: 'Copied to clipboard!', - position: 'bottom' - }) - }) - }, - getAmountFormated(amount, unit = 'USD') { - return LNbits.utils.formatCurrency(amount, unit) - }, - - setActivePage(page = 'market') { - this.activePage = page - }, - async addRelay(relayUrl) { - let relay = String(relayUrl).trim() - - this.relays.add(relay) - this.$q.localStorage.set(`nostrmarket.relays`, Array.from(this.relays)) - this.initNostr() // todo: improve - }, - removeRelay(relayUrl) { - this.relays.delete(relayUrl) - this.relays = new Set(Array.from(this.relays)) - this.$q.localStorage.set(`nostrmarket.relays`, Array.from(this.relays)) - this.initNostr() // todo: improve - }, - - - - addMerchant(publicKey) { - this.merchants.unshift({ - publicKey, - profile: null - }) - this.$q.localStorage.set('nostrmarket.merchants', this.merchants) - this.initNostr() // todo: improve - }, - addMerchants(publicKeys = []) { - const merchantsPubkeys = this.merchants.map(m => m.publicKey) - - const newMerchants = publicKeys - .filter(p => merchantsPubkeys.indexOf(p) === -1) - .map(p => ({ publicKey: p, profile: null })) - this.merchants.unshift(...newMerchants) - this.$q.localStorage.set('nostrmarket.merchants', this.merchants) - this.initNostr() // todo: improve - }, - removeMerchant(publicKey) { - this.merchants = this.merchants.filter(m => m.publicKey !== publicKey) - this.$q.localStorage.set('nostrmarket.merchants', this.merchants) - this.products = this.products.filter(p => p.pubkey !== publicKey) - this.stalls = this.stalls.filter(p => p.pubkey !== publicKey) - this.initNostr() // todo: improve - }, - - addProductToCart(item) { - let stallCart = this.shoppingCarts.find(s => s.id === item.stall_id) - if (!stallCart) { - stallCart = { - id: item.stall_id, - products: [] - } - this.shoppingCarts.push(stallCart) - } - stallCart.merchant = this.merchants.find(m => m.publicKey === item.pubkey) - - let product = stallCart.products.find(p => p.id === item.id) - if (!product) { - product = { ...item, orderedQuantity: 0 } - stallCart.products.push(product) - - } - product.orderedQuantity = Math.min(product.quantity, item.orderedQuantity || (product.orderedQuantity + 1)) - - this.$q.localStorage.set('nostrmarket.shoppingCarts', this.shoppingCarts) - - this.$q.notify({ - type: 'positive', - message: 'Product added to cart!' - }) - }, - - removeProductFromCart(item) { - const stallCart = this.shoppingCarts.find(c => c.id === item.stallId) - if (stallCart) { - stallCart.products = stallCart.products.filter(p => p.id !== item.productId) - if (!stallCart.products.length) { - this.shoppingCarts = this.shoppingCarts.filter(s => s.id !== item.stallId) - } - this.$q.localStorage.set('nostrmarket.shoppingCarts', this.shoppingCarts) - } - }, - removeCart(cartId) { - this.shoppingCarts = this.shoppingCarts.filter(s => s.id !== cartId) - this.$q.localStorage.set('nostrmarket.shoppingCarts', this.shoppingCarts) - }, - - checkoutStallCart(cart) { - this.checkoutCart = cart - this.checkoutStall = this.stalls.find(s => s.id === cart.id) - this.setActivePage('shopping-cart-checkout') - }, - - async placeOrder({ event, order, cartId }) { - if (!this.account?.privkey) { - this.openAccountDialog() - return - } - try { - this.activeOrderId = order.id - event.content = await NostrTools.nip04.encrypt( - this.account.privkey, - this.checkoutStall.pubkey, - JSON.stringify(order) - ) - - event.id = NostrTools.getEventHash(event) - event.sig = await NostrTools.signEvent(event, this.account.privkey) - - this.sendOrderEvent(event) - this.persistOrderUpdate(this.checkoutStall.pubkey, event.created_at, order) - this.removeCart(cartId) - this.setActivePage('shopping-cart-list') - } catch (error) { - console.warn(error) - this.$q.notify({ - type: 'warning', - message: 'Failed to place order!' - }) - } - }, - - sendOrderEvent(event) { - const pub = this.pool.publish(Array.from(this.relays), event) - this.$q.notify({ - type: 'positive', - message: 'The order has been placed!' - }) - this.qrCodeDialog = { - data: { - payment_request: null, - message: null, - }, - dismissMsg: null, - show: true - } - pub.on('ok', () => { - this.qrCodeDialog.show = true - }) - pub.on('failed', (error) => { - // do not show to user. It is possible that only one relay has failed - console.error(error) - }) - }, - - async listenForIncommingDms(from) { - if (!this.account?.privkey) { - return - } - - try { - const filters = [{ - kinds: [4], - '#p': [this.account.pubkey], - }, { - kinds: [4], - authors: [this.account.pubkey], - }] - - const subs = this.pool.sub(Array.from(this.relays), filters) - subs.on('event', async event => { - const receiverPubkey = event.tags.find(([k, v]) => k === 'p' && v && v !== '')[1] - const isSentByMe = event.pubkey === this.account.pubkey - if (receiverPubkey !== this.account.pubkey && !isSentByMe) { - console.warn('Unexpected DM. Dropped!') - return - } - this.persistDMEvent(event) - const peerPubkey = isSentByMe ? receiverPubkey : event.pubkey - await this.handleIncommingDm(event, peerPubkey) - }) - return subs - } catch (err) { - console.error(`Error: ${err}`) - } - }, - async handleIncommingDm(event, peerPubkey) { - try { - - const plainText = await NostrTools.nip04.decrypt( - this.account.privkey, - peerPubkey, - event.content - ) - console.log('### plainText', plainText) - if (!isJson(plainText)) return - - const jsonData = JSON.parse(plainText) - if ([0, 1, 2].indexOf(jsonData.type) !== -1) { - this.persistOrderUpdate(peerPubkey, event.created_at, jsonData) - } - if (jsonData.type === 1) { - this.handlePaymentRequest(jsonData) - - } else if (jsonData.type === 2) { - this.handleOrderStatusUpdate(jsonData) - } - } catch (e) { - console.warn('Unable to handle incomming DM', e) - } - }, - - handlePaymentRequest(json) { - if (json.id && (json.id !== this.activeOrderId)) { - // not for active order, store somewehre else - return - } - if (!json.payment_options?.length) { - this.qrCodeDialog.data.message = json.message || 'Unexpected error' - return - } - - const paymentRequest = json.payment_options.find(o => o.type == 'ln') - .link - if (!paymentRequest) return - this.qrCodeDialog.data.payment_request = paymentRequest - this.qrCodeDialog.dismissMsg = this.$q.notify({ - timeout: 10000, - message: 'Waiting for payment...' - }) - - }, - - handleOrderStatusUpdate(jsonData) { - if (jsonData.id && (jsonData.id !== this.activeOrderId)) { - // not for active order, store somewehre else - return - } - if (this.qrCodeDialog.dismissMsg) { - this.qrCodeDialog.dismissMsg() - } - this.qrCodeDialog.show = false - const message = jsonData.shipped ? 'Order shipped' : jsonData.paid ? 'Order paid' : 'Order notification' - this.$q.notify({ - type: 'positive', - message: message, - caption: jsonData.message || '' - }) - }, - - persistDMEvent(event) { - const dms = this.$q.localStorage.getItem(`nostrmarket.dm.${event.pubkey}`) || { events: [], lastCreatedAt: 0 } - const existingEvent = dms.events.find(e => e.id === event.id) - if (existingEvent) return - - dms.events.push(event) - dms.events.sort((a, b) => a - b) - dms.lastCreatedAt = dms.events[dms.events.length - 1].created_at - this.$q.localStorage.set(`nostrmarket.dm.${event.pubkey}`, dms) - }, - - lastDmForPubkey(pubkey) { - const dms = this.$q.localStorage.getItem(`nostrmarket.dm.${pubkey}`) - if (!dms) return 0 - return dms.lastCreatedAt - }, - - persistOrderUpdate(pubkey, eventCreatedAt, orderUpdate) { - let orders = this.$q.localStorage.getItem(`nostrmarket.orders.${pubkey}`) || [] - const orderIndex = orders.findIndex(o => o.id === orderUpdate.id) - - if (orderIndex === -1) { - orders.unshift({ - ...orderUpdate, - eventCreatedAt, - createdAt: eventCreatedAt - }) - this.orders[pubkey] = orders - this.orders = { ...this.orders } - this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders) - return - } - - let order = orders[orderIndex] - - if (orderUpdate.type === 0) { - order.createdAt = eventCreatedAt - order = { ...order, ...orderUpdate, message: order.message || orderUpdate.message } - } else { - order = order.eventCreatedAt < eventCreatedAt ? { ...order, ...orderUpdate } : { ...orderUpdate, ...order } - } - - orders.splice(orderIndex, 1, order) - this.orders[pubkey] = orders - this.orders = { ...this.orders } - this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders) - }, - - showInvoiceQr(invoice) { - if (!invoice) return - this.qrCodeDialog = { - data: { - payment_request: invoice - }, - dismissMsg: null, - show: true - } - }, - - toggleCategoryFilter(category) { - const index = this.filterCategories.indexOf(category) - if (index === -1) { - this.filterCategories.push(category) - } else { - this.filterCategories.splice(index, 1) - } - }, - - hasCategory(categories = []) { - if (!this.filterCategories?.length) return true - for (const cat of categories) { - if (this.filterCategories.indexOf(cat) !== -1) return true - } - return false - }, - allStallCatgories(stallId) { - const categories = this.products.filter(p => p.stall_id === stallId).map(p => p.categories).flat().filter(c => !!c) - return Array.from(new Set(categories)) - }, - allStallImages(stallId) { - const images = this.products.filter(p => p.stall_id === stallId).map(p => p.images && p.images[0]).filter(i => !!i) - return Array.from(new Set(images)) - }, - - sanitizeImageSrc(src, defaultValue) { - try { - if (src) { - new URL(src) - return src - } - } catch { } - return defaultValue - }, - - async publishNaddr() { - if (!this.account?.privkey) { - this.openAccountDialog() - this.$q.notify({ - message: 'Login Required!', - icon: 'warning' - }) - return - } - - - const merchants = Array.from(this.merchants.map(m => m.publicKey)) - const { name, about, ui } = this.config?.opts || {} - const content = { merchants, name, about, ui } - const identifier = this.config.identifier ?? crypto.randomUUID() - const event = { - ...(await NostrTools.getBlankEvent()), - kind: 30019, - content: JSON.stringify(content), - created_at: Math.floor(Date.now() / 1000), - tags: [['d', identifier]], - pubkey: this.account.pubkey - } - event.id = NostrTools.getEventHash(event) - try { - event.sig = await NostrTools.signEvent(event, this.account.privkey) - - const pub = this.pool.publish(Array.from(this.relays), event) - pub.on('ok', () => { - console.debug(`Config event was sent`) - }) - pub.on('failed', error => { - console.error(error) - }) - } catch (err) { - console.error(err) - this.$q.notify({ - message: 'Cannot publish market profile', - caption: `Error: ${err}`, - color: 'negative' - }) - return - } - const naddr = NostrTools.nip19.naddrEncode({ - pubkey: event.pubkey, - kind: 30019, - identifier: identifier, - relays: Array.from(this.relays) - }) - this.copyText(naddr) - }, - - logout() { - window.localStorage.removeItem('nostrmarket.account') - window.location.href = window.location.origin + window.location.pathname; - this.account = null - this.accountMetadata = null - }, - - clearAllData() { - LNbits.utils - .confirmDialog( - 'This will remove all information about merchants, products, relays and others. ' + - 'You will NOT be logged out. Do you want to proceed?' - ) - .onOk(async () => { - this.$q.localStorage.getAllKeys() - .filter(key => key !== 'nostrmarket.account') - .forEach(key => window.localStorage.removeItem(key)) - - this.merchants = [] - this.relays = [] - this.orders = [] - this.config = { opts: null } - this.shoppingCarts = [] - this.checkoutCart = null - window.location.href = window.location.origin + window.location.pathname; - - }) - - }, - markNoteAsRead(noteId) { - this.readNotes[noteId] = true - this.$q.localStorage.set('nostrmarket.readNotes', this.readNotes) - } - - } - }) -} - -market() diff --git a/static/js/nostr.bundle.js b/static/js/nostr.bundle.js new file mode 100644 index 0000000..0d41aa7 --- /dev/null +++ b/static/js/nostr.bundle.js @@ -0,0 +1,8705 @@ +"use strict"; +var NostrTools = (() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __commonJS = (cb, mod2) => function __require() { + return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( + isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, + mod2 + )); + var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); + + // + var init_define_process = __esm({ + ""() { + } + }); + + // node_modules/@scure/bip39/wordlists/english.js + var require_english = __commonJS({ + "node_modules/@scure/bip39/wordlists/english.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.wordlist = void 0; + exports.wordlist = `abandon +ability +able +about +above +absent +absorb +abstract +absurd +abuse +access +accident +account +accuse +achieve +acid +acoustic +acquire +across +act +action +actor +actress +actual +adapt +add +addict +address +adjust +admit +adult +advance +advice +aerobic +affair +afford +afraid +again +age +agent +agree +ahead +aim +air +airport +aisle +alarm +album +alcohol +alert +alien +all +alley +allow +almost +alone +alpha +already +also +alter +always +amateur +amazing +among +amount +amused +analyst +anchor +ancient +anger +angle +angry +animal +ankle +announce +annual +another +answer +antenna +antique +anxiety +any +apart +apology +appear +apple +approve +april +arch +arctic +area +arena +argue +arm +armed +armor +army +around +arrange +arrest +arrive +arrow +art +artefact +artist +artwork +ask +aspect +assault +asset +assist +assume +asthma +athlete +atom +attack +attend +attitude +attract +auction +audit +august +aunt +author +auto +autumn +average +avocado +avoid +awake +aware +away +awesome +awful +awkward +axis +baby +bachelor +bacon +badge +bag +balance +balcony +ball +bamboo +banana +banner +bar +barely +bargain +barrel +base +basic +basket +battle +beach +bean +beauty +because +become +beef +before +begin +behave +behind +believe +below +belt +bench +benefit +best +betray +better +between +beyond +bicycle +bid +bike +bind +biology +bird +birth +bitter +black +blade +blame +blanket +blast +bleak +bless +blind +blood +blossom +blouse +blue +blur +blush +board +boat +body +boil +bomb +bone +bonus +book +boost +border +boring +borrow +boss +bottom +bounce +box +boy +bracket +brain +brand +brass +brave +bread +breeze +brick +bridge +brief +bright +bring +brisk +broccoli +broken +bronze +broom +brother +brown +brush +bubble +buddy +budget +buffalo +build +bulb +bulk +bullet +bundle +bunker +burden +burger +burst +bus +business +busy +butter +buyer +buzz +cabbage +cabin +cable +cactus +cage +cake +call +calm +camera +camp +can +canal +cancel +candy +cannon +canoe +canvas +canyon +capable +capital +captain +car +carbon +card +cargo +carpet +carry +cart +case +cash +casino +castle +casual +cat +catalog +catch +category +cattle +caught +cause +caution +cave +ceiling +celery +cement +census +century +cereal +certain +chair +chalk +champion +change +chaos +chapter +charge +chase +chat +cheap +check +cheese +chef +cherry +chest +chicken +chief +child +chimney +choice +choose +chronic +chuckle +chunk +churn +cigar +cinnamon +circle +citizen +city +civil +claim +clap +clarify +claw +clay +clean +clerk +clever +click +client +cliff +climb +clinic +clip +clock +clog +close +cloth +cloud +clown +club +clump +cluster +clutch +coach +coast +coconut +code +coffee +coil +coin +collect +color +column +combine +come +comfort +comic +common +company +concert +conduct +confirm +congress +connect +consider +control +convince +cook +cool +copper +copy +coral +core +corn +correct +cost +cotton +couch +country +couple +course +cousin +cover +coyote +crack +cradle +craft +cram +crane +crash +crater +crawl +crazy +cream +credit +creek +crew +cricket +crime +crisp +critic +crop +cross +crouch +crowd +crucial +cruel +cruise +crumble +crunch +crush +cry +crystal +cube +culture +cup +cupboard +curious +current +curtain +curve +cushion +custom +cute +cycle +dad +damage +damp +dance +danger +daring +dash +daughter +dawn +day +deal +debate +debris +decade +december +decide +decline +decorate +decrease +deer +defense +define +defy +degree +delay +deliver +demand +demise +denial +dentist +deny +depart +depend +deposit +depth +deputy +derive +describe +desert +design +desk +despair +destroy +detail +detect +develop +device +devote +diagram +dial +diamond +diary +dice +diesel +diet +differ +digital +dignity +dilemma +dinner +dinosaur +direct +dirt +disagree +discover +disease +dish +dismiss +disorder +display +distance +divert +divide +divorce +dizzy +doctor +document +dog +doll +dolphin +domain +donate +donkey +donor +door +dose +double +dove +draft +dragon +drama +drastic +draw +dream +dress +drift +drill +drink +drip +drive +drop +drum +dry +duck +dumb +dune +during +dust +dutch +duty +dwarf +dynamic +eager +eagle +early +earn +earth +easily +east +easy +echo +ecology +economy +edge +edit +educate +effort +egg +eight +either +elbow +elder +electric +elegant +element +elephant +elevator +elite +else +embark +embody +embrace +emerge +emotion +employ +empower +empty +enable +enact +end +endless +endorse +enemy +energy +enforce +engage +engine +enhance +enjoy +enlist +enough +enrich +enroll +ensure +enter +entire +entry +envelope +episode +equal +equip +era +erase +erode +erosion +error +erupt +escape +essay +essence +estate +eternal +ethics +evidence +evil +evoke +evolve +exact +example +excess +exchange +excite +exclude +excuse +execute +exercise +exhaust +exhibit +exile +exist +exit +exotic +expand +expect +expire +explain +expose +express +extend +extra +eye +eyebrow +fabric +face +faculty +fade +faint +faith +fall +false +fame +family +famous +fan +fancy +fantasy +farm +fashion +fat +fatal +father +fatigue +fault +favorite +feature +february +federal +fee +feed +feel +female +fence +festival +fetch +fever +few +fiber +fiction +field +figure +file +film +filter +final +find +fine +finger +finish +fire +firm +first +fiscal +fish +fit +fitness +fix +flag +flame +flash +flat +flavor +flee +flight +flip +float +flock +floor +flower +fluid +flush +fly +foam +focus +fog +foil +fold +follow +food +foot +force +forest +forget +fork +fortune +forum +forward +fossil +foster +found +fox +fragile +frame +frequent +fresh +friend +fringe +frog +front +frost +frown +frozen +fruit +fuel +fun +funny +furnace +fury +future +gadget +gain +galaxy +gallery +game +gap +garage +garbage +garden +garlic +garment +gas +gasp +gate +gather +gauge +gaze +general +genius +genre +gentle +genuine +gesture +ghost +giant +gift +giggle +ginger +giraffe +girl +give +glad +glance +glare +glass +glide +glimpse +globe +gloom +glory +glove +glow +glue +goat +goddess +gold +good +goose +gorilla +gospel +gossip +govern +gown +grab +grace +grain +grant +grape +grass +gravity +great +green +grid +grief +grit +grocery +group +grow +grunt +guard +guess +guide +guilt +guitar +gun +gym +habit +hair +half +hammer +hamster +hand +happy +harbor +hard +harsh +harvest +hat +have +hawk +hazard +head +health +heart +heavy +hedgehog +height +hello +helmet +help +hen +hero +hidden +high +hill +hint +hip +hire +history +hobby +hockey +hold +hole +holiday +hollow +home +honey +hood +hope +horn +horror +horse +hospital +host +hotel +hour +hover +hub +huge +human +humble +humor +hundred +hungry +hunt +hurdle +hurry +hurt +husband +hybrid +ice +icon +idea +identify +idle +ignore +ill +illegal +illness +image +imitate +immense +immune +impact +impose +improve +impulse +inch +include +income +increase +index +indicate +indoor +industry +infant +inflict +inform +inhale +inherit +initial +inject +injury +inmate +inner +innocent +input +inquiry +insane +insect +inside +inspire +install +intact +interest +into +invest +invite +involve +iron +island +isolate +issue +item +ivory +jacket +jaguar +jar +jazz +jealous +jeans +jelly +jewel +job +join +joke +journey +joy +judge +juice +jump +jungle +junior +junk +just +kangaroo +keen +keep +ketchup +key +kick +kid +kidney +kind +kingdom +kiss +kit +kitchen +kite +kitten +kiwi +knee +knife +knock +know +lab +label +labor +ladder +lady +lake +lamp +language +laptop +large +later +latin +laugh +laundry +lava +law +lawn +lawsuit +layer +lazy +leader +leaf +learn +leave +lecture +left +leg +legal +legend +leisure +lemon +lend +length +lens +leopard +lesson +letter +level +liar +liberty +library +license +life +lift +light +like +limb +limit +link +lion +liquid +list +little +live +lizard +load +loan +lobster +local +lock +logic +lonely +long +loop +lottery +loud +lounge +love +loyal +lucky +luggage +lumber +lunar +lunch +luxury +lyrics +machine +mad +magic +magnet +maid +mail +main +major +make +mammal +man +manage +mandate +mango +mansion +manual +maple +marble +march +margin +marine +market +marriage +mask +mass +master +match +material +math +matrix +matter +maximum +maze +meadow +mean +measure +meat +mechanic +medal +media +melody +melt +member +memory +mention +menu +mercy +merge +merit +merry +mesh +message +metal +method +middle +midnight +milk +million +mimic +mind +minimum +minor +minute +miracle +mirror +misery +miss +mistake +mix +mixed +mixture +mobile +model +modify +mom +moment +monitor +monkey +monster +month +moon +moral +more +morning +mosquito +mother +motion +motor +mountain +mouse +move +movie +much +muffin +mule +multiply +muscle +museum +mushroom +music +must +mutual +myself +mystery +myth +naive +name +napkin +narrow +nasty +nation +nature +near +neck +need +negative +neglect +neither +nephew +nerve +nest +net +network +neutral +never +news +next +nice +night +noble +noise +nominee +noodle +normal +north +nose +notable +note +nothing +notice +novel +now +nuclear +number +nurse +nut +oak +obey +object +oblige +obscure +observe +obtain +obvious +occur +ocean +october +odor +off +offer +office +often +oil +okay +old +olive +olympic +omit +once +one +onion +online +only +open +opera +opinion +oppose +option +orange +orbit +orchard +order +ordinary +organ +orient +original +orphan +ostrich +other +outdoor +outer +output +outside +oval +oven +over +own +owner +oxygen +oyster +ozone +pact +paddle +page +pair +palace +palm +panda +panel +panic +panther +paper +parade +parent +park +parrot +party +pass +patch +path +patient +patrol +pattern +pause +pave +payment +peace +peanut +pear +peasant +pelican +pen +penalty +pencil +people +pepper +perfect +permit +person +pet +phone +photo +phrase +physical +piano +picnic +picture +piece +pig +pigeon +pill +pilot +pink +pioneer +pipe +pistol +pitch +pizza +place +planet +plastic +plate +play +please +pledge +pluck +plug +plunge +poem +poet +point +polar +pole +police +pond +pony +pool +popular +portion +position +possible +post +potato +pottery +poverty +powder +power +practice +praise +predict +prefer +prepare +present +pretty +prevent +price +pride +primary +print +priority +prison +private +prize +problem +process +produce +profit +program +project +promote +proof +property +prosper +protect +proud +provide +public +pudding +pull +pulp +pulse +pumpkin +punch +pupil +puppy +purchase +purity +purpose +purse +push +put +puzzle +pyramid +quality +quantum +quarter +question +quick +quit +quiz +quote +rabbit +raccoon +race +rack +radar +radio +rail +rain +raise +rally +ramp +ranch +random +range +rapid +rare +rate +rather +raven +raw +razor +ready +real +reason +rebel +rebuild +recall +receive +recipe +record +recycle +reduce +reflect +reform +refuse +region +regret +regular +reject +relax +release +relief +rely +remain +remember +remind +remove +render +renew +rent +reopen +repair +repeat +replace +report +require +rescue +resemble +resist +resource +response +result +retire +retreat +return +reunion +reveal +review +reward +rhythm +rib +ribbon +rice +rich +ride +ridge +rifle +right +rigid +ring +riot +ripple +risk +ritual +rival +river +road +roast +robot +robust +rocket +romance +roof +rookie +room +rose +rotate +rough +round +route +royal +rubber +rude +rug +rule +run +runway +rural +sad +saddle +sadness +safe +sail +salad +salmon +salon +salt +salute +same +sample +sand +satisfy +satoshi +sauce +sausage +save +say +scale +scan +scare +scatter +scene +scheme +school +science +scissors +scorpion +scout +scrap +screen +script +scrub +sea +search +season +seat +second +secret +section +security +seed +seek +segment +select +sell +seminar +senior +sense +sentence +series +service +session +settle +setup +seven +shadow +shaft +shallow +share +shed +shell +sheriff +shield +shift +shine +ship +shiver +shock +shoe +shoot +shop +short +shoulder +shove +shrimp +shrug +shuffle +shy +sibling +sick +side +siege +sight +sign +silent +silk +silly +silver +similar +simple +since +sing +siren +sister +situate +six +size +skate +sketch +ski +skill +skin +skirt +skull +slab +slam +sleep +slender +slice +slide +slight +slim +slogan +slot +slow +slush +small +smart +smile +smoke +smooth +snack +snake +snap +sniff +snow +soap +soccer +social +sock +soda +soft +solar +soldier +solid +solution +solve +someone +song +soon +sorry +sort +soul +sound +soup +source +south +space +spare +spatial +spawn +speak +special +speed +spell +spend +sphere +spice +spider +spike +spin +spirit +split +spoil +sponsor +spoon +sport +spot +spray +spread +spring +spy +square +squeeze +squirrel +stable +stadium +staff +stage +stairs +stamp +stand +start +state +stay +steak +steel +stem +step +stereo +stick +still +sting +stock +stomach +stone +stool +story +stove +strategy +street +strike +strong +struggle +student +stuff +stumble +style +subject +submit +subway +success +such +sudden +suffer +sugar +suggest +suit +summer +sun +sunny +sunset +super +supply +supreme +sure +surface +surge +surprise +surround +survey +suspect +sustain +swallow +swamp +swap +swarm +swear +sweet +swift +swim +swing +switch +sword +symbol +symptom +syrup +system +table +tackle +tag +tail +talent +talk +tank +tape +target +task +taste +tattoo +taxi +teach +team +tell +ten +tenant +tennis +tent +term +test +text +thank +that +theme +then +theory +there +they +thing +this +thought +three +thrive +throw +thumb +thunder +ticket +tide +tiger +tilt +timber +time +tiny +tip +tired +tissue +title +toast +tobacco +today +toddler +toe +together +toilet +token +tomato +tomorrow +tone +tongue +tonight +tool +tooth +top +topic +topple +torch +tornado +tortoise +toss +total +tourist +toward +tower +town +toy +track +trade +traffic +tragic +train +transfer +trap +trash +travel +tray +treat +tree +trend +trial +tribe +trick +trigger +trim +trip +trophy +trouble +truck +true +truly +trumpet +trust +truth +try +tube +tuition +tumble +tuna +tunnel +turkey +turn +turtle +twelve +twenty +twice +twin +twist +two +type +typical +ugly +umbrella +unable +unaware +uncle +uncover +under +undo +unfair +unfold +unhappy +uniform +unique +unit +universe +unknown +unlock +until +unusual +unveil +update +upgrade +uphold +upon +upper +upset +urban +urge +usage +use +used +useful +useless +usual +utility +vacant +vacuum +vague +valid +valley +valve +van +vanish +vapor +various +vast +vault +vehicle +velvet +vendor +venture +venue +verb +verify +version +very +vessel +veteran +viable +vibrant +vicious +victory +video +view +village +vintage +violin +virtual +virus +visa +visit +visual +vital +vivid +vocal +voice +void +volcano +volume +vote +voyage +wage +wagon +wait +walk +wall +walnut +want +warfare +warm +warrior +wash +wasp +waste +water +wave +way +wealth +weapon +wear +weasel +weather +web +wedding +weekend +weird +welcome +west +wet +whale +what +wheat +wheel +when +where +whip +whisper +wide +width +wife +wild +will +win +window +wine +wing +wink +winner +winter +wire +wisdom +wise +wish +witness +wolf +woman +wonder +wood +wool +word +work +world +worry +worth +wrap +wreck +wrestle +wrist +write +wrong +yard +year +yellow +you +young +youth +zebra +zero +zone +zoo`.split("\n"); + } + }); + + // node_modules/@noble/hashes/_assert.js + var require_assert = __commonJS({ + "node_modules/@noble/hashes/_assert.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0; + function number2(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); + } + exports.number = number2; + function bool2(b) { + if (typeof b !== "boolean") + throw new Error(`Expected boolean, not ${b}`); + } + exports.bool = bool2; + function bytes2(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); + } + exports.bytes = bytes2; + function hash2(hash3) { + if (typeof hash3 !== "function" || typeof hash3.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number2(hash3.outputLen); + number2(hash3.blockLen); + } + exports.hash = hash2; + function exists2(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance.finished) + throw new Error("Hash#digest() has already been called"); + } + exports.exists = exists2; + function output2(out, instance) { + bytes2(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } + } + exports.output = output2; + var assert2 = { + number: number2, + bool: bool2, + bytes: bytes2, + hash: hash2, + exists: exists2, + output: output2 + }; + exports.default = assert2; + } + }); + + // node_modules/@noble/hashes/crypto.js + var require_crypto = __commonJS({ + "node_modules/@noble/hashes/crypto.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.crypto = void 0; + exports.crypto = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; + } + }); + + // node_modules/@noble/hashes/utils.js + var require_utils = __commonJS({ + "node_modules/@noble/hashes/utils.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0; + var crypto_1 = require_crypto(); + var u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); + exports.u8 = u8; + var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); + exports.u32 = u32; + var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + exports.createView = createView2; + var rotr2 = (word, shift) => word << 32 - shift | word >>> shift; + exports.rotr = rotr2; + exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; + if (!exports.isLE) + throw new Error("Non little-endian hardware is not supported"); + var hexes3 = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex3(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < uint8a.length; i++) { + hex2 += hexes3[uint8a[i]]; + } + return hex2; + } + exports.bytesToHex = bytesToHex3; + function hexToBytes3(hex2) { + if (typeof hex2 !== "string") { + throw new TypeError("hexToBytes: expected string, got " + typeof hex2); + } + if (hex2.length % 2) + throw new Error("hexToBytes: received invalid unpadded hex"); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("Invalid byte sequence"); + array[i] = byte; + } + return array; + } + exports.hexToBytes = hexToBytes3; + var nextTick = async () => { + }; + exports.nextTick = nextTick; + async function asyncLoop(iters, tick, cb) { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await (0, exports.nextTick)(); + ts += diff; + } + } + exports.asyncLoop = asyncLoop; + function utf8ToBytes3(str) { + if (typeof str !== "string") { + throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + exports.utf8ToBytes = utf8ToBytes3; + function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes3(data); + if (!(data instanceof Uint8Array)) + throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`); + return data; + } + exports.toBytes = toBytes2; + function concatBytes3(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error("Uint8Array list expected"); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + exports.concatBytes = concatBytes3; + var Hash2 = class { + clone() { + return this._cloneInto(); + } + }; + exports.Hash = Hash2; + var isPlainObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]" && obj.constructor === Object; + function checkOpts(defaults, opts) { + if (opts !== void 0 && (typeof opts !== "object" || !isPlainObject(opts))) + throw new TypeError("Options should be object or undefined"); + const merged = Object.assign(defaults, opts); + return merged; + } + exports.checkOpts = checkOpts; + function wrapConstructor2(hashConstructor) { + const hashC = (message) => hashConstructor().update(toBytes2(message)).digest(); + const tmp = hashConstructor(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashConstructor(); + return hashC; + } + exports.wrapConstructor = wrapConstructor2; + function wrapConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; + } + exports.wrapConstructorWithOpts = wrapConstructorWithOpts; + function randomBytes2(bytesLength = 32) { + if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") { + return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); + } + exports.randomBytes = randomBytes2; + } + }); + + // node_modules/@noble/hashes/hmac.js + var require_hmac = __commonJS({ + "node_modules/@noble/hashes/hmac.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hmac = void 0; + var _assert_js_1 = require_assert(); + var utils_js_1 = require_utils(); + var HMAC2 = class extends utils_js_1.Hash { + constructor(hash2, _key) { + super(); + this.finished = false; + this.destroyed = false; + _assert_js_1.default.hash(hash2); + const key = (0, utils_js_1.toBytes)(_key); + this.iHash = hash2.create(); + if (typeof this.iHash.update !== "function") + throw new TypeError("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + pad.set(key.length > blockLen ? hash2.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54; + this.iHash.update(pad); + this.oHash = hash2.create(); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54 ^ 92; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + _assert_js_1.default.exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + _assert_js_1.default.exists(this); + _assert_js_1.default.bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + }; + var hmac2 = (hash2, key, message) => new HMAC2(hash2, key).update(message).digest(); + exports.hmac = hmac2; + exports.hmac.create = (hash2, key) => new HMAC2(hash2, key); + } + }); + + // node_modules/@noble/hashes/pbkdf2.js + var require_pbkdf2 = __commonJS({ + "node_modules/@noble/hashes/pbkdf2.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.pbkdf2Async = exports.pbkdf2 = void 0; + var _assert_js_1 = require_assert(); + var hmac_js_1 = require_hmac(); + var utils_js_1 = require_utils(); + function pbkdf2Init(hash2, _password, _salt, _opts) { + _assert_js_1.default.hash(hash2); + const opts = (0, utils_js_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + _assert_js_1.default.number(c); + _assert_js_1.default.number(dkLen); + _assert_js_1.default.number(asyncTick); + if (c < 1) + throw new Error("PBKDF2: iterations (c) should be >= 1"); + const password = (0, utils_js_1.toBytes)(_password); + const salt = (0, utils_js_1.toBytes)(_salt); + const DK = new Uint8Array(dkLen); + const PRF = hmac_js_1.hmac.create(hash2, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; + } + function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + u.fill(0); + return DK; + } + function pbkdf2(hash2, password, salt, opts) { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash2, password, salt, opts); + let prfW; + const arr = new Uint8Array(4); + const view = (0, utils_js_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); + } + exports.pbkdf2 = pbkdf2; + async function pbkdf2Async(hash2, password, salt, opts) { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash2, password, salt, opts); + let prfW; + const arr = new Uint8Array(4); + const view = (0, utils_js_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await (0, utils_js_1.asyncLoop)(c - 1, asyncTick, (i) => { + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i2 = 0; i2 < Ti.length; i2++) + Ti[i2] ^= u[i2]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); + } + exports.pbkdf2Async = pbkdf2Async; + } + }); + + // node_modules/@noble/hashes/_sha2.js + var require_sha2 = __commonJS({ + "node_modules/@noble/hashes/_sha2.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SHA2 = void 0; + var _assert_js_1 = require_assert(); + var utils_js_1 = require_utils(); + function setBigUint642(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE2 ? 4 : 0; + const l = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE2); + view.setUint32(byteOffset + l, wl, isLE2); + } + var SHA22 = class extends utils_js_1.Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = (0, utils_js_1.createView)(this.buffer); + } + update(data) { + _assert_js_1.default.exists(this); + const { view, buffer, blockLen } = this; + data = (0, utils_js_1.toBytes)(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = (0, utils_js_1.createView)(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + _assert_js_1.default.exists(this); + _assert_js_1.default.output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = (0, utils_js_1.createView)(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE2); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + }; + exports.SHA2 = SHA22; + } + }); + + // node_modules/@noble/hashes/sha256.js + var require_sha256 = __commonJS({ + "node_modules/@noble/hashes/sha256.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sha224 = exports.sha256 = void 0; + var _sha2_js_1 = require_sha2(); + var utils_js_1 = require_utils(); + var Chi2 = (a, b, c) => a & b ^ ~a & c; + var Maj2 = (a, b, c) => a & b ^ a & c ^ b & c; + var SHA256_K2 = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + var IV2 = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SHA256_W2 = new Uint32Array(64); + var SHA2562 = class extends _sha2_js_1.SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV2[0] | 0; + this.B = IV2[1] | 0; + this.C = IV2[2] | 0; + this.D = IV2[3] | 0; + this.E = IV2[4] | 0; + this.F = IV2[5] | 0; + this.G = IV2[6] | 0; + this.H = IV2[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W2[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W2[i - 15]; + const W2 = SHA256_W2[i - 2]; + const s0 = (0, utils_js_1.rotr)(W15, 7) ^ (0, utils_js_1.rotr)(W15, 18) ^ W15 >>> 3; + const s1 = (0, utils_js_1.rotr)(W2, 17) ^ (0, utils_js_1.rotr)(W2, 19) ^ W2 >>> 10; + SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0; + } + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = (0, utils_js_1.rotr)(E, 6) ^ (0, utils_js_1.rotr)(E, 11) ^ (0, utils_js_1.rotr)(E, 25); + const T1 = H + sigma1 + Chi2(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0; + const sigma0 = (0, utils_js_1.rotr)(A, 2) ^ (0, utils_js_1.rotr)(A, 13) ^ (0, utils_js_1.rotr)(A, 22); + const T2 = sigma0 + Maj2(A, B, C) | 0; + H = G; + G = F; + F = E; + E = D + T1 | 0; + D = C; + C = B; + B = A; + A = T1 + T2 | 0; + } + A = A + this.A | 0; + B = B + this.B | 0; + C = C + this.C | 0; + D = D + this.D | 0; + E = E + this.E | 0; + F = F + this.F | 0; + G = G + this.G | 0; + H = H + this.H | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W2.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } + }; + var SHA2242 = class extends SHA2562 { + constructor() { + super(); + this.A = 3238371032 | 0; + this.B = 914150663 | 0; + this.C = 812702999 | 0; + this.D = 4144912697 | 0; + this.E = 4290775857 | 0; + this.F = 1750603025 | 0; + this.G = 1694076839 | 0; + this.H = 3204075428 | 0; + this.outputLen = 28; + } + }; + exports.sha256 = (0, utils_js_1.wrapConstructor)(() => new SHA2562()); + exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA2242()); + } + }); + + // node_modules/@noble/hashes/_u64.js + var require_u64 = __commonJS({ + "node_modules/@noble/hashes/_u64.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.add = exports.toBig = exports.split = exports.fromBig = void 0; + var U32_MASK642 = BigInt(2 ** 32 - 1); + var _32n2 = BigInt(32); + function fromBig2(n, le = false) { + if (le) + return { h: Number(n & U32_MASK642), l: Number(n >> _32n2 & U32_MASK642) }; + return { h: Number(n >> _32n2 & U32_MASK642) | 0, l: Number(n & U32_MASK642) | 0 }; + } + exports.fromBig = fromBig2; + function split2(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig2(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + exports.split = split2; + var toBig2 = (h, l) => BigInt(h >>> 0) << _32n2 | BigInt(l >>> 0); + exports.toBig = toBig2; + var shrSH2 = (h, l, s) => h >>> s; + var shrSL2 = (h, l, s) => h << 32 - s | l >>> s; + var rotrSH2 = (h, l, s) => h >>> s | l << 32 - s; + var rotrSL2 = (h, l, s) => h << 32 - s | l >>> s; + var rotrBH2 = (h, l, s) => h << 64 - s | l >>> s - 32; + var rotrBL2 = (h, l, s) => h >>> s - 32 | l << 64 - s; + var rotr32H2 = (h, l) => l; + var rotr32L2 = (h, l) => h; + var rotlSH2 = (h, l, s) => h << s | l >>> 32 - s; + var rotlSL2 = (h, l, s) => l << s | h >>> 32 - s; + var rotlBH2 = (h, l, s) => l << s - 32 | h >>> 64 - s; + var rotlBL2 = (h, l, s) => h << s - 32 | l >>> 64 - s; + function add2(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; + } + exports.add = add2; + var add3L2 = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + var add3H2 = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; + var add4L2 = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + var add4H2 = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; + var add5L2 = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + var add5H2 = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; + var u642 = { + fromBig: fromBig2, + split: split2, + toBig: exports.toBig, + shrSH: shrSH2, + shrSL: shrSL2, + rotrSH: rotrSH2, + rotrSL: rotrSL2, + rotrBH: rotrBH2, + rotrBL: rotrBL2, + rotr32H: rotr32H2, + rotr32L: rotr32L2, + rotlSH: rotlSH2, + rotlSL: rotlSL2, + rotlBH: rotlBH2, + rotlBL: rotlBL2, + add: add2, + add3L: add3L2, + add3H: add3H2, + add4L: add4L2, + add4H: add4H2, + add5H: add5H2, + add5L: add5L2 + }; + exports.default = u642; + } + }); + + // node_modules/@noble/hashes/sha512.js + var require_sha512 = __commonJS({ + "node_modules/@noble/hashes/sha512.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA512 = void 0; + var _sha2_js_1 = require_sha2(); + var _u64_js_1 = require_u64(); + var utils_js_1 = require_utils(); + var [SHA512_Kh2, SHA512_Kl2] = _u64_js_1.default.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" + ].map((n) => BigInt(n))); + var SHA512_W_H2 = new Uint32Array(80); + var SHA512_W_L2 = new Uint32Array(80); + var SHA5122 = class extends _sha2_js_1.SHA2 { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H2[i] = view.getUint32(offset); + SHA512_W_L2[i] = view.getUint32(offset += 4); + } + for (let i = 16; i < 80; i++) { + const W15h = SHA512_W_H2[i - 15] | 0; + const W15l = SHA512_W_L2[i - 15] | 0; + const s0h = _u64_js_1.default.rotrSH(W15h, W15l, 1) ^ _u64_js_1.default.rotrSH(W15h, W15l, 8) ^ _u64_js_1.default.shrSH(W15h, W15l, 7); + const s0l = _u64_js_1.default.rotrSL(W15h, W15l, 1) ^ _u64_js_1.default.rotrSL(W15h, W15l, 8) ^ _u64_js_1.default.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H2[i - 2] | 0; + const W2l = SHA512_W_L2[i - 2] | 0; + const s1h = _u64_js_1.default.rotrSH(W2h, W2l, 19) ^ _u64_js_1.default.rotrBH(W2h, W2l, 61) ^ _u64_js_1.default.shrSH(W2h, W2l, 6); + const s1l = _u64_js_1.default.rotrSL(W2h, W2l, 19) ^ _u64_js_1.default.rotrBL(W2h, W2l, 61) ^ _u64_js_1.default.shrSL(W2h, W2l, 6); + const SUMl = _u64_js_1.default.add4L(s0l, s1l, SHA512_W_L2[i - 7], SHA512_W_L2[i - 16]); + const SUMh = _u64_js_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H2[i - 7], SHA512_W_H2[i - 16]); + SHA512_W_H2[i] = SUMh | 0; + SHA512_W_L2[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + for (let i = 0; i < 80; i++) { + const sigma1h = _u64_js_1.default.rotrSH(Eh, El, 14) ^ _u64_js_1.default.rotrSH(Eh, El, 18) ^ _u64_js_1.default.rotrBH(Eh, El, 41); + const sigma1l = _u64_js_1.default.rotrSL(Eh, El, 14) ^ _u64_js_1.default.rotrSL(Eh, El, 18) ^ _u64_js_1.default.rotrBL(Eh, El, 41); + const CHIh = Eh & Fh ^ ~Eh & Gh; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = _u64_js_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl2[i], SHA512_W_L2[i]); + const T1h = _u64_js_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh2[i], SHA512_W_H2[i]); + const T1l = T1ll | 0; + const sigma0h = _u64_js_1.default.rotrSH(Ah, Al, 28) ^ _u64_js_1.default.rotrBH(Ah, Al, 34) ^ _u64_js_1.default.rotrBH(Ah, Al, 39); + const sigma0l = _u64_js_1.default.rotrSL(Ah, Al, 28) ^ _u64_js_1.default.rotrBL(Ah, Al, 34) ^ _u64_js_1.default.rotrBL(Ah, Al, 39); + const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = _u64_js_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = _u64_js_1.default.add3L(T1l, sigma0l, MAJl); + Ah = _u64_js_1.default.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah, l: Al } = _u64_js_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = _u64_js_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = _u64_js_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = _u64_js_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = _u64_js_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = _u64_js_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = _u64_js_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = _u64_js_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + SHA512_W_H2.fill(0); + SHA512_W_L2.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + }; + exports.SHA512 = SHA5122; + var SHA512_2242 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 2352822216 | 0; + this.Al = 424955298 | 0; + this.Bh = 1944164710 | 0; + this.Bl = 2312950998 | 0; + this.Ch = 502970286 | 0; + this.Cl = 855612546 | 0; + this.Dh = 1738396948 | 0; + this.Dl = 1479516111 | 0; + this.Eh = 258812777 | 0; + this.El = 2077511080 | 0; + this.Fh = 2011393907 | 0; + this.Fl = 79989058 | 0; + this.Gh = 1067287976 | 0; + this.Gl = 1780299464 | 0; + this.Hh = 286451373 | 0; + this.Hl = 2446758561 | 0; + this.outputLen = 28; + } + }; + var SHA512_2562 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 573645204 | 0; + this.Al = 4230739756 | 0; + this.Bh = 2673172387 | 0; + this.Bl = 3360449730 | 0; + this.Ch = 596883563 | 0; + this.Cl = 1867755857 | 0; + this.Dh = 2520282905 | 0; + this.Dl = 1497426621 | 0; + this.Eh = 2519219938 | 0; + this.El = 2827943907 | 0; + this.Fh = 3193839141 | 0; + this.Fl = 1401305490 | 0; + this.Gh = 721525244 | 0; + this.Gl = 746961066 | 0; + this.Hh = 246885852 | 0; + this.Hl = 2177182882 | 0; + this.outputLen = 32; + } + }; + var SHA3842 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 3418070365 | 0; + this.Al = 3238371032 | 0; + this.Bh = 1654270250 | 0; + this.Bl = 914150663 | 0; + this.Ch = 2438529370 | 0; + this.Cl = 812702999 | 0; + this.Dh = 355462360 | 0; + this.Dl = 4144912697 | 0; + this.Eh = 1731405415 | 0; + this.El = 4290775857 | 0; + this.Fh = 2394180231 | 0; + this.Fl = 1750603025 | 0; + this.Gh = 3675008525 | 0; + this.Gl = 1694076839 | 0; + this.Hh = 1203062813 | 0; + this.Hl = 3204075428 | 0; + this.outputLen = 48; + } + }; + exports.sha512 = (0, utils_js_1.wrapConstructor)(() => new SHA5122()); + exports.sha512_224 = (0, utils_js_1.wrapConstructor)(() => new SHA512_2242()); + exports.sha512_256 = (0, utils_js_1.wrapConstructor)(() => new SHA512_2562()); + exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA3842()); + } + }); + + // node_modules/@scure/base/lib/index.js + var require_lib = __commonJS({ + "node_modules/@scure/base/lib/index.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64url = exports.base64 = exports.base32crockford = exports.base32hex = exports.base32 = exports.base16 = exports.utils = exports.assertNumber = void 0; + function assertNumber2(n) { + if (!Number.isSafeInteger(n)) + throw new Error(`Wrong integer: ${n}`); + } + exports.assertNumber = assertNumber2; + function chain2(...args) { + const wrap = (a, b) => (c) => a(b(c)); + const encode = Array.from(args).reverse().reduce((acc, i) => acc ? wrap(acc, i.encode) : i.encode, void 0); + const decode2 = args.reduce((acc, i) => acc ? wrap(acc, i.decode) : i.decode, void 0); + return { encode, decode: decode2 }; + } + function alphabet2(alphabet3) { + return { + encode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("alphabet.encode input should be an array of numbers"); + return digits.map((i) => { + assertNumber2(i); + if (i < 0 || i >= alphabet3.length) + throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet3.length})`); + return alphabet3[i]; + }); + }, + decode: (input) => { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("alphabet.decode input should be array of strings"); + return input.map((letter) => { + if (typeof letter !== "string") + throw new Error(`alphabet.decode: not string element=${letter}`); + const index = alphabet3.indexOf(letter); + if (index === -1) + throw new Error(`Unknown letter: "${letter}". Allowed: ${alphabet3}`); + return index; + }); + } + }; + } + function join2(separator = "") { + if (typeof separator !== "string") + throw new Error("join separator should be string"); + return { + encode: (from) => { + if (!Array.isArray(from) || from.length && typeof from[0] !== "string") + throw new Error("join.encode input should be array of strings"); + for (let i of from) + if (typeof i !== "string") + throw new Error(`join.encode: non-string input=${i}`); + return from.join(separator); + }, + decode: (to) => { + if (typeof to !== "string") + throw new Error("join.decode input should be string"); + return to.split(separator); + } + }; + } + function padding2(bits, chr = "=") { + assertNumber2(bits); + if (typeof chr !== "string") + throw new Error("padding chr should be string"); + return { + encode(data) { + if (!Array.isArray(data) || data.length && typeof data[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of data) + if (typeof i !== "string") + throw new Error(`padding.encode: non-string input=${i}`); + while (data.length * bits % 8) + data.push(chr); + return data; + }, + decode(input) { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of input) + if (typeof i !== "string") + throw new Error(`padding.decode: non-string input=${i}`); + let end = input.length; + if (end * bits % 8) + throw new Error("Invalid padding: string should have whole number of bytes"); + for (; end > 0 && input[end - 1] === chr; end--) { + if (!((end - 1) * bits % 8)) + throw new Error("Invalid padding: string has too much padding"); + } + return input.slice(0, end); + } + }; + } + function normalize2(fn) { + if (typeof fn !== "function") + throw new Error("normalize fn should be function"); + return { encode: (from) => from, decode: (to) => fn(to) }; + } + function convertRadix3(data, from, to) { + if (from < 2) + throw new Error(`convertRadix: wrong from=${from}, base cannot be less than 2`); + if (to < 2) + throw new Error(`convertRadix: wrong to=${to}, base cannot be less than 2`); + if (!Array.isArray(data)) + throw new Error("convertRadix: data should be array"); + if (!data.length) + return []; + let pos = 0; + const res = []; + const digits = Array.from(data); + digits.forEach((d) => { + assertNumber2(d); + if (d < 0 || d >= from) + throw new Error(`Wrong integer: ${d}`); + }); + while (true) { + let carry = 0; + let done = true; + for (let i = pos; i < digits.length; i++) { + const digit = digits[i]; + const digitBase = from * carry + digit; + if (!Number.isSafeInteger(digitBase) || from * carry / from !== carry || digitBase - digit !== from * carry) { + throw new Error("convertRadix: carry overflow"); + } + carry = digitBase % to; + digits[i] = Math.floor(digitBase / to); + if (!Number.isSafeInteger(digits[i]) || digits[i] * to + carry !== digitBase) + throw new Error("convertRadix: carry overflow"); + if (!done) + continue; + else if (!digits[i]) + pos = i; + else + done = false; + } + res.push(carry); + if (done) + break; + } + for (let i = 0; i < data.length - 1 && data[i] === 0; i++) + res.push(0); + return res.reverse(); + } + var gcd2 = (a, b) => !b ? a : gcd2(b, a % b); + var radix2carry2 = (from, to) => from + (to - gcd2(from, to)); + function convertRadix22(data, from, to, padding3) { + if (!Array.isArray(data)) + throw new Error("convertRadix2: data should be array"); + if (from <= 0 || from > 32) + throw new Error(`convertRadix2: wrong from=${from}`); + if (to <= 0 || to > 32) + throw new Error(`convertRadix2: wrong to=${to}`); + if (radix2carry2(from, to) > 32) { + throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry2(from, to)}`); + } + let carry = 0; + let pos = 0; + const mask = 2 ** to - 1; + const res = []; + for (const n of data) { + assertNumber2(n); + if (n >= 2 ** from) + throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); + carry = carry << from | n; + if (pos + from > 32) + throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); + pos += from; + for (; pos >= to; pos -= to) + res.push((carry >> pos - to & mask) >>> 0); + carry &= 2 ** pos - 1; + } + carry = carry << to - pos & mask; + if (!padding3 && pos >= from) + throw new Error("Excess padding"); + if (!padding3 && carry) + throw new Error(`Non-zero padding: ${carry}`); + if (padding3 && pos > 0) + res.push(carry >>> 0); + return res; + } + function radix3(num) { + assertNumber2(num); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix.encode input should be Uint8Array"); + return convertRadix3(Array.from(bytes2), 2 ** 8, num); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix.decode input should be array of strings"); + return Uint8Array.from(convertRadix3(digits, num, 2 ** 8)); + } + }; + } + function radix22(bits, revPadding = false) { + assertNumber2(bits); + if (bits <= 0 || bits > 32) + throw new Error("radix2: bits should be in (0..32]"); + if (radix2carry2(8, bits) > 32 || radix2carry2(bits, 8) > 32) + throw new Error("radix2: carry overflow"); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix2.encode input should be Uint8Array"); + return convertRadix22(Array.from(bytes2), 8, bits, !revPadding); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix2.decode input should be array of strings"); + return Uint8Array.from(convertRadix22(digits, bits, 8, revPadding)); + } + }; + } + function unsafeWrapper2(fn) { + if (typeof fn !== "function") + throw new Error("unsafeWrapper fn should be function"); + return function(...args) { + try { + return fn.apply(null, args); + } catch (e) { + } + }; + } + function checksum2(len, fn) { + assertNumber2(len); + if (typeof fn !== "function") + throw new Error("checksum fn should be function"); + return { + encode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.encode: input should be Uint8Array"); + const checksum3 = fn(data).slice(0, len); + const res = new Uint8Array(data.length + len); + res.set(data); + res.set(checksum3, data.length); + return res; + }, + decode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.decode: input should be Uint8Array"); + const payload = data.slice(0, -len); + const newChecksum = fn(payload).slice(0, len); + const oldChecksum = data.slice(-len); + for (let i = 0; i < len; i++) + if (newChecksum[i] !== oldChecksum[i]) + throw new Error("Invalid checksum"); + return payload; + } + }; + } + exports.utils = { alphabet: alphabet2, chain: chain2, checksum: checksum2, radix: radix3, radix2: radix22, join: join2, padding: padding2 }; + exports.base16 = chain2(radix22(4), alphabet2("0123456789ABCDEF"), join2("")); + exports.base32 = chain2(radix22(5), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding2(5), join2("")); + exports.base32hex = chain2(radix22(5), alphabet2("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding2(5), join2("")); + exports.base32crockford = chain2(radix22(5), alphabet2("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join2(""), normalize2((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1"))); + exports.base64 = chain2(radix22(6), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding2(6), join2("")); + exports.base64url = chain2(radix22(6), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding2(6), join2("")); + var genBase582 = (abc) => chain2(radix3(58), alphabet2(abc), join2("")); + exports.base58 = genBase582("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); + exports.base58flickr = genBase582("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"); + exports.base58xrp = genBase582("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"); + var XMR_BLOCK_LEN2 = [0, 2, 3, 5, 6, 7, 9, 10, 11]; + exports.base58xmr = { + encode(data) { + let res = ""; + for (let i = 0; i < data.length; i += 8) { + const block = data.subarray(i, i + 8); + res += exports.base58.encode(block).padStart(XMR_BLOCK_LEN2[block.length], "1"); + } + return res; + }, + decode(str) { + let res = []; + for (let i = 0; i < str.length; i += 11) { + const slice = str.slice(i, i + 11); + const blockLen = XMR_BLOCK_LEN2.indexOf(slice.length); + const block = exports.base58.decode(slice); + for (let j = 0; j < block.length - blockLen; j++) { + if (block[j] !== 0) + throw new Error("base58xmr: wrong padding"); + } + res = res.concat(Array.from(block.slice(block.length - blockLen))); + } + return Uint8Array.from(res); + } + }; + var base58check3 = (sha2562) => chain2(checksum2(4, (data) => sha2562(sha2562(data))), exports.base58); + exports.base58check = base58check3; + var BECH_ALPHABET2 = chain2(alphabet2("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join2("")); + var POLYMOD_GENERATORS2 = [996825010, 642813549, 513874426, 1027748829, 705979059]; + function bech32Polymod2(pre) { + const b = pre >> 25; + let chk = (pre & 33554431) << 5; + for (let i = 0; i < POLYMOD_GENERATORS2.length; i++) { + if ((b >> i & 1) === 1) + chk ^= POLYMOD_GENERATORS2[i]; + } + return chk; + } + function bechChecksum2(prefix, words, encodingConst = 1) { + const len = prefix.length; + let chk = 1; + for (let i = 0; i < len; i++) { + const c = prefix.charCodeAt(i); + if (c < 33 || c > 126) + throw new Error(`Invalid prefix (${prefix})`); + chk = bech32Polymod2(chk) ^ c >> 5; + } + chk = bech32Polymod2(chk); + for (let i = 0; i < len; i++) + chk = bech32Polymod2(chk) ^ prefix.charCodeAt(i) & 31; + for (let v of words) + chk = bech32Polymod2(chk) ^ v; + for (let i = 0; i < 6; i++) + chk = bech32Polymod2(chk); + chk ^= encodingConst; + return BECH_ALPHABET2.encode(convertRadix22([chk % 2 ** 30], 30, 5, false)); + } + function genBech322(encoding) { + const ENCODING_CONST = encoding === "bech32" ? 1 : 734539939; + const _words = radix22(5); + const fromWords = _words.decode; + const toWords = _words.encode; + const fromWordsUnsafe = unsafeWrapper2(fromWords); + function encode(prefix, words, limit = 90) { + if (typeof prefix !== "string") + throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`); + if (!Array.isArray(words) || words.length && typeof words[0] !== "number") + throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`); + const actualLength = prefix.length + 7 + words.length; + if (limit !== false && actualLength > limit) + throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); + prefix = prefix.toLowerCase(); + return `${prefix}1${BECH_ALPHABET2.encode(words)}${bechChecksum2(prefix, words, ENCODING_CONST)}`; + } + function decode2(str, limit = 90) { + if (typeof str !== "string") + throw new Error(`bech32.decode input should be string, not ${typeof str}`); + if (str.length < 8 || limit !== false && str.length > limit) + throw new TypeError(`Wrong string length: ${str.length} (${str}). Expected (8..${limit})`); + const lowered = str.toLowerCase(); + if (str !== lowered && str !== str.toUpperCase()) + throw new Error(`String must be lowercase or uppercase`); + str = lowered; + const sepIndex = str.lastIndexOf("1"); + if (sepIndex === 0 || sepIndex === -1) + throw new Error(`Letter "1" must be present between prefix and data only`); + const prefix = str.slice(0, sepIndex); + const _words2 = str.slice(sepIndex + 1); + if (_words2.length < 6) + throw new Error("Data must be at least 6 characters long"); + const words = BECH_ALPHABET2.decode(_words2).slice(0, -6); + const sum = bechChecksum2(prefix, words, ENCODING_CONST); + if (!_words2.endsWith(sum)) + throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); + return { prefix, words }; + } + const decodeUnsafe = unsafeWrapper2(decode2); + function decodeToBytes(str) { + const { prefix, words } = decode2(str, false); + return { prefix, words, bytes: fromWords(words) }; + } + return { encode, decode: decode2, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords }; + } + exports.bech32 = genBech322("bech32"); + exports.bech32m = genBech322("bech32m"); + exports.utf8 = { + encode: (data) => new TextDecoder().decode(data), + decode: (str) => new TextEncoder().encode(str) + }; + exports.hex = chain2(radix22(4), alphabet2("0123456789abcdef"), join2(""), normalize2((s) => { + if (typeof s !== "string" || s.length % 2) + throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); + return s.toLowerCase(); + })); + var CODERS2 = { + utf8: exports.utf8, + hex: exports.hex, + base16: exports.base16, + base32: exports.base32, + base64: exports.base64, + base64url: exports.base64url, + base58: exports.base58, + base58xmr: exports.base58xmr + }; + var coderTypeError2 = `Invalid encoding type. Available types: ${Object.keys(CODERS2).join(", ")}`; + var bytesToString = (type, bytes2) => { + if (typeof type !== "string" || !CODERS2.hasOwnProperty(type)) + throw new TypeError(coderTypeError2); + if (!(bytes2 instanceof Uint8Array)) + throw new TypeError("bytesToString() expects Uint8Array"); + return CODERS2[type].encode(bytes2); + }; + exports.bytesToString = bytesToString; + exports.str = exports.bytesToString; + var stringToBytes = (type, str) => { + if (!CODERS2.hasOwnProperty(type)) + throw new TypeError(coderTypeError2); + if (typeof str !== "string") + throw new TypeError("stringToBytes() expects string"); + return CODERS2[type].decode(str); + }; + exports.stringToBytes = stringToBytes; + exports.bytes = exports.stringToBytes; + } + }); + + // node_modules/@scure/bip39/index.js + var require_bip39 = __commonJS({ + "node_modules/@scure/bip39/index.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.mnemonicToSeedSync = exports.mnemonicToSeed = exports.validateMnemonic = exports.entropyToMnemonic = exports.mnemonicToEntropy = exports.generateMnemonic = void 0; + var _assert_1 = require_assert(); + var pbkdf2_1 = require_pbkdf2(); + var sha256_1 = require_sha256(); + var sha512_1 = require_sha512(); + var utils_1 = require_utils(); + var base_1 = require_lib(); + var isJapanese = (wordlist2) => wordlist2[0] === "\u3042\u3044\u3053\u304F\u3057\u3093"; + function nfkd(str) { + if (typeof str !== "string") + throw new TypeError(`Invalid mnemonic type: ${typeof str}`); + return str.normalize("NFKD"); + } + function normalize2(str) { + const norm = nfkd(str); + const words = norm.split(" "); + if (![12, 15, 18, 21, 24].includes(words.length)) + throw new Error("Invalid mnemonic"); + return { nfkd: norm, words }; + } + function assertEntropy(entropy) { + _assert_1.default.bytes(entropy, 16, 20, 24, 28, 32); + } + function generateMnemonic2(wordlist2, strength = 128) { + _assert_1.default.number(strength); + if (strength % 32 !== 0 || strength > 256) + throw new TypeError("Invalid entropy"); + return entropyToMnemonic((0, utils_1.randomBytes)(strength / 8), wordlist2); + } + exports.generateMnemonic = generateMnemonic2; + var calcChecksum = (entropy) => { + const bitsLeft = 8 - entropy.length / 4; + return new Uint8Array([(0, sha256_1.sha256)(entropy)[0] >> bitsLeft << bitsLeft]); + }; + function getCoder(wordlist2) { + if (!Array.isArray(wordlist2) || wordlist2.length !== 2048 || typeof wordlist2[0] !== "string") + throw new Error("Worlist: expected array of 2048 strings"); + wordlist2.forEach((i) => { + if (typeof i !== "string") + throw new Error(`Wordlist: non-string element: ${i}`); + }); + return base_1.utils.chain(base_1.utils.checksum(1, calcChecksum), base_1.utils.radix2(11, true), base_1.utils.alphabet(wordlist2)); + } + function mnemonicToEntropy(mnemonic, wordlist2) { + const { words } = normalize2(mnemonic); + const entropy = getCoder(wordlist2).decode(words); + assertEntropy(entropy); + return entropy; + } + exports.mnemonicToEntropy = mnemonicToEntropy; + function entropyToMnemonic(entropy, wordlist2) { + assertEntropy(entropy); + const words = getCoder(wordlist2).encode(entropy); + return words.join(isJapanese(wordlist2) ? "\u3000" : " "); + } + exports.entropyToMnemonic = entropyToMnemonic; + function validateMnemonic2(mnemonic, wordlist2) { + try { + mnemonicToEntropy(mnemonic, wordlist2); + } catch (e) { + return false; + } + return true; + } + exports.validateMnemonic = validateMnemonic2; + var salt = (passphrase) => nfkd(`mnemonic${passphrase}`); + function mnemonicToSeed(mnemonic, passphrase = "") { + return (0, pbkdf2_1.pbkdf2Async)(sha512_1.sha512, normalize2(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); + } + exports.mnemonicToSeed = mnemonicToSeed; + function mnemonicToSeedSync2(mnemonic, passphrase = "") { + return (0, pbkdf2_1.pbkdf2)(sha512_1.sha512, normalize2(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); + } + exports.mnemonicToSeedSync = mnemonicToSeedSync2; + } + }); + + // index.ts + var nostr_tools_exports = {}; + __export(nostr_tools_exports, { + Kind: () => Kind, + SimplePool: () => SimplePool, + finishEvent: () => finishEvent, + fj: () => fakejson_exports, + generatePrivateKey: () => generatePrivateKey, + getBlankEvent: () => getBlankEvent, + getEventHash: () => getEventHash, + getPublicKey: () => getPublicKey, + getSignature: () => getSignature, + matchFilter: () => matchFilter, + matchFilters: () => matchFilters, + mergeFilters: () => mergeFilters, + nip04: () => nip04_exports, + nip05: () => nip05_exports, + nip06: () => nip06_exports, + nip10: () => nip10_exports, + nip13: () => nip13_exports, + nip18: () => nip18_exports, + nip19: () => nip19_exports, + nip21: () => nip21_exports, + nip25: () => nip25_exports, + nip26: () => nip26_exports, + nip27: () => nip27_exports, + nip39: () => nip39_exports, + nip42: () => nip42_exports, + nip57: () => nip57_exports, + nip98: () => nip98_exports, + parseReferences: () => parseReferences, + relayInit: () => relayInit, + serializeEvent: () => serializeEvent, + signEvent: () => signEvent, + utils: () => utils_exports2, + validateEvent: () => validateEvent, + verifySignature: () => verifySignature + }); + init_define_process(); + + // keys.ts + init_define_process(); + + // node_modules/@noble/curves/esm/secp256k1.js + init_define_process(); + + // node_modules/@noble/hashes/esm/sha256.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_sha2.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_assert.js + init_define_process(); + function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); + } + function bool(b) { + if (typeof b !== "boolean") + throw new Error(`Expected boolean, not ${b}`); + } + function bytes(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); + } + function hash(hash2) { + if (typeof hash2 !== "function" || typeof hash2.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number(hash2.outputLen); + number(hash2.blockLen); + } + function exists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance.finished) + throw new Error("Hash#digest() has already been called"); + } + function output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } + } + var assert = { + number, + bool, + bytes, + hash, + exists, + output + }; + var assert_default = assert; + + // node_modules/@noble/hashes/esm/utils.js + init_define_process(); + + // node_modules/@noble/hashes/esm/crypto.js + init_define_process(); + var crypto2 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; + + // node_modules/@noble/hashes/esm/utils.js + var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + var rotr = (word, shift) => word << 32 - shift | word >>> shift; + var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; + if (!isLE) + throw new Error("Non little-endian hardware is not supported"); + var hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < uint8a.length; i++) { + hex2 += hexes[uint8a[i]]; + } + return hex2; + } + function hexToBytes(hex2) { + if (typeof hex2 !== "string") { + throw new TypeError("hexToBytes: expected string, got " + typeof hex2); + } + if (hex2.length % 2) + throw new Error("hexToBytes: received invalid unpadded hex"); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("Invalid byte sequence"); + array[i] = byte; + } + return array; + } + function utf8ToBytes(str) { + if (typeof str !== "string") { + throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function toBytes(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + if (!(data instanceof Uint8Array)) + throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`); + return data; + } + function concatBytes(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error("Uint8Array list expected"); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + var Hash = class { + clone() { + return this._cloneInto(); + } + }; + function wrapConstructor(hashConstructor) { + const hashC = (message) => hashConstructor().update(toBytes(message)).digest(); + const tmp = hashConstructor(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashConstructor(); + return hashC; + } + function randomBytes(bytesLength = 32) { + if (crypto2 && typeof crypto2.getRandomValues === "function") { + return crypto2.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); + } + + // node_modules/@noble/hashes/esm/_sha2.js + function setBigUint64(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE2 ? 4 : 0; + const l = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE2); + view.setUint32(byteOffset + l, wl, isLE2); + } + var SHA2 = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + assert_default.exists(this); + const { view, buffer, blockLen } = this; + data = toBytes(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE2); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + }; + + // node_modules/@noble/hashes/esm/sha256.js + var Chi = (a, b, c) => a & b ^ ~a & c; + var Maj = (a, b, c) => a & b ^ a & c ^ b & c; + var SHA256_K = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + var IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SHA256_W = new Uint32Array(64); + var SHA256 = class extends SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; + SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0; + } + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = sigma0 + Maj(A, B, C) | 0; + H = G; + G = F; + F = E; + E = D + T1 | 0; + D = C; + C = B; + B = A; + A = T1 + T2 | 0; + } + A = A + this.A | 0; + B = B + this.B | 0; + C = C + this.C | 0; + D = D + this.D | 0; + E = E + this.E | 0; + F = F + this.F | 0; + G = G + this.G | 0; + H = H + this.H | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } + }; + var SHA224 = class extends SHA256 { + constructor() { + super(); + this.A = 3238371032 | 0; + this.B = 914150663 | 0; + this.C = 812702999 | 0; + this.D = 4144912697 | 0; + this.E = 4290775857 | 0; + this.F = 1750603025 | 0; + this.G = 1694076839 | 0; + this.H = 3204075428 | 0; + this.outputLen = 28; + } + }; + var sha256 = wrapConstructor(() => new SHA256()); + var sha224 = wrapConstructor(() => new SHA224()); + + // node_modules/@noble/curves/esm/abstract/modular.js + init_define_process(); + + // node_modules/@noble/curves/esm/abstract/utils.js + var utils_exports = {}; + __export(utils_exports, { + bitGet: () => bitGet, + bitLen: () => bitLen, + bitMask: () => bitMask, + bitSet: () => bitSet, + bytesToHex: () => bytesToHex2, + bytesToNumberBE: () => bytesToNumberBE, + bytesToNumberLE: () => bytesToNumberLE, + concatBytes: () => concatBytes2, + createHmacDrbg: () => createHmacDrbg, + ensureBytes: () => ensureBytes, + equalBytes: () => equalBytes, + hexToBytes: () => hexToBytes2, + hexToNumber: () => hexToNumber, + numberToBytesBE: () => numberToBytesBE, + numberToBytesLE: () => numberToBytesLE, + numberToHexUnpadded: () => numberToHexUnpadded, + numberToVarBytesBE: () => numberToVarBytesBE, + utf8ToBytes: () => utf8ToBytes2, + validateObject: () => validateObject + }); + init_define_process(); + var _0n = BigInt(0); + var _1n = BigInt(1); + var _2n = BigInt(2); + var u8a = (a) => a instanceof Uint8Array; + var hexes2 = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex2(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < bytes2.length; i++) { + hex2 += hexes2[bytes2[i]]; + } + return hex2; + } + function numberToHexUnpadded(num) { + const hex2 = num.toString(16); + return hex2.length & 1 ? `0${hex2}` : hex2; + } + function hexToNumber(hex2) { + if (typeof hex2 !== "string") + throw new Error("hex string expected, got " + typeof hex2); + return BigInt(hex2 === "" ? "0" : `0x${hex2}`); + } + function hexToBytes2(hex2) { + if (typeof hex2 !== "string") + throw new Error("hex string expected, got " + typeof hex2); + if (hex2.length % 2) + throw new Error("hex string is invalid: unpadded " + hex2.length); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("invalid byte sequence"); + array[i] = byte; + } + return array; + } + function bytesToNumberBE(bytes2) { + return hexToNumber(bytesToHex2(bytes2)); + } + function bytesToNumberLE(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + return hexToNumber(bytesToHex2(Uint8Array.from(bytes2).reverse())); + } + var numberToBytesBE = (n, len) => hexToBytes2(n.toString(16).padStart(len * 2, "0")); + var numberToBytesLE = (n, len) => numberToBytesBE(n, len).reverse(); + var numberToVarBytesBE = (n) => hexToBytes2(numberToHexUnpadded(n)); + function ensureBytes(title, hex2, expectedLength) { + let res; + if (typeof hex2 === "string") { + try { + res = hexToBytes2(hex2); + } catch (e) { + throw new Error(`${title} must be valid hex string, got "${hex2}". Cause: ${e}`); + } + } else if (u8a(hex2)) { + res = Uint8Array.from(hex2); + } else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === "number" && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; + } + function concatBytes2(...arrs) { + const r = new Uint8Array(arrs.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; + arrs.forEach((a) => { + if (!u8a(a)) + throw new Error("Uint8Array expected"); + r.set(a, pad); + pad += a.length; + }); + return r; + } + function equalBytes(b1, b2) { + if (b1.length !== b2.length) + return false; + for (let i = 0; i < b1.length; i++) + if (b1[i] !== b2[i]) + return false; + return true; + } + function utf8ToBytes2(str) { + if (typeof str !== "string") { + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function bitLen(n) { + let len; + for (len = 0; n > _0n; n >>= _1n, len += 1) + ; + return len; + } + var bitGet = (n, pos) => n >> BigInt(pos) & _1n; + var bitSet = (n, pos, value) => n | (value ? _1n : _0n) << BigInt(pos); + var bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; + var u8n = (data) => new Uint8Array(data); + var u8fr = (arr) => Uint8Array.from(arr); + function createHmacDrbg(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== "number" || hashLen < 2) + throw new Error("hashLen must be a number"); + if (typeof qByteLen !== "number" || qByteLen < 2) + throw new Error("qByteLen must be a number"); + if (typeof hmacFn !== "function") + throw new Error("hmacFn must be a function"); + let v = u8n(hashLen); + let k = u8n(hashLen); + let i = 0; + const reset = () => { + v.fill(1); + k.fill(0); + i = 0; + }; + const h = (...b) => hmacFn(k, v, ...b); + const reseed = (seed = u8n()) => { + k = h(u8fr([0]), seed); + v = h(); + if (seed.length === 0) + return; + k = h(u8fr([1]), seed); + v = h(); + }; + const gen = () => { + if (i++ >= 1e3) + throw new Error("drbg: tried 1000 values"); + let len = 0; + const out = []; + while (len < qByteLen) { + v = h(); + const sl = v.slice(); + out.push(sl); + len += v.length; + } + return concatBytes2(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed(seed); + let res = void 0; + while (!(res = pred(gen()))) + reseed(); + reset(); + return res; + }; + return genUntil; + } + var validatorFns = { + bigint: (val) => typeof val === "bigint", + function: (val) => typeof val === "function", + boolean: (val) => typeof val === "boolean", + string: (val) => typeof val === "string", + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) + }; + function validateObject(object, validators, optValidators = {}) { + const checkField = (fieldName, type, isOptional) => { + const checkVal = validatorFns[type]; + if (typeof checkVal !== "function") + throw new Error(`Invalid validator "${type}", expected function`); + const val = object[fieldName]; + if (isOptional && val === void 0) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); + } + }; + for (const [fieldName, type] of Object.entries(validators)) + checkField(fieldName, type, false); + for (const [fieldName, type] of Object.entries(optValidators)) + checkField(fieldName, type, true); + return object; + } + + // node_modules/@noble/curves/esm/abstract/modular.js + var _0n2 = BigInt(0); + var _1n2 = BigInt(1); + var _2n2 = BigInt(2); + var _3n = BigInt(3); + var _4n = BigInt(4); + var _5n = BigInt(5); + var _8n = BigInt(8); + var _9n = BigInt(9); + var _16n = BigInt(16); + function mod(a, b) { + const result = a % b; + return result >= _0n2 ? result : b + result; + } + function pow(num, power, modulo) { + if (modulo <= _0n2 || power < _0n2) + throw new Error("Expected power/modulo > 0"); + if (modulo === _1n2) + return _0n2; + let res = _1n2; + while (power > _0n2) { + if (power & _1n2) + res = res * num % modulo; + num = num * num % modulo; + power >>= _1n2; + } + return res; + } + function pow2(x, power, modulo) { + let res = x; + while (power-- > _0n2) { + res *= res; + res %= modulo; + } + return res; + } + function invert(number2, modulo) { + if (number2 === _0n2 || modulo <= _0n2) { + throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); + } + let a = mod(number2, modulo); + let b = modulo; + let x = _0n2, y = _1n2, u = _1n2, v = _0n2; + while (a !== _0n2) { + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd2 = b; + if (gcd2 !== _1n2) + throw new Error("invert: does not exist"); + return mod(x, modulo); + } + function tonelliShanks(P) { + const legendreC = (P - _1n2) / _2n2; + let Q, S, Z; + for (Q = P - _1n2, S = 0; Q % _2n2 === _0n2; Q /= _2n2, S++) + ; + for (Z = _2n2; Z < P && pow(Z, legendreC, P) !== P - _1n2; Z++) + ; + if (S === 1) { + const p1div4 = (P + _1n2) / _4n; + return function tonelliFast(Fp2, n) { + const root = Fp2.pow(n, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + const Q1div2 = (Q + _1n2) / _2n2; + return function tonelliSlow(Fp2, n) { + if (Fp2.pow(n, legendreC) === Fp2.neg(Fp2.ONE)) + throw new Error("Cannot find square root"); + let r = S; + let g = Fp2.pow(Fp2.mul(Fp2.ONE, Z), Q); + let x = Fp2.pow(n, Q1div2); + let b = Fp2.pow(n, Q); + while (!Fp2.eql(b, Fp2.ONE)) { + if (Fp2.eql(b, Fp2.ZERO)) + return Fp2.ZERO; + let m = 1; + for (let t2 = Fp2.sqr(b); m < r; m++) { + if (Fp2.eql(t2, Fp2.ONE)) + break; + t2 = Fp2.sqr(t2); + } + const ge2 = Fp2.pow(g, _1n2 << BigInt(r - m - 1)); + g = Fp2.sqr(ge2); + x = Fp2.mul(x, ge2); + b = Fp2.mul(b, g); + r = m; + } + return x; + }; + } + function FpSqrt(P) { + if (P % _4n === _3n) { + const p1div4 = (P + _1n2) / _4n; + return function sqrt3mod4(Fp2, n) { + const root = Fp2.pow(n, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _8n === _5n) { + const c1 = (P - _5n) / _8n; + return function sqrt5mod8(Fp2, n) { + const n2 = Fp2.mul(n, _2n2); + const v = Fp2.pow(n2, c1); + const nv = Fp2.mul(n, v); + const i = Fp2.mul(Fp2.mul(nv, _2n2), v); + const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE)); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _16n === _9n) { + } + return tonelliShanks(P); + } + var FIELD_FIELDS = [ + "create", + "isValid", + "is0", + "neg", + "inv", + "sqrt", + "sqr", + "eql", + "add", + "sub", + "mul", + "pow", + "div", + "addN", + "subN", + "mulN", + "sqrN" + ]; + function validateField(field) { + const initial = { + ORDER: "bigint", + MASK: "bigint", + BYTES: "isSafeInteger", + BITS: "isSafeInteger" + }; + const opts = FIELD_FIELDS.reduce((map, val) => { + map[val] = "function"; + return map; + }, initial); + return validateObject(field, opts); + } + function FpPow(f2, num, power) { + if (power < _0n2) + throw new Error("Expected power > 0"); + if (power === _0n2) + return f2.ONE; + if (power === _1n2) + return num; + let p = f2.ONE; + let d = num; + while (power > _0n2) { + if (power & _1n2) + p = f2.mul(p, d); + d = f2.sqr(d); + power >>= _1n2; + } + return p; + } + function FpInvertBatch(f2, nums) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (f2.is0(num)) + return acc; + tmp[i] = acc; + return f2.mul(acc, num); + }, f2.ONE); + const inverted = f2.inv(lastMultiplied); + nums.reduceRight((acc, num, i) => { + if (f2.is0(num)) + return acc; + tmp[i] = f2.mul(acc, tmp[i]); + return f2.mul(acc, num); + }, inverted); + return tmp; + } + function nLength(n, nBitLength) { + const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; + } + function Field(ORDER, bitLen2, isLE2 = false, redef = {}) { + if (ORDER <= _0n2) + throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2); + if (BYTES > 2048) + throw new Error("Field lengths over 2048 bytes are not supported"); + const sqrtP = FpSqrt(ORDER); + const f2 = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: bitMask(BITS), + ZERO: _0n2, + ONE: _1n2, + create: (num) => mod(num, ORDER), + isValid: (num) => { + if (typeof num !== "bigint") + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n2 <= num && num < ORDER; + }, + is0: (num) => num === _0n2, + isOdd: (num) => (num & _1n2) === _1n2, + neg: (num) => mod(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod(num * num, ORDER), + add: (lhs, rhs) => mod(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod(lhs * rhs, ORDER), + pow: (num, power) => FpPow(f2, num, power), + div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert(num, ORDER), + sqrt: redef.sqrt || ((n) => sqrtP(f2, n)), + invertBatch: (lst) => FpInvertBatch(f2, lst), + cmov: (a, b, c) => c ? b : a, + toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), + fromBytes: (bytes2) => { + if (bytes2.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); + return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2); + } + }); + return Object.freeze(f2); + } + function hashToPrivateScalar(hash2, groupOrder, isLE2 = false) { + hash2 = ensureBytes("privateHash", hash2); + const hashLen = hash2.length; + const minLen = nLength(groupOrder).nByteLength + 8; + if (minLen < 24 || hashLen < minLen || hashLen > 1024) + throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); + const num = isLE2 ? bytesToNumberLE(hash2) : bytesToNumberBE(hash2); + return mod(num, groupOrder - _1n2) + _1n2; + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + init_define_process(); + + // node_modules/@noble/curves/esm/abstract/curve.js + init_define_process(); + var _0n3 = BigInt(0); + var _1n3 = BigInt(1); + function wNAF(c, bits) { + const constTimeNegate = (condition, item) => { + const neg = item.negate(); + return condition ? neg : item; + }; + const opts = (W) => { + const windows = Math.ceil(bits / W) + 1; + const windowSize = 2 ** (W - 1); + return { windows, windowSize }; + }; + return { + constTimeNegate, + unsafeLadder(elm, n) { + let p = c.ZERO; + let d = elm; + while (n > _0n3) { + if (n & _1n3) + p = p.add(d); + d = d.double(); + n >>= _1n3; + } + return p; + }, + precomputeWindow(elm, W) { + const { windows, windowSize } = opts(W); + const points = []; + let p = elm; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < windowSize; i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + }, + wNAF(W, precomputes, n) { + const { windows, windowSize } = opts(W); + let p = c.ZERO; + let f2 = c.BASE; + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n3; + } + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; + const cond1 = window % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f2 = f2.add(constTimeNegate(cond1, precomputes[offset1])); + } else { + p = p.add(constTimeNegate(cond2, precomputes[offset2])); + } + } + return { p, f: f2 }; + }, + wNAFCached(P, precomputesMap, n, transform) { + const W = P._WINDOW_SIZE || 1; + let comp = precomputesMap.get(P); + if (!comp) { + comp = this.precomputeWindow(P, W); + if (W !== 1) { + precomputesMap.set(P, transform(comp)); + } + } + return this.wNAF(W, comp, n); + } + }; + } + function validateBasic(curve) { + validateField(curve.Fp); + validateObject(curve, { + n: "bigint", + h: "bigint", + Gx: "field", + Gy: "field" + }, { + nBitLength: "isSafeInteger", + nByteLength: "isSafeInteger" + }); + return Object.freeze({ + ...nLength(curve.n, curve.nBitLength), + ...curve, + ...{ p: curve.Fp.ORDER } + }); + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + function validatePointOpts(curve) { + const opts = validateBasic(curve); + validateObject(opts, { + a: "field", + b: "field" + }, { + allowedPrivateKeyLengths: "array", + wrapPrivateKey: "boolean", + isTorsionFree: "function", + clearCofactor: "function", + allowInfinityPoint: "boolean", + fromBytes: "function", + toBytes: "function" + }); + const { endo, Fp: Fp2, a } = opts; + if (endo) { + if (!Fp2.eql(a, Fp2.ZERO)) { + throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); + } + if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { + throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); + } + } + return Object.freeze({ ...opts }); + } + var { bytesToNumberBE: b2n, hexToBytes: h2b } = utils_exports; + var DER = { + Err: class DERErr extends Error { + constructor(m = "") { + super(m); + } + }, + _parseInt(data) { + const { Err: E } = DER; + if (data.length < 2 || data[0] !== 2) + throw new E("Invalid signature integer tag"); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E("Invalid signature integer: wrong length"); + if (res[0] & 128) + throw new E("Invalid signature integer: negative"); + if (res[0] === 0 && !(res[1] & 128)) + throw new E("Invalid signature integer: unnecessary leading zero"); + return { d: b2n(res), l: data.subarray(len + 2) }; + }, + toSig(hex2) { + const { Err: E } = DER; + const data = typeof hex2 === "string" ? h2b(hex2) : hex2; + if (!(data instanceof Uint8Array)) + throw new Error("ui8a expected"); + let l = data.length; + if (l < 2 || data[0] != 48) + throw new E("Invalid signature tag"); + if (data[1] !== l - 2) + throw new E("Invalid signature: incorrect length"); + const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); + const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); + if (rBytesLeft.length) + throw new E("Invalid signature: left bytes after parsing"); + return { r, s }; + }, + hexFromSig(sig) { + const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2; + const h = (num) => { + const hex2 = num.toString(16); + return hex2.length & 1 ? `0${hex2}` : hex2; + }; + const s = slice(h(sig.s)); + const r = slice(h(sig.r)); + const shl = s.length / 2; + const rhl = r.length / 2; + const sl = h(shl); + const rl = h(rhl); + return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; + } + }; + var _0n4 = BigInt(0); + var _1n4 = BigInt(1); + var _2n3 = BigInt(2); + var _3n2 = BigInt(3); + var _4n2 = BigInt(4); + function weierstrassPoints(opts) { + const CURVE = validatePointOpts(opts); + const { Fp: Fp2 } = CURVE; + const toBytes2 = CURVE.toBytes || ((c, point, isCompressed) => { + const a = point.toAffine(); + return concatBytes2(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y)); + }); + const fromBytes = CURVE.fromBytes || ((bytes2) => { + const tail = bytes2.subarray(1); + const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x, y }; + }); + function weierstrassEquation(x) { + const { a, b } = CURVE; + const x2 = Fp2.sqr(x); + const x3 = Fp2.mul(x2, x); + return Fp2.add(Fp2.add(x3, Fp2.mul(x, a)), b); + } + if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) + throw new Error("bad generator point: equation left != right"); + function isWithinCurveOrder(num) { + return typeof num === "bigint" && _0n4 < num && num < CURVE.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error("Expected valid bigint: 0 < bigint < curve.n"); + } + function normPrivateKeyToScalar(key) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; + if (lengths && typeof key !== "bigint") { + if (key instanceof Uint8Array) + key = bytesToHex2(key); + if (typeof key !== "string" || !lengths.includes(key.length)) + throw new Error("Invalid key"); + key = key.padStart(nByteLength * 2, "0"); + } + let num; + try { + num = typeof key === "bigint" ? key : bytesToNumberBE(ensureBytes("private key", key, nByteLength)); + } catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); + } + if (wrapPrivateKey) + num = mod(num, n); + assertGE(num); + return num; + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point3)) + throw new Error("ProjectivePoint expected"); + } + class Point3 { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp2.isValid(px)) + throw new Error("x required"); + if (py == null || !Fp2.isValid(py)) + throw new Error("y required"); + if (pz == null || !Fp2.isValid(pz)) + throw new Error("z required"); + } + static fromAffine(p) { + const { x, y } = p || {}; + if (!p || !Fp2.isValid(x) || !Fp2.isValid(y)) + throw new Error("invalid affine point"); + if (p instanceof Point3) + throw new Error("projective point not allowed"); + const is0 = (i) => Fp2.eql(i, Fp2.ZERO); + if (is0(x) && is0(y)) + return Point3.ZERO; + return new Point3(x, y, Fp2.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + static normalizeZ(points) { + const toInv = Fp2.invertBatch(points.map((p) => p.pz)); + return points.map((p, i) => p.toAffine(toInv[i])).map(Point3.fromAffine); + } + static fromHex(hex2) { + const P = Point3.fromAffine(fromBytes(ensureBytes("pointHex", hex2))); + P.assertValidity(); + return P; + } + static fromPrivateKey(privateKey) { + return Point3.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + assertValidity() { + if (this.is0()) { + if (CURVE.allowInfinityPoint) + return; + throw new Error("bad point: ZERO"); + } + const { x, y } = this.toAffine(); + if (!Fp2.isValid(x) || !Fp2.isValid(y)) + throw new Error("bad point: x or y not FE"); + const left = Fp2.sqr(y); + const right = weierstrassEquation(x); + if (!Fp2.eql(left, right)) + throw new Error("bad point: equation left != right"); + if (!this.isTorsionFree()) + throw new Error("bad point: not in prime-order subgroup"); + } + hasEvenY() { + const { y } = this.toAffine(); + if (Fp2.isOdd) + return !Fp2.isOdd(y); + throw new Error("Field doesn't support isOdd"); + } + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U1 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); + const U2 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); + return U1 && U2; + } + negate() { + return new Point3(this.px, Fp2.neg(this.py), this.pz); + } + double() { + const { a, b } = CURVE; + const b3 = Fp2.mul(b, _3n2); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + let t0 = Fp2.mul(X1, X1); + let t1 = Fp2.mul(Y1, Y1); + let t2 = Fp2.mul(Z1, Z1); + let t3 = Fp2.mul(X1, Y1); + t3 = Fp2.add(t3, t3); + Z3 = Fp2.mul(X1, Z1); + Z3 = Fp2.add(Z3, Z3); + X3 = Fp2.mul(a, Z3); + Y3 = Fp2.mul(b3, t2); + Y3 = Fp2.add(X3, Y3); + X3 = Fp2.sub(t1, Y3); + Y3 = Fp2.add(t1, Y3); + Y3 = Fp2.mul(X3, Y3); + X3 = Fp2.mul(t3, X3); + Z3 = Fp2.mul(b3, Z3); + t2 = Fp2.mul(a, t2); + t3 = Fp2.sub(t0, t2); + t3 = Fp2.mul(a, t3); + t3 = Fp2.add(t3, Z3); + Z3 = Fp2.add(t0, t0); + t0 = Fp2.add(Z3, t0); + t0 = Fp2.add(t0, t2); + t0 = Fp2.mul(t0, t3); + Y3 = Fp2.add(Y3, t0); + t2 = Fp2.mul(Y1, Z1); + t2 = Fp2.add(t2, t2); + t0 = Fp2.mul(t2, t3); + X3 = Fp2.sub(X3, t0); + Z3 = Fp2.mul(t2, t1); + Z3 = Fp2.add(Z3, Z3); + Z3 = Fp2.add(Z3, Z3); + return new Point3(X3, Y3, Z3); + } + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + const a = CURVE.a; + const b3 = Fp2.mul(CURVE.b, _3n2); + let t0 = Fp2.mul(X1, X2); + let t1 = Fp2.mul(Y1, Y2); + let t2 = Fp2.mul(Z1, Z2); + let t3 = Fp2.add(X1, Y1); + let t4 = Fp2.add(X2, Y2); + t3 = Fp2.mul(t3, t4); + t4 = Fp2.add(t0, t1); + t3 = Fp2.sub(t3, t4); + t4 = Fp2.add(X1, Z1); + let t5 = Fp2.add(X2, Z2); + t4 = Fp2.mul(t4, t5); + t5 = Fp2.add(t0, t2); + t4 = Fp2.sub(t4, t5); + t5 = Fp2.add(Y1, Z1); + X3 = Fp2.add(Y2, Z2); + t5 = Fp2.mul(t5, X3); + X3 = Fp2.add(t1, t2); + t5 = Fp2.sub(t5, X3); + Z3 = Fp2.mul(a, t4); + X3 = Fp2.mul(b3, t2); + Z3 = Fp2.add(X3, Z3); + X3 = Fp2.sub(t1, Z3); + Z3 = Fp2.add(t1, Z3); + Y3 = Fp2.mul(X3, Z3); + t1 = Fp2.add(t0, t0); + t1 = Fp2.add(t1, t0); + t2 = Fp2.mul(a, t2); + t4 = Fp2.mul(b3, t4); + t1 = Fp2.add(t1, t2); + t2 = Fp2.sub(t0, t2); + t2 = Fp2.mul(a, t2); + t4 = Fp2.add(t4, t2); + t0 = Fp2.mul(t1, t4); + Y3 = Fp2.add(Y3, t0); + t0 = Fp2.mul(t5, t4); + X3 = Fp2.mul(t3, X3); + X3 = Fp2.sub(X3, t0); + t0 = Fp2.mul(t3, t1); + Z3 = Fp2.mul(t5, Z3); + Z3 = Fp2.add(Z3, t0); + return new Point3(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point3.ZERO); + } + wNAF(n) { + return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { + const toInv = Fp2.invertBatch(comp.map((p) => p.pz)); + return comp.map((p, i) => p.toAffine(toInv[i])).map(Point3.fromAffine); + }); + } + multiplyUnsafe(n) { + const I = Point3.ZERO; + if (n === _0n4) + return I; + assertGE(n); + if (n === _1n4) + return this; + const { endo } = CURVE; + if (!endo) + return wnaf.unsafeLadder(this, n); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let k1p = I; + let k2p = I; + let d = this; + while (k1 > _0n4 || k2 > _0n4) { + if (k1 & _1n4) + k1p = k1p.add(d); + if (k2 & _1n4) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n4; + k2 >>= _1n4; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point3(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + multiply(scalar) { + assertGE(scalar); + let n = scalar; + let point, fake; + const { endo } = CURVE; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point3(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } else { + const { p, f: f2 } = this.wNAF(n); + point = p; + fake = f2; + } + return Point3.normalizeZ([point, fake])[0]; + } + multiplyAndAddUnsafe(Q, a, b) { + const G = Point3.BASE; + const mul = (P, a2) => a2 === _0n4 || a2 === _1n4 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2); + const sum = mul(this, a).add(mul(Q, b)); + return sum.is0() ? void 0 : sum; + } + toAffine(iz) { + const { px: x, py: y, pz: z } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? Fp2.ONE : Fp2.inv(z); + const ax = Fp2.mul(x, iz); + const ay = Fp2.mul(y, iz); + const zz = Fp2.mul(z, iz); + if (is0) + return { x: Fp2.ZERO, y: Fp2.ZERO }; + if (!Fp2.eql(zz, Fp2.ONE)) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE; + if (cofactor === _1n4) + return true; + if (isTorsionFree) + return isTorsionFree(Point3, this); + throw new Error("isTorsionFree() has not been declared for the elliptic curve"); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE; + if (cofactor === _1n4) + return this; + if (clearCofactor) + return clearCofactor(Point3, this); + return this.multiplyUnsafe(CURVE.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes2(Point3, this, isCompressed); + } + toHex(isCompressed = true) { + return bytesToHex2(this.toRawBytes(isCompressed)); + } + } + Point3.BASE = new Point3(CURVE.Gx, CURVE.Gy, Fp2.ONE); + Point3.ZERO = new Point3(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); + const _bits = CURVE.nBitLength; + const wnaf = wNAF(Point3, CURVE.endo ? Math.ceil(_bits / 2) : _bits); + return { + CURVE, + ProjectivePoint: Point3, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder + }; + } + function validateOpts(curve) { + const opts = validateBasic(curve); + validateObject(opts, { + hash: "hash", + hmac: "function", + randomBytes: "function" + }, { + bits2int: "function", + bits2int_modN: "function", + lowS: "boolean" + }); + return Object.freeze({ lowS: true, ...opts }); + } + function weierstrass(curveDef) { + const CURVE = validateOpts(curveDef); + const { Fp: Fp2, n: CURVE_ORDER } = CURVE; + const compressedLen = Fp2.BYTES + 1; + const uncompressedLen = 2 * Fp2.BYTES + 1; + function isValidFieldElement(num) { + return _0n4 < num && num < Fp2.ORDER; + } + function modN2(a) { + return mod(a, CURVE_ORDER); + } + function invN(a) { + return invert(a, CURVE_ORDER); + } + const { ProjectivePoint: Point3, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ + ...CURVE, + toBytes(c, point, isCompressed) { + const a = point.toAffine(); + const x = Fp2.toBytes(a.x); + const cat = concatBytes2; + if (isCompressed) { + return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x); + } else { + return cat(Uint8Array.from([4]), x, Fp2.toBytes(a.y)); + } + }, + fromBytes(bytes2) { + const len = bytes2.length; + const head = bytes2[0]; + const tail = bytes2.subarray(1); + if (len === compressedLen && (head === 2 || head === 3)) { + const x = bytesToNumberBE(tail); + if (!isValidFieldElement(x)) + throw new Error("Point is not on curve"); + const y2 = weierstrassEquation(x); + let y = Fp2.sqrt(y2); + const isYOdd = (y & _1n4) === _1n4; + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y = Fp2.neg(y); + return { x, y }; + } else if (len === uncompressedLen && head === 4) { + const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x, y }; + } else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + } + }); + const numToNByteStr = (num) => bytesToHex2(numberToBytesBE(num, CURVE.nByteLength)); + function isBiggerThanHalfOrder(number2) { + const HALF = CURVE_ORDER >> _1n4; + return number2 > HALF; + } + function normalizeS(s) { + return isBiggerThanHalfOrder(s) ? modN2(-s) : s; + } + const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); + class Signature { + constructor(r, s, recovery) { + this.r = r; + this.s = s; + this.recovery = recovery; + this.assertValidity(); + } + static fromCompact(hex2) { + const l = CURVE.nByteLength; + hex2 = ensureBytes("compactSignature", hex2, l * 2); + return new Signature(slcNum(hex2, 0, l), slcNum(hex2, l, 2 * l)); + } + static fromDER(hex2) { + const { r, s } = DER.toSig(ensureBytes("DER", hex2)); + return new Signature(r, s); + } + assertValidity() { + if (!isWithinCurveOrder(this.r)) + throw new Error("r must be 0 < r < CURVE.n"); + if (!isWithinCurveOrder(this.s)) + throw new Error("s must be 0 < s < CURVE.n"); + } + addRecoveryBit(recovery) { + return new Signature(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r, s, recovery: rec } = this; + const h = bits2int_modN(ensureBytes("msgHash", msgHash)); + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error("recovery id invalid"); + const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; + if (radj >= Fp2.ORDER) + throw new Error("recovery id 2 or 3 invalid"); + const prefix = (rec & 1) === 0 ? "02" : "03"; + const R = Point3.fromHex(prefix + numToNByteStr(radj)); + const ir = invN(radj); + const u1 = modN2(-h * ir); + const u2 = modN2(s * ir); + const Q = Point3.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error("point at infinify"); + Q.assertValidity(); + return Q; + } + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature(this.r, modN2(-this.s), this.recovery) : this; + } + toDERRawBytes() { + return hexToBytes2(this.toDERHex()); + } + toDERHex() { + return DER.hexFromSig({ r: this.r, s: this.s }); + } + toCompactRawBytes() { + return hexToBytes2(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } catch (error) { + return false; + } + }, + normPrivateKeyToScalar, + randomPrivateKey: () => { + const rand = CURVE.randomBytes(Fp2.BYTES + 8); + const num = hashToPrivateScalar(rand, CURVE_ORDER); + return numberToBytesBE(num, CURVE.nByteLength); + }, + precompute(windowSize = 8, point = Point3.BASE) { + point._setWindowSize(windowSize); + point.multiply(BigInt(3)); + return point; + } + }; + function getPublicKey2(privateKey, isCompressed = true) { + return Point3.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === "string"; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point3) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error("first arg must be private key"); + if (!isProbPub(publicB)) + throw new Error("second arg must be public key"); + const b = Point3.fromHex(publicB); + return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + const bits2int = CURVE.bits2int || function(bytes2) { + const num = bytesToNumberBE(bytes2); + const delta = bytes2.length * 8 - CURVE.nBitLength; + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { + return modN2(bits2int(bytes2)); + }; + const ORDER_MASK = bitMask(CURVE.nBitLength); + function int2octets(num) { + if (typeof num !== "bigint") + throw new Error("bigint expected"); + if (!(_0n4 <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); + return numberToBytesBE(num, CURVE.nByteLength); + } + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (["recovered", "canonical"].some((k) => k in opts)) + throw new Error("sign() legacy options not supported"); + const { hash: hash2, randomBytes: randomBytes2 } = CURVE; + let { lowS, prehash, extraEntropy: ent } = opts; + if (lowS == null) + lowS = true; + msgHash = ensureBytes("msgHash", msgHash); + if (prehash) + msgHash = ensureBytes("prehashed msgHash", hash2(msgHash)); + const h1int = bits2int_modN(msgHash); + const d = normPrivateKeyToScalar(privateKey); + const seedArgs = [int2octets(d), int2octets(h1int)]; + if (ent != null) { + const e = ent === true ? randomBytes2(Fp2.BYTES) : ent; + seedArgs.push(ensureBytes("extraEntropy", e, Fp2.BYTES)); + } + const seed = concatBytes2(...seedArgs); + const m = h1int; + function k2sig(kBytes) { + const k = bits2int(kBytes); + if (!isWithinCurveOrder(k)) + return; + const ik = invN(k); + const q = Point3.BASE.multiply(k).toAffine(); + const r = modN2(q.x); + if (r === _0n4) + return; + const s = modN2(ik * modN2(m + r * d)); + if (s === _0n4) + return; + let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n4); + let normS = s; + if (lowS && isBiggerThanHalfOrder(s)) { + normS = normalizeS(s); + recovery ^= 1; + } + return new Signature(r, normS, recovery); + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; + function sign(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); + const drbg = createHmacDrbg(CURVE.hash.outputLen, CURVE.nByteLength, CURVE.hmac); + return drbg(seed, k2sig); + } + Point3.BASE._setWindowSize(8); + function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { + const sg = signature; + msgHash = ensureBytes("msgHash", msgHash); + publicKey = ensureBytes("publicKey", publicKey); + if ("strict" in opts) + throw new Error("options.strict was renamed to lowS"); + const { lowS, prehash } = opts; + let _sig = void 0; + let P; + try { + if (typeof sg === "string" || sg instanceof Uint8Array) { + try { + _sig = Signature.fromDER(sg); + } catch (derError) { + if (!(derError instanceof DER.Err)) + throw derError; + _sig = Signature.fromCompact(sg); + } + } else if (typeof sg === "object" && typeof sg.r === "bigint" && typeof sg.s === "bigint") { + const { r: r2, s: s2 } = sg; + _sig = new Signature(r2, s2); + } else { + throw new Error("PARSE"); + } + P = Point3.fromHex(publicKey); + } catch (error) { + if (error.message === "PARSE") + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig.hasHighS()) + return false; + if (prehash) + msgHash = CURVE.hash(msgHash); + const { r, s } = _sig; + const h = bits2int_modN(msgHash); + const is = invN(s); + const u1 = modN2(h * is); + const u2 = modN2(r * is); + const R = Point3.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); + if (!R) + return false; + const v = modN2(R.x); + return v === r; + } + return { + CURVE, + getPublicKey: getPublicKey2, + getSharedSecret, + sign, + verify, + ProjectivePoint: Point3, + Signature, + utils + }; + } + function SWUFpSqrtRatio(Fp2, Z) { + const q = Fp2.ORDER; + let l = _0n4; + for (let o = q - _1n4; o % _2n3 === _0n4; o /= _2n3) + l += _1n4; + const c1 = l; + const c2 = (q - _1n4) / _2n3 ** c1; + const c3 = (c2 - _1n4) / _2n3; + const c4 = _2n3 ** c1 - _1n4; + const c5 = _2n3 ** (c1 - _1n4); + const c6 = Fp2.pow(Z, c2); + const c7 = Fp2.pow(Z, (c2 + _1n4) / _2n3); + let sqrtRatio = (u, v) => { + let tv1 = c6; + let tv2 = Fp2.pow(v, c4); + let tv3 = Fp2.sqr(tv2); + tv3 = Fp2.mul(tv3, v); + let tv5 = Fp2.mul(u, tv3); + tv5 = Fp2.pow(tv5, c3); + tv5 = Fp2.mul(tv5, tv2); + tv2 = Fp2.mul(tv5, v); + tv3 = Fp2.mul(tv5, u); + let tv4 = Fp2.mul(tv3, tv2); + tv5 = Fp2.pow(tv4, c5); + let isQR = Fp2.eql(tv5, Fp2.ONE); + tv2 = Fp2.mul(tv3, c7); + tv5 = Fp2.mul(tv4, tv1); + tv3 = Fp2.cmov(tv2, tv3, isQR); + tv4 = Fp2.cmov(tv5, tv4, isQR); + for (let i = c1; i > _1n4; i--) { + let tv52 = _2n3 ** (i - _2n3); + let tvv5 = Fp2.pow(tv4, tv52); + const e1 = Fp2.eql(tvv5, Fp2.ONE); + tv2 = Fp2.mul(tv3, tv1); + tv1 = Fp2.mul(tv1, tv1); + tvv5 = Fp2.mul(tv4, tv1); + tv3 = Fp2.cmov(tv2, tv3, e1); + tv4 = Fp2.cmov(tvv5, tv4, e1); + } + return { isValid: isQR, value: tv3 }; + }; + if (Fp2.ORDER % _4n2 === _3n2) { + const c12 = (Fp2.ORDER - _3n2) / _4n2; + const c22 = Fp2.sqrt(Fp2.neg(Z)); + sqrtRatio = (u, v) => { + let tv1 = Fp2.sqr(v); + const tv2 = Fp2.mul(u, v); + tv1 = Fp2.mul(tv1, tv2); + let y1 = Fp2.pow(tv1, c12); + y1 = Fp2.mul(y1, tv2); + const y2 = Fp2.mul(y1, c22); + const tv3 = Fp2.mul(Fp2.sqr(y1), v); + const isQR = Fp2.eql(tv3, u); + let y = Fp2.cmov(y2, y1, isQR); + return { isValid: isQR, value: y }; + }; + } + return sqrtRatio; + } + function mapToCurveSimpleSWU(Fp2, opts) { + validateField(Fp2); + if (!Fp2.isValid(opts.A) || !Fp2.isValid(opts.B) || !Fp2.isValid(opts.Z)) + throw new Error("mapToCurveSimpleSWU: invalid opts"); + const sqrtRatio = SWUFpSqrtRatio(Fp2, opts.Z); + if (!Fp2.isOdd) + throw new Error("Fp.isOdd is not implemented!"); + return (u) => { + let tv1, tv2, tv3, tv4, tv5, tv6, x, y; + tv1 = Fp2.sqr(u); + tv1 = Fp2.mul(tv1, opts.Z); + tv2 = Fp2.sqr(tv1); + tv2 = Fp2.add(tv2, tv1); + tv3 = Fp2.add(tv2, Fp2.ONE); + tv3 = Fp2.mul(tv3, opts.B); + tv4 = Fp2.cmov(opts.Z, Fp2.neg(tv2), !Fp2.eql(tv2, Fp2.ZERO)); + tv4 = Fp2.mul(tv4, opts.A); + tv2 = Fp2.sqr(tv3); + tv6 = Fp2.sqr(tv4); + tv5 = Fp2.mul(tv6, opts.A); + tv2 = Fp2.add(tv2, tv5); + tv2 = Fp2.mul(tv2, tv3); + tv6 = Fp2.mul(tv6, tv4); + tv5 = Fp2.mul(tv6, opts.B); + tv2 = Fp2.add(tv2, tv5); + x = Fp2.mul(tv1, tv3); + const { isValid, value } = sqrtRatio(tv2, tv6); + y = Fp2.mul(tv1, u); + y = Fp2.mul(y, value); + x = Fp2.cmov(x, tv3, isValid); + y = Fp2.cmov(y, value, isValid); + const e1 = Fp2.isOdd(u) === Fp2.isOdd(y); + y = Fp2.cmov(Fp2.neg(y), y, e1); + x = Fp2.div(x, tv4); + return { x, y }; + }; + } + + // node_modules/@noble/curves/esm/abstract/hash-to-curve.js + init_define_process(); + function validateDST(dst) { + if (dst instanceof Uint8Array) + return dst; + if (typeof dst === "string") + return utf8ToBytes2(dst); + throw new Error("DST must be Uint8Array or string"); + } + var os2ip = bytesToNumberBE; + function i2osp(value, length) { + if (value < 0 || value >= 1 << 8 * length) { + throw new Error(`bad I2OSP call: value=${value} length=${length}`); + } + const res = Array.from({ length }).fill(0); + for (let i = length - 1; i >= 0; i--) { + res[i] = value & 255; + value >>>= 8; + } + return new Uint8Array(res); + } + function strxor(a, b) { + const arr = new Uint8Array(a.length); + for (let i = 0; i < a.length; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; + } + function isBytes(item) { + if (!(item instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + } + function isNum(item) { + if (!Number.isSafeInteger(item)) + throw new Error("number expected"); + } + function expand_message_xmd(msg, DST, lenInBytes, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + if (DST.length > 255) + DST = H(concatBytes2(utf8ToBytes2("H2C-OVERSIZE-DST-"), DST)); + const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; + const ell = Math.ceil(lenInBytes / b_in_bytes); + if (ell > 255) + throw new Error("Invalid xmd length"); + const DST_prime = concatBytes2(DST, i2osp(DST.length, 1)); + const Z_pad = i2osp(0, r_in_bytes); + const l_i_b_str = i2osp(lenInBytes, 2); + const b = new Array(ell); + const b_0 = H(concatBytes2(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); + b[0] = H(concatBytes2(b_0, i2osp(1, 1), DST_prime)); + for (let i = 1; i <= ell; i++) { + const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; + b[i] = H(concatBytes2(...args)); + } + const pseudo_random_bytes = concatBytes2(...b); + return pseudo_random_bytes.slice(0, lenInBytes); + } + function expand_message_xof(msg, DST, lenInBytes, k, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + if (DST.length > 255) { + const dkLen = Math.ceil(2 * k / 8); + DST = H.create({ dkLen }).update(utf8ToBytes2("H2C-OVERSIZE-DST-")).update(DST).digest(); + } + if (lenInBytes > 65535 || DST.length > 255) + throw new Error("expand_message_xof: invalid lenInBytes"); + return H.create({ dkLen: lenInBytes }).update(msg).update(i2osp(lenInBytes, 2)).update(DST).update(i2osp(DST.length, 1)).digest(); + } + function hash_to_field(msg, count, options) { + validateObject(options, { + DST: "string", + p: "bigint", + m: "isSafeInteger", + k: "isSafeInteger", + hash: "hash" + }); + const { p, k, m, hash: hash2, expand, DST: _DST } = options; + isBytes(msg); + isNum(count); + const DST = validateDST(_DST); + const log2p = p.toString(2).length; + const L = Math.ceil((log2p + k) / 8); + const len_in_bytes = count * m * L; + let prb; + if (expand === "xmd") { + prb = expand_message_xmd(msg, DST, len_in_bytes, hash2); + } else if (expand === "xof") { + prb = expand_message_xof(msg, DST, len_in_bytes, k, hash2); + } else if (expand === "_internal_pass") { + prb = msg; + } else { + throw new Error('expand must be "xmd" or "xof"'); + } + const u = new Array(count); + for (let i = 0; i < count; i++) { + const e = new Array(m); + for (let j = 0; j < m; j++) { + const elm_offset = L * (j + i * m); + const tv = prb.subarray(elm_offset, elm_offset + L); + e[j] = mod(os2ip(tv), p); + } + u[i] = e; + } + return u; + } + function isogenyMap(field, map) { + const COEFF = map.map((i) => Array.from(i).reverse()); + return (x, y) => { + const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); + x = field.div(xNum, xDen); + y = field.mul(y, field.div(yNum, yDen)); + return { x, y }; + }; + } + function createHasher(Point3, mapToCurve, def) { + if (typeof mapToCurve !== "function") + throw new Error("mapToCurve() must be defined"); + return { + hashToCurve(msg, options) { + const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); + const u0 = Point3.fromAffine(mapToCurve(u[0])); + const u1 = Point3.fromAffine(mapToCurve(u[1])); + const P = u0.add(u1).clearCofactor(); + P.assertValidity(); + return P; + }, + encodeToCurve(msg, options) { + const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); + const P = Point3.fromAffine(mapToCurve(u[0])).clearCofactor(); + P.assertValidity(); + return P; + } + }; + } + + // node_modules/@noble/curves/esm/_shortw_utils.js + init_define_process(); + + // node_modules/@noble/hashes/esm/hmac.js + init_define_process(); + var HMAC = class extends Hash { + constructor(hash2, _key) { + super(); + this.finished = false; + this.destroyed = false; + assert_default.hash(hash2); + const key = toBytes(_key); + this.iHash = hash2.create(); + if (typeof this.iHash.update !== "function") + throw new TypeError("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + pad.set(key.length > blockLen ? hash2.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54; + this.iHash.update(pad); + this.oHash = hash2.create(); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54 ^ 92; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + assert_default.exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + }; + var hmac = (hash2, key, message) => new HMAC(hash2, key).update(message).digest(); + hmac.create = (hash2, key) => new HMAC(hash2, key); + + // node_modules/@noble/curves/esm/_shortw_utils.js + function getHash(hash2) { + return { + hash: hash2, + hmac: (key, ...msgs) => hmac(hash2, key, concatBytes(...msgs)), + randomBytes + }; + } + function createCurve(curveDef, defHash) { + const create = (hash2) => weierstrass({ ...curveDef, ...getHash(hash2) }); + return Object.freeze({ ...create(defHash), create }); + } + + // node_modules/@noble/curves/esm/secp256k1.js + var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); + var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); + var _1n5 = BigInt(1); + var _2n4 = BigInt(2); + var divNearest = (a, b) => (a + b / _2n4) / b; + function sqrtMod(y) { + const P = secp256k1P; + const _3n3 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); + const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); + const b2 = y * y * y % P; + const b3 = b2 * b2 * y % P; + const b6 = pow2(b3, _3n3, P) * b3 % P; + const b9 = pow2(b6, _3n3, P) * b3 % P; + const b11 = pow2(b9, _2n4, P) * b2 % P; + const b22 = pow2(b11, _11n, P) * b11 % P; + const b44 = pow2(b22, _22n, P) * b22 % P; + const b88 = pow2(b44, _44n, P) * b44 % P; + const b176 = pow2(b88, _88n, P) * b88 % P; + const b220 = pow2(b176, _44n, P) * b44 % P; + const b223 = pow2(b220, _3n3, P) * b3 % P; + const t1 = pow2(b223, _23n, P) * b22 % P; + const t2 = pow2(t1, _6n, P) * b2 % P; + const root = pow2(t2, _2n4, P); + if (!Fp.eql(Fp.sqr(root), y)) + throw new Error("Cannot find square root"); + return root; + } + var Fp = Field(secp256k1P, void 0, void 0, { sqrt: sqrtMod }); + var secp256k1 = createCurve({ + a: BigInt(0), + b: BigInt(7), + Fp, + n: secp256k1N, + Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), + Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), + h: BigInt(1), + lowS: true, + endo: { + beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), + splitScalar: (k) => { + const n = secp256k1N; + const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); + const b1 = -_1n5 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); + const a2 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); + const b2 = a1; + const POW_2_128 = BigInt("0x100000000000000000000000000000000"); + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = mod(k - c1 * a1 - c2 * a2, n); + let k2 = mod(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error("splitScalar: Endomorphism failed, k=" + k); + } + return { k1neg, k1, k2neg, k2 }; + } + } + }, sha256); + var _0n5 = BigInt(0); + var fe = (x) => typeof x === "bigint" && _0n5 < x && x < secp256k1P; + var ge = (x) => typeof x === "bigint" && _0n5 < x && x < secp256k1N; + var TAGGED_HASH_PREFIXES = {}; + function taggedHash(tag, ...messages) { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === void 0) { + const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes2(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return sha256(concatBytes2(tagP, ...messages)); + } + var pointToBytes = (point) => point.toRawBytes(true).slice(1); + var numTo32b = (n) => numberToBytesBE(n, 32); + var modP = (x) => mod(x, secp256k1P); + var modN = (x) => mod(x, secp256k1N); + var Point = secp256k1.ProjectivePoint; + var GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); + function schnorrGetExtPubKey(priv) { + let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); + let p = Point.fromPrivateKey(d_); + const scalar = p.hasEvenY() ? d_ : modN(-d_); + return { scalar, bytes: pointToBytes(p) }; + } + function lift_x(x) { + if (!fe(x)) + throw new Error("bad x: need 0 < x < p"); + const xx = modP(x * x); + const c = modP(xx * x + BigInt(7)); + let y = sqrtMod(c); + if (y % _2n4 !== _0n5) + y = modP(-y); + const p = new Point(x, y, _1n5); + p.assertValidity(); + return p; + } + function challenge(...args) { + return modN(bytesToNumberBE(taggedHash("BIP0340/challenge", ...args))); + } + function schnorrGetPublicKey(privateKey) { + return schnorrGetExtPubKey(privateKey).bytes; + } + function schnorrSign(message, privateKey, auxRand = randomBytes(32)) { + const m = ensureBytes("message", message); + const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); + const a = ensureBytes("auxRand", auxRand, 32); + const t = numTo32b(d ^ bytesToNumberBE(taggedHash("BIP0340/aux", a))); + const rand = taggedHash("BIP0340/nonce", t, px, m); + const k_ = modN(bytesToNumberBE(rand)); + if (k_ === _0n5) + throw new Error("sign failed: k is zero"); + const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); + const e = challenge(rx, px, m); + const sig = new Uint8Array(64); + sig.set(rx, 0); + sig.set(numTo32b(modN(k + e * d)), 32); + if (!schnorrVerify(sig, m, px)) + throw new Error("sign: Invalid signature produced"); + return sig; + } + function schnorrVerify(signature, message, publicKey) { + const sig = ensureBytes("signature", signature, 64); + const m = ensureBytes("message", message); + const pub = ensureBytes("publicKey", publicKey, 32); + try { + const P = lift_x(bytesToNumberBE(pub)); + const r = bytesToNumberBE(sig.subarray(0, 32)); + if (!fe(r)) + return false; + const s = bytesToNumberBE(sig.subarray(32, 64)); + if (!ge(s)) + return false; + const e = challenge(numTo32b(r), pointToBytes(P), m); + const R = GmulAdd(P, s, modN(-e)); + if (!R || !R.hasEvenY() || R.toAffine().x !== r) + return false; + return true; + } catch (error) { + return false; + } + } + var schnorr = { + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + utils: { + randomPrivateKey: secp256k1.utils.randomPrivateKey, + lift_x, + pointToBytes, + numberToBytesBE, + bytesToNumberBE, + taggedHash, + mod + } + }; + var isoMap = isogenyMap(Fp, [ + [ + "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7", + "0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581", + "0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262", + "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c" + ], + [ + "0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b", + "0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + [ + "0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c", + "0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3", + "0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931", + "0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84" + ], + [ + "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b", + "0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573", + "0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ] + ].map((i) => i.map((j) => BigInt(j)))); + var mapSWU = mapToCurveSimpleSWU(Fp, { + A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"), + B: BigInt("1771"), + Z: Fp.create(BigInt("-11")) + }); + var { hashToCurve, encodeToCurve } = createHasher(secp256k1.ProjectivePoint, (scalars) => { + const { x, y } = mapSWU(Fp.create(scalars[0])); + return isoMap(x, y); + }, { + DST: "secp256k1_XMD:SHA-256_SSWU_RO_", + encodeDST: "secp256k1_XMD:SHA-256_SSWU_NU_", + p: Fp.ORDER, + m: 1, + k: 128, + expand: "xmd", + hash: sha256 + }); + + // keys.ts + function generatePrivateKey() { + return bytesToHex(schnorr.utils.randomPrivateKey()); + } + function getPublicKey(privateKey) { + return bytesToHex(schnorr.getPublicKey(privateKey)); + } + + // relay.ts + init_define_process(); + + // event.ts + init_define_process(); + + // utils.ts + var utils_exports2 = {}; + __export(utils_exports2, { + MessageNode: () => MessageNode, + MessageQueue: () => MessageQueue, + insertEventIntoAscendingList: () => insertEventIntoAscendingList, + insertEventIntoDescendingList: () => insertEventIntoDescendingList, + normalizeURL: () => normalizeURL, + utf8Decoder: () => utf8Decoder, + utf8Encoder: () => utf8Encoder + }); + init_define_process(); + var utf8Decoder = new TextDecoder("utf-8"); + var utf8Encoder = new TextEncoder(); + function normalizeURL(url) { + let p = new URL(url); + p.pathname = p.pathname.replace(/\/+/g, "/"); + if (p.pathname.endsWith("/")) + p.pathname = p.pathname.slice(0, -1); + if (p.port === "80" && p.protocol === "ws:" || p.port === "443" && p.protocol === "wss:") + p.port = ""; + p.searchParams.sort(); + p.hash = ""; + return p.toString(); + } + function insertEventIntoDescendingList(sortedArray, event) { + let start = 0; + let end = sortedArray.length - 1; + let midPoint; + let position = start; + if (end < 0) { + position = 0; + } else if (event.created_at < sortedArray[end].created_at) { + position = end + 1; + } else if (event.created_at >= sortedArray[start].created_at) { + position = start; + } else + while (true) { + if (end <= start + 1) { + position = end; + break; + } + midPoint = Math.floor(start + (end - start) / 2); + if (sortedArray[midPoint].created_at > event.created_at) { + start = midPoint; + } else if (sortedArray[midPoint].created_at < event.created_at) { + end = midPoint; + } else { + position = midPoint; + break; + } + } + if (sortedArray[position]?.id !== event.id) { + return [ + ...sortedArray.slice(0, position), + event, + ...sortedArray.slice(position) + ]; + } + return sortedArray; + } + function insertEventIntoAscendingList(sortedArray, event) { + let start = 0; + let end = sortedArray.length - 1; + let midPoint; + let position = start; + if (end < 0) { + position = 0; + } else if (event.created_at > sortedArray[end].created_at) { + position = end + 1; + } else if (event.created_at <= sortedArray[start].created_at) { + position = start; + } else + while (true) { + if (end <= start + 1) { + position = end; + break; + } + midPoint = Math.floor(start + (end - start) / 2); + if (sortedArray[midPoint].created_at < event.created_at) { + start = midPoint; + } else if (sortedArray[midPoint].created_at > event.created_at) { + end = midPoint; + } else { + position = midPoint; + break; + } + } + if (sortedArray[position]?.id !== event.id) { + return [ + ...sortedArray.slice(0, position), + event, + ...sortedArray.slice(position) + ]; + } + return sortedArray; + } + var MessageNode = class { + _value; + _next; + get value() { + return this._value; + } + set value(message) { + this._value = message; + } + get next() { + return this._next; + } + set next(node) { + this._next = node; + } + constructor(message) { + this._value = message; + this._next = null; + } + }; + var MessageQueue = class { + _first; + _last; + get first() { + return this._first; + } + set first(messageNode) { + this._first = messageNode; + } + get last() { + return this._last; + } + set last(messageNode) { + this._last = messageNode; + } + _size; + get size() { + return this._size; + } + set size(v) { + this._size = v; + } + constructor() { + this._first = null; + this._last = null; + this._size = 0; + } + enqueue(message) { + const newNode = new MessageNode(message); + if (this._size === 0 || !this._last) { + this._first = newNode; + this._last = newNode; + } else { + this._last.next = newNode; + this._last = newNode; + } + this._size++; + return true; + } + dequeue() { + if (this._size === 0 || !this._first) + return null; + let prev = this._first; + this._first = prev.next; + prev.next = null; + this._size--; + return prev.value; + } + }; + + // event.ts + var Kind = /* @__PURE__ */ ((Kind3) => { + Kind3[Kind3["Metadata"] = 0] = "Metadata"; + Kind3[Kind3["Text"] = 1] = "Text"; + Kind3[Kind3["RecommendRelay"] = 2] = "RecommendRelay"; + Kind3[Kind3["Contacts"] = 3] = "Contacts"; + Kind3[Kind3["EncryptedDirectMessage"] = 4] = "EncryptedDirectMessage"; + Kind3[Kind3["EventDeletion"] = 5] = "EventDeletion"; + Kind3[Kind3["Repost"] = 6] = "Repost"; + Kind3[Kind3["Reaction"] = 7] = "Reaction"; + Kind3[Kind3["BadgeAward"] = 8] = "BadgeAward"; + Kind3[Kind3["ChannelCreation"] = 40] = "ChannelCreation"; + Kind3[Kind3["ChannelMetadata"] = 41] = "ChannelMetadata"; + Kind3[Kind3["ChannelMessage"] = 42] = "ChannelMessage"; + Kind3[Kind3["ChannelHideMessage"] = 43] = "ChannelHideMessage"; + Kind3[Kind3["ChannelMuteUser"] = 44] = "ChannelMuteUser"; + Kind3[Kind3["Blank"] = 255] = "Blank"; + Kind3[Kind3["Report"] = 1984] = "Report"; + Kind3[Kind3["ZapRequest"] = 9734] = "ZapRequest"; + Kind3[Kind3["Zap"] = 9735] = "Zap"; + Kind3[Kind3["RelayList"] = 10002] = "RelayList"; + Kind3[Kind3["ClientAuth"] = 22242] = "ClientAuth"; + Kind3[Kind3["HttpAuth"] = 27235] = "HttpAuth"; + Kind3[Kind3["ProfileBadge"] = 30008] = "ProfileBadge"; + Kind3[Kind3["BadgeDefinition"] = 30009] = "BadgeDefinition"; + Kind3[Kind3["Article"] = 30023] = "Article"; + return Kind3; + })(Kind || {}); + function getBlankEvent(kind = 255 /* Blank */) { + return { + kind, + content: "", + tags: [], + created_at: 0 + }; + } + function finishEvent(t, privateKey) { + let event = t; + event.pubkey = getPublicKey(privateKey); + event.id = getEventHash(event); + event.sig = getSignature(event, privateKey); + return event; + } + function serializeEvent(evt) { + if (!validateEvent(evt)) + throw new Error("can't serialize event with wrong or missing properties"); + return JSON.stringify([ + 0, + evt.pubkey, + evt.created_at, + evt.kind, + evt.tags, + evt.content + ]); + } + function getEventHash(event) { + let eventHash = sha256(utf8Encoder.encode(serializeEvent(event))); + return bytesToHex(eventHash); + } + var isRecord = (obj) => obj instanceof Object; + function validateEvent(event) { + if (!isRecord(event)) + return false; + if (typeof event.kind !== "number") + return false; + if (typeof event.content !== "string") + return false; + if (typeof event.created_at !== "number") + return false; + if (typeof event.pubkey !== "string") + return false; + if (!event.pubkey.match(/^[a-f0-9]{64}$/)) + return false; + if (!Array.isArray(event.tags)) + return false; + for (let i = 0; i < event.tags.length; i++) { + let tag = event.tags[i]; + if (!Array.isArray(tag)) + return false; + for (let j = 0; j < tag.length; j++) { + if (typeof tag[j] === "object") + return false; + } + } + return true; + } + function verifySignature(event) { + try { + return schnorr.verify(event.sig, getEventHash(event), event.pubkey); + } catch (err) { + return false; + } + } + function signEvent(event, key) { + console.warn( + "nostr-tools: `signEvent` is deprecated and will be removed or changed in the future. Please use `getSignature` instead." + ); + return getSignature(event, key); + } + function getSignature(event, key) { + return bytesToHex(schnorr.sign(getEventHash(event), key)); + } + + // filter.ts + init_define_process(); + function matchFilter(filter, event) { + if (filter.ids && filter.ids.indexOf(event.id) === -1) { + if (!filter.ids.some((prefix) => event.id.startsWith(prefix))) { + return false; + } + } + if (filter.kinds && filter.kinds.indexOf(event.kind) === -1) + return false; + if (filter.authors && filter.authors.indexOf(event.pubkey) === -1) { + if (!filter.authors.some((prefix) => event.pubkey.startsWith(prefix))) { + return false; + } + } + for (let f2 in filter) { + if (f2[0] === "#") { + let tagName = f2.slice(1); + let values = filter[`#${tagName}`]; + if (values && !event.tags.find( + ([t, v]) => t === f2.slice(1) && values.indexOf(v) !== -1 + )) + return false; + } + } + if (filter.since && event.created_at < filter.since) + return false; + if (filter.until && event.created_at > filter.until) + return false; + return true; + } + function matchFilters(filters, event) { + for (let i = 0; i < filters.length; i++) { + if (matchFilter(filters[i], event)) + return true; + } + return false; + } + function mergeFilters(...filters) { + let result = {}; + for (let i = 0; i < filters.length; i++) { + let filter = filters[i]; + Object.entries(filter).forEach(([property, values]) => { + if (property === "kinds" || property === "ids" || property === "authors" || property[0] === "#") { + result[property] = result[property] || []; + for (let v = 0; v < values.length; v++) { + let value = values[v]; + if (!result[property].includes(value)) + result[property].push(value); + } + } + }); + if (filter.limit && (!result.limit || filter.limit > result.limit)) + result.limit = filter.limit; + if (filter.until && (!result.until || filter.until > result.until)) + result.until = filter.until; + if (filter.since && (!result.since || filter.since < result.since)) + result.since = filter.since; + } + return result; + } + + // fakejson.ts + var fakejson_exports = {}; + __export(fakejson_exports, { + getHex64: () => getHex64, + getInt: () => getInt, + getSubscriptionId: () => getSubscriptionId, + matchEventId: () => matchEventId, + matchEventKind: () => matchEventKind, + matchEventPubkey: () => matchEventPubkey + }); + init_define_process(); + function getHex64(json, field) { + let len = field.length + 3; + let idx = json.indexOf(`"${field}":`) + len; + let s = json.slice(idx).indexOf(`"`) + idx + 1; + return json.slice(s, s + 64); + } + function getInt(json, field) { + let len = field.length; + let idx = json.indexOf(`"${field}":`) + len + 3; + let sliced = json.slice(idx); + let end = Math.min(sliced.indexOf(","), sliced.indexOf("}")); + return parseInt(sliced.slice(0, end), 10); + } + function getSubscriptionId(json) { + let idx = json.slice(0, 22).indexOf(`"EVENT"`); + if (idx === -1) + return null; + let pstart = json.slice(idx + 7 + 1).indexOf(`"`); + if (pstart === -1) + return null; + let start = idx + 7 + 1 + pstart; + let pend = json.slice(start + 1, 80).indexOf(`"`); + if (pend === -1) + return null; + let end = start + 1 + pend; + return json.slice(start + 1, end); + } + function matchEventId(json, id) { + return id === getHex64(json, "id"); + } + function matchEventPubkey(json, pubkey) { + return pubkey === getHex64(json, "pubkey"); + } + function matchEventKind(json, kind) { + return kind === getInt(json, "kind"); + } + + // relay.ts + var newListeners = () => ({ + connect: [], + disconnect: [], + error: [], + notice: [], + auth: [] + }); + function relayInit(url, options = {}) { + let { listTimeout = 3e3, getTimeout = 3e3, countTimeout = 3e3 } = options; + var ws; + var openSubs = {}; + var listeners = newListeners(); + var subListeners = {}; + var pubListeners = {}; + var connectionPromise; + async function connectRelay() { + if (connectionPromise) + return connectionPromise; + connectionPromise = new Promise((resolve, reject) => { + try { + ws = new WebSocket(url); + } catch (err) { + reject(err); + } + ws.onopen = () => { + listeners.connect.forEach((cb) => cb()); + resolve(); + }; + ws.onerror = () => { + connectionPromise = void 0; + listeners.error.forEach((cb) => cb()); + reject(); + }; + ws.onclose = async () => { + connectionPromise = void 0; + listeners.disconnect.forEach((cb) => cb()); + }; + let incomingMessageQueue = new MessageQueue(); + let handleNextInterval; + ws.onmessage = (e) => { + incomingMessageQueue.enqueue(e.data); + if (!handleNextInterval) { + handleNextInterval = setInterval(handleNext, 0); + } + }; + function handleNext() { + if (incomingMessageQueue.size === 0) { + clearInterval(handleNextInterval); + handleNextInterval = null; + return; + } + var json = incomingMessageQueue.dequeue(); + if (!json) + return; + let subid = getSubscriptionId(json); + if (subid) { + let so = openSubs[subid]; + if (so && so.alreadyHaveEvent && so.alreadyHaveEvent(getHex64(json, "id"), url)) { + return; + } + } + try { + let data = JSON.parse(json); + switch (data[0]) { + case "EVENT": { + let id2 = data[1]; + let event = data[2]; + if (validateEvent(event) && openSubs[id2] && (openSubs[id2].skipVerification || verifySignature(event)) && matchFilters(openSubs[id2].filters, event)) { + openSubs[id2]; + (subListeners[id2]?.event || []).forEach((cb) => cb(event)); + } + return; + } + case "COUNT": + let id = data[1]; + let payload = data[2]; + if (openSubs[id]) { + ; + (subListeners[id]?.count || []).forEach((cb) => cb(payload)); + } + return; + case "EOSE": { + let id2 = data[1]; + if (id2 in subListeners) { + subListeners[id2].eose.forEach((cb) => cb()); + subListeners[id2].eose = []; + } + return; + } + case "OK": { + let id2 = data[1]; + let ok = data[2]; + let reason = data[3] || ""; + if (id2 in pubListeners) { + if (ok) + pubListeners[id2].ok.forEach((cb) => cb()); + else + pubListeners[id2].failed.forEach((cb) => cb(reason)); + pubListeners[id2].ok = []; + pubListeners[id2].failed = []; + } + return; + } + case "NOTICE": + let notice = data[1]; + listeners.notice.forEach((cb) => cb(notice)); + return; + case "AUTH": { + let challenge2 = data[1]; + listeners.auth?.forEach((cb) => cb(challenge2)); + return; + } + } + } catch (err) { + return; + } + } + }); + return connectionPromise; + } + function connected() { + return ws?.readyState === 1; + } + async function connect() { + if (connected()) + return; + await connectRelay(); + } + async function trySend(params) { + let msg = JSON.stringify(params); + if (!connected()) { + await new Promise((resolve) => setTimeout(resolve, 1e3)); + if (!connected()) { + return; + } + } + try { + ws.send(msg); + } catch (err) { + console.log(err); + } + } + const sub = (filters, { + verb = "REQ", + skipVerification = false, + alreadyHaveEvent = null, + id = Math.random().toString().slice(2) + } = {}) => { + let subid = id; + openSubs[subid] = { + id: subid, + filters, + skipVerification, + alreadyHaveEvent + }; + trySend([verb, subid, ...filters]); + return { + sub: (newFilters, newOpts = {}) => sub(newFilters || filters, { + skipVerification: newOpts.skipVerification || skipVerification, + alreadyHaveEvent: newOpts.alreadyHaveEvent || alreadyHaveEvent, + id: subid + }), + unsub: () => { + delete openSubs[subid]; + delete subListeners[subid]; + trySend(["CLOSE", subid]); + }, + on: (type, cb) => { + subListeners[subid] = subListeners[subid] || { + event: [], + count: [], + eose: [] + }; + subListeners[subid][type].push(cb); + }, + off: (type, cb) => { + let listeners2 = subListeners[subid]; + let idx = listeners2[type].indexOf(cb); + if (idx >= 0) + listeners2[type].splice(idx, 1); + } + }; + }; + function _publishEvent(event, type) { + if (!event.id) + throw new Error(`event ${event} has no id`); + let id = event.id; + trySend([type, event]); + return { + on: (type2, cb) => { + pubListeners[id] = pubListeners[id] || { + ok: [], + failed: [] + }; + pubListeners[id][type2].push(cb); + }, + off: (type2, cb) => { + let listeners2 = pubListeners[id]; + if (!listeners2) + return; + let idx = listeners2[type2].indexOf(cb); + if (idx >= 0) + listeners2[type2].splice(idx, 1); + } + }; + } + return { + url, + sub, + on: (type, cb) => { + listeners[type].push(cb); + if (type === "connect" && ws?.readyState === 1) { + ; + cb(); + } + }, + off: (type, cb) => { + let index = listeners[type].indexOf(cb); + if (index !== -1) + listeners[type].splice(index, 1); + }, + list: (filters, opts) => new Promise((resolve) => { + let s = sub(filters, opts); + let events = []; + let timeout = setTimeout(() => { + s.unsub(); + resolve(events); + }, listTimeout); + s.on("eose", () => { + s.unsub(); + clearTimeout(timeout); + resolve(events); + }); + s.on("event", (event) => { + events.push(event); + }); + }), + get: (filter, opts) => new Promise((resolve) => { + let s = sub([filter], opts); + let timeout = setTimeout(() => { + s.unsub(); + resolve(null); + }, getTimeout); + s.on("event", (event) => { + s.unsub(); + clearTimeout(timeout); + resolve(event); + }); + }), + count: (filters) => new Promise((resolve) => { + let s = sub(filters, { ...sub, verb: "COUNT" }); + let timeout = setTimeout(() => { + s.unsub(); + resolve(null); + }, countTimeout); + s.on("count", (event) => { + s.unsub(); + clearTimeout(timeout); + resolve(event); + }); + }), + publish(event) { + return _publishEvent(event, "EVENT"); + }, + auth(event) { + return _publishEvent(event, "AUTH"); + }, + connect, + close() { + listeners = newListeners(); + subListeners = {}; + pubListeners = {}; + if (ws.readyState === WebSocket.OPEN) { + ws?.close(); + } + }, + get status() { + return ws?.readyState ?? 3; + } + }; + } + + // pool.ts + init_define_process(); + var SimplePool = class { + _conn; + _seenOn = {}; + eoseSubTimeout; + getTimeout; + seenOnEnabled = true; + constructor(options = {}) { + this._conn = {}; + this.eoseSubTimeout = options.eoseSubTimeout || 3400; + this.getTimeout = options.getTimeout || 3400; + this.seenOnEnabled = options.seenOnEnabled !== false; + } + close(relays) { + relays.forEach((url) => { + let relay = this._conn[normalizeURL(url)]; + if (relay) + relay.close(); + }); + } + async ensureRelay(url) { + const nm = normalizeURL(url); + if (!this._conn[nm]) { + this._conn[nm] = relayInit(nm, { + getTimeout: this.getTimeout * 0.9, + listTimeout: this.getTimeout * 0.9 + }); + } + const relay = this._conn[nm]; + await relay.connect(); + return relay; + } + sub(relays, filters, opts) { + let _knownIds = /* @__PURE__ */ new Set(); + let modifiedOpts = { ...opts || {} }; + modifiedOpts.alreadyHaveEvent = (id, url) => { + if (opts?.alreadyHaveEvent?.(id, url)) { + return true; + } + if (this.seenOnEnabled) { + let set = this._seenOn[id] || /* @__PURE__ */ new Set(); + set.add(url); + this._seenOn[id] = set; + } + return _knownIds.has(id); + }; + let subs = []; + let eventListeners = /* @__PURE__ */ new Set(); + let eoseListeners = /* @__PURE__ */ new Set(); + let eosesMissing = relays.length; + let eoseSent = false; + let eoseTimeout = setTimeout(() => { + eoseSent = true; + for (let cb of eoseListeners.values()) + cb(); + }, this.eoseSubTimeout); + relays.forEach(async (relay) => { + let r; + try { + r = await this.ensureRelay(relay); + } catch (err) { + handleEose(); + return; + } + if (!r) + return; + let s = r.sub(filters, modifiedOpts); + s.on("event", (event) => { + _knownIds.add(event.id); + for (let cb of eventListeners.values()) + cb(event); + }); + s.on("eose", () => { + if (eoseSent) + return; + handleEose(); + }); + subs.push(s); + function handleEose() { + eosesMissing--; + if (eosesMissing === 0) { + clearTimeout(eoseTimeout); + for (let cb of eoseListeners.values()) + cb(); + } + } + }); + let greaterSub = { + sub(filters2, opts2) { + subs.forEach((sub) => sub.sub(filters2, opts2)); + return greaterSub; + }, + unsub() { + subs.forEach((sub) => sub.unsub()); + }, + on(type, cb) { + if (type === "event") { + eventListeners.add(cb); + } else if (type === "eose") { + eoseListeners.add(cb); + } + }, + off(type, cb) { + if (type === "event") { + eventListeners.delete(cb); + } else if (type === "eose") + eoseListeners.delete(cb); + } + }; + return greaterSub; + } + get(relays, filter, opts) { + return new Promise((resolve) => { + let sub = this.sub(relays, [filter], opts); + let timeout = setTimeout(() => { + sub.unsub(); + resolve(null); + }, this.getTimeout); + sub.on("event", (event) => { + resolve(event); + clearTimeout(timeout); + sub.unsub(); + }); + }); + } + list(relays, filters, opts) { + return new Promise((resolve) => { + let events = []; + let sub = this.sub(relays, filters, opts); + sub.on("event", (event) => { + events.push(event); + }); + sub.on("eose", () => { + sub.unsub(); + resolve(events); + }); + }); + } + publish(relays, event) { + const pubPromises = relays.map(async (relay) => { + let r; + try { + r = await this.ensureRelay(relay); + return r.publish(event); + } catch (_) { + return { on() { + }, off() { + } }; + } + }); + const callbackMap = /* @__PURE__ */ new Map(); + return { + on(type, cb) { + relays.forEach(async (relay, i) => { + let pub = await pubPromises[i]; + let callback = () => cb(relay); + callbackMap.set(cb, callback); + pub.on(type, callback); + }); + }, + off(type, cb) { + relays.forEach(async (_, i) => { + let callback = callbackMap.get(cb); + if (callback) { + let pub = await pubPromises[i]; + pub.off(type, callback); + } + }); + } + }; + } + seenOn(id) { + return Array.from(this._seenOn[id]?.values?.() || []); + } + }; + + // references.ts + init_define_process(); + + // nip19.ts + var nip19_exports = {}; + __export(nip19_exports, { + BECH32_REGEX: () => BECH32_REGEX, + decode: () => decode, + naddrEncode: () => naddrEncode, + neventEncode: () => neventEncode, + noteEncode: () => noteEncode, + nprofileEncode: () => nprofileEncode, + npubEncode: () => npubEncode, + nrelayEncode: () => nrelayEncode, + nsecEncode: () => nsecEncode + }); + init_define_process(); + + // node_modules/@scure/base/lib/esm/index.js + init_define_process(); + function assertNumber(n) { + if (!Number.isSafeInteger(n)) + throw new Error(`Wrong integer: ${n}`); + } + function chain(...args) { + const wrap = (a, b) => (c) => a(b(c)); + const encode = Array.from(args).reverse().reduce((acc, i) => acc ? wrap(acc, i.encode) : i.encode, void 0); + const decode2 = args.reduce((acc, i) => acc ? wrap(acc, i.decode) : i.decode, void 0); + return { encode, decode: decode2 }; + } + function alphabet(alphabet2) { + return { + encode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("alphabet.encode input should be an array of numbers"); + return digits.map((i) => { + assertNumber(i); + if (i < 0 || i >= alphabet2.length) + throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet2.length})`); + return alphabet2[i]; + }); + }, + decode: (input) => { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("alphabet.decode input should be array of strings"); + return input.map((letter) => { + if (typeof letter !== "string") + throw new Error(`alphabet.decode: not string element=${letter}`); + const index = alphabet2.indexOf(letter); + if (index === -1) + throw new Error(`Unknown letter: "${letter}". Allowed: ${alphabet2}`); + return index; + }); + } + }; + } + function join(separator = "") { + if (typeof separator !== "string") + throw new Error("join separator should be string"); + return { + encode: (from) => { + if (!Array.isArray(from) || from.length && typeof from[0] !== "string") + throw new Error("join.encode input should be array of strings"); + for (let i of from) + if (typeof i !== "string") + throw new Error(`join.encode: non-string input=${i}`); + return from.join(separator); + }, + decode: (to) => { + if (typeof to !== "string") + throw new Error("join.decode input should be string"); + return to.split(separator); + } + }; + } + function padding(bits, chr = "=") { + assertNumber(bits); + if (typeof chr !== "string") + throw new Error("padding chr should be string"); + return { + encode(data) { + if (!Array.isArray(data) || data.length && typeof data[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of data) + if (typeof i !== "string") + throw new Error(`padding.encode: non-string input=${i}`); + while (data.length * bits % 8) + data.push(chr); + return data; + }, + decode(input) { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of input) + if (typeof i !== "string") + throw new Error(`padding.decode: non-string input=${i}`); + let end = input.length; + if (end * bits % 8) + throw new Error("Invalid padding: string should have whole number of bytes"); + for (; end > 0 && input[end - 1] === chr; end--) { + if (!((end - 1) * bits % 8)) + throw new Error("Invalid padding: string has too much padding"); + } + return input.slice(0, end); + } + }; + } + function normalize(fn) { + if (typeof fn !== "function") + throw new Error("normalize fn should be function"); + return { encode: (from) => from, decode: (to) => fn(to) }; + } + function convertRadix(data, from, to) { + if (from < 2) + throw new Error(`convertRadix: wrong from=${from}, base cannot be less than 2`); + if (to < 2) + throw new Error(`convertRadix: wrong to=${to}, base cannot be less than 2`); + if (!Array.isArray(data)) + throw new Error("convertRadix: data should be array"); + if (!data.length) + return []; + let pos = 0; + const res = []; + const digits = Array.from(data); + digits.forEach((d) => { + assertNumber(d); + if (d < 0 || d >= from) + throw new Error(`Wrong integer: ${d}`); + }); + while (true) { + let carry = 0; + let done = true; + for (let i = pos; i < digits.length; i++) { + const digit = digits[i]; + const digitBase = from * carry + digit; + if (!Number.isSafeInteger(digitBase) || from * carry / from !== carry || digitBase - digit !== from * carry) { + throw new Error("convertRadix: carry overflow"); + } + carry = digitBase % to; + digits[i] = Math.floor(digitBase / to); + if (!Number.isSafeInteger(digits[i]) || digits[i] * to + carry !== digitBase) + throw new Error("convertRadix: carry overflow"); + if (!done) + continue; + else if (!digits[i]) + pos = i; + else + done = false; + } + res.push(carry); + if (done) + break; + } + for (let i = 0; i < data.length - 1 && data[i] === 0; i++) + res.push(0); + return res.reverse(); + } + var gcd = (a, b) => !b ? a : gcd(b, a % b); + var radix2carry = (from, to) => from + (to - gcd(from, to)); + function convertRadix2(data, from, to, padding2) { + if (!Array.isArray(data)) + throw new Error("convertRadix2: data should be array"); + if (from <= 0 || from > 32) + throw new Error(`convertRadix2: wrong from=${from}`); + if (to <= 0 || to > 32) + throw new Error(`convertRadix2: wrong to=${to}`); + if (radix2carry(from, to) > 32) { + throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`); + } + let carry = 0; + let pos = 0; + const mask = 2 ** to - 1; + const res = []; + for (const n of data) { + assertNumber(n); + if (n >= 2 ** from) + throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); + carry = carry << from | n; + if (pos + from > 32) + throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); + pos += from; + for (; pos >= to; pos -= to) + res.push((carry >> pos - to & mask) >>> 0); + carry &= 2 ** pos - 1; + } + carry = carry << to - pos & mask; + if (!padding2 && pos >= from) + throw new Error("Excess padding"); + if (!padding2 && carry) + throw new Error(`Non-zero padding: ${carry}`); + if (padding2 && pos > 0) + res.push(carry >>> 0); + return res; + } + function radix(num) { + assertNumber(num); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix.encode input should be Uint8Array"); + return convertRadix(Array.from(bytes2), 2 ** 8, num); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix.decode input should be array of strings"); + return Uint8Array.from(convertRadix(digits, num, 2 ** 8)); + } + }; + } + function radix2(bits, revPadding = false) { + assertNumber(bits); + if (bits <= 0 || bits > 32) + throw new Error("radix2: bits should be in (0..32]"); + if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) + throw new Error("radix2: carry overflow"); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix2.encode input should be Uint8Array"); + return convertRadix2(Array.from(bytes2), 8, bits, !revPadding); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix2.decode input should be array of strings"); + return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); + } + }; + } + function unsafeWrapper(fn) { + if (typeof fn !== "function") + throw new Error("unsafeWrapper fn should be function"); + return function(...args) { + try { + return fn.apply(null, args); + } catch (e) { + } + }; + } + function checksum(len, fn) { + assertNumber(len); + if (typeof fn !== "function") + throw new Error("checksum fn should be function"); + return { + encode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.encode: input should be Uint8Array"); + const checksum2 = fn(data).slice(0, len); + const res = new Uint8Array(data.length + len); + res.set(data); + res.set(checksum2, data.length); + return res; + }, + decode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.decode: input should be Uint8Array"); + const payload = data.slice(0, -len); + const newChecksum = fn(payload).slice(0, len); + const oldChecksum = data.slice(-len); + for (let i = 0; i < len; i++) + if (newChecksum[i] !== oldChecksum[i]) + throw new Error("Invalid checksum"); + return payload; + } + }; + } + var base16 = chain(radix2(4), alphabet("0123456789ABCDEF"), join("")); + var base32 = chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join("")); + var base32hex = chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join("")); + var base32crockford = chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join(""), normalize((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1"))); + var base64 = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join("")); + var base64url = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join("")); + var genBase58 = (abc) => chain(radix(58), alphabet(abc), join("")); + var base58 = genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); + var base58flickr = genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"); + var base58xrp = genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"); + var XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; + var base58xmr = { + encode(data) { + let res = ""; + for (let i = 0; i < data.length; i += 8) { + const block = data.subarray(i, i + 8); + res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], "1"); + } + return res; + }, + decode(str) { + let res = []; + for (let i = 0; i < str.length; i += 11) { + const slice = str.slice(i, i + 11); + const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); + const block = base58.decode(slice); + for (let j = 0; j < block.length - blockLen; j++) { + if (block[j] !== 0) + throw new Error("base58xmr: wrong padding"); + } + res = res.concat(Array.from(block.slice(block.length - blockLen))); + } + return Uint8Array.from(res); + } + }; + var base58check = (sha2562) => chain(checksum(4, (data) => sha2562(sha2562(data))), base58); + var BECH_ALPHABET = chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join("")); + var POLYMOD_GENERATORS = [996825010, 642813549, 513874426, 1027748829, 705979059]; + function bech32Polymod(pre) { + const b = pre >> 25; + let chk = (pre & 33554431) << 5; + for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { + if ((b >> i & 1) === 1) + chk ^= POLYMOD_GENERATORS[i]; + } + return chk; + } + function bechChecksum(prefix, words, encodingConst = 1) { + const len = prefix.length; + let chk = 1; + for (let i = 0; i < len; i++) { + const c = prefix.charCodeAt(i); + if (c < 33 || c > 126) + throw new Error(`Invalid prefix (${prefix})`); + chk = bech32Polymod(chk) ^ c >> 5; + } + chk = bech32Polymod(chk); + for (let i = 0; i < len; i++) + chk = bech32Polymod(chk) ^ prefix.charCodeAt(i) & 31; + for (let v of words) + chk = bech32Polymod(chk) ^ v; + for (let i = 0; i < 6; i++) + chk = bech32Polymod(chk); + chk ^= encodingConst; + return BECH_ALPHABET.encode(convertRadix2([chk % 2 ** 30], 30, 5, false)); + } + function genBech32(encoding) { + const ENCODING_CONST = encoding === "bech32" ? 1 : 734539939; + const _words = radix2(5); + const fromWords = _words.decode; + const toWords = _words.encode; + const fromWordsUnsafe = unsafeWrapper(fromWords); + function encode(prefix, words, limit = 90) { + if (typeof prefix !== "string") + throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`); + if (!Array.isArray(words) || words.length && typeof words[0] !== "number") + throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`); + const actualLength = prefix.length + 7 + words.length; + if (limit !== false && actualLength > limit) + throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); + prefix = prefix.toLowerCase(); + return `${prefix}1${BECH_ALPHABET.encode(words)}${bechChecksum(prefix, words, ENCODING_CONST)}`; + } + function decode2(str, limit = 90) { + if (typeof str !== "string") + throw new Error(`bech32.decode input should be string, not ${typeof str}`); + if (str.length < 8 || limit !== false && str.length > limit) + throw new TypeError(`Wrong string length: ${str.length} (${str}). Expected (8..${limit})`); + const lowered = str.toLowerCase(); + if (str !== lowered && str !== str.toUpperCase()) + throw new Error(`String must be lowercase or uppercase`); + str = lowered; + const sepIndex = str.lastIndexOf("1"); + if (sepIndex === 0 || sepIndex === -1) + throw new Error(`Letter "1" must be present between prefix and data only`); + const prefix = str.slice(0, sepIndex); + const _words2 = str.slice(sepIndex + 1); + if (_words2.length < 6) + throw new Error("Data must be at least 6 characters long"); + const words = BECH_ALPHABET.decode(_words2).slice(0, -6); + const sum = bechChecksum(prefix, words, ENCODING_CONST); + if (!_words2.endsWith(sum)) + throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); + return { prefix, words }; + } + const decodeUnsafe = unsafeWrapper(decode2); + function decodeToBytes(str) { + const { prefix, words } = decode2(str, false); + return { prefix, words, bytes: fromWords(words) }; + } + return { encode, decode: decode2, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords }; + } + var bech32 = genBech32("bech32"); + var bech32m = genBech32("bech32m"); + var utf8 = { + encode: (data) => new TextDecoder().decode(data), + decode: (str) => new TextEncoder().encode(str) + }; + var hex = chain(radix2(4), alphabet("0123456789abcdef"), join(""), normalize((s) => { + if (typeof s !== "string" || s.length % 2) + throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); + return s.toLowerCase(); + })); + var CODERS = { + utf8, + hex, + base16, + base32, + base64, + base64url, + base58, + base58xmr + }; + var coderTypeError = `Invalid encoding type. Available types: ${Object.keys(CODERS).join(", ")}`; + + // nip19.ts + var Bech32MaxSize = 5e3; + var BECH32_REGEX = /[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/; + function decode(nip19) { + let { prefix, words } = bech32.decode(nip19, Bech32MaxSize); + let data = new Uint8Array(bech32.fromWords(words)); + switch (prefix) { + case "nprofile": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nprofile"); + if (tlv[0][0].length !== 32) + throw new Error("TLV 0 should be 32 bytes"); + return { + type: "nprofile", + data: { + pubkey: bytesToHex(tlv[0][0]), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [] + } + }; + } + case "nevent": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nevent"); + if (tlv[0][0].length !== 32) + throw new Error("TLV 0 should be 32 bytes"); + if (tlv[2] && tlv[2][0].length !== 32) + throw new Error("TLV 2 should be 32 bytes"); + return { + type: "nevent", + data: { + id: bytesToHex(tlv[0][0]), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [], + author: tlv[2]?.[0] ? bytesToHex(tlv[2][0]) : void 0 + } + }; + } + case "naddr": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for naddr"); + if (!tlv[2]?.[0]) + throw new Error("missing TLV 2 for naddr"); + if (tlv[2][0].length !== 32) + throw new Error("TLV 2 should be 32 bytes"); + if (!tlv[3]?.[0]) + throw new Error("missing TLV 3 for naddr"); + if (tlv[3][0].length !== 4) + throw new Error("TLV 3 should be 4 bytes"); + return { + type: "naddr", + data: { + identifier: utf8Decoder.decode(tlv[0][0]), + pubkey: bytesToHex(tlv[2][0]), + kind: parseInt(bytesToHex(tlv[3][0]), 16), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [] + } + }; + } + case "nrelay": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nrelay"); + return { + type: "nrelay", + data: utf8Decoder.decode(tlv[0][0]) + }; + } + case "nsec": + case "npub": + case "note": + return { type: prefix, data: bytesToHex(data) }; + default: + throw new Error(`unknown prefix ${prefix}`); + } + } + function parseTLV(data) { + let result = {}; + let rest = data; + while (rest.length > 0) { + let t = rest[0]; + let l = rest[1]; + if (!l) + throw new Error(`malformed TLV ${t}`); + let v = rest.slice(2, 2 + l); + rest = rest.slice(2 + l); + if (v.length < l) + throw new Error(`not enough data to read on TLV ${t}`); + result[t] = result[t] || []; + result[t].push(v); + } + return result; + } + function nsecEncode(hex2) { + return encodeBytes("nsec", hex2); + } + function npubEncode(hex2) { + return encodeBytes("npub", hex2); + } + function noteEncode(hex2) { + return encodeBytes("note", hex2); + } + function encodeBech32(prefix, data) { + let words = bech32.toWords(data); + return bech32.encode(prefix, words, Bech32MaxSize); + } + function encodeBytes(prefix, hex2) { + let data = hexToBytes(hex2); + return encodeBech32(prefix, data); + } + function nprofileEncode(profile) { + let data = encodeTLV({ + 0: [hexToBytes(profile.pubkey)], + 1: (profile.relays || []).map((url) => utf8Encoder.encode(url)) + }); + return encodeBech32("nprofile", data); + } + function neventEncode(event) { + let data = encodeTLV({ + 0: [hexToBytes(event.id)], + 1: (event.relays || []).map((url) => utf8Encoder.encode(url)), + 2: event.author ? [hexToBytes(event.author)] : [] + }); + return encodeBech32("nevent", data); + } + function naddrEncode(addr) { + let kind = new ArrayBuffer(4); + new DataView(kind).setUint32(0, addr.kind, false); + let data = encodeTLV({ + 0: [utf8Encoder.encode(addr.identifier)], + 1: (addr.relays || []).map((url) => utf8Encoder.encode(url)), + 2: [hexToBytes(addr.pubkey)], + 3: [new Uint8Array(kind)] + }); + return encodeBech32("naddr", data); + } + function nrelayEncode(url) { + let data = encodeTLV({ + 0: [utf8Encoder.encode(url)] + }); + return encodeBech32("nrelay", data); + } + function encodeTLV(tlv) { + let entries = []; + Object.entries(tlv).forEach(([t, vs]) => { + vs.forEach((v) => { + let entry = new Uint8Array(v.length + 2); + entry.set([parseInt(t)], 0); + entry.set([v.length], 1); + entry.set(v, 2); + entries.push(entry); + }); + }); + return concatBytes(...entries); + } + + // references.ts + var mentionRegex = /\bnostr:((note|npub|naddr|nevent|nprofile)1\w+)\b|#\[(\d+)\]/g; + function parseReferences(evt) { + let references = []; + for (let ref of evt.content.matchAll(mentionRegex)) { + if (ref[2]) { + try { + let { type, data } = decode(ref[1]); + switch (type) { + case "npub": { + references.push({ + text: ref[0], + profile: { pubkey: data, relays: [] } + }); + break; + } + case "nprofile": { + references.push({ + text: ref[0], + profile: data + }); + break; + } + case "note": { + references.push({ + text: ref[0], + event: { id: data, relays: [] } + }); + break; + } + case "nevent": { + references.push({ + text: ref[0], + event: data + }); + break; + } + case "naddr": { + references.push({ + text: ref[0], + address: data + }); + break; + } + } + } catch (err) { + } + } else if (ref[3]) { + let idx = parseInt(ref[3], 10); + let tag = evt.tags[idx]; + if (!tag) + continue; + switch (tag[0]) { + case "p": { + references.push({ + text: ref[0], + profile: { pubkey: tag[1], relays: tag[2] ? [tag[2]] : [] } + }); + break; + } + case "e": { + references.push({ + text: ref[0], + event: { id: tag[1], relays: tag[2] ? [tag[2]] : [] } + }); + break; + } + case "a": { + try { + let [kind, pubkey, identifier] = tag[1].split(":"); + references.push({ + text: ref[0], + address: { + identifier, + pubkey, + kind: parseInt(kind, 10), + relays: tag[2] ? [tag[2]] : [] + } + }); + } catch (err) { + } + break; + } + } + } + } + return references; + } + + // nip04.ts + var nip04_exports = {}; + __export(nip04_exports, { + decrypt: () => decrypt, + encrypt: () => encrypt + }); + init_define_process(); + if (typeof crypto !== "undefined" && !crypto.subtle && crypto.webcrypto) { + crypto.subtle = crypto.webcrypto.subtle; + } + async function encrypt(privkey, pubkey, text) { + const key = secp256k1.getSharedSecret(privkey, "02" + pubkey); + const normalizedKey = getNormalizedX(key); + let iv = Uint8Array.from(randomBytes(16)); + let plaintext = utf8Encoder.encode(text); + let cryptoKey = await crypto.subtle.importKey( + "raw", + normalizedKey, + { name: "AES-CBC" }, + false, + ["encrypt"] + ); + let ciphertext = await crypto.subtle.encrypt( + { name: "AES-CBC", iv }, + cryptoKey, + plaintext + ); + let ctb64 = base64.encode(new Uint8Array(ciphertext)); + let ivb64 = base64.encode(new Uint8Array(iv.buffer)); + return `${ctb64}?iv=${ivb64}`; + } + async function decrypt(privkey, pubkey, data) { + let [ctb64, ivb64] = data.split("?iv="); + let key = secp256k1.getSharedSecret(privkey, "02" + pubkey); + let normalizedKey = getNormalizedX(key); + let cryptoKey = await crypto.subtle.importKey( + "raw", + normalizedKey, + { name: "AES-CBC" }, + false, + ["decrypt"] + ); + let ciphertext = base64.decode(ctb64); + let iv = base64.decode(ivb64); + let plaintext = await crypto.subtle.decrypt( + { name: "AES-CBC", iv }, + cryptoKey, + ciphertext + ); + let text = utf8Decoder.decode(plaintext); + return text; + } + function getNormalizedX(key) { + return key.slice(1, 33); + } + + // nip05.ts + var nip05_exports = {}; + __export(nip05_exports, { + NIP05_REGEX: () => NIP05_REGEX, + queryProfile: () => queryProfile, + searchDomain: () => searchDomain, + useFetchImplementation: () => useFetchImplementation + }); + init_define_process(); + var NIP05_REGEX = /^(?:([\w.+-]+)@)?([\w.-]+)$/; + var _fetch; + try { + _fetch = fetch; + } catch { + } + function useFetchImplementation(fetchImplementation) { + _fetch = fetchImplementation; + } + async function searchDomain(domain, query = "") { + try { + let res = await (await _fetch(`https://${domain}/.well-known/nostr.json?name=${query}`)).json(); + return res.names; + } catch (_) { + return {}; + } + } + async function queryProfile(fullname) { + const match = fullname.match(NIP05_REGEX); + if (!match) + return null; + const [_, name = "_", domain] = match; + try { + const res = await _fetch(`https://${domain}/.well-known/nostr.json?name=${name}`); + const { names, relays } = parseNIP05Result(await res.json()); + const pubkey = names[name]; + return pubkey ? { pubkey, relays: relays?.[pubkey] } : null; + } catch (_e) { + return null; + } + } + function parseNIP05Result(json) { + const result = { + names: {} + }; + for (const [name, pubkey] of Object.entries(json.names)) { + if (typeof name === "string" && typeof pubkey === "string") { + result.names[name] = pubkey; + } + } + if (json.relays) { + result.relays = {}; + for (const [pubkey, relays] of Object.entries(json.relays)) { + if (typeof pubkey === "string" && Array.isArray(relays)) { + result.relays[pubkey] = relays.filter((relay) => typeof relay === "string"); + } + } + } + return result; + } + + // nip06.ts + var nip06_exports = {}; + __export(nip06_exports, { + generateSeedWords: () => generateSeedWords, + privateKeyFromSeedWords: () => privateKeyFromSeedWords, + validateWords: () => validateWords + }); + init_define_process(); + var import_english = __toESM(require_english()); + var import_bip39 = __toESM(require_bip39()); + + // node_modules/@scure/bip32/lib/esm/index.js + init_define_process(); + + // node_modules/@noble/hashes/esm/ripemd160.js + init_define_process(); + var Rho = new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); + var Id = Uint8Array.from({ length: 16 }, (_, i) => i); + var Pi = Id.map((i) => (9 * i + 5) % 16); + var idxL = [Id]; + var idxR = [Pi]; + for (let i = 0; i < 4; i++) + for (let j of [idxL, idxR]) + j.push(j[i].map((k) => Rho[k])); + var shifts = [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5] + ].map((i) => new Uint8Array(i)); + var shiftsL = idxL.map((idx, i) => idx.map((j) => shifts[i][j])); + var shiftsR = idxR.map((idx, i) => idx.map((j) => shifts[i][j])); + var Kl = new Uint32Array([0, 1518500249, 1859775393, 2400959708, 2840853838]); + var Kr = new Uint32Array([1352829926, 1548603684, 1836072691, 2053994217, 0]); + var rotl = (word, shift) => word << shift | word >>> 32 - shift; + function f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + else if (group === 1) + return x & y | ~x & z; + else if (group === 2) + return (x | ~y) ^ z; + else if (group === 3) + return x & z | y & ~z; + else + return x ^ (y | ~z); + } + var BUF = new Uint32Array(16); + var RIPEMD160 = class extends SHA2 { + constructor() { + super(64, 20, 8, true); + this.h0 = 1732584193 | 0; + this.h1 = 4023233417 | 0; + this.h2 = 2562383102 | 0; + this.h3 = 271733878 | 0; + this.h4 = 3285377520 | 0; + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF[i] = view.getUint32(offset, true); + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl[group], hbr = Kr[group]; + const rl = idxL[group], rr = idxR[group]; + const sl = shiftsL[group], sr = shiftsR[group]; + for (let i = 0; i < 16; i++) { + const tl = rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; + } + for (let i = 0; i < 16; i++) { + const tr = rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; + } + } + this.set(this.h1 + cl + dr | 0, this.h2 + dl + er | 0, this.h3 + el + ar | 0, this.h4 + al + br | 0, this.h0 + bl + cr | 0); + } + roundClean() { + BUF.fill(0); + } + destroy() { + this.destroyed = true; + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0); + } + }; + var ripemd160 = wrapConstructor(() => new RIPEMD160()); + + // node_modules/@noble/hashes/esm/sha512.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_u64.js + init_define_process(); + var U32_MASK64 = BigInt(2 ** 32 - 1); + var _32n = BigInt(32); + function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) }; + return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; + } + function split(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0); + var shrSH = (h, l, s) => h >>> s; + var shrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrSH = (h, l, s) => h >>> s | l << 32 - s; + var rotrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32; + var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s; + var rotr32H = (h, l) => l; + var rotr32L = (h, l) => h; + var rotlSH = (h, l, s) => h << s | l >>> 32 - s; + var rotlSL = (h, l, s) => l << s | h >>> 32 - s; + var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; + var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; + function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; + } + var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; + var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; + var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; + var u64 = { + fromBig, + split, + toBig, + shrSH, + shrSL, + rotrSH, + rotrSL, + rotrBH, + rotrBL, + rotr32H, + rotr32L, + rotlSH, + rotlSL, + rotlBH, + rotlBL, + add, + add3L, + add3H, + add4L, + add4H, + add5H, + add5L + }; + var u64_default = u64; + + // node_modules/@noble/hashes/esm/sha512.js + var [SHA512_Kh, SHA512_Kl] = u64_default.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" + ].map((n) => BigInt(n))); + var SHA512_W_H = new Uint32Array(80); + var SHA512_W_L = new Uint32Array(80); + var SHA512 = class extends SHA2 { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32(offset += 4); + } + for (let i = 16; i < 80; i++) { + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = u64_default.rotrSH(W15h, W15l, 1) ^ u64_default.rotrSH(W15h, W15l, 8) ^ u64_default.shrSH(W15h, W15l, 7); + const s0l = u64_default.rotrSL(W15h, W15l, 1) ^ u64_default.rotrSL(W15h, W15l, 8) ^ u64_default.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = u64_default.rotrSH(W2h, W2l, 19) ^ u64_default.rotrBH(W2h, W2l, 61) ^ u64_default.shrSH(W2h, W2l, 6); + const s1l = u64_default.rotrSL(W2h, W2l, 19) ^ u64_default.rotrBL(W2h, W2l, 61) ^ u64_default.shrSL(W2h, W2l, 6); + const SUMl = u64_default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = u64_default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + for (let i = 0; i < 80; i++) { + const sigma1h = u64_default.rotrSH(Eh, El, 14) ^ u64_default.rotrSH(Eh, El, 18) ^ u64_default.rotrBH(Eh, El, 41); + const sigma1l = u64_default.rotrSL(Eh, El, 14) ^ u64_default.rotrSL(Eh, El, 18) ^ u64_default.rotrBL(Eh, El, 41); + const CHIh = Eh & Fh ^ ~Eh & Gh; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = u64_default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = u64_default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + const sigma0h = u64_default.rotrSH(Ah, Al, 28) ^ u64_default.rotrBH(Ah, Al, 34) ^ u64_default.rotrBH(Ah, Al, 39); + const sigma0l = u64_default.rotrSL(Ah, Al, 28) ^ u64_default.rotrBL(Ah, Al, 34) ^ u64_default.rotrBL(Ah, Al, 39); + const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = u64_default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = u64_default.add3L(T1l, sigma0l, MAJl); + Ah = u64_default.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah, l: Al } = u64_default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = u64_default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = u64_default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = u64_default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = u64_default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = u64_default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = u64_default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = u64_default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + SHA512_W_H.fill(0); + SHA512_W_L.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + }; + var SHA512_224 = class extends SHA512 { + constructor() { + super(); + this.Ah = 2352822216 | 0; + this.Al = 424955298 | 0; + this.Bh = 1944164710 | 0; + this.Bl = 2312950998 | 0; + this.Ch = 502970286 | 0; + this.Cl = 855612546 | 0; + this.Dh = 1738396948 | 0; + this.Dl = 1479516111 | 0; + this.Eh = 258812777 | 0; + this.El = 2077511080 | 0; + this.Fh = 2011393907 | 0; + this.Fl = 79989058 | 0; + this.Gh = 1067287976 | 0; + this.Gl = 1780299464 | 0; + this.Hh = 286451373 | 0; + this.Hl = 2446758561 | 0; + this.outputLen = 28; + } + }; + var SHA512_256 = class extends SHA512 { + constructor() { + super(); + this.Ah = 573645204 | 0; + this.Al = 4230739756 | 0; + this.Bh = 2673172387 | 0; + this.Bl = 3360449730 | 0; + this.Ch = 596883563 | 0; + this.Cl = 1867755857 | 0; + this.Dh = 2520282905 | 0; + this.Dl = 1497426621 | 0; + this.Eh = 2519219938 | 0; + this.El = 2827943907 | 0; + this.Fh = 3193839141 | 0; + this.Fl = 1401305490 | 0; + this.Gh = 721525244 | 0; + this.Gl = 746961066 | 0; + this.Hh = 246885852 | 0; + this.Hl = 2177182882 | 0; + this.outputLen = 32; + } + }; + var SHA384 = class extends SHA512 { + constructor() { + super(); + this.Ah = 3418070365 | 0; + this.Al = 3238371032 | 0; + this.Bh = 1654270250 | 0; + this.Bl = 914150663 | 0; + this.Ch = 2438529370 | 0; + this.Cl = 812702999 | 0; + this.Dh = 355462360 | 0; + this.Dl = 4144912697 | 0; + this.Eh = 1731405415 | 0; + this.El = 4290775857 | 0; + this.Fh = 2394180231 | 0; + this.Fl = 1750603025 | 0; + this.Gh = 3675008525 | 0; + this.Gl = 1694076839 | 0; + this.Hh = 1203062813 | 0; + this.Hl = 3204075428 | 0; + this.outputLen = 48; + } + }; + var sha512 = wrapConstructor(() => new SHA512()); + var sha512_224 = wrapConstructor(() => new SHA512_224()); + var sha512_256 = wrapConstructor(() => new SHA512_256()); + var sha384 = wrapConstructor(() => new SHA384()); + + // node_modules/@scure/bip32/lib/esm/index.js + var Point2 = secp256k1.ProjectivePoint; + var base58check2 = base58check(sha256); + function bytesToNumber(bytes2) { + return BigInt(`0x${bytesToHex(bytes2)}`); + } + function numberToBytes(num) { + return hexToBytes(num.toString(16).padStart(64, "0")); + } + var MASTER_SECRET = utf8ToBytes("Bitcoin seed"); + var BITCOIN_VERSIONS = { private: 76066276, public: 76067358 }; + var HARDENED_OFFSET = 2147483648; + var hash160 = (data) => ripemd160(sha256(data)); + var fromU32 = (data) => createView(data).getUint32(0, false); + var toU32 = (n) => { + if (!Number.isSafeInteger(n) || n < 0 || n > 2 ** 32 - 1) { + throw new Error(`Invalid number=${n}. Should be from 0 to 2 ** 32 - 1`); + } + const buf = new Uint8Array(4); + createView(buf).setUint32(0, n, false); + return buf; + }; + var HDKey = class { + get fingerprint() { + if (!this.pubHash) { + throw new Error("No publicKey set!"); + } + return fromU32(this.pubHash); + } + get identifier() { + return this.pubHash; + } + get pubKeyHash() { + return this.pubHash; + } + get privateKey() { + return this.privKeyBytes || null; + } + get publicKey() { + return this.pubKey || null; + } + get privateExtendedKey() { + const priv = this.privateKey; + if (!priv) { + throw new Error("No private key"); + } + return base58check2.encode(this.serialize(this.versions.private, concatBytes(new Uint8Array([0]), priv))); + } + get publicExtendedKey() { + if (!this.pubKey) { + throw new Error("No public key"); + } + return base58check2.encode(this.serialize(this.versions.public, this.pubKey)); + } + static fromMasterSeed(seed, versions = BITCOIN_VERSIONS) { + bytes(seed); + if (8 * seed.length < 128 || 8 * seed.length > 512) { + throw new Error(`HDKey: wrong seed length=${seed.length}. Should be between 128 and 512 bits; 256 bits is advised)`); + } + const I = hmac(sha512, MASTER_SECRET, seed); + return new HDKey({ + versions, + chainCode: I.slice(32), + privateKey: I.slice(0, 32) + }); + } + static fromExtendedKey(base58key, versions = BITCOIN_VERSIONS) { + const keyBuffer = base58check2.decode(base58key); + const keyView = createView(keyBuffer); + const version = keyView.getUint32(0, false); + const opt = { + versions, + depth: keyBuffer[4], + parentFingerprint: keyView.getUint32(5, false), + index: keyView.getUint32(9, false), + chainCode: keyBuffer.slice(13, 45) + }; + const key = keyBuffer.slice(45); + const isPriv = key[0] === 0; + if (version !== versions[isPriv ? "private" : "public"]) { + throw new Error("Version mismatch"); + } + if (isPriv) { + return new HDKey({ ...opt, privateKey: key.slice(1) }); + } else { + return new HDKey({ ...opt, publicKey: key }); + } + } + static fromJSON(json) { + return HDKey.fromExtendedKey(json.xpriv); + } + constructor(opt) { + this.depth = 0; + this.index = 0; + this.chainCode = null; + this.parentFingerprint = 0; + if (!opt || typeof opt !== "object") { + throw new Error("HDKey.constructor must not be called directly"); + } + this.versions = opt.versions || BITCOIN_VERSIONS; + this.depth = opt.depth || 0; + this.chainCode = opt.chainCode; + this.index = opt.index || 0; + this.parentFingerprint = opt.parentFingerprint || 0; + if (!this.depth) { + if (this.parentFingerprint || this.index) { + throw new Error("HDKey: zero depth with non-zero index/parent fingerprint"); + } + } + if (opt.publicKey && opt.privateKey) { + throw new Error("HDKey: publicKey and privateKey at same time."); + } + if (opt.privateKey) { + if (!secp256k1.utils.isValidPrivateKey(opt.privateKey)) { + throw new Error("Invalid private key"); + } + this.privKey = typeof opt.privateKey === "bigint" ? opt.privateKey : bytesToNumber(opt.privateKey); + this.privKeyBytes = numberToBytes(this.privKey); + this.pubKey = secp256k1.getPublicKey(opt.privateKey, true); + } else if (opt.publicKey) { + this.pubKey = Point2.fromHex(opt.publicKey).toRawBytes(true); + } else { + throw new Error("HDKey: no public or private key provided"); + } + this.pubHash = hash160(this.pubKey); + } + derive(path) { + if (!/^[mM]'?/.test(path)) { + throw new Error('Path must start with "m" or "M"'); + } + if (/^[mM]'?$/.test(path)) { + return this; + } + const parts = path.replace(/^[mM]'?\//, "").split("/"); + let child = this; + for (const c of parts) { + const m = /^(\d+)('?)$/.exec(c); + if (!m || m.length !== 3) { + throw new Error(`Invalid child index: ${c}`); + } + let idx = +m[1]; + if (!Number.isSafeInteger(idx) || idx >= HARDENED_OFFSET) { + throw new Error("Invalid index"); + } + if (m[2] === "'") { + idx += HARDENED_OFFSET; + } + child = child.deriveChild(idx); + } + return child; + } + deriveChild(index) { + if (!this.pubKey || !this.chainCode) { + throw new Error("No publicKey or chainCode set"); + } + let data = toU32(index); + if (index >= HARDENED_OFFSET) { + const priv = this.privateKey; + if (!priv) { + throw new Error("Could not derive hardened child key"); + } + data = concatBytes(new Uint8Array([0]), priv, data); + } else { + data = concatBytes(this.pubKey, data); + } + const I = hmac(sha512, this.chainCode, data); + const childTweak = bytesToNumber(I.slice(0, 32)); + const chainCode = I.slice(32); + if (!secp256k1.utils.isValidPrivateKey(childTweak)) { + throw new Error("Tweak bigger than curve order"); + } + const opt = { + versions: this.versions, + chainCode, + depth: this.depth + 1, + parentFingerprint: this.fingerprint, + index + }; + try { + if (this.privateKey) { + const added = mod(this.privKey + childTweak, secp256k1.CURVE.n); + if (!secp256k1.utils.isValidPrivateKey(added)) { + throw new Error("The tweak was out of range or the resulted private key is invalid"); + } + opt.privateKey = added; + } else { + const added = Point2.fromHex(this.pubKey).add(Point2.fromPrivateKey(childTweak)); + if (added.equals(Point2.ZERO)) { + throw new Error("The tweak was equal to negative P, which made the result key invalid"); + } + opt.publicKey = added.toRawBytes(true); + } + return new HDKey(opt); + } catch (err) { + return this.deriveChild(index + 1); + } + } + sign(hash2) { + if (!this.privateKey) { + throw new Error("No privateKey set!"); + } + bytes(hash2, 32); + return secp256k1.sign(hash2, this.privKey).toCompactRawBytes(); + } + verify(hash2, signature) { + bytes(hash2, 32); + bytes(signature, 64); + if (!this.publicKey) { + throw new Error("No publicKey set!"); + } + let sig; + try { + sig = secp256k1.Signature.fromCompact(signature); + } catch (error) { + return false; + } + return secp256k1.verify(sig, hash2, this.publicKey); + } + wipePrivateData() { + this.privKey = void 0; + if (this.privKeyBytes) { + this.privKeyBytes.fill(0); + this.privKeyBytes = void 0; + } + return this; + } + toJSON() { + return { + xpriv: this.privateExtendedKey, + xpub: this.publicExtendedKey + }; + } + serialize(version, key) { + if (!this.chainCode) { + throw new Error("No chainCode set"); + } + bytes(key, 33); + return concatBytes(toU32(version), new Uint8Array([this.depth]), toU32(this.parentFingerprint), toU32(this.index), this.chainCode, key); + } + }; + + // nip06.ts + function privateKeyFromSeedWords(mnemonic, passphrase) { + let root = HDKey.fromMasterSeed((0, import_bip39.mnemonicToSeedSync)(mnemonic, passphrase)); + let privateKey = root.derive(`m/44'/1237'/0'/0/0`).privateKey; + if (!privateKey) + throw new Error("could not derive private key"); + return bytesToHex(privateKey); + } + function generateSeedWords() { + return (0, import_bip39.generateMnemonic)(import_english.wordlist); + } + function validateWords(words) { + return (0, import_bip39.validateMnemonic)(words, import_english.wordlist); + } + + // nip10.ts + var nip10_exports = {}; + __export(nip10_exports, { + parse: () => parse + }); + init_define_process(); + function parse(event) { + const result = { + reply: void 0, + root: void 0, + mentions: [], + profiles: [] + }; + const eTags = []; + for (const tag of event.tags) { + if (tag[0] === "e" && tag[1]) { + eTags.push(tag); + } + if (tag[0] === "p" && tag[1]) { + result.profiles.push({ + pubkey: tag[1], + relays: tag[2] ? [tag[2]] : [] + }); + } + } + for (let eTagIndex = 0; eTagIndex < eTags.length; eTagIndex++) { + const eTag = eTags[eTagIndex]; + const [_, eTagEventId, eTagRelayUrl, eTagMarker] = eTag; + const eventPointer = { + id: eTagEventId, + relays: eTagRelayUrl ? [eTagRelayUrl] : [] + }; + const isFirstETag = eTagIndex === 0; + const isLastETag = eTagIndex === eTags.length - 1; + if (eTagMarker === "root") { + result.root = eventPointer; + continue; + } + if (eTagMarker === "reply") { + result.reply = eventPointer; + continue; + } + if (eTagMarker === "mention") { + result.mentions.push(eventPointer); + continue; + } + if (isFirstETag) { + result.root = eventPointer; + continue; + } + if (isLastETag) { + result.reply = eventPointer; + continue; + } + result.mentions.push(eventPointer); + } + return result; + } + + // nip13.ts + var nip13_exports = {}; + __export(nip13_exports, { + getPow: () => getPow + }); + init_define_process(); + function getPow(id) { + return getLeadingZeroBits(hexToBytes(id)); + } + function getLeadingZeroBits(hash2) { + let total, i, bits; + for (i = 0, total = 0; i < hash2.length; i++) { + bits = msb(hash2[i]); + total += bits; + if (bits !== 8) { + break; + } + } + return total; + } + function msb(b) { + let n = 0; + if (b === 0) { + return 8; + } + while (b >>= 1) { + n++; + } + return 7 - n; + } + + // nip18.ts + var nip18_exports = {}; + __export(nip18_exports, { + finishRepostEvent: () => finishRepostEvent, + getRepostedEvent: () => getRepostedEvent, + getRepostedEventPointer: () => getRepostedEventPointer + }); + init_define_process(); + function finishRepostEvent(t, reposted, relayUrl, privateKey) { + return finishEvent({ + kind: 6 /* Repost */, + tags: [ + ...t.tags ?? [], + ["e", reposted.id, relayUrl], + ["p", reposted.pubkey] + ], + content: t.content === "" ? "" : JSON.stringify(reposted), + created_at: t.created_at + }, privateKey); + } + function getRepostedEventPointer(event) { + if (event.kind !== 6 /* Repost */) { + return void 0; + } + let lastETag; + let lastPTag; + for (let i = event.tags.length - 1; i >= 0 && (lastETag === void 0 || lastPTag === void 0); i--) { + const tag = event.tags[i]; + if (tag.length >= 2) { + if (tag[0] === "e" && lastETag === void 0) { + lastETag = tag; + } else if (tag[0] === "p" && lastPTag === void 0) { + lastPTag = tag; + } + } + } + if (lastETag === void 0) { + return void 0; + } + return { + id: lastETag[1], + relays: [lastETag[2], lastPTag?.[2]].filter((x) => typeof x === "string"), + author: lastPTag?.[1] + }; + } + function getRepostedEvent(event, { skipVerification } = {}) { + const pointer = getRepostedEventPointer(event); + if (pointer === void 0 || event.content === "") { + return void 0; + } + let repostedEvent; + try { + repostedEvent = JSON.parse(event.content); + } catch (error) { + return void 0; + } + if (repostedEvent.id !== pointer.id) { + return void 0; + } + if (!skipVerification && !verifySignature(repostedEvent)) { + return void 0; + } + return repostedEvent; + } + + // nip21.ts + var nip21_exports = {}; + __export(nip21_exports, { + NOSTR_URI_REGEX: () => NOSTR_URI_REGEX, + parse: () => parse2, + test: () => test + }); + init_define_process(); + var NOSTR_URI_REGEX = new RegExp(`nostr:(${BECH32_REGEX.source})`); + function test(value) { + return typeof value === "string" && new RegExp(`^${NOSTR_URI_REGEX.source}$`).test(value); + } + function parse2(uri) { + const match = uri.match(new RegExp(`^${NOSTR_URI_REGEX.source}$`)); + if (!match) + throw new Error(`Invalid Nostr URI: ${uri}`); + return { + uri: match[0], + value: match[1], + decoded: decode(match[1]) + }; + } + + // nip25.ts + var nip25_exports = {}; + __export(nip25_exports, { + finishReactionEvent: () => finishReactionEvent, + getReactedEventPointer: () => getReactedEventPointer + }); + init_define_process(); + function finishReactionEvent(t, reacted, privateKey) { + const inheritedTags = reacted.tags.filter( + (tag) => tag.length >= 2 && (tag[0] === "e" || tag[0] === "p") + ); + return finishEvent({ + ...t, + kind: 7 /* Reaction */, + tags: [ + ...t.tags ?? [], + ...inheritedTags, + ["e", reacted.id], + ["p", reacted.pubkey] + ], + content: t.content ?? "+" + }, privateKey); + } + function getReactedEventPointer(event) { + if (event.kind !== 7 /* Reaction */) { + return void 0; + } + let lastETag; + let lastPTag; + for (let i = event.tags.length - 1; i >= 0 && (lastETag === void 0 || lastPTag === void 0); i--) { + const tag = event.tags[i]; + if (tag.length >= 2) { + if (tag[0] === "e" && lastETag === void 0) { + lastETag = tag; + } else if (tag[0] === "p" && lastPTag === void 0) { + lastPTag = tag; + } + } + } + if (lastETag === void 0 || lastPTag === void 0) { + return void 0; + } + return { + id: lastETag[1], + relays: [lastETag[2], lastPTag[2]].filter((x) => x !== void 0), + author: lastPTag[1] + }; + } + + // nip26.ts + var nip26_exports = {}; + __export(nip26_exports, { + createDelegation: () => createDelegation, + getDelegator: () => getDelegator + }); + init_define_process(); + function createDelegation(privateKey, parameters) { + let conditions = []; + if ((parameters.kind || -1) >= 0) + conditions.push(`kind=${parameters.kind}`); + if (parameters.until) + conditions.push(`created_at<${parameters.until}`); + if (parameters.since) + conditions.push(`created_at>${parameters.since}`); + let cond = conditions.join("&"); + if (cond === "") + throw new Error("refusing to create a delegation without any conditions"); + let sighash = sha256( + utf8Encoder.encode(`nostr:delegation:${parameters.pubkey}:${cond}`) + ); + let sig = bytesToHex( + schnorr.sign(sighash, privateKey) + ); + return { + from: getPublicKey(privateKey), + to: parameters.pubkey, + cond, + sig + }; + } + function getDelegator(event) { + let tag = event.tags.find((tag2) => tag2[0] === "delegation" && tag2.length >= 4); + if (!tag) + return null; + let pubkey = tag[1]; + let cond = tag[2]; + let sig = tag[3]; + let conditions = cond.split("&"); + for (let i = 0; i < conditions.length; i++) { + let [key, operator, value] = conditions[i].split(/\b/); + if (key === "kind" && operator === "=" && event.kind === parseInt(value)) + continue; + else if (key === "created_at" && operator === "<" && event.created_at < parseInt(value)) + continue; + else if (key === "created_at" && operator === ">" && event.created_at > parseInt(value)) + continue; + else + return null; + } + let sighash = sha256( + utf8Encoder.encode(`nostr:delegation:${event.pubkey}:${cond}`) + ); + if (!schnorr.verify(sig, sighash, pubkey)) + return null; + return pubkey; + } + + // nip27.ts + var nip27_exports = {}; + __export(nip27_exports, { + matchAll: () => matchAll, + regex: () => regex, + replaceAll: () => replaceAll + }); + init_define_process(); + var regex = () => new RegExp(`\\b${NOSTR_URI_REGEX.source}\\b`, "g"); + function* matchAll(content) { + const matches = content.matchAll(regex()); + for (const match of matches) { + try { + const [uri, value] = match; + yield { + uri, + value, + decoded: decode(value), + start: match.index, + end: match.index + uri.length + }; + } catch (_e) { + } + } + } + function replaceAll(content, replacer) { + return content.replaceAll(regex(), (uri, value) => { + return replacer({ + uri, + value, + decoded: decode(value) + }); + }); + } + + // nip39.ts + var nip39_exports = {}; + __export(nip39_exports, { + useFetchImplementation: () => useFetchImplementation2, + validateGithub: () => validateGithub + }); + init_define_process(); + var _fetch2; + try { + _fetch2 = fetch; + } catch { + } + function useFetchImplementation2(fetchImplementation) { + _fetch2 = fetchImplementation; + } + async function validateGithub(pubkey, username, proof) { + try { + let res = await (await _fetch2(`https://gist.github.com/${username}/${proof}/raw`)).text(); + return res === `Verifying that I control the following Nostr public key: ${pubkey}`; + } catch (_) { + return false; + } + } + + // nip42.ts + var nip42_exports = {}; + __export(nip42_exports, { + authenticate: () => authenticate + }); + init_define_process(); + var authenticate = async ({ + challenge: challenge2, + relay, + sign + }) => { + const e = { + kind: 22242 /* ClientAuth */, + created_at: Math.floor(Date.now() / 1e3), + tags: [ + ["relay", relay.url], + ["challenge", challenge2] + ], + content: "" + }; + const pub = relay.auth(await sign(e)); + return new Promise((resolve, reject) => { + pub.on("ok", function ok() { + pub.off("ok", ok); + resolve(); + }); + pub.on("failed", function fail(reason) { + pub.off("failed", fail); + reject(reason); + }); + }); + }; + + // nip57.ts + var nip57_exports = {}; + __export(nip57_exports, { + getZapEndpoint: () => getZapEndpoint, + makeZapReceipt: () => makeZapReceipt, + makeZapRequest: () => makeZapRequest, + useFetchImplementation: () => useFetchImplementation3, + validateZapRequest: () => validateZapRequest + }); + init_define_process(); + var _fetch3; + try { + _fetch3 = fetch; + } catch { + } + function useFetchImplementation3(fetchImplementation) { + _fetch3 = fetchImplementation; + } + async function getZapEndpoint(metadata) { + try { + let lnurl = ""; + let { lud06, lud16 } = JSON.parse(metadata.content); + if (lud06) { + let { words } = bech32.decode(lud06, 1e3); + let data = bech32.fromWords(words); + lnurl = utf8Decoder.decode(data); + } else if (lud16) { + let [name, domain] = lud16.split("@"); + lnurl = `https://${domain}/.well-known/lnurlp/${name}`; + } else { + return null; + } + let res = await _fetch3(lnurl); + let body = await res.json(); + if (body.allowsNostr && body.nostrPubkey) { + return body.callback; + } + } catch (err) { + } + return null; + } + function makeZapRequest({ + profile, + event, + amount, + relays, + comment = "" + }) { + if (!amount) + throw new Error("amount not given"); + if (!profile) + throw new Error("profile not given"); + let zr = { + kind: 9734, + created_at: Math.round(Date.now() / 1e3), + content: comment, + tags: [ + ["p", profile], + ["amount", amount.toString()], + ["relays", ...relays] + ] + }; + if (event) { + zr.tags.push(["e", event]); + } + return zr; + } + function validateZapRequest(zapRequestString) { + let zapRequest; + try { + zapRequest = JSON.parse(zapRequestString); + } catch (err) { + return "Invalid zap request JSON."; + } + if (!validateEvent(zapRequest)) + return "Zap request is not a valid Nostr event."; + if (!verifySignature(zapRequest)) + return "Invalid signature on zap request."; + let p = zapRequest.tags.find(([t, v]) => t === "p" && v); + if (!p) + return "Zap request doesn't have a 'p' tag."; + if (!p[1].match(/^[a-f0-9]{64}$/)) + return "Zap request 'p' tag is not valid hex."; + let e = zapRequest.tags.find(([t, v]) => t === "e" && v); + if (e && !e[1].match(/^[a-f0-9]{64}$/)) + return "Zap request 'e' tag is not valid hex."; + let relays = zapRequest.tags.find(([t, v]) => t === "relays" && v); + if (!relays) + return "Zap request doesn't have a 'relays' tag."; + return null; + } + function makeZapReceipt({ + zapRequest, + preimage, + bolt11, + paidAt + }) { + let zr = JSON.parse(zapRequest); + let tagsFromZapRequest = zr.tags.filter( + ([t]) => t === "e" || t === "p" || t === "a" + ); + let zap = { + kind: 9735, + created_at: Math.round(paidAt.getTime() / 1e3), + content: "", + tags: [ + ...tagsFromZapRequest, + ["bolt11", bolt11], + ["description", zapRequest] + ] + }; + if (preimage) { + zap.tags.push(["preimage", preimage]); + } + return zap; + } + + // nip98.ts + var nip98_exports = {}; + __export(nip98_exports, { + getToken: () => getToken, + validateToken: () => validateToken + }); + init_define_process(); + var _authorizationScheme = "Nostr "; + async function getToken(loginUrl, httpMethod, sign, includeAuthorizationScheme = false) { + if (!loginUrl || !httpMethod) + throw new Error("Missing loginUrl or httpMethod"); + if (httpMethod !== "get" /* Get */ && httpMethod !== "post" /* Post */) + throw new Error("Unknown httpMethod"); + const event = getBlankEvent(27235 /* HttpAuth */); + event.tags = [ + ["u", loginUrl], + ["method", httpMethod] + ]; + event.created_at = Math.round(new Date().getTime() / 1e3); + const signedEvent = await sign(event); + const authorizationScheme = includeAuthorizationScheme ? _authorizationScheme : ""; + return authorizationScheme + base64.encode(utf8Encoder.encode(JSON.stringify(signedEvent))); + } + async function validateToken(token, url, method) { + if (!token) { + throw new Error("Missing token"); + } + token = token.replace(_authorizationScheme, ""); + const eventB64 = utf8Decoder.decode(base64.decode(token)); + if (!eventB64 || eventB64.length === 0 || !eventB64.startsWith("{")) { + throw new Error("Invalid token"); + } + const event = JSON.parse(eventB64); + if (!event) { + throw new Error("Invalid nostr event"); + } + if (!verifySignature(event)) { + throw new Error("Invalid nostr event, signature invalid"); + } + if (event.kind !== 27235 /* HttpAuth */) { + throw new Error("Invalid nostr event, kind invalid"); + } + if (!event.created_at) { + throw new Error("Invalid nostr event, created_at invalid"); + } + if (Math.round(new Date().getTime() / 1e3) - event.created_at > 60) { + throw new Error("Invalid nostr event, expired"); + } + const urlTag = event.tags.find((t) => t[0] === "u"); + if (urlTag?.length !== 1 && urlTag?.[1] !== url) { + throw new Error("Invalid nostr event, url tag invalid"); + } + const methodTag = event.tags.find((t) => t[0] === "method"); + if (methodTag?.length !== 1 && methodTag?.[1].toLowerCase() !== method.toLowerCase()) { + throw new Error("Invalid nostr event, method tag invalid"); + } + return true; + } + return __toCommonJS(nostr_tools_exports); +})(); diff --git a/static/market/assets/ErrorNotFound.db627eb7.js b/static/market/assets/ErrorNotFound.db627eb7.js new file mode 100644 index 0000000..c3e2dc2 --- /dev/null +++ b/static/market/assets/ErrorNotFound.db627eb7.js @@ -0,0 +1 @@ +import{_ as t,y as o,A as s,aU as a,D as e,E as n,aQ as r}from"./index.725caa24.js";const c=o({name:"ErrorNotFound"}),l={class:"fullscreen bg-blue text-white text-center q-pa-md flex flex-center"},d=e("div",{style:{"font-size":"30vh"}}," 404 ",-1),i=e("div",{class:"text-h2",style:{opacity:".4"}}," Oops. Nothing here... ",-1);function _(p,f,u,h,x,m){return s(),a("div",l,[e("div",null,[d,i,n(r,{class:"q-mt-xl",color:"white","text-color":"blue",unelevated:"",to:"/",label:"Go Home","no-caps":""})])])}var N=t(c,[["render",_]]);export{N as default}; diff --git a/static/market/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff b/static/market/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff new file mode 100644 index 0000000..a815cf8 Binary files /dev/null and b/static/market/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff differ diff --git a/static/market/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff b/static/market/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff new file mode 100644 index 0000000..d39bb52 Binary files /dev/null and b/static/market/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff differ diff --git a/static/market/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff b/static/market/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff new file mode 100644 index 0000000..36979ae Binary files /dev/null and b/static/market/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff differ diff --git a/static/market/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff b/static/market/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff new file mode 100644 index 0000000..db0012d Binary files /dev/null and b/static/market/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff differ diff --git a/static/market/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff b/static/market/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff new file mode 100644 index 0000000..04cbe94 Binary files /dev/null and b/static/market/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff differ diff --git a/static/market/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff b/static/market/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff new file mode 100644 index 0000000..9eaa94f Binary files /dev/null and b/static/market/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff differ diff --git a/static/market/assets/MainLayout.421c5479.js b/static/market/assets/MainLayout.421c5479.js new file mode 100644 index 0000000..6ac98a9 --- /dev/null +++ b/static/market/assets/MainLayout.421c5479.js @@ -0,0 +1 @@ +import{c as q,i as j,e as C,l as O,p as W,a as u,h as d,b as k,g as P,d as A,w as T,o as D,f as K,n as U,j as I,k as G,m as J,q as X,r as p,s as Y,t as L,u as _,v as Z,x as ee,_ as te,y as oe,z as ne,A as le,B as ie,C as B,D as x,E}from"./index.725caa24.js";import{Q as F}from"./QResizeObserver.bcb70109.js";var ae=q({name:"QPageContainer",setup(e,{slots:h}){const{proxy:{$q:n}}=P(),o=j(O,C);if(o===C)return console.error("QPageContainer needs to be child of QLayout"),C;W(A,!0);const i=u(()=>{const a={};return o.header.space===!0&&(a.paddingTop=`${o.header.size}px`),o.right.space===!0&&(a[`padding${n.lang.rtl===!0?"Left":"Right"}`]=`${o.right.size}px`),o.footer.space===!0&&(a.paddingBottom=`${o.footer.size}px`),o.left.space===!0&&(a[`padding${n.lang.rtl===!0?"Right":"Left"}`]=`${o.left.size}px`),a});return()=>d("div",{class:"q-page-container",style:i.value},k(h.default))}});const{passive:M}=G,re=["both","horizontal","vertical"];var se=q({name:"QScrollObserver",props:{axis:{type:String,validator:e=>re.includes(e),default:"vertical"},debounce:[String,Number],scrollTarget:{default:void 0}},emits:["scroll"],setup(e,{emit:h}){const n={position:{top:0,left:0},direction:"down",directionChanged:!1,delta:{top:0,left:0},inflectionPoint:{top:0,left:0}};let o=null,i,a;T(()=>e.scrollTarget,()=>{f(),y()});function c(){o!==null&&o();const g=Math.max(0,J(i)),m=X(i),s={top:g-n.position.top,left:m-n.position.left};if(e.axis==="vertical"&&s.top===0||e.axis==="horizontal"&&s.left===0)return;const S=Math.abs(s.top)>=Math.abs(s.left)?s.top<0?"up":"down":s.left<0?"left":"right";n.position={top:g,left:m},n.directionChanged=n.direction!==S,n.delta=s,n.directionChanged===!0&&(n.direction=S,n.inflectionPoint=n.position),h("scroll",{...n})}function y(){i=I(a,e.scrollTarget),i.addEventListener("scroll",r,M),r(!0)}function f(){i!==void 0&&(i.removeEventListener("scroll",r,M),i=void 0)}function r(g){if(g===!0||e.debounce===0||e.debounce==="0")c();else if(o===null){const[m,s]=e.debounce?[setTimeout(c,e.debounce),clearTimeout]:[requestAnimationFrame(c),cancelAnimationFrame];o=()=>{s(m),o=null}}}const{proxy:b}=P();return T(()=>b.$q.lang.rtl,c),D(()=>{a=b.$el.parentNode,y()}),K(()=>{o!==null&&o(),f()}),Object.assign(b,{trigger:r,getPosition:()=>n}),U}}),ce=q({name:"QLayout",props:{container:Boolean,view:{type:String,default:"hhh lpr fff",validator:e=>/^(h|l)h(h|r) lpr (f|l)f(f|r)$/.test(e.toLowerCase())},onScroll:Function,onScrollHeight:Function,onResize:Function},setup(e,{slots:h,emit:n}){const{proxy:{$q:o}}=P(),i=p(null),a=p(o.screen.height),c=p(e.container===!0?0:o.screen.width),y=p({position:0,direction:"down",inflectionPoint:0}),f=p(0),r=p(Y.value===!0?0:L()),b=u(()=>"q-layout q-layout--"+(e.container===!0?"containerized":"standard")),g=u(()=>e.container===!1?{minHeight:o.screen.height+"px"}:null),m=u(()=>r.value!==0?{[o.lang.rtl===!0?"left":"right"]:`${r.value}px`}:null),s=u(()=>r.value!==0?{[o.lang.rtl===!0?"right":"left"]:0,[o.lang.rtl===!0?"left":"right"]:`-${r.value}px`,width:`calc(100% + ${r.value}px)`}:null);function S(t){if(e.container===!0||document.qScrollPrevented!==!0){const l={position:t.position.top,direction:t.direction,directionChanged:t.directionChanged,inflectionPoint:t.inflectionPoint.top,delta:t.delta.top};y.value=l,e.onScroll!==void 0&&n("scroll",l)}}function N(t){const{height:l,width:v}=t;let w=!1;a.value!==l&&(w=!0,a.value=l,e.onScrollHeight!==void 0&&n("scrollHeight",l),R()),c.value!==v&&(w=!0,c.value=v),w===!0&&e.onResize!==void 0&&n("resize",t)}function V({height:t}){f.value!==t&&(f.value=t,R())}function R(){if(e.container===!0){const t=a.value>f.value?L():0;r.value!==t&&(r.value=t)}}let z=null;const H={instances:{},view:u(()=>e.view),isContainer:u(()=>e.container),rootRef:i,height:a,containerHeight:f,scrollbarWidth:r,totalWidth:u(()=>c.value+r.value),rows:u(()=>{const t=e.view.toLowerCase().split(" ");return{top:t[0].split(""),middle:t[1].split(""),bottom:t[2].split("")}}),header:_({size:0,offset:0,space:!1}),right:_({size:300,offset:0,space:!1}),footer:_({size:0,offset:0,space:!1}),left:_({size:300,offset:0,space:!1}),scroll:y,animate(){z!==null?clearTimeout(z):document.body.classList.add("q-body--layout-animate"),z=setTimeout(()=>{z=null,document.body.classList.remove("q-body--layout-animate")},155)},update(t,l,v){H[t][l]=v}};if(W(O,H),L()>0){let v=function(){t=null,l.classList.remove("hide-scrollbar")},w=function(){if(t===null){if(l.scrollHeight>o.screen.height)return;l.classList.add("hide-scrollbar")}else clearTimeout(t);t=setTimeout(v,300)},$=function(Q){t!==null&&Q==="remove"&&(clearTimeout(t),v()),window[`${Q}EventListener`]("resize",w)},t=null;const l=document.body;T(()=>e.container!==!0?"add":"remove",$),e.container!==!0&&$("add"),Z(()=>{$("remove")})}return()=>{const t=ee(h.default,[d(se,{onScroll:S}),d(F,{onResize:N})]),l=d("div",{class:b.value,style:g.value,ref:e.container===!0?void 0:i,tabindex:-1},t);return e.container===!0?d("div",{class:"q-layout-container overflow-hidden",ref:i},[d(F,{onResize:V}),d("div",{class:"absolute-full",style:m.value},[d("div",{class:"scroll",style:s.value},[l])])]):l}}});const ue=oe({name:"MainLayout",setup(){return{}}}),de={class:"row q-mb-sm q-mt-md"},fe=x("div",{class:"col-lg-2 col-md-1 col-sm-0"},null,-1),ve={class:"col-lg-8 col-md-10 col-sm-12 auto-width q-ml-md q-mr-md"},he=x("div",{class:"col-lg-2 col-md-1 col-sm-0"},null,-1);function ge(e,h,n,o,i,a){const c=ne("router-view");return le(),ie(ce,{view:"lHh Lpr lFf"},{default:B(()=>[x("div",de,[fe,x("div",ve,[E(ae,null,{default:B(()=>[E(c)]),_:1})]),he])]),_:1})}var ye=te(ue,[["render",ge]]);export{ye as default}; diff --git a/static/market/assets/MarketPage.2aa781b5.js b/static/market/assets/MarketPage.2aa781b5.js new file mode 100644 index 0000000..5d63629 --- /dev/null +++ b/static/market/assets/MarketPage.2aa781b5.js @@ -0,0 +1,18 @@ +import{c as Se,a as k,h as _,b as Ee,x as Ln,P as as,r as Q,G as ta,H as zn,F as dt,I as jt,w as de,o as fn,f as Ke,g as Fe,J as Mn,k as xn,K as Il,L as Sn,t as is,M as Ri,N as Bi,O as Vi,Q as Wn,R as pa,S as no,T as Fi,U as ao,j as Ea,V as na,W as We,X as Vt,Y as ls,Z as Ft,$ as os,a0 as Yi,a1 as je,a2 as rs,a3 as io,n as lo,a4 as oo,a5 as Ui,a6 as Na,a7 as La,a8 as ss,a9 as us,aa as ro,ab as Ra,ac as so,ad as cs,ae as ds,af as uo,ag as co,i as ba,e as Et,l as fs,d as hs,ah as fo,ai as ms,aj as gs,ak as vs,y as ot,al as ho,am as dn,an as mo,ao as kn,ap as _a,p as ys,aq as ps,ar as ii,as as wi,at as bs,au as Hi,av as go,aw as vo,ax as yo,ay as _s,az as ws,aA as Al,aB as Ss,aC as ks,aD as Cs,aE as Ts,aF as Ms,aG as qs,aH as Ol,aI as Ps,aJ as Ds,aK as $s,aL as on,aM as Si,_ as _t,A as S,B as j,C as f,E as c,D as m,aN as we,aO as Ae,aP as vt,aQ as ee,aR as fe,aS as Xe,aT as ki,aU as V,aV as at,aW as et,aX as po,aY as lt,aZ as oe,a_ as W,a$ as xs,b0 as In,b1 as bo,b2 as Is,b3 as As,b4 as ca,m as li,b5 as oi,b6 as El,z as Ci,b7 as _o,b8 as Os,b9 as Es,ba as Ns,bb as Nl,bc as Ls,bd as Rs,be as Bs,bf as Vs}from"./index.725caa24.js";import{Q as Fs}from"./QResizeObserver.bcb70109.js";var ri=Se({name:"QToolbar",props:{inset:Boolean},setup(e,{slots:t}){const n=k(()=>"q-toolbar row no-wrap items-center"+(e.inset===!0?" q-toolbar--inset":""));return()=>_("div",{class:n.value,role:"toolbar"},Ee(t.default))}});const Ys=["top","middle","bottom"];var rn=Se({name:"QBadge",props:{color:String,textColor:String,floating:Boolean,transparent:Boolean,multiLine:Boolean,outline:Boolean,rounded:Boolean,label:[Number,String],align:{type:String,validator:e=>Ys.includes(e)}},setup(e,{slots:t}){const n=k(()=>e.align!==void 0?{verticalAlign:e.align}:null),a=k(()=>{const i=e.outline===!0&&e.color||e.textColor;return`q-badge flex inline items-center no-wrap q-badge--${e.multiLine===!0?"multi":"single"}-line`+(e.outline===!0?" q-badge--outline":e.color!==void 0?` bg-${e.color}`:"")+(i!==void 0?` text-${i}`:"")+(e.floating===!0?" q-badge--floating":"")+(e.rounded===!0?" q-badge--rounded":"")+(e.transparent===!0?" q-badge--transparent":"")});return()=>_("div",{class:a.value,style:n.value,role:"status","aria-label":e.label},Ln(t.default,e.label!==void 0?[e.label]:[]))}});function wa(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),as.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const wo={target:{default:!0},noParentEvent:Boolean,contextMenu:Boolean};function So({showing:e,avoidEmit:t,configureAnchorEl:n}){const{props:a,proxy:i,emit:l}=Fe(),o=Q(null);let r=null;function s(g){return o.value===null?!1:g===void 0||g.touches===void 0||g.touches.length<=1}const u={};n===void 0&&(Object.assign(u,{hide(g){i.hide(g)},toggle(g){i.toggle(g),g.qAnchorHandled=!0},toggleKey(g){ta(g,13)===!0&&u.toggle(g)},contextClick(g){i.hide(g),zn(g),dt(()=>{i.show(g),g.qAnchorHandled=!0})},prevent:zn,mobileTouch(g){if(u.mobileCleanup(g),s(g)!==!0)return;i.hide(g),o.value.classList.add("non-selectable");const C=g.target;jt(u,"anchor",[[C,"touchmove","mobileCleanup","passive"],[C,"touchend","mobileCleanup","passive"],[C,"touchcancel","mobileCleanup","passive"],[o.value,"contextmenu","prevent","notPassive"]]),r=setTimeout(()=>{r=null,i.show(g),g.qAnchorHandled=!0},300)},mobileCleanup(g){o.value.classList.remove("non-selectable"),r!==null&&(clearTimeout(r),r=null),e.value===!0&&g!==void 0&&wa()}}),n=function(g=a.contextMenu){if(a.noParentEvent===!0||o.value===null)return;let C;g===!0?i.$q.platform.is.mobile===!0?C=[[o.value,"touchstart","mobileTouch","passive"]]:C=[[o.value,"mousedown","hide","passive"],[o.value,"contextmenu","contextClick","notPassive"]]:C=[[o.value,"click","toggle","passive"],[o.value,"keyup","toggleKey","passive"]],jt(u,"anchor",C)});function d(){Mn(u,"anchor")}function v(g){for(o.value=g;o.value.classList.contains("q-anchor--skip");)o.value=o.value.parentNode;n()}function y(){if(a.target===!1||a.target===""||i.$el.parentNode===null)o.value=null;else if(a.target===!0)v(i.$el.parentNode);else{let g=a.target;if(typeof a.target=="string")try{g=document.querySelector(a.target)}catch{g=void 0}g!=null?(o.value=g.$el||g,n()):(o.value=null,console.error(`Anchor: target "${a.target}" not found`))}}return de(()=>a.contextMenu,g=>{o.value!==null&&(d(),n(g))}),de(()=>a.target,()=>{o.value!==null&&d(),y()}),de(()=>a.noParentEvent,g=>{o.value!==null&&(g===!0?d():n())}),fn(()=>{y(),t!==!0&&a.modelValue===!0&&o.value===null&&l("update:modelValue",!1)}),Ke(()=>{r!==null&&clearTimeout(r),d()}),{anchorEl:o,canShow:s,anchorEvents:u}}function ko(e,t){const n=Q(null);let a;function i(r,s){const u=`${s!==void 0?"add":"remove"}EventListener`,d=s!==void 0?s:a;r!==window&&r[u]("scroll",d,xn.passive),window[u]("scroll",d,xn.passive),a=s}function l(){n.value!==null&&(i(n.value),n.value=null)}const o=de(()=>e.noParentEvent,()=>{n.value!==null&&(l(),t())});return Ke(o),{localScrollTarget:n,unconfigureScrollTarget:l,changeScrollEvent:i}}const{notPassiveCapture:Sa}=xn,un=[];function ka(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let n=Il.length-1;for(;n>=0;){const a=Il[n].$;if(a.type.name==="QTooltip"){n--;continue}if(a.type.name!=="QDialog")break;if(a.props.seamless!==!0)return;n--}for(let a=un.length-1;a>=0;a--){const i=un[a];if((i.anchorEl.value===null||i.anchorEl.value.contains(t)===!1)&&(t===document.body||i.innerRef.value!==null&&i.innerRef.value.contains(t)===!1))e.qClickOutside=!0,i.onClickOutside(e);else return}}function Co(e){un.push(e),un.length===1&&(document.addEventListener("mousedown",ka,Sa),document.addEventListener("touchstart",ka,Sa))}function Ca(e){const t=un.findIndex(n=>n===e);t>-1&&(un.splice(t,1),un.length===0&&(document.removeEventListener("mousedown",ka,Sa),document.removeEventListener("touchstart",ka,Sa)))}let Ll,Rl;function Ta(e){const t=e.split(" ");return t.length!==2?!1:["top","center","bottom"].includes(t[0])!==!0?(console.error("Anchor/Self position must start with one of top/center/bottom"),!1):["left","middle","right","start","end"].includes(t[1])!==!0?(console.error("Anchor/Self position must end with one of left/middle/right/start/end"),!1):!0}function To(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const Ti={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{Ti[`${e}#ltr`]=e,Ti[`${e}#rtl`]=e});function Ma(e,t){const n=e.split(" ");return{vertical:n[0],horizontal:Ti[`${n[1]}#${t===!0?"rtl":"ltr"}`]}}function Us(e,t){let{top:n,left:a,right:i,bottom:l,width:o,height:r}=e.getBoundingClientRect();return t!==void 0&&(n-=t[1],a-=t[0],l+=t[1],i+=t[0],o+=t[0],r+=t[1]),{top:n,bottom:l,height:r,left:a,right:i,width:o,middle:a+(i-a)/2,center:n+(l-n)/2}}function Hs(e,t,n){let{top:a,left:i}=e.getBoundingClientRect();return a+=t.top,i+=t.left,n!==void 0&&(a+=n[1],i+=n[0]),{top:a,bottom:a+1,height:1,left:i,right:i+1,width:1,middle:i,center:a}}function zs(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function Bl(e,t,n,a){return{top:e[n.vertical]-t[a.vertical],left:e[n.horizontal]-t[a.horizontal]}}function zi(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{zi(e,t+1)},10);return}const{targetEl:n,offset:a,anchorEl:i,anchorOrigin:l,selfOrigin:o,absoluteOffset:r,fit:s,cover:u,maxHeight:d,maxWidth:v}=e;if(Sn.is.ios===!0&&window.visualViewport!==void 0){const B=document.body.style,{offsetLeft:x,offsetTop:$}=window.visualViewport;x!==Ll&&(B.setProperty("--q-pe-left",x+"px"),Ll=x),$!==Rl&&(B.setProperty("--q-pe-top",$+"px"),Rl=$)}const{scrollLeft:y,scrollTop:g}=n,C=r===void 0?Us(i,u===!0?[0,0]:a):Hs(i,r,a);Object.assign(n.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:v||"100vw",maxHeight:d||"100vh",visibility:"visible"});const{offsetWidth:w,offsetHeight:T}=n,{elWidth:q,elHeight:P}=s===!0||u===!0?{elWidth:Math.max(C.width,w),elHeight:u===!0?Math.max(C.height,T):T}:{elWidth:w,elHeight:T};let p={maxWidth:v,maxHeight:d};(s===!0||u===!0)&&(p.minWidth=C.width+"px",u===!0&&(p.minHeight=C.height+"px")),Object.assign(n.style,p);const b=zs(q,P);let M=Bl(C,b,l,o);if(r===void 0||a===void 0)si(M,C,b,l,o);else{const{top:B,left:x}=M;si(M,C,b,l,o);let $=!1;if(M.top!==B){$=!0;const G=2*a[1];C.center=C.top-=G,C.bottom-=G+2}if(M.left!==x){$=!0;const G=2*a[0];C.middle=C.left-=G,C.right-=G+2}$===!0&&(M=Bl(C,b,l,o),si(M,C,b,l,o))}p={top:M.top+"px",left:M.left+"px"},M.maxHeight!==void 0&&(p.maxHeight=M.maxHeight+"px",C.height>M.maxHeight&&(p.minHeight=p.maxHeight)),M.maxWidth!==void 0&&(p.maxWidth=M.maxWidth+"px",C.width>M.maxWidth&&(p.minWidth=p.maxWidth)),Object.assign(n.style,p),n.scrollTop!==g&&(n.scrollTop=g),n.scrollLeft!==y&&(n.scrollLeft=y)}function si(e,t,n,a,i){const l=n.bottom,o=n.right,r=is(),s=window.innerHeight-r,u=document.body.clientWidth;if(e.top<0||e.top+l>s)if(i.vertical==="center")e.top=t[a.vertical]>s/2?Math.max(0,s-l):0,e.maxHeight=Math.min(l,s);else if(t[a.vertical]>s/2){const d=Math.min(s,a.vertical==="center"?t.center:a.vertical===i.vertical?t.bottom:t.top);e.maxHeight=Math.min(l,d),e.top=Math.max(0,d-l)}else e.top=Math.max(0,a.vertical==="center"?t.center:a.vertical===i.vertical?t.top:t.bottom),e.maxHeight=Math.min(l,s-e.top);if(e.left<0||e.left+o>u)if(e.maxWidth=Math.min(o,u),i.horizontal==="middle")e.left=t[a.horizontal]>u/2?Math.max(0,u-o):0;else if(t[a.horizontal]>u/2){const d=Math.min(u,a.horizontal==="middle"?t.middle:a.horizontal===i.horizontal?t.right:t.left);e.maxWidth=Math.min(o,d),e.left=Math.max(0,d-e.maxWidth)}else e.left=Math.max(0,a.horizontal==="middle"?t.middle:a.horizontal===i.horizontal?t.left:t.right),e.maxWidth=Math.min(o,u-e.left)}var Tt=Se({name:"QTooltip",inheritAttrs:!1,props:{...wo,...Ri,...Bi,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{default:"jump-down"},transitionHide:{default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:Ta},self:{type:String,default:"top middle",validator:Ta},offset:{type:Array,default:()=>[14,14],validator:To},scrollTarget:{default:void 0},delay:{type:Number,default:0},hideDelay:{type:Number,default:0}},emits:[...Vi],setup(e,{slots:t,emit:n,attrs:a}){let i,l;const o=Fe(),{proxy:{$q:r}}=o,s=Q(null),u=Q(!1),d=k(()=>Ma(e.anchor,r.lang.rtl)),v=k(()=>Ma(e.self,r.lang.rtl)),y=k(()=>e.persistent!==!0),{registerTick:g,removeTick:C}=Wn(),{registerTimeout:w}=pa(),{transitionProps:T,transitionStyle:q}=no(e),{localScrollTarget:P,changeScrollEvent:p,unconfigureScrollTarget:b}=ko(e,N),{anchorEl:M,canShow:B,anchorEvents:x}=So({showing:u,configureAnchorEl:Be}),{show:$,hide:G}=Fi({showing:u,canShow:B,handleShow:E,handleHide:le,hideOnRouteChange:y,processOnMount:!0});Object.assign(x,{delayShow:J,delayHide:qe});const{showPortal:Z,hidePortal:ce,renderPortal:$e}=ao(o,s,H,"tooltip");if(r.platform.is.mobile===!0){const U={anchorEl:M,innerRef:s,onClickOutside(be){return G(be),be.target.classList.contains("q-dialog__backdrop")&&We(be),!0}},me=k(()=>e.modelValue===null&&e.persistent!==!0&&u.value===!0);de(me,be=>{(be===!0?Co:Ca)(U)}),Ke(()=>{Ca(U)})}function E(U){Z(),g(()=>{l=new MutationObserver(()=>ke()),l.observe(s.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),ke(),N()}),i===void 0&&(i=de(()=>r.screen.width+"|"+r.screen.height+"|"+e.self+"|"+e.anchor+"|"+r.lang.rtl,ke)),w(()=>{Z(!0),n("show",U)},e.transitionDuration)}function le(U){C(),ce(),ve(),w(()=>{ce(!0),n("hide",U)},e.transitionDuration)}function ve(){l!==void 0&&(l.disconnect(),l=void 0),i!==void 0&&(i(),i=void 0),b(),Mn(x,"tooltipTemp")}function ke(){zi({targetEl:s.value,offset:e.offset,anchorEl:M.value,anchorOrigin:d.value,selfOrigin:v.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function J(U){if(r.platform.is.mobile===!0){wa(),document.body.classList.add("non-selectable");const me=M.value,be=["touchmove","touchcancel","touchend","click"].map(X=>[me,X,"delayHide","passiveCapture"]);jt(x,"tooltipTemp",be)}w(()=>{$(U)},e.delay)}function qe(U){r.platform.is.mobile===!0&&(Mn(x,"tooltipTemp"),wa(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),w(()=>{G(U)},e.hideDelay)}function Be(){if(e.noParentEvent===!0||M.value===null)return;const U=r.platform.is.mobile===!0?[[M.value,"touchstart","delayShow","passive"]]:[[M.value,"mouseenter","delayShow","passive"],[M.value,"mouseleave","delayHide","passive"]];jt(x,"anchor",U)}function N(){if(M.value!==null||e.scrollTarget!==void 0){P.value=Ea(M.value,e.scrollTarget);const U=e.noParentEvent===!0?ke:G;p(P.value,U)}}function A(){return u.value===!0?_("div",{...a,ref:s,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",a.class],style:[a.style,q.value],role:"tooltip"},Ee(t.default)):null}function H(){return _(na,T.value,A)}return Ke(ve),Object.assign(o.proxy,{updatePosition:ke}),$e}});const Ws={xs:8,sm:10,md:14,lg:20,xl:24};var aa=Se({name:"QChip",props:{...Vt,...ls,dense:Boolean,icon:String,iconRight:String,iconRemove:String,iconSelected:String,label:[String,Number],color:String,textColor:String,modelValue:{type:Boolean,default:!0},selected:{type:Boolean,default:null},square:Boolean,outline:Boolean,clickable:Boolean,removable:Boolean,removeAriaLabel:String,tabindex:[String,Number],disable:Boolean,ripple:{type:[Boolean,Object],default:!0}},emits:["update:modelValue","update:selected","remove","click"],setup(e,{slots:t,emit:n}){const{proxy:{$q:a}}=Fe(),i=Ft(e,a),l=os(e,Ws),o=k(()=>e.selected===!0||e.icon!==void 0),r=k(()=>e.selected===!0?e.iconSelected||a.iconSet.chip.selected:e.icon),s=k(()=>e.iconRemove||a.iconSet.chip.remove),u=k(()=>e.disable===!1&&(e.clickable===!0||e.selected!==null)),d=k(()=>{const T=e.outline===!0&&e.color||e.textColor;return"q-chip row inline no-wrap items-center"+(e.outline===!1&&e.color!==void 0?` bg-${e.color}`:"")+(T?` text-${T} q-chip--colored`:"")+(e.disable===!0?" disabled":"")+(e.dense===!0?" q-chip--dense":"")+(e.outline===!0?" q-chip--outline":"")+(e.selected===!0?" q-chip--selected":"")+(u.value===!0?" q-chip--clickable cursor-pointer non-selectable q-hoverable":"")+(e.square===!0?" q-chip--square":"")+(i.value===!0?" q-chip--dark q-dark":"")}),v=k(()=>{const T=e.disable===!0?{tabindex:-1,"aria-disabled":"true"}:{tabindex:e.tabindex||0},q={...T,role:"button","aria-hidden":"false","aria-label":e.removeAriaLabel||a.lang.label.remove};return{chip:T,remove:q}});function y(T){T.keyCode===13&&g(T)}function g(T){e.disable||(n("update:selected",!e.selected),n("click",T))}function C(T){(T.keyCode===void 0||T.keyCode===13)&&(We(T),e.disable===!1&&(n("update:modelValue",!1),n("remove")))}function w(){const T=[];u.value===!0&&T.push(_("div",{class:"q-focus-helper"})),o.value===!0&&T.push(_(je,{class:"q-chip__icon q-chip__icon--left",name:r.value}));const q=e.label!==void 0?[_("div",{class:"ellipsis"},[e.label])]:void 0;return T.push(_("div",{class:"q-chip__content col row no-wrap items-center q-anchor--skip"},rs(t.default,q))),e.iconRight&&T.push(_(je,{class:"q-chip__icon q-chip__icon--right",name:e.iconRight})),e.removable===!0&&T.push(_(je,{class:"q-chip__icon q-chip__icon--remove cursor-pointer",name:s.value,...v.value.remove,onClick:C,onKeyup:C})),T}return()=>{if(e.modelValue===!1)return;const T={class:d.value,style:l.value};return u.value===!0&&Object.assign(T,v.value.chip,{onClick:g,onKeyup:y}),Yi("div",T,w(),"ripple",e.ripple!==!1&&e.disable!==!0,()=>[[io,e.ripple]])}}}),Qt=Se({name:"QList",props:{...Vt,bordered:Boolean,dense:Boolean,separator:Boolean,padding:Boolean,tag:{type:String,default:"div"}},setup(e,{slots:t}){const n=Fe(),a=Ft(e,n.proxy.$q),i=k(()=>"q-list"+(e.bordered===!0?" q-list--bordered":"")+(e.dense===!0?" q-list--dense":"")+(e.separator===!0?" q-list--separator":"")+(a.value===!0?" q-list--dark":"")+(e.padding===!0?" q-list--padding":""));return()=>_(e.tag,{class:i.value},Ee(t.default))}});const js=["horizontal","vertical","cell","none"];var Qs=Se({name:"QMarkupTable",props:{...Vt,dense:Boolean,flat:Boolean,bordered:Boolean,square:Boolean,wrapCells:Boolean,separator:{type:String,default:"horizontal",validator:e=>js.includes(e)}},setup(e,{slots:t}){const n=Fe(),a=Ft(e,n.proxy.$q),i=k(()=>`q-markup-table q-table__container q-table__card q-table--${e.separator}-separator`+(a.value===!0?" q-table--dark q-table__card--dark q-dark":"")+(e.dense===!0?" q-table--dense":"")+(e.flat===!0?" q-table--flat":"")+(e.bordered===!0?" q-table--bordered":"")+(e.square===!0?" q-table--square":"")+(e.wrapCells===!1?" q-table--no-wrap":""));return()=>_("div",{class:i.value},[_("table",{class:"q-table"},Ee(t.default))])}});function Ks(e,t){return _("div",e,[_("table",{class:"q-table"},t)])}let Gn=!1;{const e=document.createElement("div");e.setAttribute("dir","rtl"),Object.assign(e.style,{width:"1px",height:"1px",overflow:"auto"});const t=document.createElement("div");Object.assign(t.style,{width:"1000px",height:"1px"}),document.body.appendChild(e),e.appendChild(t),e.scrollLeft=-1e3,Gn=e.scrollLeft>=0,e.remove()}const gt=1e3,Gs=["start","center","end","start-force","center-force","end-force"],Mo=Array.prototype.filter,Zs=window.getComputedStyle(document.body).overflowAnchor===void 0?lo:function(e,t){e!==null&&(e._qOverflowAnimationFrame!==void 0&&cancelAnimationFrame(e._qOverflowAnimationFrame),e._qOverflowAnimationFrame=requestAnimationFrame(()=>{if(e===null)return;e._qOverflowAnimationFrame=void 0;const n=e.children||[];Mo.call(n,i=>i.dataset&&i.dataset.qVsAnchor!==void 0).forEach(i=>{delete i.dataset.qVsAnchor});const a=n[t];a&&a.dataset&&(a.dataset.qVsAnchor="")}))};function qn(e,t){return e+t}function ui(e,t,n,a,i,l,o,r){const s=e===window?document.scrollingElement||document.documentElement:e,u=i===!0?"offsetWidth":"offsetHeight",d={scrollStart:0,scrollViewSize:-o-r,scrollMaxSize:0,offsetStart:-o,offsetEnd:-r};if(i===!0?(e===window?(d.scrollStart=window.pageXOffset||window.scrollX||document.body.scrollLeft||0,d.scrollViewSize+=document.documentElement.clientWidth):(d.scrollStart=s.scrollLeft,d.scrollViewSize+=s.clientWidth),d.scrollMaxSize=s.scrollWidth,l===!0&&(d.scrollStart=(Gn===!0?d.scrollMaxSize-d.scrollViewSize:0)-d.scrollStart)):(e===window?(d.scrollStart=window.pageYOffset||window.scrollY||document.body.scrollTop||0,d.scrollViewSize+=document.documentElement.clientHeight):(d.scrollStart=s.scrollTop,d.scrollViewSize+=s.clientHeight),d.scrollMaxSize=s.scrollHeight),n!==null)for(let v=n.previousElementSibling;v!==null;v=v.previousElementSibling)v.classList.contains("q-virtual-scroll--skip")===!1&&(d.offsetStart+=v[u]);if(a!==null)for(let v=a.nextElementSibling;v!==null;v=v.nextElementSibling)v.classList.contains("q-virtual-scroll--skip")===!1&&(d.offsetEnd+=v[u]);if(t!==e){const v=s.getBoundingClientRect(),y=t.getBoundingClientRect();i===!0?(d.offsetStart+=y.left-v.left,d.offsetEnd-=y.width):(d.offsetStart+=y.top-v.top,d.offsetEnd-=y.height),e!==window&&(d.offsetStart+=d.scrollStart),d.offsetEnd+=d.scrollMaxSize-d.offsetStart}return d}function Vl(e,t,n,a){t==="end"&&(t=(e===window?document.body:e)[n===!0?"scrollWidth":"scrollHeight"]),e===window?n===!0?(a===!0&&(t=(Gn===!0?document.body.scrollWidth-document.documentElement.clientWidth:0)-t),window.scrollTo(t,window.pageYOffset||window.scrollY||document.body.scrollTop||0)):window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,t):n===!0?(a===!0&&(t=(Gn===!0?e.scrollWidth-e.offsetWidth:0)-t),e.scrollLeft=t):e.scrollTop=t}function Fn(e,t,n,a){if(n>=a)return 0;const i=t.length,l=Math.floor(n/gt),o=Math.floor((a-1)/gt)+1;let r=e.slice(l,o).reduce(qn,0);return n%gt!==0&&(r-=t.slice(l*gt,n).reduce(qn,0)),a%gt!==0&&a!==i&&(r-=t.slice(a,o*gt).reduce(qn,0)),r}const Js={virtualScrollSliceSize:{type:[Number,String],default:null},virtualScrollSliceRatioBefore:{type:[Number,String],default:1},virtualScrollSliceRatioAfter:{type:[Number,String],default:1},virtualScrollItemSize:{type:[Number,String],default:24},virtualScrollStickySizeStart:{type:[Number,String],default:0},virtualScrollStickySizeEnd:{type:[Number,String],default:0},tableColspan:[Number,String]},qo={virtualScrollHorizontal:Boolean,onVirtualScroll:Function,...Js};function Po({virtualScrollLength:e,getVirtualScrollTarget:t,getVirtualScrollEl:n,virtualScrollItemSizeComputed:a}){const i=Fe(),{props:l,emit:o,proxy:r}=i,{$q:s}=r;let u,d,v,y=[],g;const C=Q(0),w=Q(0),T=Q({}),q=Q(null),P=Q(null),p=Q(null),b=Q({from:0,to:0}),M=k(()=>l.tableColspan!==void 0?l.tableColspan:100);a===void 0&&(a=k(()=>l.virtualScrollItemSize));const B=k(()=>a.value+";"+l.virtualScrollHorizontal),x=k(()=>B.value+";"+l.virtualScrollSliceRatioBefore+";"+l.virtualScrollSliceRatioAfter);de(x,()=>{ke()}),de(B,$);function $(){ve(d,!0)}function G(A){ve(A===void 0?d:A)}function Z(A,H){const U=t();if(U==null||U.nodeType===8)return;const me=ui(U,n(),q.value,P.value,l.virtualScrollHorizontal,s.lang.rtl,l.virtualScrollStickySizeStart,l.virtualScrollStickySizeEnd);v!==me.scrollViewSize&&ke(me.scrollViewSize),$e(U,me,Math.min(e.value-1,Math.max(0,parseInt(A,10)||0)),0,Gs.indexOf(H)>-1?H:d>-1&&A>d?"end":"start")}function ce(){const A=t();if(A==null||A.nodeType===8)return;const H=ui(A,n(),q.value,P.value,l.virtualScrollHorizontal,s.lang.rtl,l.virtualScrollStickySizeStart,l.virtualScrollStickySizeEnd),U=e.value-1,me=H.scrollMaxSize-H.offsetStart-H.offsetEnd-w.value;if(u===H.scrollStart)return;if(H.scrollMaxSize<=0){$e(A,H,0,0);return}v!==H.scrollViewSize&&ke(H.scrollViewSize),E(b.value.from);const be=Math.floor(H.scrollMaxSize-Math.max(H.scrollViewSize,H.offsetEnd)-Math.min(g[U],H.scrollViewSize/2));if(be>0&&Math.ceil(H.scrollStart)>=be){$e(A,H,U,H.scrollMaxSize-H.offsetEnd-y.reduce(qn,0));return}let X=0,te=H.scrollStart-H.offsetStart,Ve=te;if(te<=me&&te+H.scrollViewSize>=C.value)te-=C.value,X=b.value.from,Ve=te;else for(let O=0;te>=y[O]&&X0&&X-H.scrollViewSize?(X++,Ve=te):Ve=g[X]+te;$e(A,H,X,Ve)}function $e(A,H,U,me,be){const X=typeof be=="string"&&be.indexOf("-force")>-1,te=X===!0?be.replace("-force",""):be,Ve=te!==void 0?te:"start";let O=Math.max(0,U-T.value[Ve]),Ne=O+T.value.total;Ne>e.value&&(Ne=e.value,O=Math.max(0,Ne-T.value.total)),u=H.scrollStart;const St=O!==b.value.from||Ne!==b.value.to;if(St===!1&&te===void 0){qe(U);return}const{activeElement:xt}=document,ut=p.value;St===!0&&ut!==null&&ut!==xt&&ut.contains(xt)===!0&&(ut.addEventListener("focusout",le),setTimeout(()=>{ut!==null&&ut.removeEventListener("focusout",le)})),Zs(ut,U-O);const It=te!==void 0?g.slice(O,U).reduce(qn,0):0;if(St===!0){const kt=Ne>=b.value.from&&O<=b.value.to?b.value.to:Ne;b.value={from:O,to:kt},C.value=Fn(y,g,0,O),w.value=Fn(y,g,Ne,e.value),requestAnimationFrame(()=>{b.value.to!==Ne&&u===H.scrollStart&&(b.value={from:b.value.from,to:Ne},w.value=Fn(y,g,Ne,e.value))})}requestAnimationFrame(()=>{if(u!==H.scrollStart)return;St===!0&&E(O);const kt=g.slice(O,U).reduce(qn,0),Ht=kt+H.offsetStart+C.value,mn=Ht+g[U];let zt=Ht+me;if(te!==void 0){const gn=kt-It,He=H.scrollStart+gn;zt=X!==!0&&HeO.classList&&O.classList.contains("q-virtual-scroll--skip")===!1),me=U.length,be=l.virtualScrollHorizontal===!0?O=>O.getBoundingClientRect().width:O=>O.offsetHeight;let X=A,te,Ve;for(let O=0;O=me;X--)g[X]=U;const be=Math.floor((e.value-1)/gt);y=[];for(let X=0;X<=be;X++){let te=0;const Ve=Math.min((X+1)*gt,e.value);for(let O=X*gt;O=0?(E(b.value.from),dt(()=>{Z(A)})):Be()}function ke(A){if(A===void 0&&typeof window!="undefined"){const te=t();te!=null&&te.nodeType!==8&&(A=ui(te,n(),q.value,P.value,l.virtualScrollHorizontal,s.lang.rtl,l.virtualScrollStickySizeStart,l.virtualScrollStickySizeEnd).scrollViewSize)}v=A;const H=parseFloat(l.virtualScrollSliceRatioBefore)||0,U=parseFloat(l.virtualScrollSliceRatioAfter)||0,me=1+H+U,be=A===void 0||A<=0?1:Math.ceil(A/a.value),X=Math.max(1,be,Math.ceil((l.virtualScrollSliceSize>0?l.virtualScrollSliceSize:10)/me));T.value={total:Math.ceil(X*me),start:Math.ceil(X*H),center:Math.ceil(X*(.5+H)),end:Math.ceil(X*(1+H)),view:be}}function J(A,H){const U=l.virtualScrollHorizontal===!0?"width":"height",me={["--q-virtual-scroll-item-"+U]:a.value+"px"};return[A==="tbody"?_(A,{class:"q-virtual-scroll__padding",key:"before",ref:q},[_("tr",[_("td",{style:{[U]:`${C.value}px`,...me},colspan:M.value})])]):_(A,{class:"q-virtual-scroll__padding",key:"before",ref:q,style:{[U]:`${C.value}px`,...me}}),_(A,{class:"q-virtual-scroll__content",key:"content",ref:p,tabindex:-1},H.flat()),A==="tbody"?_(A,{class:"q-virtual-scroll__padding",key:"after",ref:P},[_("tr",[_("td",{style:{[U]:`${w.value}px`,...me},colspan:M.value})])]):_(A,{class:"q-virtual-scroll__padding",key:"after",ref:P,style:{[U]:`${w.value}px`,...me}})]}function qe(A){d!==A&&(l.onVirtualScroll!==void 0&&o("virtualScroll",{index:A,from:b.value.from,to:b.value.to-1,direction:A{ke()});let N=!1;return Na(()=>{N=!0}),La(()=>{if(N!==!0)return;const A=t();u!==void 0&&A!==void 0&&A!==null&&A.nodeType!==8?Vl(A,u,l.virtualScrollHorizontal,s.lang.rtl):Z(d)}),Ke(()=>{Be.cancel()}),Object.assign(r,{scrollTo:Z,reset:$,refresh:G}),{virtualScrollSliceRange:b,virtualScrollSliceSizeComputed:T,setVirtualScrollSize:ke,onVirtualScrollEvt:Be,localResetVirtualScroll:ve,padVirtualScroll:J,scrollTo:Z,reset:$,refresh:G}}const Xs={list:Qt,table:Qs},eu=["list","table","__qtable"];var Wi=Se({name:"QVirtualScroll",props:{...qo,type:{type:String,default:"list",validator:e=>eu.includes(e)},items:{type:Array,default:()=>[]},itemsFn:Function,itemsSize:Number,scrollTarget:{default:void 0}},setup(e,{slots:t,attrs:n}){let a;const i=Q(null),l=k(()=>e.itemsSize>=0&&e.itemsFn!==void 0?parseInt(e.itemsSize,10):Array.isArray(e.items)?e.items.length:0),{virtualScrollSliceRange:o,localResetVirtualScroll:r,padVirtualScroll:s,onVirtualScrollEvt:u}=Po({virtualScrollLength:l,getVirtualScrollTarget:C,getVirtualScrollEl:g}),d=k(()=>{if(l.value===0)return[];const P=(p,b)=>({index:o.value.from+b,item:p});return e.itemsFn===void 0?e.items.slice(o.value.from,o.value.to).map(P):e.itemsFn(o.value.from,o.value.to-o.value.from).map(P)}),v=k(()=>"q-virtual-scroll q-virtual-scroll"+(e.virtualScrollHorizontal===!0?"--horizontal":"--vertical")+(e.scrollTarget!==void 0?"":" scroll")),y=k(()=>e.scrollTarget!==void 0?{}:{tabindex:0});de(l,()=>{r()}),de(()=>e.scrollTarget,()=>{T(),w()});function g(){return i.value.$el||i.value}function C(){return a}function w(){a=Ea(g(),e.scrollTarget),a.addEventListener("scroll",u,xn.passive)}function T(){a!==void 0&&(a.removeEventListener("scroll",u,xn.passive),a=void 0)}function q(){let P=s(e.type==="list"?"div":"tbody",d.value.map(t.default));return t.before!==void 0&&(P=t.before().concat(P)),Ln(t.after,P)}return Ui(()=>{r()}),fn(()=>{w()}),La(()=>{w()}),Na(()=>{T()}),Ke(()=>{T()}),()=>{if(t.default===void 0){console.error("QVirtualScroll: default scoped slot is required for rendering");return}return e.type==="__qtable"?Ks({ref:i,class:"q-table__middle "+v.value},q()):_(Xs[e.type],{...n,ref:i,class:[n.class,v.value],...y.value},q)}}});const tu=[_("circle",{cx:"15",cy:"15",r:"15"},[_("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),_("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]),_("circle",{cx:"60",cy:"15",r:"9","fill-opacity":".3"},[_("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),_("animate",{attributeName:"fill-opacity",from:".5",to:".5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})]),_("circle",{cx:"105",cy:"15",r:"15"},[_("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),_("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})])];var Do=Se({name:"QSpinnerDots",props:ss,setup(e){const{cSize:t,classes:n}=us(e);return()=>_("svg",{class:n.value,fill:"currentColor",width:t.value,height:t.value,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg"},tu)}});const nu={ratio:[String,Number]};function au(e,t){return k(()=>{const n=Number(e.ratio||(t!==void 0?t.value:void 0));return isNaN(n)!==!0&&n>0?{paddingBottom:`${100/n}%`}:null})}const iu=16/9;var ji=Se({name:"QImg",props:{...nu,src:String,srcset:String,sizes:String,alt:String,crossorigin:String,decoding:String,referrerpolicy:String,draggable:Boolean,loading:{type:String,default:"lazy"},fetchpriority:{type:String,default:"auto"},width:String,height:String,initialRatio:{type:[Number,String],default:iu},placeholderSrc:String,fit:{type:String,default:"cover"},position:{type:String,default:"50% 50%"},imgClass:String,imgStyle:Object,noSpinner:Boolean,noNativeMenu:Boolean,noTransition:Boolean,spinnerColor:String,spinnerSize:String},emits:["load","error"],setup(e,{slots:t,emit:n}){const a=Q(e.initialRatio),i=au(e,a);let l=null,o=!1;const r=[Q(null),Q(T())],s=Q(0),u=Q(!1),d=Q(!1),v=k(()=>`q-img q-img--${e.noNativeMenu===!0?"no-":""}menu`),y=k(()=>({width:e.width,height:e.height})),g=k(()=>`q-img__image ${e.imgClass!==void 0?e.imgClass+" ":""}q-img__image--with${e.noTransition===!0?"out":""}-transition`),C=k(()=>({...e.imgStyle,objectFit:e.fit,objectPosition:e.position}));de(()=>w(),q);function w(){return e.src||e.srcset||e.sizes?{src:e.src,srcset:e.srcset,sizes:e.sizes}:null}function T(){return e.placeholderSrc!==void 0?{src:e.placeholderSrc}:null}function q($){l!==null&&(clearTimeout(l),l=null),d.value=!1,$===null?(u.value=!1,r[s.value^1].value=T()):u.value=!0,r[s.value].value=$}function P({target:$}){o!==!0&&(l!==null&&(clearTimeout(l),l=null),a.value=$.naturalHeight===0?.5:$.naturalWidth/$.naturalHeight,p($,1))}function p($,G){o===!0||G===1e3||($.complete===!0?b($):l=setTimeout(()=>{l=null,p($,G+1)},50))}function b($){o!==!0&&(s.value=s.value^1,r[s.value].value=null,u.value=!1,d.value=!1,n("load",$.currentSrc||$.src))}function M($){l!==null&&(clearTimeout(l),l=null),u.value=!1,d.value=!0,r[s.value].value=null,r[s.value^1].value=T(),n("error",$)}function B($){const G=r[$].value,Z={key:"img_"+$,class:g.value,style:C.value,crossorigin:e.crossorigin,decoding:e.decoding,referrerpolicy:e.referrerpolicy,height:e.height,width:e.width,loading:e.loading,fetchpriority:e.fetchpriority,"aria-hidden":"true",draggable:e.draggable,...G};return s.value===$?(Z.class+=" q-img__image--waiting",Object.assign(Z,{onLoad:P,onError:M})):Z.class+=" q-img__image--loaded",_("div",{class:"q-img__container absolute-full",key:"img"+$},_("img",Z))}function x(){return u.value!==!0?_("div",{key:"content",class:"q-img__content absolute-full q-anchor--skip"},Ee(t[d.value===!0?"error":"default"])):_("div",{key:"loading",class:"q-img__loading absolute-full flex flex-center"},t.loading!==void 0?t.loading():e.noSpinner===!0?void 0:[_(ro,{color:e.spinnerColor,size:e.spinnerSize})])}return q(w()),Ke(()=>{o=!0,l!==null&&(clearTimeout(l),l=null)}),()=>{const $=[];return i.value!==null&&$.push(_("div",{key:"filler",style:i.value})),d.value!==!0&&(r[0].value!==null&&$.push(B(0)),r[1].value!==null&&$.push(B(1))),$.push(_(na,{name:"q-transition--fade"},x)),_("div",{class:v.value,style:y.value,role:"img","aria-label":e.alt},$)}}}),lu=Se({name:"QBanner",props:{...Vt,inlineActions:Boolean,dense:Boolean,rounded:Boolean},setup(e,{slots:t}){const{proxy:{$q:n}}=Fe(),a=Ft(e,n),i=k(()=>"q-banner row items-center"+(e.dense===!0?" q-banner--dense":"")+(a.value===!0?" q-banner--dark q-dark":"")+(e.rounded===!0?" rounded-borders":"")),l=k(()=>`q-banner__actions row items-center justify-end col-${e.inlineActions===!0?"auto":"all"}`);return()=>{const o=[_("div",{class:"q-banner__avatar col-auto row items-center self-start"},Ee(t.avatar)),_("div",{class:"q-banner__content col text-body2"},Ee(t.default))],r=Ee(t.action);return r!==void 0&&o.push(_("div",{class:l.value},r)),_("div",{class:i.value+(e.inlineActions===!1&&r!==void 0?" q-banner--top-padding":""),role:"alert"},o)}}}),Wt=Se({name:"QBreadcrumbsEl",props:{...Ra,label:String,icon:String,tag:{type:String,default:"span"}},emits:["click"],setup(e,{slots:t}){const{linkTag:n,linkAttrs:a,linkClass:i,navigateOnClick:l}=so(),o=k(()=>({class:"q-breadcrumbs__el q-link flex inline items-center relative-position "+(e.disable!==!0?"q-link--focusable"+i.value:"q-breadcrumbs__el--disable"),...a.value,onClick:l})),r=k(()=>"q-breadcrumbs__el-icon"+(e.label!==void 0?" q-breadcrumbs__el-icon--with-label":""));return()=>{const s=[];return e.icon!==void 0&&s.push(_(je,{class:r.value,name:e.icon})),e.label!==void 0&&s.push(e.label),_(n.value,{...o.value},Ln(t.default,s))}}});const ou=["",!0];var ru=Se({name:"QBreadcrumbs",props:{...cs,separator:{type:String,default:"/"},separatorColor:String,activeColor:{type:String,default:"primary"},gutter:{type:String,validator:e=>["none","xs","sm","md","lg","xl"].includes(e),default:"sm"}},setup(e,{slots:t}){const n=ds(e),a=k(()=>`flex items-center ${n.value}${e.gutter==="none"?"":` q-gutter-${e.gutter}`}`),i=k(()=>e.separatorColor?` text-${e.separatorColor}`:""),l=k(()=>` text-${e.activeColor}`);return()=>{const o=uo(Ee(t.default));if(o.length===0)return;let r=1;const s=[],u=o.filter(v=>v.type!==void 0&&v.type.name==="QBreadcrumbsEl").length,d=t.separator!==void 0?t.separator:()=>e.separator;return o.forEach(v=>{if(v.type!==void 0&&v.type.name==="QBreadcrumbsEl"){const y=rparseInt(e.lines,10)),a=k(()=>"q-item__label"+(e.overline===!0?" q-item__label--overline text-overline":"")+(e.caption===!0?" q-item__label--caption text-caption":"")+(e.header===!0?" q-item__label--header":"")+(n.value===1?" ellipsis":"")),i=k(()=>e.lines!==void 0&&n.value>1?{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":n.value}:null);return()=>_("div",{style:i.value,class:a.value},Ee(t.default))}}),ae=Se({name:"QItemSection",props:{avatar:Boolean,thumbnail:Boolean,side:Boolean,top:Boolean,noWrap:Boolean},setup(e,{slots:t}){const n=k(()=>`q-item__section column q-item__section--${e.avatar===!0||e.side===!0||e.thumbnail===!0?"side":"main"}`+(e.top===!0?" q-item__section--top justify-start":" justify-center")+(e.avatar===!0?" q-item__section--avatar":"")+(e.thumbnail===!0?" q-item__section--thumbnail":"")+(e.noWrap===!0?" q-item__section--nowrap":""));return()=>_("div",{class:n.value},Ee(t.default))}}),nt=Se({name:"QItem",props:{...Vt,...Ra,tag:{type:String,default:"div"},active:{type:Boolean,default:null},clickable:Boolean,dense:Boolean,insetLevel:Number,tabindex:[String,Number],focused:Boolean,manualFocus:Boolean},emits:["click","keyup"],setup(e,{slots:t,emit:n}){const{proxy:{$q:a}}=Fe(),i=Ft(e,a),{hasLink:l,linkAttrs:o,linkClass:r,linkTag:s,navigateOnClick:u}=so(),d=Q(null),v=Q(null),y=k(()=>e.clickable===!0||l.value===!0||e.tag==="label"),g=k(()=>e.disable!==!0&&y.value===!0),C=k(()=>"q-item q-item-type row no-wrap"+(e.dense===!0?" q-item--dense":"")+(i.value===!0?" q-item--dark":"")+(l.value===!0&&e.active===null?r.value:e.active===!0?` q-item--active${e.activeClass!==void 0?` ${e.activeClass}`:""}`:"")+(e.disable===!0?" disabled":"")+(g.value===!0?" q-item--clickable q-link cursor-pointer "+(e.manualFocus===!0?"q-manual-focusable":"q-focusable q-hoverable")+(e.focused===!0?" q-manual-focusable--focused":""):"")),w=k(()=>{if(e.insetLevel===void 0)return null;const p=a.lang.rtl===!0?"Right":"Left";return{["padding"+p]:16+e.insetLevel*56+"px"}});function T(p){g.value===!0&&(v.value!==null&&(p.qKeyEvent!==!0&&document.activeElement===d.value?v.value.focus():document.activeElement===v.value&&d.value.focus()),u(p))}function q(p){if(g.value===!0&&ta(p,13)===!0){We(p),p.qKeyEvent=!0;const b=new MouseEvent("click",p);b.qKeyEvent=!0,d.value.dispatchEvent(b)}n("keyup",p)}function P(){const p=co(t.default,[]);return g.value===!0&&p.unshift(_("div",{class:"q-focus-helper",tabindex:-1,ref:v})),p}return()=>{const p={ref:d,class:C.value,style:w.value,role:"listitem",onClick:T,onKeyup:q};return g.value===!0?(p.tabindex=e.tabindex||"0",Object.assign(p,o.value)):y.value===!0&&(p["aria-disabled"]="true"),_(s.value,p,P())}}}),su=Se({name:"QPage",props:{padding:Boolean,styleFn:Function},setup(e,{slots:t}){const{proxy:{$q:n}}=Fe(),a=ba(fs,Et);if(a===Et)return console.error("QPage needs to be a deep child of QLayout"),Et;if(ba(hs,Et)===Et)return console.error("QPage needs to be child of QPageContainer"),Et;const l=k(()=>{const r=(a.header.space===!0?a.header.size:0)+(a.footer.space===!0?a.footer.size:0);if(typeof e.styleFn=="function"){const s=a.isContainer.value===!0?a.containerHeight.value:n.screen.height;return e.styleFn(r,s)}return{minHeight:a.isContainer.value===!0?a.containerHeight.value-r+"px":n.screen.height===0?r!==0?`calc(100vh - ${r}px)`:"100vh":n.screen.height-r+"px"}}),o=k(()=>`q-page${e.padding===!0?" q-layout-padding":""}`);return()=>_("main",{class:o.value,style:l.value},Ee(t.default))}});const uu=_("div",{class:"q-space"});var cu=Se({name:"QSpace",setup(){return()=>uu}});function Fl(e){if(e===!1)return 0;if(e===!0||e===void 0)return 1;const t=parseInt(e,10);return isNaN(t)?0:t}var Mi=fo({name:"close-popup",beforeMount(e,{value:t}){const n={depth:Fl(t),handler(a){n.depth!==0&&setTimeout(()=>{const i=ms(e);i!==void 0&&gs(i,a,n.depth)})},handlerKey(a){ta(a,13)===!0&&n.handler(a)}};e.__qclosepopup=n,e.addEventListener("click",n.handler),e.addEventListener("keyup",n.handlerKey)},updated(e,{value:t,oldValue:n}){t!==n&&(e.__qclosepopup.depth=Fl(t))},beforeUnmount(e){const t=e.__qclosepopup;e.removeEventListener("click",t.handler),e.removeEventListener("keyup",t.handlerKey),delete e.__qclosepopup}});function du(){return ba(vs)}var fu=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},$o={},rt={};let Qi;const hu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];rt.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};rt.getSymbolTotalCodewords=function(t){return hu[t]};rt.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};rt.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Qi=t};rt.isKanjiModeEnabled=function(){return typeof Qi!="undefined"};rt.toSJIS=function(t){return Qi(t)};var Ba={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(a){return a&&typeof a.bit!="undefined"&&a.bit>=0&&a.bit<4},e.from=function(a,i){if(e.isValid(a))return a;try{return t(a)}catch{return i}}})(Ba);function xo(){this.buffer=[],this.length=0}xo.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mu=xo;function ia(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}ia.prototype.set=function(e,t,n,a){const i=e*this.size+t;this.data[i]=n,a&&(this.reservedBit[i]=!0)};ia.prototype.get=function(e,t){return this.data[e*this.size+t]};ia.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};ia.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var gu=ia,Io={};(function(e){const t=rt.getSymbolSize;e.getRowColCoords=function(a){if(a===1)return[];const i=Math.floor(a/7)+2,l=t(a),o=l===145?26:Math.ceil((l-13)/(2*i-2))*2,r=[l-7];for(let s=1;s=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const l=i.size;let o=0,r=0,s=0,u=null,d=null;for(let v=0;v=5&&(o+=t.N1+(r-5)),u=g,r=1),g=i.get(y,v),g===d?s++:(s>=5&&(o+=t.N1+(s-5)),d=g,s=1)}r>=5&&(o+=t.N1+(r-5)),s>=5&&(o+=t.N1+(s-5))}return o},e.getPenaltyN2=function(i){const l=i.size;let o=0;for(let r=0;r=10&&(r===1488||r===93)&&o++,s=s<<1&2047|i.get(d,u),d>=10&&(s===1488||s===93)&&o++}return o*t.N3},e.getPenaltyN4=function(i){let l=0;const o=i.data.length;for(let s=0;s=0;){const o=l[0];for(let s=0;s0){const l=new Uint8Array(this.degree);return l.set(a,i),l}return a};var yu=Ki,Lo={},Xt={},Gi={};Gi.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Pt={};const Ro="[0-9]+",pu="[A-Z $%*+\\-./:]+";let Zn="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Zn=Zn.replace(/u/g,"\\u");const bu="(?:(?![A-Z0-9 $%*+\\-./:]|"+Zn+`)(?:.|[\r +]))+`;Pt.KANJI=new RegExp(Zn,"g");Pt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Pt.BYTE=new RegExp(bu,"g");Pt.NUMERIC=new RegExp(Ro,"g");Pt.ALPHANUMERIC=new RegExp(pu,"g");const _u=new RegExp("^"+Zn+"$"),wu=new RegExp("^"+Ro+"$"),Su=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Pt.testKanji=function(t){return _u.test(t)};Pt.testNumeric=function(t){return wu.test(t)};Pt.testAlphanumeric=function(t){return Su.test(t)};(function(e){const t=Gi,n=Pt;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(l,o){if(!l.ccBits)throw new Error("Invalid mode: "+l);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?l.ccBits[0]:o<27?l.ccBits[1]:l.ccBits[2]},e.getBestModeForData=function(l){return n.testNumeric(l)?e.NUMERIC:n.testAlphanumeric(l)?e.ALPHANUMERIC:n.testKanji(l)?e.KANJI:e.BYTE},e.toString=function(l){if(l&&l.id)return l.id;throw new Error("Invalid mode")},e.isValid=function(l){return l&&l.bit&&l.ccBits};function a(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(l,o){if(e.isValid(l))return l;try{return a(l)}catch{return o}}})(Xt);(function(e){const t=rt,n=Va,a=Ba,i=Xt,l=Gi,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,r=t.getBCHDigit(o);function s(y,g,C){for(let w=1;w<=40;w++)if(g<=e.getCapacity(w,C,y))return w}function u(y,g){return i.getCharCountIndicator(y,g)+4}function d(y,g){let C=0;return y.forEach(function(w){C+=u(w.mode,g)+w.getBitsLength()}),C}function v(y,g){for(let C=1;C<=40;C++)if(d(y,C)<=e.getCapacity(C,g,i.MIXED))return C}e.from=function(g,C){return l.isValid(g)?parseInt(g,10):C},e.getCapacity=function(g,C,w){if(!l.isValid(g))throw new Error("Invalid QR Code version");typeof w=="undefined"&&(w=i.BYTE);const T=t.getSymbolTotalCodewords(g),q=n.getTotalCodewordsCount(g,C),P=(T-q)*8;if(w===i.MIXED)return P;const p=P-u(w,g);switch(w){case i.NUMERIC:return Math.floor(p/10*3);case i.ALPHANUMERIC:return Math.floor(p/11*2);case i.KANJI:return Math.floor(p/13);case i.BYTE:default:return Math.floor(p/8)}},e.getBestVersionForData=function(g,C){let w;const T=a.from(C,a.M);if(Array.isArray(g)){if(g.length>1)return v(g,T);if(g.length===0)return 1;w=g[0]}else w=g;return s(w.mode,w.getLength(),T)},e.getEncodedBits=function(g){if(!l.isValid(g)||g<7)throw new Error("Invalid QR Code version");let C=g<<12;for(;t.getBCHDigit(C)-r>=0;)C^=o<=0;)i^=Vo<0&&(a=this.data.substr(n),i=parseInt(a,10),t.put(i,l*3+1))};var Tu=An;const Mu=Xt,ci=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function On(e){this.mode=Mu.ALPHANUMERIC,this.data=e}On.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};On.prototype.getLength=function(){return this.data.length};On.prototype.getBitsLength=function(){return On.getBitsLength(this.data.length)};On.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let a=ci.indexOf(this.data[n])*45;a+=ci.indexOf(this.data[n+1]),t.put(a,11)}this.data.length%2&&t.put(ci.indexOf(this.data[n]),6)};var qu=On,Pu=function(t){for(var n=[],a=t.length,i=0;i=55296&&l<=56319&&a>i+1){var o=t.charCodeAt(i+1);o>=56320&&o<=57343&&(l=(l-55296)*1024+o-56320+65536,i+=1)}if(l<128){n.push(l);continue}if(l<2048){n.push(l>>6|192),n.push(l&63|128);continue}if(l<55296||l>=57344&&l<65536){n.push(l>>12|224),n.push(l>>6&63|128),n.push(l&63|128);continue}if(l>=65536&&l<=1114111){n.push(l>>18|240),n.push(l>>12&63|128),n.push(l>>6&63|128),n.push(l&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const Du=Pu,$u=Xt;function En(e){this.mode=$u.BYTE,typeof e=="string"&&(e=Du(e)),this.data=new Uint8Array(e)}En.getBitsLength=function(t){return t*8};En.prototype.getLength=function(){return this.data.length};En.prototype.getBitsLength=function(){return En.getBitsLength(this.data.length)};En.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var Ou=Nn,Yo={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,a,i){var l={},o={};o[a]=0;var r=t.PriorityQueue.make();r.push(a,0);for(var s,u,d,v,y,g,C,w,T;!r.empty();){s=r.pop(),u=s.value,v=s.cost,y=n[u]||{};for(d in y)y.hasOwnProperty(d)&&(g=y[d],C=v+g,w=o[d],T=typeof o[d]=="undefined",(T||w>C)&&(o[d]=C,r.push(d,C),l[d]=u))}if(typeof i!="undefined"&&typeof o[i]=="undefined"){var q=["Could not find a path from ",a," to ",i,"."].join("");throw new Error(q)}return l},extract_shortest_path_from_predecessor_list:function(n,a){for(var i=[],l=a;l;)i.push(l),n[l],l=n[l];return i.reverse(),i},find_path:function(n,a,i){var l=t.single_source_shortest_paths(n,a,i);return t.extract_shortest_path_from_predecessor_list(l,i)},PriorityQueue:{make:function(n){var a=t.PriorityQueue,i={},l;n=n||{};for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);return i.queue=[],i.sorter=n.sorter||a.default_sorter,i},default_sorter:function(n,a){return n.cost-a.cost},push:function(n,a){var i={value:n,cost:a};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Yo);(function(e){const t=Xt,n=Tu,a=qu,i=xu,l=Ou,o=Pt,r=rt,s=Yo.exports;function u(q){return unescape(encodeURIComponent(q)).length}function d(q,P,p){const b=[];let M;for(;(M=q.exec(p))!==null;)b.push({data:M[0],index:M.index,mode:P,length:M[0].length});return b}function v(q){const P=d(o.NUMERIC,t.NUMERIC,q),p=d(o.ALPHANUMERIC,t.ALPHANUMERIC,q);let b,M;return r.isKanjiModeEnabled()?(b=d(o.BYTE,t.BYTE,q),M=d(o.KANJI,t.KANJI,q)):(b=d(o.BYTE_KANJI,t.BYTE,q),M=[]),P.concat(p,b,M).sort(function(x,$){return x.index-$.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function y(q,P){switch(P){case t.NUMERIC:return n.getBitsLength(q);case t.ALPHANUMERIC:return a.getBitsLength(q);case t.KANJI:return l.getBitsLength(q);case t.BYTE:return i.getBitsLength(q)}}function g(q){return q.reduce(function(P,p){const b=P.length-1>=0?P[P.length-1]:null;return b&&b.mode===p.mode?(P[P.length-1].data+=p.data,P):(P.push(p),P)},[])}function C(q){const P=[];for(let p=0;p=0&&r<=6&&(s===0||s===6)||s>=0&&s<=6&&(r===0||r===6)||r>=2&&r<=4&&s>=2&&s<=4?e.set(l+r,o+s,!0,!0):e.set(l+r,o+s,!1,!0))}}function Uu(e){const t=e.size;for(let n=8;n>r&1)===1,e.set(i,l,o,!0),e.set(l,i,o,!0)}function hi(e,t,n){const a=e.size,i=Vu.getEncodedBits(t,n);let l,o;for(l=0;l<15;l++)o=(i>>l&1)===1,l<6?e.set(l,8,o,!0):l<8?e.set(l+1,8,o,!0):e.set(a-15+l,8,o,!0),l<8?e.set(8,a-l-1,o,!0):l<9?e.set(8,15-l-1+1,o,!0):e.set(8,15-l-1,o,!0);e.set(a-8,8,1,!0)}function Wu(e,t){const n=e.size;let a=-1,i=n-1,l=7,o=0;for(let r=n-1;r>0;r-=2)for(r===6&&r--;;){for(let s=0;s<2;s++)if(!e.isReserved(i,r-s)){let u=!1;o>>l&1)===1),e.set(i,r-s,u),l--,l===-1&&(o++,l=7)}if(i+=a,i<0||n<=i){i-=a,a=-a;break}}}function ju(e,t,n){const a=new Eu;n.forEach(function(s){a.put(s.mode.bit,4),a.put(s.getLength(),Fu.getCharCountIndicator(s.mode,e)),s.write(a)});const i=Ya.getSymbolTotalCodewords(e),l=Di.getTotalCodewordsCount(e,t),o=(i-l)*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!==0;)a.putBit(0);const r=(o-a.getLengthInBits())/8;for(let s=0;s=7&&zu(s,t),Wu(s,o),isNaN(a)&&(a=Pi.getBestMask(s,hi.bind(null,s,n))),Pi.applyMask(a,s),hi(s,n,a),{modules:s,version:t,errorCorrectionLevel:n,maskPattern:a,segments:i}}$o.create=function(t,n){if(typeof t=="undefined"||t==="")throw new Error("No input text");let a=di.M,i,l;return typeof n!="undefined"&&(a=di.from(n.errorCorrectionLevel,di.M),i=Pa.from(n.version),l=Pi.from(n.maskPattern),n.toSJISFunc&&Ya.setToSJISFunction(n.toSJISFunc)),Ku(t,i,a,l)};var Uo={},Zi={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let a=n.slice().replace("#","").split("");if(a.length<3||a.length===5||a.length>8)throw new Error("Invalid hex color: "+n);(a.length===3||a.length===4)&&(a=Array.prototype.concat.apply([],a.map(function(l){return[l,l]}))),a.length===6&&a.push("F","F");const i=parseInt(a.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+a.slice(0,6).join("")}}e.getOptions=function(a){a||(a={}),a.color||(a.color={});const i=typeof a.margin=="undefined"||a.margin===null||a.margin<0?4:a.margin,l=a.width&&a.width>=21?a.width:void 0,o=a.scale||4;return{width:l,scale:l?4:o,margin:i,color:{dark:t(a.color.dark||"#000000ff"),light:t(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},e.getScale=function(a,i){return i.width&&i.width>=a+i.margin*2?i.width/(a+i.margin*2):i.scale},e.getImageWidth=function(a,i){const l=e.getScale(a,i);return Math.floor((a+i.margin*2)*l)},e.qrToImageData=function(a,i,l){const o=i.modules.size,r=i.modules.data,s=e.getScale(o,l),u=Math.floor((o+l.margin*2)*s),d=l.margin*s,v=[l.color.light,l.color.dark];for(let y=0;y=d&&g>=d&&y0&&s>0&&e[r-1]||(a+=l?mi("M",s+n,.5+u+n):mi("m",i,0),i=0,l=!1),s+1':"",u="',d='viewBox="0 0 '+r+" "+r+'"',v=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",y=''+s+u+` +`;return typeof a=="function"&&a(null,y),y};const Ju=fu,$i=$o,zo=Uo,Xu=Ho;function Ji(e,t,n,a,i){const l=[].slice.call(arguments,1),o=l.length,r=typeof l[o-1]=="function";if(!r&&!Ju())throw new Error("Callback required as last argument");if(r){if(o<2)throw new Error("Too few arguments provided");o===2?(i=n,n=t,t=a=void 0):o===3&&(t.getContext&&typeof i=="undefined"?(i=a,a=void 0):(i=a,a=n,n=t,t=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=t,t=a=void 0):o===2&&!t.getContext&&(a=n,n=t,t=void 0),new Promise(function(s,u){try{const d=$i.create(n,a);s(e(d,t,a))}catch(d){u(d)}})}try{const s=$i.create(n,a);i(null,e(s,t,a))}catch(s){i(s)}}$i.create;var ec=Ji.bind(null,zo.render),tc=Ji.bind(null,zo.renderToDataURL),nc=Ji.bind(null,function(e,t,n){return Xu.render(e,n)});/*! vue-qrcode v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */const zl="ready";var ac=ot({name:"VueQrcode",props:{value:{type:String,default:void 0},options:{type:Object,default:void 0},tag:{type:String,default:"canvas"}},emits:[zl],watch:{$props:{deep:!0,immediate:!0,handler(){this.$el&&this.generate()}}},mounted(){this.generate()},methods:{generate(){const e=this.options||{},t=String(this.value),n=()=>{this.$emit(zl,this.$el)};switch(this.tag){case"canvas":ec(this.$el,t,e,a=>{if(a)throw a;n()});break;case"img":tc(t,e,(a,i)=>{if(a)throw a;this.$el.src=i,this.$el.onload=n});break;case"svg":nc(t,e,(a,i)=>{if(a)throw a;const l=document.createElement("div");l.innerHTML=i;const o=l.querySelector("svg");if(o){const{attributes:r,childNodes:s}=o;Object.keys(r).forEach(u=>{const d=r[Number(u)];this.$el.setAttribute(d.name,d.value)}),Object.keys(s).forEach(u=>{const d=s[Number(u)];this.$el.appendChild(d.cloneNode(!0))}),n()}});break}}},render(){return _(this.tag,this.$slots.default)}});let ic=0;const lc=["click","keydown"],oc={icon:String,label:[Number,String],alert:[Boolean,String],alertIcon:String,name:{type:[Number,String],default:()=>`t_${ic++}`},noCaps:Boolean,tabindex:[String,Number],disable:Boolean,contentClass:String,ripple:{type:[Boolean,Object],default:!0}};function rc(e,t,n,a){const i=ba(ho,Et);if(i===Et)return console.error("QTab/QRouteTab component needs to be child of QTabs"),Et;const{proxy:l}=Fe(),o=Q(null),r=Q(null),s=Q(null),u=k(()=>e.disable===!0||e.ripple===!1?!1:Object.assign({keyCodes:[13,32],early:!0},e.ripple===!0?{}:e.ripple)),d=k(()=>i.currentModel.value===e.name),v=k(()=>"q-tab relative-position self-stretch flex flex-center text-center"+(d.value===!0?" q-tab--active"+(i.tabProps.value.activeClass?" "+i.tabProps.value.activeClass:"")+(i.tabProps.value.activeColor?` text-${i.tabProps.value.activeColor}`:"")+(i.tabProps.value.activeBgColor?` bg-${i.tabProps.value.activeBgColor}`:""):" q-tab--inactive")+(e.icon&&e.label&&i.tabProps.value.inlineLabel===!1?" q-tab--full":"")+(e.noCaps===!0||i.tabProps.value.noCaps===!0?" q-tab--no-caps":"")+(e.disable===!0?" disabled":" q-focusable q-hoverable cursor-pointer")+(a!==void 0?a.linkClass.value:"")),y=k(()=>"q-tab__content self-stretch flex-center relative-position q-anchor--skip non-selectable "+(i.tabProps.value.inlineLabel===!0?"row no-wrap q-tab__content--inline":"column")+(e.contentClass!==void 0?` ${e.contentClass}`:"")),g=k(()=>e.disable===!0||i.hasFocus.value===!0||d.value===!1&&i.hasActiveTab.value===!0?-1:e.tabindex||0);function C(p,b){if(b!==!0&&o.value!==null&&o.value.focus(),e.disable===!0){a!==void 0&&a.hasRouterLink.value===!0&&We(p);return}if(a===void 0){i.updateModel({name:e.name}),n("click",p);return}if(a.hasRouterLink.value===!0){const M=(B={})=>{let x;const $=B.to===void 0||kn(B.to,e.to)===!0?i.avoidRouteWatcher=_a():null;return a.navigateToRouterLink(p,{...B,returnRouterError:!0}).catch(G=>{x=G}).then(G=>{if($===i.avoidRouteWatcher&&(i.avoidRouteWatcher=!1,x===void 0&&(G===void 0||G.message.startsWith("Avoided redundant navigation")===!0)&&i.updateModel({name:e.name})),B.returnRouterError===!0)return x!==void 0?Promise.reject(x):G})};n("click",p,M),p.defaultPrevented!==!0&&M();return}n("click",p)}function w(p){ta(p,[13,32])?C(p,!0):mo(p)!==!0&&p.keyCode>=35&&p.keyCode<=40&&p.altKey!==!0&&p.metaKey!==!0&&i.onKbdNavigate(p.keyCode,l.$el)===!0&&We(p),n("keydown",p)}function T(){const p=i.tabProps.value.narrowIndicator,b=[],M=_("div",{ref:s,class:["q-tab__indicator",i.tabProps.value.indicatorClass]});e.icon!==void 0&&b.push(_(je,{class:"q-tab__icon",name:e.icon})),e.label!==void 0&&b.push(_("div",{class:"q-tab__label"},e.label)),e.alert!==!1&&b.push(e.alertIcon!==void 0?_(je,{class:"q-tab__alert-icon",color:e.alert!==!0?e.alert:void 0,name:e.alertIcon}):_("div",{class:"q-tab__alert"+(e.alert!==!0?` text-${e.alert}`:"")})),p===!0&&b.push(M);const B=[_("div",{class:"q-focus-helper",tabindex:-1,ref:o}),_("div",{class:y.value},Ln(t.default,b))];return p===!1&&B.push(M),B}const q={name:k(()=>e.name),rootRef:r,tabIndicatorRef:s,routeData:a};Ke(()=>{i.unregisterTab(q)}),fn(()=>{i.registerTab(q)});function P(p,b){const M={ref:r,class:v.value,tabindex:g.value,role:"tab","aria-selected":d.value===!0?"true":"false","aria-disabled":e.disable===!0?"true":void 0,onClick:C,onKeydown:w,...b};return dn(_(p,M,T()),[[io,u.value]])}return{renderTab:P,$tabs:i}}var gi=Se({name:"QTab",props:oc,emits:lc,setup(e,{slots:t,emit:n}){const{renderTab:a}=rc(e,t,n);return()=>a("div")}});function sc(e,t,n){const a=n===!0?["left","right"]:["top","bottom"];return`absolute-${t===!0?a[0]:a[1]}${e?` text-${e}`:""}`}const uc=["left","center","right","justify"];var cc=Se({name:"QTabs",props:{modelValue:[Number,String],align:{type:String,default:"center",validator:e=>uc.includes(e)},breakpoint:{type:[String,Number],default:600},vertical:Boolean,shrink:Boolean,stretch:Boolean,activeClass:String,activeColor:String,activeBgColor:String,indicatorColor:String,leftIcon:String,rightIcon:String,outsideArrows:Boolean,mobileArrows:Boolean,switchIndicator:Boolean,narrowIndicator:Boolean,inlineLabel:Boolean,noCaps:Boolean,dense:Boolean,contentClass:String,"onUpdate:modelValue":[Function,Array]},setup(e,{slots:t,emit:n}){const{proxy:a}=Fe(),{$q:i}=a,{registerTick:l}=Wn(),{registerTick:o}=Wn(),{registerTick:r}=Wn(),{registerTimeout:s,removeTimeout:u}=pa(),{registerTimeout:d,removeTimeout:v}=pa(),y=Q(null),g=Q(null),C=Q(e.modelValue),w=Q(!1),T=Q(!0),q=Q(!1),P=Q(!1),p=[],b=Q(0),M=Q(!1);let B=null,x=null,$;const G=k(()=>({activeClass:e.activeClass,activeColor:e.activeColor,activeBgColor:e.activeBgColor,indicatorClass:sc(e.indicatorColor,e.switchIndicator,e.vertical),narrowIndicator:e.narrowIndicator,inlineLabel:e.inlineLabel,noCaps:e.noCaps})),Z=k(()=>{const I=b.value,z=C.value;for(let ie=0;ie`q-tabs__content--align-${w.value===!0?"left":P.value===!0?"justify":e.align}`),$e=k(()=>`q-tabs row no-wrap items-center q-tabs--${w.value===!0?"":"not-"}scrollable q-tabs--${e.vertical===!0?"vertical":"horizontal"} q-tabs__arrows--${e.outsideArrows===!0?"outside":"inside"} q-tabs--mobile-with${e.mobileArrows===!0?"":"out"}-arrows`+(e.dense===!0?" q-tabs--dense":"")+(e.shrink===!0?" col-shrink":"")+(e.stretch===!0?" self-stretch":"")),E=k(()=>"q-tabs__content scroll--mobile row no-wrap items-center self-stretch hide-scrollbar relative-position "+ce.value+(e.contentClass!==void 0?` ${e.contentClass}`:"")),le=k(()=>e.vertical===!0?{container:"height",content:"offsetHeight",scroll:"scrollHeight"}:{container:"width",content:"offsetWidth",scroll:"scrollWidth"}),ve=k(()=>e.vertical!==!0&&i.lang.rtl===!0),ke=k(()=>Gn===!1&&ve.value===!0);de(ve,H),de(()=>e.modelValue,I=>{J({name:I,setCurrent:!0,skipEmit:!0})}),de(()=>e.outsideArrows,qe);function J({name:I,setCurrent:z,skipEmit:ie}){C.value!==I&&(ie!==!0&&e["onUpdate:modelValue"]!==void 0&&n("update:modelValue",I),(z===!0||e["onUpdate:modelValue"]===void 0)&&(N(C.value,I),C.value=I))}function qe(){l(()=>{Be({width:y.value.offsetWidth,height:y.value.offsetHeight})})}function Be(I){if(le.value===void 0||g.value===null)return;const z=I[le.value.container],ie=Math.min(g.value[le.value.scroll],Array.prototype.reduce.call(g.value.children,(xe,_e)=>xe+(_e[le.value.content]||0),0)),Oe=z>0&&ie>z;w.value=Oe,Oe===!0&&o(H),P.value=zxe.name.value===I):null,Oe=z!=null&&z!==""?p.find(xe=>xe.name.value===z):null;if(ie&&Oe){const xe=ie.tabIndicatorRef.value,_e=Oe.tabIndicatorRef.value;B!==null&&(clearTimeout(B),B=null),xe.style.transition="none",xe.style.transform="none",_e.style.transition="none",_e.style.transform="none";const ge=xe.getBoundingClientRect(),Ue=_e.getBoundingClientRect();_e.style.transform=e.vertical===!0?`translate3d(0,${ge.top-Ue.top}px,0) scale3d(1,${Ue.height?ge.height/Ue.height:1},1)`:`translate3d(${ge.left-Ue.left}px,0,0) scale3d(${Ue.width?ge.width/Ue.width:1},1,1)`,r(()=>{B=setTimeout(()=>{B=null,_e.style.transition="transform .25s cubic-bezier(.4, 0, .2, 1)",_e.style.transform="none"},70)})}Oe&&w.value===!0&&A(Oe.rootRef.value)}function A(I){const{left:z,width:ie,top:Oe,height:xe}=g.value.getBoundingClientRect(),_e=I.getBoundingClientRect();let ge=e.vertical===!0?_e.top-Oe:_e.left-z;if(ge<0){g.value[e.vertical===!0?"scrollTop":"scrollLeft"]+=Math.floor(ge),H();return}ge+=e.vertical===!0?_e.height-xe:_e.width-ie,ge>0&&(g.value[e.vertical===!0?"scrollTop":"scrollLeft"]+=Math.ceil(ge),H())}function H(){const I=g.value;if(I===null)return;const z=I.getBoundingClientRect(),ie=e.vertical===!0?I.scrollTop:Math.abs(I.scrollLeft);ve.value===!0?(T.value=Math.ceil(ie+z.width)0):(T.value=ie>0,q.value=e.vertical===!0?Math.ceil(ie+z.height){O(I)===!0&&X()},5)}function me(){U(ke.value===!0?Number.MAX_SAFE_INTEGER:0)}function be(){U(ke.value===!0?0:Number.MAX_SAFE_INTEGER)}function X(){x!==null&&(clearInterval(x),x=null)}function te(I,z){const ie=Array.prototype.filter.call(g.value.children,Ue=>Ue===z||Ue.matches&&Ue.matches(".q-tab.q-focusable")===!0),Oe=ie.length;if(Oe===0)return;if(I===36)return A(ie[0]),ie[0].focus(),!0;if(I===35)return A(ie[Oe-1]),ie[Oe-1].focus(),!0;const xe=I===(e.vertical===!0?38:37),_e=I===(e.vertical===!0?40:39),ge=xe===!0?-1:_e===!0?1:void 0;if(ge!==void 0){const Ue=ve.value===!0?-1:1,ze=ie.indexOf(z)+ge*Ue;return ze>=0&&zeke.value===!0?{get:I=>Math.abs(I.scrollLeft),set:(I,z)=>{I.scrollLeft=-z}}:e.vertical===!0?{get:I=>I.scrollTop,set:(I,z)=>{I.scrollTop=z}}:{get:I=>I.scrollLeft,set:(I,z)=>{I.scrollLeft=z}});function O(I){const z=g.value,{get:ie,set:Oe}=Ve.value;let xe=!1,_e=ie(z);const ge=I<_e?-1:1;return _e+=ge*5,_e<0?(xe=!0,_e=0):(ge===-1&&_e<=I||ge===1&&_e>=I)&&(xe=!0,_e=I),Oe(z,_e),H(),xe}function Ne(I,z){for(const ie in I)if(I[ie]!==z[ie])return!1;return!0}function St(){let I=null,z={matchedLen:0,queryDiff:9999,hrefLen:0};const ie=p.filter(ge=>ge.routeData!==void 0&&ge.routeData.hasRouterLink.value===!0),{hash:Oe,query:xe}=a.$route,_e=Object.keys(xe).length;for(const ge of ie){const Ue=ge.routeData.exact.value===!0;if(ge.routeData[Ue===!0?"linkIsExactActive":"linkIsActive"].value!==!0)continue;const{hash:ze,query:Ct,matched:vn,href:ti}=ge.routeData.resolvedLink.value,en=Object.keys(Ct).length;if(Ue===!0){if(ze!==Oe||en!==_e||Ne(xe,Ct)===!1)continue;I=ge.name.value;break}if(ze!==""&&ze!==Oe||en!==0&&Ne(Ct,xe)===!1)continue;const ct={matchedLen:vn.length,queryDiff:_e-en,hrefLen:ti.length-ze.length};if(ct.matchedLen>z.matchedLen){I=ge.name.value,z=ct;continue}else if(ct.matchedLen!==z.matchedLen)continue;if(ct.queryDiffz.hrefLen&&(I=ge.name.value,z=ct)}I===null&&p.some(ge=>ge.routeData===void 0&&ge.name.value===C.value)===!0||J({name:I,setCurrent:!0})}function xt(I){if(u(),M.value!==!0&&y.value!==null&&I.target&&typeof I.target.closest=="function"){const z=I.target.closest(".q-tab");z&&y.value.contains(z)===!0&&(M.value=!0,w.value===!0&&A(z))}}function ut(){s(()=>{M.value=!1},30)}function It(){zt.avoidRouteWatcher===!1?d(St):v()}function kt(){if($===void 0){const I=de(()=>a.$route.fullPath,It);$=()=>{I(),$=void 0}}}function Ht(I){p.push(I),b.value++,qe(),I.routeData===void 0||a.$route===void 0?d(()=>{if(w.value===!0){const z=C.value,ie=z!=null&&z!==""?p.find(Oe=>Oe.name.value===z):null;ie&&A(ie.rootRef.value)}}):(kt(),I.routeData.hasRouterLink.value===!0&&It())}function mn(I){p.splice(p.indexOf(I),1),b.value--,qe(),$!==void 0&&I.routeData!==void 0&&(p.every(z=>z.routeData===void 0)===!0&&$(),It())}const zt={currentModel:C,tabProps:G,hasFocus:M,hasActiveTab:Z,registerTab:Ht,unregisterTab:mn,verifyRouteModel:It,updateModel:J,onKbdNavigate:te,avoidRouteWatcher:!1};ys(ho,zt);function gn(){B!==null&&clearTimeout(B),X(),$!==void 0&&$()}let He;return Ke(gn),Na(()=>{He=$!==void 0,gn()}),La(()=>{He===!0&&kt(),qe()}),()=>_("div",{ref:y,class:$e.value,role:"tablist",onFocusin:xt,onFocusout:ut},[_(Fs,{onResize:Be}),_("div",{ref:g,class:E.value,onScroll:H},Ee(t.default)),_(je,{class:"q-tabs__arrow q-tabs__arrow--left absolute q-tab__icon"+(T.value===!0?"":" q-tabs__arrow--faded"),name:e.leftIcon||i.iconSet.tabs[e.vertical===!0?"up":"left"],onMousedownPassive:me,onTouchstartPassive:me,onMouseupPassive:X,onMouseleavePassive:X,onTouchendPassive:X}),_(je,{class:"q-tabs__arrow q-tabs__arrow--right absolute q-tab__icon"+(q.value===!0?"":" q-tabs__arrow--faded"),name:e.rightIcon||i.iconSet.tabs[e.vertical===!0?"down":"right"],onMousedownPassive:be,onTouchstartPassive:be,onMouseupPassive:X,onMouseleavePassive:X,onTouchendPassive:X})])}});const Xi={left:!0,right:!0,up:!0,down:!0,horizontal:!0,vertical:!0},dc=Object.keys(Xi);Xi.all=!0;function Wl(e){const t={};for(const n of dc)e[n]===!0&&(t[n]=!0);return Object.keys(t).length===0?Xi:(t.horizontal===!0?t.left=t.right=!0:t.left===!0&&t.right===!0&&(t.horizontal=!0),t.vertical===!0?t.up=t.down=!0:t.up===!0&&t.down===!0&&(t.vertical=!0),t.horizontal===!0&&t.vertical===!0&&(t.all=!0),t)}const fc=["INPUT","TEXTAREA"];function jl(e,t){return t.event===void 0&&e.target!==void 0&&e.target.draggable!==!0&&typeof t.handler=="function"&&fc.includes(e.target.nodeName.toUpperCase())===!1&&(e.qClonedBy===void 0||e.qClonedBy.indexOf(t.uid)===-1)}function hc(e){const t=[.06,6,50];return typeof e=="string"&&e.length&&e.split(":").forEach((n,a)=>{const i=parseFloat(n);i&&(t[a]=i)}),t}var mc=fo({name:"touch-swipe",beforeMount(e,{value:t,arg:n,modifiers:a}){if(a.mouse!==!0&&Sn.has.touch!==!0)return;const i=a.mouseCapture===!0?"Capture":"",l={handler:t,sensitivity:hc(n),direction:Wl(a),noop:lo,mouseStart(o){jl(o,l)&&ps(o)&&(jt(l,"temp",[[document,"mousemove","move",`notPassive${i}`],[document,"mouseup","end","notPassiveCapture"]]),l.start(o,!0))},touchStart(o){if(jl(o,l)){const r=o.target;jt(l,"temp",[[r,"touchmove","move","notPassiveCapture"],[r,"touchcancel","end","notPassiveCapture"],[r,"touchend","end","notPassiveCapture"]]),l.start(o)}},start(o,r){Sn.is.firefox===!0&&ii(e,!0);const s=wi(o);l.event={x:s.left,y:s.top,time:Date.now(),mouse:r===!0,dir:!1}},move(o){if(l.event===void 0)return;if(l.event.dir!==!1){We(o);return}const r=Date.now()-l.event.time;if(r===0)return;const s=wi(o),u=s.left-l.event.x,d=Math.abs(u),v=s.top-l.event.y,y=Math.abs(v);if(l.event.mouse!==!0){if(dl.sensitivity[0]&&(l.event.dir=v<0?"up":"down"),l.direction.horizontal===!0&&d>y&&y<100&&g>l.sensitivity[0]&&(l.event.dir=u<0?"left":"right"),l.direction.up===!0&&dl.sensitivity[0]&&(l.event.dir="up"),l.direction.down===!0&&d0&&d<100&&C>l.sensitivity[0]&&(l.event.dir="down"),l.direction.left===!0&&d>y&&u<0&&y<100&&g>l.sensitivity[0]&&(l.event.dir="left"),l.direction.right===!0&&d>y&&u>0&&y<100&&g>l.sensitivity[0]&&(l.event.dir="right"),l.event.dir!==!1?(We(o),l.event.mouse===!0&&(document.body.classList.add("no-pointer-events--children"),document.body.classList.add("non-selectable"),wa(),l.styleCleanup=w=>{l.styleCleanup=void 0,document.body.classList.remove("non-selectable");const T=()=>{document.body.classList.remove("no-pointer-events--children")};w===!0?setTimeout(T,50):T()}),l.handler({evt:o,touch:l.event.mouse!==!0,mouse:l.event.mouse,direction:l.event.dir,duration:r,distance:{x:d,y}})):l.end(o)},end(o){l.event!==void 0&&(Mn(l,"temp"),Sn.is.firefox===!0&&ii(e,!1),l.styleCleanup!==void 0&&l.styleCleanup(!0),o!==void 0&&l.event.dir!==!1&&We(o),l.event=void 0)}};if(e.__qtouchswipe=l,a.mouse===!0){const o=a.mouseCapture===!0||a.mousecapture===!0?"Capture":"";jt(l,"main",[[e,"mousedown","mouseStart",`passive${o}`]])}Sn.has.touch===!0&&jt(l,"main",[[e,"touchstart","touchStart",`passive${a.capture===!0?"Capture":""}`],[e,"touchmove","noop","notPassiveCapture"]])},updated(e,t){const n=e.__qtouchswipe;n!==void 0&&(t.oldValue!==t.value&&(typeof t.value!="function"&&n.end(),n.handler=t.value),n.direction=Wl(t.modifiers))},beforeUnmount(e){const t=e.__qtouchswipe;t!==void 0&&(Mn(t,"main"),Mn(t,"temp"),Sn.is.firefox===!0&&ii(e,!1),t.styleCleanup!==void 0&&t.styleCleanup(),delete e.__qtouchswipe)}});function gc(){const e=new Map;return{getCache:function(t,n){return e[t]===void 0?e[t]=n:e[t]},getCacheWithFn:function(t,n){return e[t]===void 0?e[t]=n():e[t]}}}const Wo={name:{required:!0},disable:Boolean},Ql={setup(e,{slots:t}){return()=>_("div",{class:"q-panel scroll",role:"tabpanel"},Ee(t.default))}},jo={modelValue:{required:!0},animated:Boolean,infinite:Boolean,swipeable:Boolean,vertical:Boolean,transitionPrev:String,transitionNext:String,transitionDuration:{type:[String,Number],default:300},keepAlive:Boolean,keepAliveInclude:[String,Array,RegExp],keepAliveExclude:[String,Array,RegExp],keepAliveMax:Number},Qo=["update:modelValue","beforeTransition","transition"];function Ko(){const{props:e,emit:t,proxy:n}=Fe(),{getCacheWithFn:a}=gc();let i,l;const o=Q(null),r=Q(null);function s(E){const le=e.vertical===!0?"up":"left";x((n.$q.lang.rtl===!0?-1:1)*(E.direction===le?1:-1))}const u=k(()=>[[mc,s,void 0,{horizontal:e.vertical!==!0,vertical:e.vertical,mouse:!0}]]),d=k(()=>e.transitionPrev||`slide-${e.vertical===!0?"down":"right"}`),v=k(()=>e.transitionNext||`slide-${e.vertical===!0?"up":"left"}`),y=k(()=>`--q-transition-duration: ${e.transitionDuration}ms`),g=k(()=>typeof e.modelValue=="string"||typeof e.modelValue=="number"?e.modelValue:String(e.modelValue)),C=k(()=>({include:e.keepAliveInclude,exclude:e.keepAliveExclude,max:e.keepAliveMax})),w=k(()=>e.keepAliveInclude!==void 0||e.keepAliveExclude!==void 0);de(()=>e.modelValue,(E,le)=>{const ve=p(E)===!0?b(E):-1;l!==!0&&B(ve===-1?0:ve{t("transition",E,le)}))});function T(){x(1)}function q(){x(-1)}function P(E){t("update:modelValue",E)}function p(E){return E!=null&&E!==""}function b(E){return i.findIndex(le=>le.props.name===E&&le.props.disable!==""&&le.props.disable!==!0)}function M(){return i.filter(E=>E.props.disable!==""&&E.props.disable!==!0)}function B(E){const le=E!==0&&e.animated===!0&&o.value!==-1?"q-transition--"+(E===-1?d.value:v.value):null;r.value!==le&&(r.value=le)}function x(E,le=o.value){let ve=le+E;for(;ve>-1&&ve{l=!1});return}ve+=E}e.infinite===!0&&i.length!==0&&le!==-1&&le!==i.length&&x(E,E===-1?i.length:-1)}function $(){const E=b(e.modelValue);return o.value!==E&&(o.value=E),!0}function G(){const E=p(e.modelValue)===!0&&$()&&i[o.value];return e.keepAlive===!0?[_(bs,C.value,[_(w.value===!0?a(g.value,()=>({...Ql,name:g.value})):Ql,{key:g.value,style:y.value},()=>E)])]:[_("div",{class:"q-panel scroll",style:y.value,key:g.value,role:"tabpanel"},[E])]}function Z(){if(i.length!==0)return e.animated===!0?[_(na,{name:r.value},G)]:G()}function ce(E){return i=uo(Ee(E.default,[])).filter(le=>le.props!==null&&le.props.slot===void 0&&p(le.props.name)===!0),i.length}function $e(){return i}return Object.assign(n,{next:T,previous:q,goTo:P}),{panelIndex:o,panelDirectives:u,updatePanelsList:ce,updatePanelIndex:$,getPanelContent:Z,getEnabledPanels:M,getPanels:$e,isValidPanelName:p,keepAliveProps:C,needsUniqueKeepAliveWrapper:w,goToPanelByOffset:x,goToPanel:P,nextPanel:T,previousPanel:q}}var vi=Se({name:"QTabPanel",props:Wo,setup(e,{slots:t}){return()=>_("div",{class:"q-tab-panel",role:"tabpanel"},Ee(t.default))}}),vc=Se({name:"QField",inheritAttrs:!1,props:Hi,emits:go,setup(){return vo(yo())}}),Go=Se({name:"QMenu",inheritAttrs:!1,props:{...wo,...Ri,...Vt,...Bi,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:Ta},self:{type:String,validator:Ta},offset:{type:Array,validator:To},scrollTarget:{default:void 0},touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...Vi,"click","escapeKey"],setup(e,{slots:t,emit:n,attrs:a}){let i=null,l,o,r;const s=Fe(),{proxy:u}=s,{$q:d}=u,v=Q(null),y=Q(!1),g=k(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),C=Ft(e,d),{registerTick:w,removeTick:T}=Wn(),{registerTimeout:q}=pa(),{transitionProps:P,transitionStyle:p}=no(e),{localScrollTarget:b,changeScrollEvent:M,unconfigureScrollTarget:B}=ko(e,U),{anchorEl:x,canShow:$}=So({showing:y}),{hide:G}=Fi({showing:y,canShow:$,handleShow:N,handleHide:A,hideOnRouteChange:g,processOnMount:!0}),{showPortal:Z,hidePortal:ce,renderPortal:$e}=ao(s,v,Ve,"menu"),E={anchorEl:x,innerRef:v,onClickOutside(O){if(e.persistent!==!0&&y.value===!0)return G(O),(O.type==="touchstart"||O.target.classList.contains("q-dialog__backdrop"))&&We(O),!0}},le=k(()=>Ma(e.anchor||(e.cover===!0?"center middle":"bottom start"),d.lang.rtl)),ve=k(()=>e.cover===!0?le.value:Ma(e.self||"top start",d.lang.rtl)),ke=k(()=>(e.square===!0?" q-menu--square":"")+(C.value===!0?" q-menu--dark q-dark":"")),J=k(()=>e.autoClose===!0?{onClick:me}:{}),qe=k(()=>y.value===!0&&e.persistent!==!0);de(qe,O=>{O===!0?(ks(X),Co(E)):(Al(X),Ca(E))});function Be(){Cs(()=>{let O=v.value;O&&O.contains(document.activeElement)!==!0&&(O=O.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||O.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||O.querySelector("[autofocus], [data-autofocus]")||O,O.focus({preventScroll:!0}))})}function N(O){if(i=e.noRefocus===!1?document.activeElement:null,_s(be),Z(),U(),l=void 0,O!==void 0&&(e.touchPosition||e.contextMenu)){const Ne=wi(O);if(Ne.left!==void 0){const{top:St,left:xt}=x.value.getBoundingClientRect();l={left:Ne.left-xt,top:Ne.top-St}}}o===void 0&&(o=de(()=>d.screen.width+"|"+d.screen.height+"|"+e.self+"|"+e.anchor+"|"+d.lang.rtl,te)),e.noFocus!==!0&&document.activeElement.blur(),w(()=>{te(),e.noFocus!==!0&&Be()}),q(()=>{d.platform.is.ios===!0&&(r=e.autoClose,v.value.click()),te(),Z(!0),n("show",O)},e.transitionDuration)}function A(O){T(),ce(),H(!0),i!==null&&(O===void 0||O.qClickOutside!==!0)&&(((O&&O.type.indexOf("key")===0?i.closest('[tabindex]:not([tabindex^="-"])'):void 0)||i).focus(),i=null),q(()=>{ce(!0),n("hide",O)},e.transitionDuration)}function H(O){l=void 0,o!==void 0&&(o(),o=void 0),(O===!0||y.value===!0)&&(ws(be),B(),Ca(E),Al(X)),O!==!0&&(i=null)}function U(){(x.value!==null||e.scrollTarget!==void 0)&&(b.value=Ea(x.value,e.scrollTarget),M(b.value,te))}function me(O){r!==!0?(Ss(u,O),n("click",O)):r=!1}function be(O){qe.value===!0&&e.noFocus!==!0&&Ts(v.value,O.target)!==!0&&Be()}function X(O){n("escapeKey"),G(O)}function te(){zi({targetEl:v.value,offset:e.offset,anchorEl:x.value,anchorOrigin:le.value,selfOrigin:ve.value,absoluteOffset:l,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Ve(){return _(na,P.value,()=>y.value===!0?_("div",{role:"menu",...a,ref:v,tabindex:-1,class:["q-menu q-position-engine scroll"+ke.value,a.class],style:[a.style,p.value],...J.value},Ee(t.default)):null)}return Ke(H),Object.assign(u,{focus:Be,updatePosition:te}),$e}});function Kl(e,t,n){if(n<=t)return t;const a=n-t+1;let i=t+(e-t)%a;return i["add","add-unique","toggle"].includes(e),yc=".*+?^${}()|[]\\",pc=Object.keys(Hi);var bc=Se({name:"QSelect",inheritAttrs:!1,props:{...qo,...Ms,...Hi,modelValue:{required:!0},multiple:Boolean,displayValue:[String,Number],displayValueHtml:Boolean,dropdownIcon:String,options:{type:Array,default:()=>[]},optionValue:[Function,String],optionLabel:[Function,String],optionDisable:[Function,String],hideSelected:Boolean,hideDropdownIcon:Boolean,fillInput:Boolean,maxValues:[Number,String],optionsDense:Boolean,optionsDark:{type:Boolean,default:null},optionsSelectedClass:String,optionsHtml:Boolean,optionsCover:Boolean,menuShrink:Boolean,menuAnchor:String,menuSelf:String,menuOffset:Array,popupContentClass:String,popupContentStyle:[String,Array,Object],useInput:Boolean,useChips:Boolean,newValueMode:{type:String,validator:Gl},mapOptions:Boolean,emitValue:Boolean,inputDebounce:{type:[Number,String],default:500},inputClass:[Array,String,Object],inputStyle:[Array,String,Object],tabindex:{type:[String,Number],default:0},autocomplete:String,transitionShow:String,transitionHide:String,transitionDuration:[String,Number],behavior:{type:String,validator:e=>["default","menu","dialog"].includes(e),default:"default"},virtualScrollItemSize:{type:[Number,String],default:void 0},onNewValue:Function,onFilter:Function},emits:[...go,"add","remove","inputValue","newValue","keyup","keypress","keydown","filterAbort"],setup(e,{slots:t,emit:n}){const{proxy:a}=Fe(),{$q:i}=a,l=Q(!1),o=Q(!1),r=Q(-1),s=Q(""),u=Q(!1),d=Q(!1);let v=null,y,g,C,w=null,T,q,P,p;const b=Q(null),M=Q(null),B=Q(null),x=Q(null),$=Q(null),G=qs(e),Z=$s(ql),ce=k(()=>Array.isArray(e.options)?e.options.length:0),$e=k(()=>e.virtualScrollItemSize===void 0?e.optionsDense===!0?24:48:e.virtualScrollItemSize),{virtualScrollSliceRange:E,virtualScrollSliceSizeComputed:le,localResetVirtualScroll:ve,padVirtualScroll:ke,onVirtualScrollEvt:J,scrollTo:qe,setVirtualScrollSize:Be}=Po({virtualScrollLength:ce,getVirtualScrollTarget:Hr,getVirtualScrollEl:Tl,virtualScrollItemSizeComputed:$e}),N=yo(),A=k(()=>{const h=e.mapOptions===!0&&e.multiple!==!0,F=e.modelValue!==void 0&&(e.modelValue!==null||h===!0)?e.multiple===!0&&Array.isArray(e.modelValue)?e.modelValue:[e.modelValue]:[];if(e.mapOptions===!0&&Array.isArray(e.options)===!0){const L=e.mapOptions===!0&&y!==void 0?y:[],ne=F.map(Me=>ti(Me,L));return e.modelValue===null&&h===!0?ne.filter(Me=>Me!==null):ne}return F}),H=k(()=>{const h={};return pc.forEach(F=>{const L=e[F];L!==void 0&&(h[F]=L)}),h}),U=k(()=>e.optionsDark===null?N.isDark.value:e.optionsDark),me=k(()=>Ol(A.value)),be=k(()=>{let h="q-field__input q-placeholder col";return e.hideSelected===!0||A.value.length===0?[h,e.inputClass]:(h+=" q-field__input--padding",e.inputClass===void 0?h:[h,e.inputClass])}),X=k(()=>(e.virtualScrollHorizontal===!0?"q-virtual-scroll--horizontal":"")+(e.popupContentClass?" "+e.popupContentClass:"")),te=k(()=>ce.value===0),Ve=k(()=>A.value.map(h=>I.value(h)).join(", ")),O=k(()=>e.displayValue!==void 0?e.displayValue:Ve.value),Ne=k(()=>e.optionsHtml===!0?()=>!0:h=>h!=null&&h.html===!0),St=k(()=>e.displayValueHtml===!0||e.displayValue===void 0&&(e.optionsHtml===!0||A.value.some(Ne.value))),xt=k(()=>N.focused.value===!0?e.tabindex:-1),ut=k(()=>{const h={tabindex:e.tabindex,role:"combobox","aria-label":e.label,"aria-readonly":e.readonly===!0?"true":"false","aria-autocomplete":e.useInput===!0?"list":"none","aria-expanded":l.value===!0?"true":"false","aria-controls":`${N.targetUid.value}_lb`};return r.value>=0&&(h["aria-activedescendant"]=`${N.targetUid.value}_${r.value}`),h}),It=k(()=>({id:`${N.targetUid.value}_lb`,role:"listbox","aria-multiselectable":e.multiple===!0?"true":"false"})),kt=k(()=>A.value.map((h,F)=>({index:F,opt:h,html:Ne.value(h),selected:!0,removeAtIndex:ge,toggleOption:ze,tabindex:xt.value}))),Ht=k(()=>{if(ce.value===0)return[];const{from:h,to:F}=E.value;return e.options.slice(h,F).map((L,ne)=>{const Me=z.value(L)===!0,Ce=h+ne,Le={clickable:!0,active:!1,activeClass:gn.value,manualFocus:!0,focused:!1,disable:Me,tabindex:-1,dense:e.optionsDense,dark:U.value,role:"option",id:`${N.targetUid.value}_${Ce}`,onClick:()=>{ze(L)}};return Me!==!0&&(ct(L)===!0&&(Le.active=!0),r.value===Ce&&(Le.focused=!0),Le["aria-selected"]=Le.active===!0?"true":"false",i.platform.is.desktop===!0&&(Le.onMousemove=()=>{l.value===!0&&Ct(Ce)})),{index:Ce,opt:L,html:Ne.value(L),label:I.value(L),selected:Le.active,focused:Le.focused,toggleOption:ze,setOptionIndex:Ct,itemProps:Le}})}),mn=k(()=>e.dropdownIcon!==void 0?e.dropdownIcon:i.iconSet.arrow.dropdown),zt=k(()=>e.optionsCover===!1&&e.outlined!==!0&&e.standout!==!0&&e.borderless!==!0&&e.rounded!==!0),gn=k(()=>e.optionsSelectedClass!==void 0?e.optionsSelectedClass:e.color!==void 0?`text-${e.color}`:""),He=k(()=>en(e.optionValue,"value")),I=k(()=>en(e.optionLabel,"label")),z=k(()=>en(e.optionDisable,"disable")),ie=k(()=>A.value.map(h=>He.value(h))),Oe=k(()=>{const h={onInput:ql,onChange:Z,onKeydown:Cl,onKeyup:Sl,onKeypress:kl,onFocus:_l,onClick(F){g===!0&&on(F)}};return h.onCompositionstart=h.onCompositionupdate=h.onCompositionend=Z,h});de(A,h=>{y=h,e.useInput===!0&&e.fillInput===!0&&e.multiple!==!0&&N.innerLoading.value!==!0&&(o.value!==!0&&l.value!==!0||me.value!==!0)&&(C!==!0&&_n(),(o.value===!0||l.value===!0)&&yn(""))},{immediate:!0}),de(()=>e.fillInput,_n),de(l,ni),de(ce,ns);function xe(h){return e.emitValue===!0?He.value(h):h}function _e(h){if(h>-1&&h=e.maxValues)return;const ne=e.modelValue.slice();n("add",{index:ne.length,value:L}),ne.push(L),n("update:modelValue",ne)}function ze(h,F){if(N.editable.value!==!0||h===void 0||z.value(h)===!0)return;const L=He.value(h);if(e.multiple!==!0){F!==!0&&(Vn(e.fillInput===!0?I.value(h):"",!0,!0),tn()),M.value!==null&&M.value.focus(),(A.value.length===0||kn(He.value(A.value[0]),L)!==!0)&&n("update:modelValue",e.emitValue===!0?L:h);return}if((g!==!0||u.value===!0)&&N.focus(),_l(),A.value.length===0){const Ce=e.emitValue===!0?L:h;n("add",{index:0,value:Ce}),n("update:modelValue",e.multiple===!0?[Ce]:Ce);return}const ne=e.modelValue.slice(),Me=ie.value.findIndex(Ce=>kn(Ce,L));if(Me>-1)n("remove",{index:Me,value:ne.splice(Me,1)[0]});else{if(e.maxValues!==void 0&&ne.length>=e.maxValues)return;const Ce=e.emitValue===!0?L:h;n("add",{index:ne.length,value:Ce}),ne.push(Ce)}n("update:modelValue",ne)}function Ct(h){if(i.platform.is.desktop!==!0)return;const F=h>-1&&h=0?I.value(e.options[L]):T))}}function ti(h,F){const L=ne=>kn(He.value(ne),h);return e.options.find(L)||F.find(L)||h}function en(h,F){const L=h!==void 0?h:F;return typeof L=="function"?L:ne=>ne!==null&&typeof ne=="object"&&L in ne?ne[L]:ne}function ct(h){const F=He.value(h);return ie.value.find(L=>kn(L,F))!==void 0}function _l(h){e.useInput===!0&&M.value!==null&&(h===void 0||M.value===h.target&&h.target.value===Ve.value)&&M.value.select()}function wl(h){ta(h,27)===!0&&l.value===!0&&(on(h),tn(),_n()),n("keyup",h)}function Sl(h){const{value:F}=h.target;if(h.keyCode!==void 0){wl(h);return}if(h.target.value="",v!==null&&(clearTimeout(v),v=null),_n(),typeof F=="string"&&F.length!==0){const L=F.toLocaleLowerCase(),ne=Ce=>{const Le=e.options.find(Je=>Ce.value(Je).toLocaleLowerCase()===L);return Le===void 0?!1:(A.value.indexOf(Le)===-1?ze(Le):tn(),!0)},Me=Ce=>{ne(He)!==!0&&(ne(I)===!0||Ce===!0||yn(F,!0,()=>Me(!0)))};Me()}else N.clearValue(h)}function kl(h){n("keypress",h)}function Cl(h){if(n("keydown",h),mo(h)===!0)return;const F=s.value.length!==0&&(e.newValueMode!==void 0||e.onNewValue!==void 0),L=h.shiftKey!==!0&&e.multiple!==!0&&(r.value>-1||F===!0);if(h.keyCode===27){zn(h);return}if(h.keyCode===9&&L===!1){pn();return}if(h.target===void 0||h.target.id!==N.targetUid.value||N.editable.value!==!0)return;if(h.keyCode===40&&N.innerLoading.value!==!0&&l.value===!1){We(h),bn();return}if(h.keyCode===8&&e.hideSelected!==!0&&s.value.length===0){e.multiple===!0&&Array.isArray(e.modelValue)===!0?_e(e.modelValue.length-1):e.multiple!==!0&&e.modelValue!==null&&n("update:modelValue",null);return}(h.keyCode===35||h.keyCode===36)&&(typeof s.value!="string"||s.value.length===0)&&(We(h),r.value=-1,vn(h.keyCode===36?1:-1,e.multiple)),(h.keyCode===33||h.keyCode===34)&&le.value!==void 0&&(We(h),r.value=Math.max(-1,Math.min(ce.value,r.value+(h.keyCode===33?-1:1)*le.value.view)),vn(h.keyCode===33?1:-1,e.multiple)),(h.keyCode===38||h.keyCode===40)&&(We(h),vn(h.keyCode===38?-1:1,e.multiple));const ne=ce.value;if((P===void 0||p0&&e.useInput!==!0&&h.key!==void 0&&h.key.length===1&&h.altKey===!1&&h.ctrlKey===!1&&h.metaKey===!1&&(h.keyCode!==32||P.length!==0)){l.value!==!0&&bn(h);const Me=h.key.toLocaleLowerCase(),Ce=P.length===1&&P[0]===Me;p=Date.now()+1500,Ce===!1&&(We(h),P+=Me);const Le=new RegExp("^"+P.split("").map(ai=>yc.indexOf(ai)>-1?"\\"+ai:ai).join(".*"),"i");let Je=r.value;if(Ce===!0||Je<0||Le.test(I.value(e.options[Je]))!==!0)do Je=Kl(Je+1,-1,ne-1);while(Je!==r.value&&(z.value(e.options[Je])===!0||Le.test(I.value(e.options[Je]))!==!0));r.value!==Je&&dt(()=>{Ct(Je),qe(Je),Je>=0&&e.useInput===!0&&e.fillInput===!0&&ua(I.value(e.options[Je]))});return}if(!(h.keyCode!==13&&(h.keyCode!==32||e.useInput===!0||P!=="")&&(h.keyCode!==9||L===!1))){if(h.keyCode!==9&&We(h),r.value>-1&&r.value{if(Le){if(Gl(Le)!==!0)return}else Le=e.newValueMode;if(Ce==null)return;Vn("",e.multiple!==!0,!0),(Le==="toggle"?ze:Ue)(Ce,Le==="add-unique"),e.multiple!==!0&&(M.value!==null&&M.value.focus(),tn())};if(e.onNewValue!==void 0?n("newValue",s.value,Me):Me(s.value),e.multiple!==!0)return}l.value===!0?pn():N.innerLoading.value!==!0&&bn()}}function Tl(){return g===!0?$.value:B.value!==null&&B.value.contentEl!==null?B.value.contentEl:void 0}function Hr(){return Tl()}function zr(){return e.hideSelected===!0?[]:t["selected-item"]!==void 0?kt.value.map(h=>t["selected-item"](h)).slice():t.selected!==void 0?[].concat(t.selected()):e.useChips===!0?kt.value.map((h,F)=>_(aa,{key:"option-"+F,removable:N.editable.value===!0&&z.value(h.opt)!==!0,dense:!0,textColor:e.color,tabindex:xt.value,onRemove(){h.removeAtIndex(F)}},()=>_("span",{class:"ellipsis",[h.html===!0?"innerHTML":"textContent"]:I.value(h.opt)}))):[_("span",{[St.value===!0?"innerHTML":"textContent"]:O.value})]}function Ml(){if(te.value===!0)return t["no-option"]!==void 0?t["no-option"]({inputValue:s.value}):void 0;const h=t.option!==void 0?t.option:L=>_(nt,{key:L.index,...L.itemProps},()=>_(ae,()=>_(se,()=>_("span",{[L.html===!0?"innerHTML":"textContent"]:L.label}))));let F=ke("div",Ht.value.map(h));return t["before-options"]!==void 0&&(F=t["before-options"]().concat(F)),Ln(t["after-options"],F)}function Wr(h,F){const L=F===!0?{...ut.value,...N.splitAttrs.attributes.value}:void 0,ne={ref:F===!0?M:void 0,key:"i_t",class:be.value,style:e.inputStyle,value:s.value!==void 0?s.value:"",type:"search",...L,id:F===!0?N.targetUid.value:void 0,maxlength:e.maxlength,autocomplete:e.autocomplete,"data-autofocus":h===!0||e.autofocus===!0||void 0,disabled:e.disable===!0,readonly:e.readonly===!0,...Oe.value};return h!==!0&&g===!0&&(Array.isArray(ne.class)===!0?ne.class=[...ne.class,"no-pointer-events"]:ne.class+=" no-pointer-events"),_("input",ne)}function ql(h){v!==null&&(clearTimeout(v),v=null),!(h&&h.target&&h.target.qComposing===!0)&&(ua(h.target.value||""),C=!0,T=s.value,N.focused.value!==!0&&(g!==!0||u.value===!0)&&N.focus(),e.onFilter!==void 0&&(v=setTimeout(()=>{v=null,yn(s.value)},e.inputDebounce)))}function ua(h){s.value!==h&&(s.value=h,n("inputValue",h))}function Vn(h,F,L){C=L!==!0,e.useInput===!0&&(ua(h),(F===!0||L!==!0)&&(T=h),F!==!0&&yn(h))}function yn(h,F,L){if(e.onFilter===void 0||F!==!0&&N.focused.value!==!0)return;N.innerLoading.value===!0?n("filterAbort"):(N.innerLoading.value=!0,d.value=!0),h!==""&&e.multiple!==!0&&A.value.length!==0&&C!==!0&&h===I.value(A.value[0])&&(h="");const ne=setTimeout(()=>{l.value===!0&&(l.value=!1)},10);w!==null&&clearTimeout(w),w=ne,n("filter",h,(Me,Ce)=>{(F===!0||N.focused.value===!0)&&w===ne&&(clearTimeout(w),typeof Me=="function"&&Me(),d.value=!1,dt(()=>{N.innerLoading.value=!1,N.editable.value===!0&&(F===!0?l.value===!0&&tn():l.value===!0?ni(!0):l.value=!0),typeof Ce=="function"&&dt(()=>{Ce(a)}),typeof L=="function"&&dt(()=>{L(a)})}))},()=>{N.focused.value===!0&&w===ne&&(clearTimeout(w),N.innerLoading.value=!1,d.value=!1),l.value===!0&&(l.value=!1)})}function jr(){return _(Go,{ref:B,class:X.value,style:e.popupContentStyle,modelValue:l.value,fit:e.menuShrink!==!0,cover:e.optionsCover===!0&&te.value!==!0&&e.useInput!==!0,anchor:e.menuAnchor,self:e.menuSelf,offset:e.menuOffset,dark:U.value,noParentEvent:!0,noRefocus:!0,noFocus:!0,square:zt.value,transitionShow:e.transitionShow,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,separateClosePopup:!0,...It.value,onScrollPassive:J,onBeforeShow:Dl,onBeforeHide:Qr,onShow:Kr},Ml)}function Qr(h){$l(h),pn()}function Kr(){Be()}function Gr(h){on(h),M.value!==null&&M.value.focus(),u.value=!0,window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,0)}function Zr(h){on(h),dt(()=>{u.value=!1})}function Jr(){const h=[_(vc,{class:`col-auto ${N.fieldClass.value}`,...H.value,for:N.targetUid.value,dark:U.value,square:!0,loading:d.value,itemAligned:!1,filled:!0,stackLabel:s.value.length!==0,...N.splitAttrs.listeners.value,onFocus:Gr,onBlur:Zr},{...t,rawControl:()=>N.getControl(!0),before:void 0,after:void 0})];return l.value===!0&&h.push(_("div",{ref:$,class:X.value+" scroll",style:e.popupContentStyle,...It.value,onClick:zn,onScrollPassive:J},Ml())),_(Si,{ref:x,modelValue:o.value,position:e.useInput===!0?"top":void 0,transitionShow:q,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,onBeforeShow:Dl,onBeforeHide:Xr,onHide:es,onShow:ts},()=>_("div",{class:"q-select__dialog"+(U.value===!0?" q-select__dialog--dark q-dark":"")+(u.value===!0?" q-select__dialog--focused":"")},h))}function Xr(h){$l(h),x.value!==null&&x.value.__updateRefocusTarget(N.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")),N.focused.value=!1}function es(h){tn(),N.focused.value===!1&&n("blur",h),_n()}function ts(){const h=document.activeElement;(h===null||h.id!==N.targetUid.value)&&M.value!==null&&M.value!==h&&M.value.focus(),Be()}function pn(){o.value!==!0&&(r.value=-1,l.value===!0&&(l.value=!1),N.focused.value===!1&&(w!==null&&(clearTimeout(w),w=null),N.innerLoading.value===!0&&(n("filterAbort"),N.innerLoading.value=!1,d.value=!1)))}function bn(h){N.editable.value===!0&&(g===!0?(N.onControlFocusin(h),o.value=!0,dt(()=>{N.focus()})):N.focus(),e.onFilter!==void 0?yn(s.value):(te.value!==!0||t["no-option"]!==void 0)&&(l.value=!0))}function tn(){o.value=!1,pn()}function _n(){e.useInput===!0&&Vn(e.multiple!==!0&&e.fillInput===!0&&A.value.length!==0&&I.value(A.value[0])||"",!0,!0)}function ni(h){let F=-1;if(h===!0){if(A.value.length!==0){const L=He.value(A.value[0]);F=e.options.findIndex(ne=>kn(He.value(ne),L))}ve(F)}Ct(F)}function ns(h,F){l.value===!0&&N.innerLoading.value===!1&&(ve(-1,!0),dt(()=>{l.value===!0&&N.innerLoading.value===!1&&(h>F?ve():ni(!0))}))}function Pl(){o.value===!1&&B.value!==null&&B.value.updatePosition()}function Dl(h){h!==void 0&&on(h),n("popupShow",h),N.hasPopupOpen=!0,N.onControlFocusin(h)}function $l(h){h!==void 0&&on(h),n("popupHide",h),N.hasPopupOpen=!1,N.onControlFocusout(h)}function xl(){g=i.platform.is.mobile!==!0&&e.behavior!=="dialog"?!1:e.behavior!=="menu"&&(e.useInput===!0?t["no-option"]!==void 0||e.onFilter!==void 0||te.value===!1:!0),q=i.platform.is.ios===!0&&g===!0&&e.useInput===!0?"fade":e.transitionShow}return Ps(xl),Ds(Pl),xl(),Ke(()=>{v!==null&&clearTimeout(v)}),Object.assign(a,{showPopup:bn,hidePopup:tn,removeAtIndex:_e,add:Ue,toggleOption:ze,getOptionIndex:()=>r.value,setOptionIndex:Ct,moveOptionSelection:vn,filter:yn,updateMenuPosition:Pl,updateInputValue:Vn,isOptionSelected:ct,getEmittingOptionValue:xe,isOptionDisabled:(...h)=>z.value.apply(null,h)===!0,getOptionValue:(...h)=>He.value.apply(null,h),getOptionLabel:(...h)=>I.value.apply(null,h)}),Object.assign(N,{innerValue:A,fieldClass:k(()=>`q-select q-field--auto-height q-select--with${e.useInput!==!0?"out":""}-input q-select--with${e.useChips!==!0?"out":""}-chips q-select--${e.multiple===!0?"multiple":"single"}`),inputRef:b,targetRef:M,hasValue:me,showPopup:bn,floatingLabel:k(()=>e.hideSelected!==!0&&me.value===!0||typeof s.value=="number"||s.value.length!==0||Ol(e.displayValue)),getControlChild:()=>{if(N.editable.value!==!1&&(o.value===!0||te.value!==!0||t["no-option"]!==void 0))return g===!0?Jr():jr();N.hasPopupOpen===!0&&(N.hasPopupOpen=!1)},controlEvents:{onFocusin(h){N.onControlFocusin(h)},onFocusout(h){N.onControlFocusout(h,()=>{_n(),pn()})},onClick(h){if(zn(h),g!==!0&&l.value===!0){pn(),M.value!==null&&M.value.focus();return}bn(h)}},getControl:h=>{const F=zr(),L=h===!0||o.value!==!0||g!==!0;if(e.useInput===!0)F.push(Wr(h,L));else if(N.editable.value===!0){const Me=L===!0?ut.value:void 0;F.push(_("input",{ref:L===!0?M:void 0,key:"d_t",class:"q-select__focus-target",id:L===!0?N.targetUid.value:void 0,value:O.value,readonly:!0,"data-autofocus":h===!0||e.autofocus===!0||void 0,...Me,onKeydown:Cl,onKeyup:wl,onKeypress:kl})),L===!0&&typeof e.autocomplete=="string"&&e.autocomplete.length!==0&&F.push(_("input",{class:"q-select__autocomplete-input",autocomplete:e.autocomplete,tabindex:-1,onKeyup:Sl}))}if(G.value!==void 0&&e.disable!==!0&&ie.value.length!==0){const Me=ie.value.map(Ce=>_("option",{value:Ce,selected:!0}));F.push(_("select",{class:"hidden",name:G.value,multiple:e.multiple},Me))}const ne=e.useInput===!0||L!==!0?void 0:N.splitAttrs.attributes.value;return _("div",{class:"q-field__native row items-center",...ne,...N.splitAttrs.listeners.value},F)},getInnerAppend:()=>e.loading!==!0&&d.value!==!0&&e.hideDropdownIcon!==!0?[_(je,{class:"q-select__dropdown-icon"+(l.value===!0?" rotate-180":""),name:mn.value})]:null}),vo(N)}}),_c=Se({name:"QTabPanels",props:{...jo,...Vt},emits:Qo,setup(e,{slots:t}){const n=Fe(),a=Ft(e,n.proxy.$q),{updatePanelsList:i,getPanelContent:l,panelDirectives:o}=Ko(),r=k(()=>"q-tab-panels q-panel-parent"+(a.value===!0?" q-tab-panels--dark q-dark":""));return()=>(i(t),Yi("div",{class:r.value},l(),"pan",e.swipeable,()=>o.value))}});const wc=ot({name:"EssentialLink",props:["merchants","relays","config-ui","read-notes"],data:function(){return{tab:"merchants",merchantPubkey:null,relayUrl:null,configData:{identifier:null,name:null,about:null,ui:{picture:null,banner:null,theme:null,darkMode:!1}},themeOptions:["classic","bitcoin","flamingo","cyber","freedom","mint","autumn","monochrome","salvador"]}},methods:{addMerchant:async function(){if(!isValidKey(this.merchantPubkey,"npub")){$q.notify({message:"Invalid Public Key!",type:"warning"});return}const e=isValidKeyHex(this.merchantPubkey)?this.merchantPubkey:NostrTools.nip19.decode(this.merchantPubkey).data;this.$emit("add-merchant",e),this.merchantPubkey=null},removeMerchant:async function(e){this.$emit("remove-merchant",e)},addRelay:async function(){const e=(this.relayUrl||"").trim();if(!e.startsWith("wss://")&&!e.startsWith("ws://")){this.relayUrl=null,$q.notify({timeout:5e3,type:"warning",message:"Invalid relay URL.",caption:"Should start with 'wss://'' or 'ws://'"});return}try{new URL(e),this.$emit("add-relay",e)}catch(t){$q.notify({timeout:5e3,type:"warning",message:"Invalid relay URL.",caption:`Error: ${t}`})}this.relayUrl=null},removeRelay:async function(e){this.$emit("remove-relay",e)},updateUiConfig:function(){setTimeout(()=>{const{name:e,about:t,ui:n}=this.configData;this.$emit("ui-config-update",{name:e,about:t,ui:n})},100)},publishNaddr(){this.$emit("publish-naddr")},clearAllData(){this.$emit("clear-all-data")},markNoteAsRead(e){this.$emit("note-read",e)}},created:async function(){this.configUi&&(this.configData={...this.configData,...this.configUi,ui:{...this.configData.ui,...this.configUi.ui||{}}})}}),Sc={class:"q-pt-md"},kc={class:"q-gutter-y-md"},Cc={class:"q-pa-md"},Tc={class:"q-gutter-y-md"},Mc=m("strong",null,"Note",-1),qc=m("div",{class:"text-caption"},[m("ul",null,[m("li",null,[m("span",{class:"text-subtitle1"}," Here all the mercants of the marketplace are listed. ")]),m("li",null,[m("span",{class:"text-subtitle1"}," You can easily add a new merchant by entering its public key in the input below. ")]),m("li",null,[m("span",{class:"text-subtitle1"}," When a merchant is added all its products and stalls will be available in the Market page. ")])])],-1),Pc=["src"],Dc=["src"],$c={class:"text-caption text-grey ellipsis-2-lines"},xc=m("strong",null,"Note",-1),Ic=m("div",{class:"text-caption"},[m("ul",null,[m("li",null,[m("span",{class:"text-subtitle1"}," Here one can customize the look and feel of the Market. ")]),m("li",null,[m("span",{class:"text-subtitle1"},[oe(" When the Market Profile is shared (via "),m("code",null,"naddr"),oe(" ) these customisations will be available to the customers. ")])])])],-1),Ac=m("div",{class:"q-mb-md"},[m("strong",null,"Information")],-1),Oc=m("div",{class:"q-mb-md q-mt-lg"},[m("strong",null,"UI Configurations")],-1),Ec=m("div",{class:"lt-md q-mt-lg"},null,-1),Nc={class:"float-right"};function Lc(e,t,n,a,i,l){return S(),j(lt,null,{default:f(()=>[c(we,null,{default:f(()=>[m("div",Sc,[m("div",kc,[c(cc,{modelValue:e.tab,"onUpdate:modelValue":t[3]||(t[3]=o=>e.tab=o),"active-color":"primary",align:"justify"},{default:f(()=>[c(gi,{name:"merchants",label:"Merchants",onUpdate:t[0]||(t[0]=o=>e.tab=o.name)}),c(gi,{name:"relays",label:"Relays",onUpdate:t[1]||(t[1]=o=>e.tab=o.name)}),c(gi,{name:"marketplace",label:"Look And Feel",onUpdate:t[2]||(t[2]=o=>e.tab=o.name)})]),_:1},8,["modelValue"])])])]),_:1}),c(Ae),c(we,null,{default:f(()=>[m("div",Cc,[m("div",Tc,[c(_c,{modelValue:e.tab,"onUpdate:modelValue":t[14]||(t[14]=o=>e.tab=o)},{default:f(()=>[c(vi,{name:"merchants"},{default:f(()=>{var o;return[(o=e.readNotes)!=null&&o.merchants?fe("",!0):(S(),j(Qt,{key:0,class:"q-mb-lg",bordered:""},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[c(je,{color:"primary",name:"info",size:"xl"})]),_:1})]),_:1}),c(ae,{class:"q-mt-sm q-ml-lg"},{default:f(()=>[c(se,null,{default:f(()=>[Mc]),_:1}),c(se,null,{default:f(()=>[qc]),_:1})]),_:1}),c(ae,{side:""},{default:f(()=>[c(ee,{onClick:t[4]||(t[4]=r=>e.markNoteAsRead("merchants")),size:"lg",outline:"",color:"primary",label:"Got it!",icon:"check_small"})]),_:1})]),_:1})]),_:1})),m("div",null,[c(Xe,{outlined:"",modelValue:e.merchantPubkey,"onUpdate:modelValue":t[5]||(t[5]=r=>e.merchantPubkey=r),onKeydown:ki(e.addMerchant,["enter"]),type:"text",label:"Pubkey/Npub",hint:"Add merchants"},{default:f(()=>[c(ee,{onClick:e.addMerchant,dense:"",flat:"",icon:"add"},null,8,["onClick"])]),_:1},8,["modelValue","onKeydown"]),c(Qt,{class:"q-mt-md"},{default:f(()=>[(S(!0),V(et,null,at(e.merchants,({publicKey:r,profile:s})=>(S(),j(nt,{key:r},{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[s!=null&&s.picture?(S(),V("img",{key:0,src:s.picture},null,8,Pc)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/blank-avatar.webp"},null,8,Dc))]),_:2},1024)]),_:2},1024),c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se,null,{default:f(()=>[m("strong",null,W(s==null?void 0:s.name),1)]),_:2},1024),c(se,null,{default:f(()=>[m("div",$c,[m("p",null,W(r),1)])]),_:2},1024),c(Tt,null,{default:f(()=>[oe(W(r),1)]),_:2},1024)]),_:2},1024),c(ae,{side:""},{default:f(()=>[c(ee,{size:"12px",flat:"",dense:"",round:"",icon:"delete",onClick:u=>e.removeMerchant(r)},null,8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1})])]}),_:1}),c(vi,{name:"relays"},{default:f(()=>[m("div",null,[m("div",null,[c(Xe,{outlined:"",modelValue:e.relayUrl,"onUpdate:modelValue":t[6]||(t[6]=o=>e.relayUrl=o),onKeydown:ki(e.addRelay,["enter"]),type:"text",label:"wss://",hint:"Add realays"},{default:f(()=>[c(ee,{onClick:e.addRelay,dense:"",flat:"",icon:"add"},null,8,["onClick"])]),_:1},8,["modelValue","onKeydown"]),c(Qt,{class:"q-mt-md"},{default:f(()=>[(S(!0),V(et,null,at(e.relays,o=>(S(),j(nt,{key:o},{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[c(je,{name:"router"})]),_:1})]),_:1}),c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se,null,{default:f(()=>[m("strong",null,W(o),1)]),_:2},1024)]),_:2},1024),c(ae,{side:""},{default:f(()=>[c(ee,{size:"12px",flat:"",dense:"",round:"",icon:"delete",onClick:r=>e.removeRelay(o)},null,8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1})])])]),_:1}),c(vi,{name:"marketplace"},{default:f(()=>{var o;return[(o=e.readNotes)!=null&&o.marketUi?fe("",!0):(S(),j(Qt,{key:0,class:"q-mb-lg gt-sm",bordered:""},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[c(je,{color:"primary",name:"info",size:"xl"})]),_:1})]),_:1}),c(ae,{class:"q-mt-sm q-ml-lg"},{default:f(()=>[c(se,null,{default:f(()=>[xc]),_:1}),c(se,null,{default:f(()=>[Ic]),_:1})]),_:1}),c(ae,{side:""},{default:f(()=>[c(ee,{onClick:t[7]||(t[7]=r=>e.markNoteAsRead("marketUi")),size:"lg",outline:"",color:"primary",label:"Got it!",icon:"check_small"})]),_:1})]),_:1})]),_:1})),Ac,c(Xe,{onChange:e.updateUiConfig,outlined:"",modelValue:e.configData.name,"onUpdate:modelValue":t[8]||(t[8]=r=>e.configData.name=r),type:"text",label:"Market Name",hint:"Short name for the market",class:"q-mb-md"},null,8,["onChange","modelValue"]),c(Xe,{onChange:e.updateUiConfig,outlined:"",modelValue:e.configData.about,"onUpdate:modelValue":t[9]||(t[9]=r=>e.configData.about=r),type:"textarea",rows:"3",label:"Marketplace Description",hint:"It will be displayed on top of the banner image. Can be a longer text.",class:"q-mb-lg"},null,8,["onChange","modelValue"]),Oc,c(Xe,{onChange:e.updateUiConfig,outlined:"",modelValue:e.configData.ui.picture,"onUpdate:modelValue":t[10]||(t[10]=r=>e.configData.ui.picture=r),type:"text",label:"Logo",hint:"It will be displayed next to the search input. Can be png, jpg, ico, gif, svg.",class:"q-mb-md"},null,8,["onChange","modelValue"]),c(Xe,{onChange:e.updateUiConfig,outlined:"",modelValue:e.configData.ui.banner,"onUpdate:modelValue":t[11]||(t[11]=r=>e.configData.ui.banner=r),type:"text",label:"Banner",hint:"It represents the visual identity of the market. Can be png, jpg, ico, gif, svg.",class:"q-mb-md"},null,8,["onChange","modelValue"]),c(bc,{onInput:e.updateUiConfig,"onUpdate:modelValue":[e.updateUiConfig,t[12]||(t[12]=r=>e.configData.ui.theme=r)],filled:"",modelValue:e.configData.ui.theme,hint:"The colors of the market will vary based on the theme. It applies to all components (buttons, labels, inputs, etc)",options:e.themeOptions,label:"Marketplace Theme"},null,8,["onInput","onUpdate:modelValue","modelValue","options"]),Ec,c(po,{onInput:e.updateUiConfig,onClick:e.updateUiConfig,modelValue:e.configData.ui.darkMode,"onUpdate:modelValue":t[13]||(t[13]=r=>e.configData.ui.darkMode=r),label:"Dark Mode",size:"sm",class:"q-mt-sm"},null,8,["onInput","onClick","modelValue"])]}),_:1})]),_:1},8,["modelValue"])])])]),_:1}),c(Ae),c(we,null,{default:f(()=>[m("div",Nc,[c(ee,{onClick:e.clearAllData,flat:"",label:"Clear All Data",icon:"delete",class:"q-ml-lg",color:"negative"},null,8,["onClick"]),c(ee,{onClick:e.publishNaddr,flat:"",label:"Share Market Profile",icon:"share",class:"q-ml-lg",color:"primary"},null,8,["onClick"])])]),_:1}),c(we,{class:"lt-md"}),c(we)]),_:1})}var Zo=_t(wc,[["render",Lc]]);const Rc=ot({name:"UserConfig",props:["account"],data:function(){return{}},methods:{logout:async function(){this.$q.dialog(confirm("Please make sure you save your private key! You will not be able to recover it later!")).onOk(async()=>{this.$emit("logout")})},copyText(e){this.$emit("copy-text",e)}},created:async function(){}}),Bc={class:"row"},Vc={class:"col-10"},Fc={class:"col-2 auto-width"},Yc={class:"row"},Uc={class:"col-10"},Hc={class:"col-2 auto-width"},zc={key:0,class:"float-right"},Wc={key:1},jc=m("strong",null,"No Account",-1),Qc=[jc];function Kc(e,t,n,a,i,l){const o=xs("value");return S(),j(lt,null,{default:f(()=>[e.account?(S(),j(we,{key:0},{default:f(()=>[m("div",Bc,[m("div",Vc,[dn((S(),j(Xe,{readonly:"",disbled:"",outlined:"",hint:e.account.pubkey,type:"text",label:"Public Key",class:"q-mb-md"},{append:f(()=>[c(ee,{onClick:t[0]||(t[0]=r=>e.copyText(e.account.npub)),icon:"content_copy",label:"Npub",flat:"",color:"gray float-right q-mt-sm"})]),_:1},8,["hint"])),[[o,e.account.npub]])]),m("div",Fc,[c(ee,{onClick:t[1]||(t[1]=r=>e.copyText(e.account.pubkey)),icon:"content_copy",label:"Hex",flat:"",color:"gray float-right q-mt-sm"})])]),m("div",Yc,[m("div",Uc,[dn((S(),j(Xe,{readonly:"",disbled:"",outlined:"",type:"password",label:"Private Key",class:"q-mb-md"},{append:f(()=>[c(ee,{onClick:t[2]||(t[2]=r=>e.copyText(e.account.nsec)),icon:"content_copy",label:"Nsec",flat:"",color:"gray float-right q-mt-sm"})]),_:1})),[[o,e.account.nsec]])]),m("div",Hc,[c(ee,{onClick:t[3]||(t[3]=r=>e.copyText(e.account.privkey)),icon:"content_copy",label:"Hex",flat:"",color:"gray float-right q-mt-sm"})])])]),_:1})):fe("",!0),c(Ae),c(we,null,{default:f(()=>[e.account?(S(),V("div",zc,[c(ee,{onClick:e.logout,flat:"",label:"Logout",icon:"logout",class:"q-ml-lg",color:"primary"},null,8,["onClick"])])):(S(),V("div",Wc,Qc))]),_:1}),c(we)]),_:1})}var Gc=_t(Rc,[["render",Kc]]);const Zc=ot({name:"UserChat",props:["user"],data:function(){return{}},methods:{},created:async function(){}}),Jc=m("div",{class:"q-pa-md"},[m("div",{class:"q-gutter-y-md"}," User Chat ")],-1);function Xc(e,t,n,a,i,l){return S(),j(lt,null,{default:f(()=>[Jc]),_:1})}var ed=_t(Zc,[["render",Xc]]);const td=ot({name:"ShoppingCartList",props:["carts"],data:function(){return{}},computed:{},methods:{formatCurrency:function(e,t){return formatCurrency(e,t)},cartTotalFormatted(e){var n;if(!((n=e.products)!=null&&n.length))return"";const t=e.products.reduce((a,i)=>i.price+a,0);return formatCurrency(t,e.products[0].currency)},removeProduct:function(e,t){this.$emit("remove-from-cart",{stallId:e,productId:t})},removeCart:function(e){this.$emit("remove-cart",e)},quantityChanged:function(e){this.$emit("add-to-cart",e)},proceedToCheckout:function(e){this.$emit("checkout-cart",e)}},created(){}}),nd=m("strong",null,"No products in cart!",-1),ad=["src"],id=["src"],ld=["textContent"],od=["textContent"],rd=["src"],sd=["src"],ud={class:"text-caption text-grey ellipsis-2-lines"},cd={class:"q-ma-md"};function dd(e,t,n,a,i,l){var o;return S(),V("div",null,[(o=e.carts)!=null&&o.length?fe("",!0):(S(),j(lt,{key:0,bordered:"",class:"q-mb-md"},{default:f(()=>[c(we,null,{default:f(()=>[nd]),_:1})]),_:1})),(S(!0),V(et,null,at(e.carts,r=>(S(),V("div",{key:r.id},[c(lt,{bordered:"",class:"q-mb-md"},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>{var s,u,d,v;return[(u=(s=r.merchant)==null?void 0:s.profile)!=null&&u.picture?(S(),V("img",{key:0,src:(v=(d=r.merchant)==null?void 0:d.profile)==null?void 0:v.picture},null,8,ad)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/blank-avatar.webp"},null,8,id))]}),_:2},1024)]),_:2},1024),c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>{var s;return[m("strong",null,[m("span",{textContent:W((s=r.products[0])==null?void 0:s.stallName)},null,8,ld)])]}),_:2},1024),c(se,{caption:""},{default:f(()=>{var s,u,d;return[oe(" By "),m("span",{class:"ellipsis-2-lines text-wrap",textContent:W(((u=(s=r.merchant)==null?void 0:s.profile)==null?void 0:u.name)||((d=r.merchant)==null?void 0:d.publicKey))},null,8,od)]}),_:2},1024)]),_:2},1024),c(ae,{side:""},{default:f(()=>[m("div",null,[c(ee,{onClick:s=>e.removeCart(r.id),flat:"",color:"pink"},{default:f(()=>[oe(" Clear Cart ")]),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024),c(Ae),c(we,{horizontal:""},{default:f(()=>[c(we,{class:"col-12"},{default:f(()=>[c(Qt,{class:"q-mt-md"},{default:f(()=>[(S(!0),V(et,null,at(r.products,s=>(S(),j(nt,{key:s.id},{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[s.images[0]||s.image?(S(),V("img",{key:0,src:s.images[0]||s.image},null,8,rd)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/placeholder.png"},null,8,sd))]),_:2},1024)]),_:2},1024),c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se,null,{default:f(()=>[oe(W(s.name),1)]),_:2},1024),c(se,{class:"gt-sm"},{default:f(()=>[m("div",ud,[m("p",null,W(s.description),1)])]),_:2},1024)]),_:2},1024),c(ae,{class:"q-mt-sm gt-sm"},{default:f(()=>[c(se,null,{default:f(()=>[m("strong",null,W(e.formatCurrency(s.price,s.currency)),1)]),_:2},1024),c(se)]),_:2},1024),c(ae,{class:"q-ma-sm"},{default:f(()=>[c(Xe,{modelValue:s.orderedQuantity,"onUpdate:modelValue":u=>s.orderedQuantity=u,modelModifiers:{number:!0},onChange:u=>e.quantityChanged(s),type:"number",rounded:"",outlined:"",min:"1",max:s.quantity},null,8,["modelValue","onUpdate:modelValue","onChange","max"])]),_:2},1024),c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>[m("strong",null,W(e.formatCurrency(s.price*s.orderedQuantity,s.currency)),1)]),_:2},1024)]),_:2},1024),c(ae,{side:""},{default:f(()=>[m("div",null,[c(ee,{flat:"",dense:"",round:"",icon:"delete",onClick:u=>e.removeProduct(s.stall_id,s.id)},null,8,["onClick"])])]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024),c(Ae),c(In,{align:"right"},{default:f(()=>[oe(" Total: "),m("strong",cd,W(e.cartTotalFormatted(r)),1),c(ee,{onClick:s=>e.proceedToCheckout(r),flat:"",color:"primary"},{default:f(()=>[oe(" Proceed to Checkout ")]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]))),128))])}var fd=_t(td,[["render",dd]]),hd=Se({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:t}){const n=k(()=>{const a=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(i=>e[i]===!0).map(i=>`q-btn-group--${i}`).join(" ");return`q-btn-group row no-wrap${a.length!==0?" "+a:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>_("div",{class:n.value},Ee(t.default))}});const md=Object.keys(bo),gd=e=>md.reduce((t,n)=>{const a=e[n];return a!==void 0&&(t[n]=a),t},{});var vd=Se({name:"QBtnDropdown",props:{...bo,...Bi,modelValue:Boolean,split:Boolean,dropdownIcon:String,contentClass:[Array,String,Object],contentStyle:[Array,String,Object],cover:Boolean,persistent:Boolean,noRouteDismiss:Boolean,autoClose:Boolean,menuAnchor:{type:String,default:"bottom end"},menuSelf:{type:String,default:"top end"},menuOffset:Array,disableMainBtn:Boolean,disableDropdown:Boolean,noIconAnimation:Boolean,toggleAriaLabel:String},emits:["update:modelValue","click","beforeShow","show","beforeHide","hide"],setup(e,{slots:t,emit:n}){const{proxy:a}=Fe(),i=Q(e.modelValue),l=Q(null),o=_a(),r=k(()=>{const b={"aria-expanded":i.value===!0?"true":"false","aria-haspopup":"true","aria-controls":o,"aria-label":e.toggleAriaLabel||a.$q.lang.label[i.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(b["aria-disabled"]="true"),b}),s=k(()=>"q-btn-dropdown__arrow"+(i.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),u=k(()=>Is(e)),d=k(()=>gd(e));de(()=>e.modelValue,b=>{l.value!==null&&l.value[b?"show":"hide"]()}),de(()=>e.split,p);function v(b){i.value=!0,n("beforeShow",b)}function y(b){n("show",b),n("update:modelValue",!0)}function g(b){i.value=!1,n("beforeHide",b)}function C(b){n("hide",b),n("update:modelValue",!1)}function w(b){n("click",b)}function T(b){on(b),p(),n("click",b)}function q(b){l.value!==null&&l.value.toggle(b)}function P(b){l.value!==null&&l.value.show(b)}function p(b){l.value!==null&&l.value.hide(b)}return Object.assign(a,{show:P,hide:p,toggle:q}),fn(()=>{e.modelValue===!0&&P()}),()=>{const b=[_(je,{class:s.value,name:e.dropdownIcon||a.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&b.push(_(Go,{ref:l,id:o,class:e.contentClass,style:e.contentStyle,cover:e.cover,fit:!0,persistent:e.persistent,noRouteDismiss:e.noRouteDismiss,autoClose:e.autoClose,anchor:e.menuAnchor,self:e.menuSelf,offset:e.menuOffset,separateClosePopup:!0,transitionShow:e.transitionShow,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,onBeforeShow:v,onShow:y,onBeforeHide:g,onHide:C},t.default)),e.split===!1?_(ee,{class:"q-btn-dropdown q-btn-dropdown--simple",...d.value,...r.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:w},{default:()=>Ee(t.label,[]).concat(b),loading:t.loading}):_(hd,{class:"q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",rounded:e.rounded,square:e.square,...u.value,glossy:e.glossy,stretch:e.stretch},()=>[_(ee,{class:"q-btn-dropdown--current",...d.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:T},{default:t.label,loading:t.loading}),_(ee,{class:"q-btn-dropdown__arrow-container q-anchor--skip",...r.value,...u.value,disable:e.disable===!0||e.disableDropdown===!0,rounded:e.rounded,color:e.color,textColor:e.textColor,dense:e.dense,size:e.size,padding:e.padding,ripple:e.ripple},()=>b)])}}});const yd=ot({name:"ShoppingCartCheckout",props:["cart","stall","customer-pubkey"],data:function(){return{orderConfirmed:!1,paymentMethod:"ln",shippingZone:null,contactData:{email:null,npub:null,address:null,message:null},paymentOptions:[{label:"Lightning Network",value:"ln"},{label:"BTC Onchain",value:"btc"},{label:"Cashu",value:"cashu"}]}},computed:{cartTotal(){var e;return(e=this.cart.products)!=null&&e.length?this.cart.products.reduce((t,n)=>n.price+t,0):0},cartTotalWithShipping(){return this.shippingZone?this.cartTotal+this.shippingZone.cost:this.cartTotal},shippingZoneLabel(){var t;if(!this.shippingZone)return"Shipping Zone";const e=this.shippingZone.name.substring(0,10);return((t=this.shippingZone)==null?void 0:t.name.length)<10?e:e+"..."}},methods:{formatCurrency:function(e,t){return formatCurrency(e,t)},selectShippingZone:function(e){this.shippingZone=e},confirmOrder:function(){if(!this.shippingZone){this.$q.notify({timeout:5e3,type:"warning",message:"Please select a shipping zone!"});return}this.orderConfirmed=!0},async placeOrder(){if(!this.shippingZone){this.$q.notify({timeout:5e3,type:"warning",message:"Please select a shipping zone!"});return}if(!this.customerPubkey){this.$emit("login-required");return}const e={address:this.contactData.address,message:this.contactData.message,contact:{nostr:this.contactData.npub,email:this.contactData.email},items:Array.from(this.cart.products,a=>({product_id:a.id,quantity:a.orderedQuantity})),shipping_id:this.shippingZone.id,type:0},t=Math.floor(Date.now()/1e3);e.id=await hash([this.customerPubkey,t,JSON.stringify(e)].join(":"));const n={...await NostrTools.getBlankEvent(),kind:4,created_at:t,tags:[["p",this.stall.pubkey]],pubkey:this.customerPubkey};this.$emit("place-order",{event:n,order:e,cartId:this.cart.id})},goToShoppingCart:function(){this.$emit("change-page","shopping-cart-list")}},created(){var e;((e=this.stall.shipping)==null?void 0:e.length)===1&&(this.shippingZone=this.stall.shipping[0])}}),pd=["src"],bd=["src"],_d=["textContent"],wd=["textContent"],Sd={class:"row q-mt-md q-ml-md q-pr-md"},kd=m("div",{class:"col-xs-12 col-sm-12 col-md-2 q-mt-md"},[m("strong",null,"Message:")],-1),Cd={class:"col-xs-12 col-sm-12 col-md-10"},Td={class:"row q-mt-md q-ml-md q-pr-md"},Md=m("div",{class:"col-xs-12 col-sm-12 col-md-2 q-mt-md"},[m("strong",null,"Address:")],-1),qd={class:"col-xs-12 col-sm-12 col-md-10"},Pd={class:"row q-mt-md q-ml-md q-pr-md"},Dd=m("div",{class:"col-xs-12 col-sm-12 col-md-2 q-mt-md"},[m("strong",null,"Email:")],-1),$d={class:"col-xs-12 col-sm-12 col-md-10"},xd={class:"row q-mt-md q-ml-md q-pr-md"},Id=m("div",{class:"col-xs-12 col-sm-12 col-md-2 q-mt-md"},[m("strong",null,"Npub:")],-1),Ad={class:"col-xs-12 col-sm-12 col-md-10"},Od={class:"row q-mt-md"},Ed=m("div",{class:"col-xs-12 col-sm-12 col-md-4"},[m("strong",null,"Subtotal:")],-1),Nd={class:"col-xs-12 col-sm-12 col-md-4"},Ld=m("div",{class:"col-xs-12 col-sm-12 col-md-4"},null,-1),Rd={class:"row q-mt-md"},Bd=m("div",{class:"col-xs-12 col-sm-12 col-md-4"},[m("strong",null,"Shipping:")],-1),Vd={class:"col-xs-12 col-sm-12 col-md-4"},Fd={key:0},Yd={class:"col-xs-12 col-sm-12 col-md-4"},Ud=["textContent"],Hd=["textContent"],zd={class:"row q-mt-md"},Wd=m("div",{class:"col-xs-12 col-sm-12 col-md-4"},[m("strong",null,"Total:")],-1),jd={class:"col-xs-12 col-sm-12 col-md-4"},Qd=m("div",{class:"col-xs-12 col-sm-12 col-md-4"},null,-1),Kd=m("strong",null,"Payment Method",-1),Gd={key:0},Zd={key:1};function Jd(e,t,n,a,i,l){return S(),V("div",null,[e.cart&&e.stall?(S(),j(lt,{key:0,bordered:"",class:"q-mb-md"},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>{var o,r,s,u;return[(r=(o=e.cart.merchant)==null?void 0:o.profile)!=null&&r.picture?(S(),V("img",{key:0,src:(u=(s=e.cart.merchant)==null?void 0:s.profile)==null?void 0:u.picture},null,8,pd)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/blank-avatar.webp"},null,8,bd))]}),_:1})]),_:1}),c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>{var o;return[m("strong",null,[m("span",{textContent:W((o=e.cart.products[0])==null?void 0:o.stallName)},null,8,_d)])]}),_:1}),c(se,{caption:""},{default:f(()=>{var o,r,s;return[oe(" By "),m("span",{class:"ellipsis-2-lines text-wrap",textContent:W(((r=(o=e.cart.merchant)==null?void 0:o.profile)==null?void 0:r.name)||((s=e.cart.merchant)==null?void 0:s.publicKey))},null,8,wd)]}),_:1})]),_:1}),c(ae,{side:""})]),_:1}),c(Ae),e.orderConfirmed?(S(),j(we,{key:0},{default:f(()=>[m("div",Sd,[kd,m("div",Cd,[c(Xe,{modelValue:e.contactData.message,"onUpdate:modelValue":t[0]||(t[0]=o=>e.contactData.message=o),modelModifiers:{trim:!0},outlined:"",type:"textarea",rows:"3",label:"Message (optional)",hint:"Message merchant about additional order needs"},null,8,["modelValue"])])]),m("div",Td,[Md,m("div",qd,[c(Xe,{modelValue:e.contactData.address,"onUpdate:modelValue":t[1]||(t[1]=o=>e.contactData.address=o),modelModifiers:{trim:!0},outlined:"",type:"textarea",rows:"3",label:"Address (optional)",hint:"Must provide for physical shipping"},null,8,["modelValue"])])]),m("div",Pd,[Dd,m("div",$d,[c(Xe,{modelValue:e.contactData.email,"onUpdate:modelValue":t[2]||(t[2]=o=>e.contactData.email=o),modelModifiers:{trim:!0},type:"email",outlined:"",label:"Email (optional)",hint:"Merchant may not use email"},null,8,["modelValue"])])]),m("div",xd,[Id,m("div",Ad,[c(Xe,{modelValue:e.contactData.npub,"onUpdate:modelValue":t[3]||(t[3]=o=>e.contactData.npub=o),modelModifiers:{trim:!0},outlined:"",label:"Alternative Npub (optional)",hint:"Use a different Npub to communicate with the merchant"},null,8,["modelValue"])])])]),_:1})):(S(),j(we,{key:1,horizontal:""},{default:f(()=>[c(we,{class:"col-7"},{default:f(()=>[m("div",Od,[Ed,m("div",Nd,[m("strong",null,W(e.formatCurrency(e.cartTotal,e.stall.currency)),1)]),Ld]),m("div",Rd,[Bd,m("div",Vd,[e.shippingZone?(S(),V("strong",Fd,W(e.formatCurrency(e.shippingZone.cost,e.stall.currency)),1)):fe("",!0)]),m("div",Yd,[c(vd,{unelevated:"",color:"secondary",rounded:"",label:e.shippingZoneLabel},{default:f(()=>[(S(!0),V(et,null,at(e.stall.shipping,o=>dn((S(),j(nt,{onClick:r=>e.selectShippingZone(o),key:o.id,clickable:""},{default:f(()=>[c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>[m("span",{textContent:W(o.name)},null,8,Ud)]),_:2},1024),c(se,{caption:""},{default:f(()=>{var r;return[m("span",{textContent:W((r=o.countries)==null?void 0:r.join(", "))},null,8,Hd)]}),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"])),[[Mi]])),128))]),_:1},8,["label"])])]),c(Ae,{class:"q-mt-sm"}),m("div",zd,[Wd,m("div",jd,[m("strong",null,W(e.formatCurrency(e.cartTotalWithShipping,e.stall.currency)),1)]),Qd])]),_:1}),c(Ae,{vertical:""}),c(we,null,{default:f(()=>[Kd,c(As,{modelValue:e.paymentMethod,"onUpdate:modelValue":t[4]||(t[4]=o=>e.paymentMethod=o),options:e.paymentOptions,color:"green",disable:""},null,8,["modelValue","options"])]),_:1})]),_:1})),c(Ae),c(In,{align:"right"},{default:f(()=>[e.orderConfirmed?(S(),V("div",Gd,[c(ee,{onClick:t[5]||(t[5]=o=>e.orderConfirmed=!1),flat:"",color:"grey"},{default:f(()=>[oe(" Back ")]),_:1}),c(ee,{onClick:t[6]||(t[6]=o=>e.placeOrder()),flat:"",color:"primary"},{default:f(()=>[oe(" Place Order ")]),_:1})])):(S(),V("div",Zd,[c(ee,{onClick:e.goToShoppingCart,flat:"",color:"grey"},{default:f(()=>[oe(" Back ")]),_:1},8,["onClick"]),c(ee,{onClick:e.confirmOrder,flat:"",color:"primary"},{default:f(()=>[oe(" Confirm ")]),_:1},8,["onClick"])]))]),_:1})]),_:1})):fe("",!0)])}var Xd=_t(yd,[["render",Jd]]);const{passive:nn}=xn;var ef=Se({name:"QInfiniteScroll",props:{offset:{type:Number,default:500},debounce:{type:[String,Number],default:100},scrollTarget:{default:void 0},initialIndex:Number,disable:Boolean,reverse:Boolean},emits:["load"],setup(e,{slots:t,emit:n}){const a=Q(!1),i=Q(!0),l=Q(null),o=Q(null);let r=e.initialIndex||0,s,u;const d=k(()=>"q-infinite-scroll__loading"+(a.value===!0?"":" invisible"));function v(){if(e.disable===!0||a.value===!0||i.value===!1)return;const x=ca(s),$=li(s),G=El(s);e.reverse===!1?Math.round($+G+e.offset)>=Math.round(x)&&y():Math.round($)<=e.offset&&y()}function y(){if(e.disable===!0||a.value===!0||i.value===!1)return;r++,a.value=!0;const x=ca(s);n("load",r,$=>{i.value===!0&&(a.value=!1,dt(()=>{if(e.reverse===!0){const G=ca(s),Z=li(s),ce=G-x;oi(s,Z+ce)}$===!0?w():l.value&&l.value.closest("body")&&u()}))})}function g(){r=0}function C(){i.value===!1&&(i.value=!0,s.addEventListener("scroll",u,nn)),v()}function w(){i.value===!0&&(i.value=!1,a.value=!1,s.removeEventListener("scroll",u,nn),u!==void 0&&u.cancel!==void 0&&u.cancel())}function T(){if(s&&i.value===!0&&s.removeEventListener("scroll",u,nn),s=Ea(l.value,e.scrollTarget),i.value===!0){if(s.addEventListener("scroll",u,nn),e.reverse===!0){const x=ca(s),$=El(s);oi(s,x-$)}v()}}function q(x){r=x}function P(x){x=parseInt(x,10);const $=u;u=x<=0?v:oo(v,isNaN(x)===!0?100:x),s&&i.value===!0&&($!==void 0&&s.removeEventListener("scroll",$,nn),s.addEventListener("scroll",u,nn))}function p(x){if(b.value===!0){if(o.value===null){x!==!0&&dt(()=>{p(!0)});return}const $=`${a.value===!0?"un":""}pauseAnimations`;Array.from(o.value.getElementsByTagName("svg")).forEach(G=>{G[$]()})}}const b=k(()=>e.disable!==!0&&i.value===!0);de([a,b],()=>{p()}),de(()=>e.disable,x=>{x===!0?w():C()}),de(()=>e.reverse,()=>{a.value===!1&&i.value===!0&&v()}),de(()=>e.scrollTarget,T),de(()=>e.debounce,P);let M=!1;La(()=>{M!==!1&&s&&oi(s,M)}),Na(()=>{M=s?li(s):!1}),Ke(()=>{i.value===!0&&s.removeEventListener("scroll",u,nn)}),fn(()=>{P(e.debounce),T(),a.value===!1&&p()});const B=Fe();return Object.assign(B.proxy,{poll:()=>{u!==void 0&&u()},trigger:y,stop:w,reset:g,resume:C,setIndex:q}),()=>{const x=co(t.default,[]);return b.value===!0&&x[e.reverse===!1?"push":"unshift"](_("div",{ref:o,class:d.value},Ee(t.loading))),_("div",{class:"q-infinite-scroll",ref:l},x)}}});const tf=ot({name:"ProductCard",props:["product","is-stall"],data:function(){return{}},methods:{},created(){}}),nf={class:"row no-wrap items-center"},af={class:"col text-subtitle2 ellipsis-2-lines"},lf={key:0},of={class:"text-h6"},rf={key:1},sf={class:"text-h6"},uf={class:"q-ml-md text-caption text-green-8 text-weight-bolder q-mt-md"},cf={key:0,class:"text-subtitle1"},df=["textContent"],ff={key:1,class:"text-subtitle1"},hf={class:"text-caption text-grey ellipsis-2-lines",style:{"min-height":"40px"}},mf={key:0},gf={class:"text-caption text-weight-bolder"},vf={class:"q-ml-auto"};function yf(e,t,n,a,i,l){return S(),j(lt,{class:"card--product"},{default:f(()=>[c(ji,{src:e.product.images&&e.product.images.length>0&&e.product.images[0]?e.product.images[0]:e.$q.config.staticPath+"/images/placeholder.png",alt:"Product Image",loading:"lazy","spinner-color":"white",fit:"contain",height:"300px"},null,8,["src"]),c(we,{class:"q-pb-xs q-pt-md"},{default:f(()=>[c(ee,{round:"",disabled:e.product.quantity<1,color:"primary",rounded:"",icon:"shopping_cart",size:"lg",style:{position:"absolute",top:"0",right:"0",transform:"translate(-50%, -50%)"},onClick:t[0]||(t[0]=o=>e.$emit("add-to-cart",e.product))},{default:f(()=>[c(Tt,null,{default:f(()=>[oe(" Add to cart ")]),_:1})]),_:1},8,["disabled"]),m("div",nf,[m("div",af,W(e.product.name),1)])]),_:1}),c(we,{class:"q-py-sm"},{default:f(()=>[m("div",null,[e.product.currency=="sat"?(S(),V("span",lf,[m("span",of,W(e.product.price)+" sats",1),c(Tt,null,{default:f(()=>[oe(" BTC "+W((e.product.price/1e8).toFixed(8)),1)]),_:1})])):(S(),V("span",rf,[m("span",sf,W(e.product.formatedPrice),1)])),m("span",uf,W(e.product.quantity)+" left",1)]),e.product.categories?(S(),V("div",cf,[c(Wi,{items:e.product.categories||[],"virtual-scroll-horizontal":""},{default:f(({item:o,index:r})=>[(S(),j(aa,{key:r,dense:""},{default:f(()=>[m("span",{textContent:W(o)},null,8,df)]),_:2},1024))]),_:1},8,["items"])])):(S(),V("div",ff," \xA0 ")),m("div",hf,[e.product.description?(S(),V("p",mf,W(e.product.description),1)):fe("",!0)])]),_:1}),c(Ae),c(In,null,{default:f(()=>[m("div",gf,W(e.product.stallName),1)]),_:1}),c(Ae),c(In,null,{default:f(()=>[m("div",vf,[e.isStall?fe("",!0):(S(),j(ee,{key:0,flat:"",class:"text-weight-bold text-capitalize q-ml-auto float-left",dense:"",color:"primary",onClick:t[1]||(t[1]=o=>e.$emit("change-page","stall",{stall:e.product.stall_id}))},{default:f(()=>[oe(" Visit Stall ")]),_:1})),c(ee,{flat:"",class:"text-weight-bold text-capitalize q-ml-auto",dense:"",color:"primary",onClick:t[2]||(t[2]=o=>e.$emit("change-page","stall",{stall:e.product.stall_id,product:e.product.id}))},{default:f(()=>[oe(" View details ")]),_:1})])]),_:1})]),_:1})}var Jo=_t(tf,[["render",yf]]);const pf=ot({name:"CustomerMarket",components:{ProductCard:Jo},props:["filtered-products","search-text","filter-categories"],data:function(){return{search:null,partialProducts:[],productsPerPage:12,startIndex:0,lastProductIndex:0,showProducts:!0}},watch:{searchText:function(){this.refreshProducts()},filteredProducts:function(){this.refreshProducts()},filterCategories:function(){this.refreshProducts()}},methods:{refreshProducts:function(){this.showProducts=!1,this.partialProducts=[],this.startIndex=0,this.lastProductIndex=Math.min(this.filteredProducts.length,this.productsPerPage),this.partialProducts.push(...this.filteredProducts.slice(0,this.lastProductIndex)),setTimeout(()=>{this.showProducts=!0},0)},addToCart(e){this.$emit("add-to-cart",e)},changePageM(e,t){this.$emit("change-page",e,t)},onLoad(e,t){setTimeout(()=>{if(this.startIndex>=this.filteredProducts.length){t();return}this.startIndex=this.lastProductIndex,this.lastProductIndex=Math.min(this.filteredProducts.length,this.lastProductIndex+this.productsPerPage),this.partialProducts.push(...this.filteredProducts.slice(this.startIndex,this.lastProductIndex)),t()},100)}},created(){this.lastProductIndex=Math.min(this.filteredProducts.length,24),this.partialProducts.push(...this.filteredProducts.slice(0,this.lastProductIndex))}}),bf={class:"row q-col-gutter-md"},_f={class:"row justify-center q-my-md"};function wf(e,t,n,a,i,l){const o=Ci("product-card");return S(),V("div",null,[e.showProducts?(S(),j(ef,{key:0,onLoad:e.onLoad,offset:250},_o({default:f(()=>[m("div",bf,[(S(!0),V(et,null,at(e.partialProducts,(r,s)=>(S(),V("div",{class:"col-xs-12 col-sm-6 col-md-4 col-lg-3",key:s},[c(o,{product:r,onChangePage:e.changePageM,onAddToCart:e.addToCart},null,8,["product","onChangePage","onAddToCart"])]))),128))])]),_:2},[e.lastProductIndex[m("div",_f,[c(Do,{color:"primary",size:"40px"})])]),key:"0"}:void 0]),1032,["onLoad"])):fe("",!0)])}var Sf=_t(pf,[["render",wf]]),kf=Se({name:"QSlideTransition",props:{appear:Boolean,duration:{type:Number,default:300}},emits:["show","hide"],setup(e,{slots:t,emit:n}){let a=!1,i,l,o=null,r=null,s,u;function d(){i&&i(),i=null,a=!1,o!==null&&(clearTimeout(o),o=null),r!==null&&(clearTimeout(r),r=null),l!==void 0&&l.removeEventListener("transitionend",s),s=null}function v(w,T,q){T!==void 0&&(w.style.height=`${T}px`),w.style.transition=`height ${e.duration}ms cubic-bezier(.25, .8, .50, 1)`,a=!0,i=q}function y(w,T){w.style.overflowY=null,w.style.height=null,w.style.transition=null,d(),T!==u&&n(T)}function g(w,T){let q=0;l=w,a===!0?(d(),q=w.offsetHeight===w.scrollHeight?0:void 0):(u="hide",w.style.overflowY="hidden"),v(w,q,T),o=setTimeout(()=>{o=null,w.style.height=`${w.scrollHeight}px`,s=P=>{r=null,(Object(P)!==P||P.target===w)&&y(w,"show")},w.addEventListener("transitionend",s),r=setTimeout(s,e.duration*1.1)},100)}function C(w,T){let q;l=w,a===!0?d():(u="show",w.style.overflowY="hidden",q=w.scrollHeight),v(w,q,T),o=setTimeout(()=>{o=null,w.style.height=0,s=P=>{r=null,(Object(P)!==P||P.target===w)&&y(w,"hide")},w.addEventListener("transitionend",s),r=setTimeout(s,e.duration*1.1)},100)}return Ke(()=>{a===!0&&d()}),()=>_(na,{css:!1,appear:e.appear,onEnter:g,onLeave:C},t.default)}});const an=Os({}),Cf=Object.keys(Ra);var Tf=Se({name:"QExpansionItem",props:{...Ra,...Ri,...Vt,icon:String,label:String,labelLines:[Number,String],caption:String,captionLines:[Number,String],dense:Boolean,toggleAriaLabel:String,expandIcon:String,expandedIcon:String,expandIconClass:[Array,String,Object],duration:Number,headerInsetLevel:Number,contentInsetLevel:Number,expandSeparator:Boolean,defaultOpened:Boolean,hideExpandIcon:Boolean,expandIconToggle:Boolean,switchToggleSide:Boolean,denseToggle:Boolean,group:String,popup:Boolean,headerStyle:[Array,String,Object],headerClass:[Array,String,Object]},emits:[...Vi,"click","afterShow","afterHide"],setup(e,{slots:t,emit:n}){const{proxy:{$q:a}}=Fe(),i=Ft(e,a),l=Q(e.modelValue!==null?e.modelValue:e.defaultOpened),o=Q(null),r=_a(),{show:s,hide:u,toggle:d}=Fi({showing:l});let v,y;const g=k(()=>`q-expansion-item q-item-type q-expansion-item--${l.value===!0?"expanded":"collapsed"} q-expansion-item--${e.popup===!0?"popup":"standard"}`),C=k(()=>{if(e.contentInsetLevel===void 0)return null;const J=a.lang.rtl===!0?"Right":"Left";return{["padding"+J]:e.contentInsetLevel*56+"px"}}),w=k(()=>e.disable!==!0&&(e.href!==void 0||e.to!==void 0&&e.to!==null&&e.to!=="")),T=k(()=>{const J={};return Cf.forEach(qe=>{J[qe]=e[qe]}),J}),q=k(()=>w.value===!0||e.expandIconToggle!==!0),P=k(()=>e.expandedIcon!==void 0&&l.value===!0?e.expandedIcon:e.expandIcon||a.iconSet.expansionItem[e.denseToggle===!0?"denseIcon":"icon"]),p=k(()=>e.disable!==!0&&(w.value===!0||e.expandIconToggle===!0)),b=k(()=>({expanded:l.value===!0,detailsId:e.targetUid,toggle:d,show:s,hide:u})),M=k(()=>{const J=e.toggleAriaLabel!==void 0?e.toggleAriaLabel:a.lang.label[l.value===!0?"collapse":"expand"](e.label);return{role:"button","aria-expanded":l.value===!0?"true":"false","aria-controls":r,"aria-label":J}});de(()=>e.group,J=>{y!==void 0&&y(),J!==void 0&&ce()});function B(J){w.value!==!0&&d(J),n("click",J)}function x(J){J.keyCode===13&&$(J,!0)}function $(J,qe){qe!==!0&&o.value!==null&&o.value.focus(),d(J),We(J)}function G(){n("afterShow")}function Z(){n("afterHide")}function ce(){v===void 0&&(v=_a()),l.value===!0&&(an[e.group]=v);const J=de(l,Be=>{Be===!0?an[e.group]=v:an[e.group]===v&&delete an[e.group]}),qe=de(()=>an[e.group],(Be,N)=>{N===v&&Be!==void 0&&Be!==v&&u()});y=()=>{J(),qe(),an[e.group]===v&&delete an[e.group],y=void 0}}function $e(){const J={class:[`q-focusable relative-position cursor-pointer${e.denseToggle===!0&&e.switchToggleSide===!0?" items-end":""}`,e.expandIconClass],side:e.switchToggleSide!==!0,avatar:e.switchToggleSide},qe=[_(je,{class:"q-expansion-item__toggle-icon"+(e.expandedIcon===void 0&&l.value===!0?" q-expansion-item__toggle-icon--rotated":""),name:P.value})];return p.value===!0&&(Object.assign(J,{tabindex:0,...M.value,onClick:$,onKeyup:x}),qe.unshift(_("div",{ref:o,class:"q-expansion-item__toggle-focus q-icon q-focus-helper q-focus-helper--rounded",tabindex:-1}))),_(ae,J,()=>qe)}function E(){let J;return t.header!==void 0?J=[].concat(t.header(b.value)):(J=[_(ae,()=>[_(se,{lines:e.labelLines},()=>e.label||""),e.caption?_(se,{lines:e.captionLines,caption:!0},()=>e.caption):null])],e.icon&&J[e.switchToggleSide===!0?"push":"unshift"](_(ae,{side:e.switchToggleSide===!0,avatar:e.switchToggleSide!==!0},()=>_(je,{name:e.icon})))),e.disable!==!0&&e.hideExpandIcon!==!0&&J[e.switchToggleSide===!0?"unshift":"push"]($e()),J}function le(){const J={ref:"item",style:e.headerStyle,class:e.headerClass,dark:i.value,disable:e.disable,dense:e.dense,insetLevel:e.headerInsetLevel};return q.value===!0&&(J.clickable=!0,J.onClick=B,Object.assign(J,w.value===!0?T.value:M.value)),_(nt,J,E)}function ve(){return dn(_("div",{key:"e-content",class:"q-expansion-item__content relative-position",style:C.value,id:r},Ee(t.default)),[[Es,l.value]])}function ke(){const J=[le(),_(kf,{duration:e.duration,onShow:G,onHide:Z},ve)];return e.expandSeparator===!0&&J.push(_(Ae,{class:"q-expansion-item__border q-expansion-item__border--top absolute-top",dark:i.value}),_(Ae,{class:"q-expansion-item__border q-expansion-item__border--bottom absolute-bottom",dark:i.value})),J}return e.group!==void 0&&ce(),Ke(()=>{y!==void 0&&y()}),()=>_("div",{class:g.value},[_("div",{class:"q-expansion-item__container relative-position"},ke())])}});//! moment.js +//! version : 2.29.4 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var Xo;function R(){return Xo.apply(null,arguments)}function Mf(e){Xo=e}function pt(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function cn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function el(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(ye(e,t))return!1;return!0}function tt(e){return e===void 0}function Bt(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function la(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function er(e,t){var n=[],a,i=e.length;for(a=0;a>>0,a;for(a=0;a0)for(n=0;n=0;return(l?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+a}var il=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ha=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,pi={},Pn={};function K(e,t,n,a){var i=a;typeof a=="string"&&(i=function(){return this[a]()}),e&&(Pn[e]=i),t&&(Pn[t[0]]=function(){return qt(i.apply(this,arguments),t[1],t[2])}),n&&(Pn[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function xf(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function If(e){var t=e.match(il),n,a;for(n=0,a=t.length;n=0&&ha.test(e);)e=e.replace(ha,a),ha.lastIndex=0,n-=1;return e}var Af={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Of(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(il).map(function(a){return a==="MMMM"||a==="MM"||a==="DD"||a==="dddd"?a.slice(1):a}).join(""),this._longDateFormat[e])}var Ef="Invalid date";function Nf(){return this._invalidDate}var Lf="%d",Rf=/\d{1,2}/;function Bf(e){return this._ordinal.replace("%d",e)}var Vf={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Ff(e,t,n,a){var i=this._relativeTime[n];return $t(i)?i(e,t,n,a):i.replace(/%d/i,e)}function Yf(e,t){var n=this._relativeTime[e>0?"future":"past"];return $t(n)?n(t):n.replace(/%s/i,t)}var Qn={};function Ge(e,t){var n=e.toLowerCase();Qn[n]=Qn[n+"s"]=Qn[t]=e}function mt(e){return typeof e=="string"?Qn[e]||Qn[e.toLowerCase()]:void 0}function ll(e){var t={},n,a;for(a in e)ye(e,a)&&(n=mt(a),n&&(t[n]=e[a]));return t}var ir={};function Ze(e,t){ir[e]=t}function Uf(e){var t=[],n;for(n in e)ye(e,n)&&t.push({unit:n,priority:ir[n]});return t.sort(function(a,i){return a.priority-i.priority}),t}function Ha(e){return e%4===0&&e%100!==0||e%400===0}function ft(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ue(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=ft(t)),n}function Rn(e,t){return function(n){return n!=null?(lr(this,e,n),R.updateOffset(this,t),this):Da(this,e)}}function Da(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function lr(e,t,n){e.isValid()&&!isNaN(n)&&(t==="FullYear"&&Ha(e.year())&&e.month()===1&&e.date()===29?(n=ue(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ga(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Hf(e){return e=mt(e),$t(this[e])?this[e]():this}function zf(e,t){if(typeof e=="object"){e=ll(e);var n=Uf(e),a,i=n.length;for(a=0;a68?1900:2e3)};var gr=Rn("FullYear",!0);function ch(){return Ha(this.year())}function dh(e,t,n,a,i,l,o){var r;return e<100&&e>=0?(r=new Date(e+400,t,n,a,i,l,o),isFinite(r.getFullYear())&&r.setFullYear(e)):r=new Date(e,t,n,a,i,l,o),r}function Jn(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function xa(e,t,n){var a=7+t-n,i=(7+Jn(e,0,a).getUTCDay()-t)%7;return-i+a-1}function vr(e,t,n,a,i){var l=(7+n-a)%7,o=xa(e,a,i),r=1+7*(t-1)+l+o,s,u;return r<=0?(s=e-1,u=Kn(s)+r):r>Kn(e)?(s=e+1,u=r-Kn(e)):(s=e,u=r),{year:s,dayOfYear:u}}function Xn(e,t,n){var a=xa(e.year(),t,n),i=Math.floor((e.dayOfYear()-a-1)/7)+1,l,o;return i<1?(o=e.year()-1,l=i+Rt(o,t,n)):i>Rt(e.year(),t,n)?(l=i-Rt(e.year(),t,n),o=e.year()+1):(o=e.year(),l=i),{week:l,year:o}}function Rt(e,t,n){var a=xa(e,t,n),i=xa(e+1,t,n);return(Kn(e)-a+i)/7}K("w",["ww",2],"wo","week");K("W",["WW",2],"Wo","isoWeek");Ge("week","w");Ge("isoWeek","W");Ze("week",5);Ze("isoWeek",5);Y("w",De);Y("ww",De,st);Y("W",De);Y("WW",De,st);sa(["w","ww","W","WW"],function(e,t,n,a){t[a.substr(0,1)]=ue(e)});function fh(e){return Xn(e,this._week.dow,this._week.doy).week}var hh={dow:0,doy:6};function mh(){return this._week.dow}function gh(){return this._week.doy}function vh(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function yh(e){var t=Xn(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}K("d",0,"do","day");K("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});K("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});K("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});K("e",0,0,"weekday");K("E",0,0,"isoWeekday");Ge("day","d");Ge("weekday","e");Ge("isoWeekday","E");Ze("day",11);Ze("weekday",11);Ze("isoWeekday",11);Y("d",De);Y("e",De);Y("E",De);Y("dd",function(e,t){return t.weekdaysMinRegex(e)});Y("ddd",function(e,t){return t.weekdaysShortRegex(e)});Y("dddd",function(e,t){return t.weekdaysRegex(e)});sa(["dd","ddd","dddd"],function(e,t,n,a){var i=n._locale.weekdaysParse(e,a,n._strict);i!=null?t.d=i:re(n).invalidWeekday=e});sa(["d","e","E"],function(e,t,n,a){t[a]=ue(e)});function ph(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function bh(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function sl(e,t){return e.slice(t,7).concat(e.slice(0,t))}var _h="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wh="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Sh=ra,kh=ra,Ch=ra;function Th(e,t){var n=pt(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?sl(n,this._week.dow):e?n[e.day()]:n}function Mh(e){return e===!0?sl(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function qh(e){return e===!0?sl(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ph(e,t,n){var a,i,l,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)l=Dt([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(l,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(l,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(l,"").toLocaleLowerCase();return n?t==="dddd"?(i=Re.call(this._weekdaysParse,o),i!==-1?i:null):t==="ddd"?(i=Re.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=Re.call(this._minWeekdaysParse,o),i!==-1?i:null):t==="dddd"?(i=Re.call(this._weekdaysParse,o),i!==-1||(i=Re.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=Re.call(this._minWeekdaysParse,o),i!==-1?i:null)):t==="ddd"?(i=Re.call(this._shortWeekdaysParse,o),i!==-1||(i=Re.call(this._weekdaysParse,o),i!==-1)?i:(i=Re.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=Re.call(this._minWeekdaysParse,o),i!==-1||(i=Re.call(this._weekdaysParse,o),i!==-1)?i:(i=Re.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function Dh(e,t,n){var a,i,l;if(this._weekdaysParseExact)return Ph.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(i=Dt([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[a]||(l="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[a]=new RegExp(l.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[a].test(e))return a;if(n&&t==="ddd"&&this._shortWeekdaysParse[a].test(e))return a;if(n&&t==="dd"&&this._minWeekdaysParse[a].test(e))return a;if(!n&&this._weekdaysParse[a].test(e))return a}}function $h(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=ph(e,this.localeData()),this.add(e-t,"d")):t}function xh(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Ih(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=bh(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Ah(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||ul.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ye(this,"_weekdaysRegex")||(this._weekdaysRegex=Sh),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oh(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||ul.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ye(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=kh),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Eh(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||ul.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ye(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ch),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ul(){function e(d,v){return v.length-d.length}var t=[],n=[],a=[],i=[],l,o,r,s,u;for(l=0;l<7;l++)o=Dt([2e3,1]).day(l),r=it(this.weekdaysMin(o,"")),s=it(this.weekdaysShort(o,"")),u=it(this.weekdays(o,"")),t.push(r),n.push(s),a.push(u),i.push(r),i.push(s),i.push(u);t.sort(e),n.sort(e),a.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function cl(){return this.hours()%12||12}function Nh(){return this.hours()||24}K("H",["HH",2],0,"hour");K("h",["hh",2],0,cl);K("k",["kk",2],0,Nh);K("hmm",0,0,function(){return""+cl.apply(this)+qt(this.minutes(),2)});K("hmmss",0,0,function(){return""+cl.apply(this)+qt(this.minutes(),2)+qt(this.seconds(),2)});K("Hmm",0,0,function(){return""+this.hours()+qt(this.minutes(),2)});K("Hmmss",0,0,function(){return""+this.hours()+qt(this.minutes(),2)+qt(this.seconds(),2)});function pr(e,t){K(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}pr("a",!0);pr("A",!1);Ge("hour","h");Ze("hour",13);function br(e,t){return t._meridiemParse}Y("a",br);Y("A",br);Y("H",De);Y("h",De);Y("k",De);Y("HH",De,st);Y("hh",De,st);Y("kk",De,st);Y("hmm",sr);Y("hmmss",ur);Y("Hmm",sr);Y("Hmmss",ur);Te(["H","HH"],Ye);Te(["k","kk"],function(e,t,n){var a=ue(e);t[Ye]=a===24?0:a});Te(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});Te(["h","hh"],function(e,t,n){t[Ye]=ue(e),re(n).bigHour=!0});Te("hmm",function(e,t,n){var a=e.length-2;t[Ye]=ue(e.substr(0,a)),t[yt]=ue(e.substr(a)),re(n).bigHour=!0});Te("hmmss",function(e,t,n){var a=e.length-4,i=e.length-2;t[Ye]=ue(e.substr(0,a)),t[yt]=ue(e.substr(a,2)),t[Lt]=ue(e.substr(i)),re(n).bigHour=!0});Te("Hmm",function(e,t,n){var a=e.length-2;t[Ye]=ue(e.substr(0,a)),t[yt]=ue(e.substr(a))});Te("Hmmss",function(e,t,n){var a=e.length-4,i=e.length-2;t[Ye]=ue(e.substr(0,a)),t[yt]=ue(e.substr(a,2)),t[Lt]=ue(e.substr(i))});function Lh(e){return(e+"").toLowerCase().charAt(0)==="p"}var Rh=/[ap]\.?m?\.?/i,Bh=Rn("Hours",!0);function Vh(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var _r={calendar:Df,longDateFormat:Af,invalidDate:Ef,ordinal:Lf,dayOfMonthOrdinalParse:Rf,relativeTime:Vf,months:eh,monthsShort:cr,week:hh,weekdays:_h,weekdaysMin:wh,weekdaysShort:yr,meridiemParse:Rh},Ie={},Yn={},ea;function Fh(e,t){var n,a=Math.min(e.length,t.length);for(n=0;n0;){if(i=Za(l.slice(0,n).join("-")),i)return i;if(a&&a.length>=n&&Fh(l,a)>=n-1)break;n--}t++}return ea}function Uh(e){return e.match("^[^/\\\\]*$")!=null}function Za(e){var t=null,n;if(Ie[e]===void 0&&typeof module!="undefined"&&module&&module.exports&&Uh(e))try{t=ea._abbr,n=require,n("./locale/"+e),Jt(t)}catch{Ie[e]=null}return Ie[e]}function Jt(e,t){var n;return e&&(tt(t)?n=Yt(e):n=dl(e,t),n?ea=n:typeof console!="undefined"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ea._abbr}function dl(e,t){if(t!==null){var n,a=_r;if(t.abbr=e,Ie[e]!=null)nr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),a=Ie[e]._config;else if(t.parentLocale!=null)if(Ie[t.parentLocale]!=null)a=Ie[t.parentLocale]._config;else if(n=Za(t.parentLocale),n!=null)a=n._config;else return Yn[t.parentLocale]||(Yn[t.parentLocale]=[]),Yn[t.parentLocale].push({name:e,config:t}),null;return Ie[e]=new al(Ii(a,t)),Yn[e]&&Yn[e].forEach(function(i){dl(i.name,i.config)}),Jt(e),Ie[e]}else return delete Ie[e],null}function Hh(e,t){if(t!=null){var n,a,i=_r;Ie[e]!=null&&Ie[e].parentLocale!=null?Ie[e].set(Ii(Ie[e]._config,t)):(a=Za(e),a!=null&&(i=a._config),t=Ii(i,t),a==null&&(t.abbr=e),n=new al(t),n.parentLocale=Ie[e],Ie[e]=n),Jt(e)}else Ie[e]!=null&&(Ie[e].parentLocale!=null?(Ie[e]=Ie[e].parentLocale,e===Jt()&&Jt(e)):Ie[e]!=null&&delete Ie[e]);return Ie[e]}function Yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ea;if(!pt(e)){if(t=Za(e),t)return t;e=[e]}return Yh(e)}function zh(){return Ai(Ie)}function fl(e){var t,n=e._a;return n&&re(e).overflow===-2&&(t=n[Nt]<0||n[Nt]>11?Nt:n[Mt]<1||n[Mt]>Ga(n[Qe],n[Nt])?Mt:n[Ye]<0||n[Ye]>24||n[Ye]===24&&(n[yt]!==0||n[Lt]!==0||n[sn]!==0)?Ye:n[yt]<0||n[yt]>59?yt:n[Lt]<0||n[Lt]>59?Lt:n[sn]<0||n[sn]>999?sn:-1,re(e)._overflowDayOfYear&&(tMt)&&(t=Mt),re(e)._overflowWeeks&&t===-1&&(t=Zf),re(e)._overflowWeekday&&t===-1&&(t=Jf),re(e).overflow=t),e}var Wh=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jh=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qh=/Z|[+-]\d\d(?::?\d\d)?/,ma=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],bi=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Kh=/^\/?Date\((-?\d+)/i,Gh=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zh={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function wr(e){var t,n,a=e._i,i=Wh.exec(a)||jh.exec(a),l,o,r,s,u=ma.length,d=bi.length;if(i){for(re(e).iso=!0,t=0,n=u;tKn(o)||e._dayOfYear===0)&&(re(e)._overflowDayOfYear=!0),n=Jn(o,0,e._dayOfYear),e._a[Nt]=n.getUTCMonth(),e._a[Mt]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=a[t]=i[t];for(;t<7;t++)e._a[t]=a[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Ye]===24&&e._a[yt]===0&&e._a[Lt]===0&&e._a[sn]===0&&(e._nextDay=!0,e._a[Ye]=0),e._d=(e._useUTC?Jn:dh).apply(null,a),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ye]=24),e._w&&typeof e._w.d!="undefined"&&e._w.d!==l&&(re(e).weekdayMismatch=!0)}}function lm(e){var t,n,a,i,l,o,r,s,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(l=1,o=4,n=Cn(t.GG,e._a[Qe],Xn(Pe(),1,4).year),a=Cn(t.W,1),i=Cn(t.E,1),(i<1||i>7)&&(s=!0)):(l=e._locale._week.dow,o=e._locale._week.doy,u=Xn(Pe(),l,o),n=Cn(t.gg,e._a[Qe],u.year),a=Cn(t.w,u.week),t.d!=null?(i=t.d,(i<0||i>6)&&(s=!0)):t.e!=null?(i=t.e+l,(t.e<0||t.e>6)&&(s=!0)):i=l),a<1||a>Rt(n,l,o)?re(e)._overflowWeeks=!0:s!=null?re(e)._overflowWeekday=!0:(r=vr(n,a,i,l,o),e._a[Qe]=r.year,e._dayOfYear=r.dayOfYear)}R.ISO_8601=function(){};R.RFC_2822=function(){};function ml(e){if(e._f===R.ISO_8601){wr(e);return}if(e._f===R.RFC_2822){Sr(e);return}e._a=[],re(e).empty=!0;var t=""+e._i,n,a,i,l,o,r=t.length,s=0,u,d;for(i=ar(e._f,e._locale).match(il)||[],d=i.length,n=0;n0&&re(e).unusedInput.push(o),t=t.slice(t.indexOf(a)+a.length),s+=a.length),Pn[l]?(a?re(e).empty=!1:re(e).unusedTokens.push(l),Gf(l,a,e)):e._strict&&!a&&re(e).unusedTokens.push(l);re(e).charsLeftOver=r-s,t.length>0&&re(e).unusedInput.push(t),e._a[Ye]<=12&&re(e).bigHour===!0&&e._a[Ye]>0&&(re(e).bigHour=void 0),re(e).parsedDateParts=e._a.slice(0),re(e).meridiem=e._meridiem,e._a[Ye]=om(e._locale,e._a[Ye],e._meridiem),u=re(e).era,u!==null&&(e._a[Qe]=e._locale.erasConvertYear(u,e._a[Qe])),hl(e),fl(e)}function om(e,t,n){var a;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(a=e.isPM(n),a&&t<12&&(t+=12),!a&&t===12&&(t=0)),t)}function rm(e){var t,n,a,i,l,o,r=!1,s=e._f.length;if(s===0){re(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;ithis?this:e:Ua()});function Tr(e,t){var n,a;if(t.length===1&&pt(t[0])&&(t=t[0]),!t.length)return Pe();for(n=t[0],a=1;athis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Pm(){if(!tt(this._isDSTShifted))return this._isDSTShifted;var e={},t;return nl(e,this),e=kr(e),e._a?(t=e._isUTC?Dt(e._a):Pe(e._a),this._isDSTShifted=this.isValid()&&bm(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dm(){return this.isValid()?!this._isUTC:!1}function $m(){return this.isValid()?this._isUTC:!1}function qr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xm=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Im=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function wt(e,t){var n=e,a=null,i,l,o;return va(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:Bt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(a=xm.exec(e))?(i=a[1]==="-"?-1:1,n={y:0,d:ue(a[Mt])*i,h:ue(a[Ye])*i,m:ue(a[yt])*i,s:ue(a[Lt])*i,ms:ue(Ei(a[sn]*1e3))*i}):(a=Im.exec(e))?(i=a[1]==="-"?-1:1,n={y:ln(a[2],i),M:ln(a[3],i),w:ln(a[4],i),d:ln(a[5],i),h:ln(a[6],i),m:ln(a[7],i),s:ln(a[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=Am(Pe(n.from),Pe(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),l=new Ja(n),va(e)&&ye(e,"_locale")&&(l._locale=e._locale),va(e)&&ye(e,"_isValid")&&(l._isValid=e._isValid),l}wt.fn=Ja.prototype;wt.invalid=pm;function ln(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function eo(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Am(e,t){var n;return e.isValid()&&t.isValid()?(t=vl(t,e),e.isBefore(t)?n=eo(e,t):(n=eo(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Pr(e,t){return function(n,a){var i,l;return a!==null&&!isNaN(+a)&&(nr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),l=n,n=a,a=l),i=wt(n,a),Dr(this,i,e),this}}function Dr(e,t,n,a){var i=t._milliseconds,l=Ei(t._days),o=Ei(t._months);!e.isValid()||(a=a==null?!0:a,o&&fr(e,Da(e,"Month")+o*n),l&&lr(e,"Date",Da(e,"Date")+l*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&R.updateOffset(e,l||o))}var Om=Pr(1,"add"),Em=Pr(-1,"subtract");function $r(e){return typeof e=="string"||e instanceof String}function Nm(e){return bt(e)||la(e)||$r(e)||Bt(e)||Rm(e)||Lm(e)||e===null||e===void 0}function Lm(e){var t=cn(e)&&!el(e),n=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,l,o=a.length;for(i=0;in.valueOf():n.valueOf()9999?ga(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):$t(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ga(n,"Z")):ga(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jm(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,a,i,l;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",l=t+'[")]',this.format(n+a+i+l)}function Xm(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=ga(this,e);return this.localeData().postformat(t)}function eg(e,t){return this.isValid()&&(bt(e)&&e.isValid()||Pe(e).isValid())?wt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function tg(e){return this.from(Pe(),e)}function ng(e,t){return this.isValid()&&(bt(e)&&e.isValid()||Pe(e).isValid())?wt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ag(e){return this.to(Pe(),e)}function xr(e){var t;return e===void 0?this._locale._abbr:(t=Yt(e),t!=null&&(this._locale=t),this)}var Ir=ht("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Ar(){return this._locale}var Ia=1e3,Dn=60*Ia,Aa=60*Dn,Or=(365*400+97)*24*Aa;function $n(e,t){return(e%t+t)%t}function Er(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Or:new Date(e,t,n).valueOf()}function Nr(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Or:Date.UTC(e,t,n)}function ig(e){var t,n;if(e=mt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Nr:Er,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=$n(t+(this._isUTC?0:this.utcOffset()*Dn),Aa);break;case"minute":t=this._d.valueOf(),t-=$n(t,Dn);break;case"second":t=this._d.valueOf(),t-=$n(t,Ia);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function lg(e){var t,n;if(e=mt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Nr:Er,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Aa-$n(t+(this._isUTC?0:this.utcOffset()*Dn),Aa)-1;break;case"minute":t=this._d.valueOf(),t+=Dn-$n(t,Dn)-1;break;case"second":t=this._d.valueOf(),t+=Ia-$n(t,Ia)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function og(){return this._d.valueOf()-(this._offset||0)*6e4}function rg(){return Math.floor(this.valueOf()/1e3)}function sg(){return new Date(this.valueOf())}function ug(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function cg(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function dg(){return this.isValid()?this.toISOString():null}function fg(){return tl(this)}function hg(){return Gt({},re(this))}function mg(){return re(this).overflow}function gg(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}K("N",0,0,"eraAbbr");K("NN",0,0,"eraAbbr");K("NNN",0,0,"eraAbbr");K("NNNN",0,0,"eraName");K("NNNNN",0,0,"eraNarrow");K("y",["y",1],"yo","eraYear");K("y",["yy",2],0,"eraYear");K("y",["yyy",3],0,"eraYear");K("y",["yyyy",4],0,"eraYear");Y("N",yl);Y("NN",yl);Y("NNN",yl);Y("NNNN",Mg);Y("NNNNN",qg);Te(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,a){var i=n._locale.erasParse(e,a,n._strict);i?re(n).era=i:re(n).invalidEra=e});Y("y",Bn);Y("yy",Bn);Y("yyy",Bn);Y("yyyy",Bn);Y("yo",Pg);Te(["y","yy","yyy","yyyy"],Qe);Te(["yo"],function(e,t,n,a){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Qe]=n._locale.eraYearOrdinalParse(e,i):t[Qe]=parseInt(e,10)});function vg(e,t){var n,a,i,l=this._eras||Yt("en")._eras;for(n=0,a=l.length;n=0)return l[a]}function pg(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}function bg(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;el&&(t=l),Eg.call(this,e,t,n,a,i))}function Eg(e,t,n,a,i){var l=vr(e,t,n,a,i),o=Jn(l.year,0,l.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}K("Q",0,"Qo","quarter");Ge("quarter","Q");Ze("quarter",7);Y("Q",or);Te("Q",function(e,t){t[Nt]=(ue(e)-1)*3});function Ng(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}K("D",["DD",2],"Do","date");Ge("date","D");Ze("date",9);Y("D",De);Y("DD",De,st);Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});Te(["D","DD"],Mt);Te("Do",function(e,t){t[Mt]=ue(e.match(De)[0])});var Rr=Rn("Date",!0);K("DDD",["DDDD",3],"DDDo","dayOfYear");Ge("dayOfYear","DDD");Ze("dayOfYear",4);Y("DDD",Wa);Y("DDDD",rr);Te(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ue(e)});function Lg(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}K("m",["mm",2],0,"minute");Ge("minute","m");Ze("minute",14);Y("m",De);Y("mm",De,st);Te(["m","mm"],yt);var Rg=Rn("Minutes",!1);K("s",["ss",2],0,"second");Ge("second","s");Ze("second",15);Y("s",De);Y("ss",De,st);Te(["s","ss"],Lt);var Bg=Rn("Seconds",!1);K("S",0,0,function(){return~~(this.millisecond()/100)});K(0,["SS",2],0,function(){return~~(this.millisecond()/10)});K(0,["SSS",3],0,"millisecond");K(0,["SSSS",4],0,function(){return this.millisecond()*10});K(0,["SSSSS",5],0,function(){return this.millisecond()*100});K(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});K(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});K(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});K(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ge("millisecond","ms");Ze("millisecond",16);Y("S",Wa,or);Y("SS",Wa,st);Y("SSS",Wa,rr);var Zt,Br;for(Zt="SSSS";Zt.length<=9;Zt+="S")Y(Zt,Bn);function Vg(e,t){t[sn]=ue(("0."+e)*1e3)}for(Zt="S";Zt.length<=9;Zt+="S")Te(Zt,Vg);Br=Rn("Milliseconds",!1);K("z",0,0,"zoneAbbr");K("zz",0,0,"zoneName");function Fg(){return this._isUTC?"UTC":""}function Yg(){return this._isUTC?"Coordinated Universal Time":""}var D=oa.prototype;D.add=Om;D.calendar=Fm;D.clone=Ym;D.diff=Km;D.endOf=lg;D.format=Xm;D.from=eg;D.fromNow=tg;D.to=ng;D.toNow=ag;D.get=Hf;D.invalidAt=mg;D.isAfter=Um;D.isBefore=Hm;D.isBetween=zm;D.isSame=Wm;D.isSameOrAfter=jm;D.isSameOrBefore=Qm;D.isValid=fg;D.lang=Ir;D.locale=xr;D.localeData=Ar;D.max=fm;D.min=dm;D.parsingFlags=hg;D.set=zf;D.startOf=ig;D.subtract=Em;D.toArray=ug;D.toObject=cg;D.toDate=sg;D.toISOString=Zm;D.inspect=Jm;typeof Symbol!="undefined"&&Symbol.for!=null&&(D[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});D.toJSON=dg;D.toString=Gm;D.unix=rg;D.valueOf=og;D.creationData=gg;D.eraName=bg;D.eraNarrow=_g;D.eraAbbr=wg;D.eraYear=Sg;D.year=gr;D.isLeapYear=ch;D.weekYear=Dg;D.isoWeekYear=$g;D.quarter=D.quarters=Ng;D.month=hr;D.daysInMonth=rh;D.week=D.weeks=vh;D.isoWeek=D.isoWeeks=yh;D.weeksInYear=Ag;D.weeksInWeekYear=Og;D.isoWeeksInYear=xg;D.isoWeeksInISOWeekYear=Ig;D.date=Rr;D.day=D.days=$h;D.weekday=xh;D.isoWeekday=Ih;D.dayOfYear=Lg;D.hour=D.hours=Bh;D.minute=D.minutes=Rg;D.second=D.seconds=Bg;D.millisecond=D.milliseconds=Br;D.utcOffset=wm;D.utc=km;D.local=Cm;D.parseZone=Tm;D.hasAlignedHourOffset=Mm;D.isDST=qm;D.isLocal=Dm;D.isUtcOffset=$m;D.isUtc=qr;D.isUTC=qr;D.zoneAbbr=Fg;D.zoneName=Yg;D.dates=ht("dates accessor is deprecated. Use date instead.",Rr);D.months=ht("months accessor is deprecated. Use month instead",hr);D.years=ht("years accessor is deprecated. Use year instead",gr);D.zone=ht("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Sm);D.isDSTShifted=ht("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Pm);function Ug(e){return Pe(e*1e3)}function Hg(){return Pe.apply(null,arguments).parseZone()}function Vr(e){return e}var pe=al.prototype;pe.calendar=$f;pe.longDateFormat=Of;pe.invalidDate=Nf;pe.ordinal=Bf;pe.preparse=Vr;pe.postformat=Vr;pe.relativeTime=Ff;pe.pastFuture=Yf;pe.set=Pf;pe.eras=vg;pe.erasParse=yg;pe.erasConvertYear=pg;pe.erasAbbrRegex=Cg;pe.erasNameRegex=kg;pe.erasNarrowRegex=Tg;pe.months=ah;pe.monthsShort=ih;pe.monthsParse=oh;pe.monthsRegex=uh;pe.monthsShortRegex=sh;pe.week=fh;pe.firstDayOfYear=gh;pe.firstDayOfWeek=mh;pe.weekdays=Th;pe.weekdaysMin=qh;pe.weekdaysShort=Mh;pe.weekdaysParse=Dh;pe.weekdaysRegex=Ah;pe.weekdaysShortRegex=Oh;pe.weekdaysMinRegex=Eh;pe.isPM=Lh;pe.meridiem=Vh;function Oa(e,t,n,a){var i=Yt(),l=Dt().set(a,t);return i[n](l,e)}function Fr(e,t,n){if(Bt(e)&&(t=e,e=void 0),e=e||"",t!=null)return Oa(e,t,n,"month");var a,i=[];for(a=0;a<12;a++)i[a]=Oa(e,a,n,"month");return i}function bl(e,t,n,a){typeof e=="boolean"?(Bt(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,Bt(t)&&(n=t,t=void 0),t=t||"");var i=Yt(),l=e?i._week.dow:0,o,r=[];if(n!=null)return Oa(t,(n+l)%7,a,"day");for(o=0;o<7;o++)r[o]=Oa(t,(o+l)%7,a,"day");return r}function zg(e,t){return Fr(e,t,"months")}function Wg(e,t){return Fr(e,t,"monthsShort")}function jg(e,t,n){return bl(e,t,n,"weekdays")}function Qg(e,t,n){return bl(e,t,n,"weekdaysShort")}function Kg(e,t,n){return bl(e,t,n,"weekdaysMin")}Jt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=ue(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});R.lang=ht("moment.lang is deprecated. Use moment.locale instead.",Jt);R.langData=ht("moment.langData is deprecated. Use moment.localeData instead.",Yt);var At=Math.abs;function Gg(){var e=this._data;return this._milliseconds=At(this._milliseconds),this._days=At(this._days),this._months=At(this._months),e.milliseconds=At(e.milliseconds),e.seconds=At(e.seconds),e.minutes=At(e.minutes),e.hours=At(e.hours),e.months=At(e.months),e.years=At(e.years),this}function Yr(e,t,n,a){var i=wt(t,n);return e._milliseconds+=a*i._milliseconds,e._days+=a*i._days,e._months+=a*i._months,e._bubble()}function Zg(e,t){return Yr(this,e,t,1)}function Jg(e,t){return Yr(this,e,t,-1)}function to(e){return e<0?Math.floor(e):Math.ceil(e)}function Xg(){var e=this._milliseconds,t=this._days,n=this._months,a=this._data,i,l,o,r,s;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=to(Li(n)+t)*864e5,t=0,n=0),a.milliseconds=e%1e3,i=ft(e/1e3),a.seconds=i%60,l=ft(i/60),a.minutes=l%60,o=ft(l/60),a.hours=o%24,t+=ft(o/24),s=ft(Ur(t)),n+=s,t-=to(Li(s)),r=ft(n/12),n%=12,a.days=t,a.months=n,a.years=r,this}function Ur(e){return e*4800/146097}function Li(e){return e*146097/4800}function ev(e){if(!this.isValid())return NaN;var t,n,a=this._milliseconds;if(e=mt(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+a/864e5,n=this._months+Ur(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Li(this._months)),e){case"week":return t/7+a/6048e5;case"day":return t+a/864e5;case"hour":return t*24+a/36e5;case"minute":return t*1440+a/6e4;case"second":return t*86400+a/1e3;case"millisecond":return Math.floor(t*864e5)+a;default:throw new Error("Unknown unit "+e)}}function tv(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+ue(this._months/12)*31536e6:NaN}function Ut(e){return function(){return this.as(e)}}var nv=Ut("ms"),av=Ut("s"),iv=Ut("m"),lv=Ut("h"),ov=Ut("d"),rv=Ut("w"),sv=Ut("M"),uv=Ut("Q"),cv=Ut("y");function dv(){return wt(this)}function fv(e){return e=mt(e),this.isValid()?this[e+"s"]():NaN}function hn(e){return function(){return this.isValid()?this._data[e]:NaN}}var hv=hn("milliseconds"),mv=hn("seconds"),gv=hn("minutes"),vv=hn("hours"),yv=hn("days"),pv=hn("months"),bv=hn("years");function _v(){return ft(this.days()/7)}var Ot=Math.round,Tn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function wv(e,t,n,a,i){return i.relativeTime(t||1,!!n,e,a)}function Sv(e,t,n,a){var i=wt(e).abs(),l=Ot(i.as("s")),o=Ot(i.as("m")),r=Ot(i.as("h")),s=Ot(i.as("d")),u=Ot(i.as("M")),d=Ot(i.as("w")),v=Ot(i.as("y")),y=l<=n.ss&&["s",l]||l0,y[4]=a,wv.apply(null,y)}function kv(e){return e===void 0?Ot:typeof e=="function"?(Ot=e,!0):!1}function Cv(e,t){return Tn[e]===void 0?!1:t===void 0?Tn[e]:(Tn[e]=t,e==="s"&&(Tn.ss=t-1),!0)}function Tv(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,a=Tn,i,l;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(a=Object.assign({},Tn,t),t.s!=null&&t.ss==null&&(a.ss=t.s-1)),i=this.localeData(),l=Sv(this,!n,a,i),n&&(l=i.pastFuture(+this,l)),i.postformat(l)}var _i=Math.abs;function wn(e){return(e>0)-(e<0)||+e}function ei(){if(!this.isValid())return this.localeData().invalidDate();var e=_i(this._milliseconds)/1e3,t=_i(this._days),n=_i(this._months),a,i,l,o,r=this.asSeconds(),s,u,d,v;return r?(a=ft(e/60),i=ft(a/60),e%=60,a%=60,l=ft(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=r<0?"-":"",u=wn(this._months)!==wn(r)?"-":"",d=wn(this._days)!==wn(r)?"-":"",v=wn(this._milliseconds)!==wn(r)?"-":"",s+"P"+(l?u+l+"Y":"")+(n?u+n+"M":"")+(t?d+t+"D":"")+(i||a||e?"T":"")+(i?v+i+"H":"")+(a?v+a+"M":"")+(e?v+o+"S":"")):"P0D"}var he=Ja.prototype;he.isValid=ym;he.abs=Gg;he.add=Zg;he.subtract=Jg;he.as=ev;he.asMilliseconds=nv;he.asSeconds=av;he.asMinutes=iv;he.asHours=lv;he.asDays=ov;he.asWeeks=rv;he.asMonths=sv;he.asQuarters=uv;he.asYears=cv;he.valueOf=tv;he._bubble=Xg;he.clone=dv;he.get=fv;he.milliseconds=hv;he.seconds=mv;he.minutes=gv;he.hours=vv;he.days=yv;he.weeks=_v;he.months=pv;he.years=bv;he.humanize=Tv;he.toISOString=ei;he.toString=ei;he.toJSON=ei;he.locale=xr;he.localeData=Ar;he.toIsoString=ht("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ei);he.lang=Ir;K("X",0,0,"unix");K("x",0,0,"valueOf");Y("x",Qa);Y("X",jf);Te("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});Te("x",function(e,t,n){n._d=new Date(ue(e))});//! moment.js +R.version="2.29.4";Mf(Pe);R.fn=D;R.min=hm;R.max=mm;R.now=gm;R.utc=Dt;R.unix=Ug;R.months=zg;R.isDate=la;R.locale=Jt;R.invalid=Ua;R.duration=wt;R.isMoment=bt;R.weekdays=jg;R.parseZone=Hg;R.localeData=Yt;R.isDuration=va;R.monthsShort=Wg;R.weekdaysMin=Kg;R.defineLocale=dl;R.updateLocale=Hh;R.locales=zh;R.weekdaysShort=Qg;R.normalizeUnits=mt;R.relativeTimeRounding=kv;R.relativeTimeThreshold=Cv;R.calendarFormat=Vm;R.prototype=D;R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Mv=ot({name:"CustomerOrders",props:["orders","products","stalls","merchants"],data:function(){return{}},computed:{merchantOrders:function(){return Object.keys(this.orders).map(e=>({pubkey:e,profile:this.merchantProfile(e),orders:this.orders[e].map(this.enrichOrder)}))}},methods:{enrichOrder:function(e){var n;const t=this.stallForOrder(e);return{...e,stallName:(t==null?void 0:t.name)||"Stall",shippingZone:((n=t==null?void 0:t.shipping)==null?void 0:n.find(a=>a.id===e.shipping_id))||{id:e.shipping_id,name:e.shipping_id},invoice:this.invoiceForOrder(e),products:this.getProductsForOrder(e)}},stallForOrder:function(e){var t;try{const n=e.items&&((t=e.items[0])==null?void 0:t.product_id);if(!n)return;const a=this.products.find(l=>l.id===n);if(!a)return;const i=this.stalls.find(l=>l.id===a.stall_id);return i||void 0}catch(n){console.log(n)}},invoiceForOrder:function(e){var t;try{const n=(t=e==null?void 0:e.payment_options)==null?void 0:t.find(a=>a.type==="ln");return n!=null&&n.link?decode(n.link):void 0}catch(n){console.warn(n)}},merchantProfile:function(e){const t=this.merchants.find(n=>n.publicKey===e);return t==null?void 0:t.profile},getProductsForOrder:function(e){var t;return(t=e==null?void 0:e.items)!=null&&t.length?e.items.map(n=>({...this.products.find(i=>i.id===n.product_id)||{id:n.product_id,name:n.product_id},orderedQuantity:n.quantity})):[]},showInvoice:function(e){var n;if(e.paid)return;const t=(n=e==null?void 0:e.payment_options)==null?void 0:n.find(a=>a.type==="ln").link;!t||this.$emit("show-invoice",t)},formatCurrency:function(e,t){return formatCurrency(e,t)},fromNow:function(e){return e?R(e*1e3).fromNow():""}},created(){}}),qv=m("strong",null,"No orders!",-1),Pv=["src"],Dv=["src"],$v=["textContent"],xv=["textContent"],Iv=["textContent"],Av=["textContent"],Ov={class:"text-caption text-grey ellipsis-2-lines"},Ev={key:0},Nv=["textContent"],Lv=["textContent"],Rv=["textContent"],Bv={class:"text-caption text-grey ellipsis-2-lines"},Vv=["textContent"],Fv=["textContent"],Yv=m("strong",null,"Order ID: ",-1),Uv=["textContent"],Hv=m("strong",null,"Products",-1),zv=["src"],Wv=["src"],jv={class:"text-caption text-grey ellipsis-2-lines"},Qv=m("strong",null,"Shipping Zone: ",-1),Kv=["textContent"],Gv=m("strong",null,"Message: ",-1),Zv=["textContent"],Jv=m("strong",null,"Invoice: ",-1),Xv=["textContent"];function e0(e,t,n,a,i,l){var o;return S(),V("div",null,[(o=e.merchantOrders)!=null&&o.length?fe("",!0):(S(),j(lt,{key:0,bordered:"",class:"q-mb-md"},{default:f(()=>[c(we,null,{default:f(()=>[qv]),_:1})]),_:1})),(S(!0),V(et,null,at(e.merchantOrders,r=>(S(),V("div",{key:r.id},[c(lt,{bordered:"",class:"q-mb-md"},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>{var s,u;return[(s=r.profile)!=null&&s.picture?(S(),V("img",{key:0,src:(u=r.profile)==null?void 0:u.picture},null,8,Pv)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/blank-avatar.webp"},null,8,Dv))]}),_:2},1024)]),_:2},1024),c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>{var s;return[m("strong",null,[m("span",{textContent:W((s=r.profile)==null?void 0:s.name)},null,8,$v)])]}),_:2},1024),c(se,{caption:""},{default:f(()=>[m("span",{class:"ellipsis-2-lines text-wrap",textContent:W(r.pubkey)},null,8,xv)]),_:2},1024)]),_:2},1024)]),_:2},1024),c(Ae),c(we,{class:"col-12"},{default:f(()=>[c(Qt,null,{default:f(()=>[(S(!0),V(et,null,at(r.orders,s=>(S(),V("div",{key:s.id,class:"q-mb-md"},[c(Tf,{dense:"","expand-separator":""},{header:f(()=>[c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se,null,{default:f(()=>{var u,d;return[m("strong",null,[m("span",{textContent:W(s.stallName)},null,8,Iv)]),(d=(u=s.invoice)==null?void 0:u.human_readable_part)!=null&&d.amount?(S(),j(rn,{key:0,onClick:v=>e.showInvoice(s),color:"orange",class:"q-ml-lg gt-sm"},{default:f(()=>{var v,y;return[m("span",{textContent:W(e.formatCurrency(((y=(v=s.invoice)==null?void 0:v.human_readable_part)==null?void 0:y.amount)/1e3,"sat"))},null,8,Av)]}),_:2},1032,["onClick"])):fe("",!0)]}),_:2},1024),c(se,null,{default:f(()=>[m("div",Ov,[s.createdAt?(S(),V("p",Ev,[m("span",{textContent:W(e.fromNow(s.createdAt))},null,8,Nv)])):fe("",!0)])]),_:2},1024)]),_:2},1024),c(ae,{side:""},{default:f(()=>[c(se,null,{default:f(()=>[c(rn,{color:s.paid?"green":"grey"},{default:f(()=>[m("span",{textContent:W(s.paid?"Paid":"Not Paid")},null,8,Lv)]),_:2},1032,["color"]),c(rn,{color:s.shipped?"green":"grey",class:"q-ml-md"},{default:f(()=>[m("span",{textContent:W(s.shipped?"Shipped":"Not Shipped")},null,8,Rv)]),_:2},1032,["color"])]),_:2},1024),c(se,null,{default:f(()=>{var u,d;return[m("div",Bv,[m("p",null,[m("span",{textContent:W((u=s.items)==null?void 0:u.length)},null,8,Vv),m("span",{textContent:W(((d=s.items)==null?void 0:d.length)===1?"product":"products")},null,8,Fv)])])]}),_:2},1024)]),_:2},1024)]),default:f(()=>[c(Ae),c(we,{class:"col-12"},{default:f(()=>[c(ae,null,{default:f(()=>[c(se,null,{default:f(()=>[Yv,oe(),m("span",{class:"ellipsis-2-lines text-wrap",textContent:W(s.id)},null,8,Uv)]),_:2},1024)]),_:2},1024)]),_:2},1024),c(Ae),c(we,{horizontal:""},{default:f(()=>[c(we,{class:"col-7"},{default:f(()=>[c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se,null,{default:f(()=>[Hv]),_:1})]),_:1}),(S(!0),V(et,null,at(s.products,u=>(S(),j(nt,{key:u.id},{default:f(()=>[c(ae,{avatar:""},{default:f(()=>[c(vt,null,{default:f(()=>[u.images&&u.images[0]||u.image?(S(),V("img",{key:0,src:u.images[0]||u.image},null,8,zv)):(S(),V("img",{key:1,src:e.$q.config.staticPath+"/images/placeholder.png"},null,8,Wv))]),_:2},1024)]),_:2},1024),c(ae,{class:"q-mt-sm"},{default:f(()=>[c(se),c(se,null,{default:f(()=>[m("strong",null,W(u.orderedQuantity)+" x "+W(u.name),1)]),_:2},1024),c(se,null,{default:f(()=>[m("div",jv,[m("p",null,W(u.description),1)])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024),c(Ae,{vertical:""}),c(we,null,{default:f(()=>[c(ae,{class:"q-mt-md q-ml-sm"},{default:f(()=>[c(se,null,{default:f(()=>{var u;return[Qv,m("span",{textContent:W(((u=s.shippingZone)==null?void 0:u.name)||"")},null,8,Kv)]}),_:2},1024)]),_:2},1024),s.message?(S(),j(ae,{key:0,class:"q-mt-md q-ml-sm"},{default:f(()=>[c(se,null,{default:f(()=>[Gv,m("span",{textContent:W(s.message)},null,8,Zv)]),_:2},1024)]),_:2},1024)):fe("",!0),c(ae,{class:"q-mt-md q-ml-sm"},{default:f(()=>[c(se,null,{default:f(()=>{var u,d;return[Jv,(d=(u=s.invoice)==null?void 0:u.human_readable_part)!=null&&d.amount?(S(),j(rn,{key:0,onClick:v=>e.showInvoice(s),color:"orange",class:"cursor-pointer"},{default:f(()=>{var v,y;return[m("span",{textContent:W(e.formatCurrency(((y=(v=s.invoice)==null?void 0:v.human_readable_part)==null?void 0:y.amount)/1e3,"sat"))},null,8,Xv)]}),_:2},1032,["onClick"])):fe("",!0)]}),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024),c(Ae,{class:"q-mb-xl"})]),_:2},1024),c(Ae)]))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128))])}var t0=_t(Mv,[["render",e0]]),n0=Se({name:"QCarouselSlide",props:{...Wo,imgSrc:String},setup(e,{slots:t}){const n=k(()=>e.imgSrc?{backgroundImage:`url("${e.imgSrc}")`}:{});return()=>_("div",{class:"q-carousel__slide",style:n.value},Ee(t.default))}});let Hn=0;const a0={fullscreen:Boolean,noRouteFullscreenExit:Boolean},i0=["update:fullscreen","fullscreen"];function l0(){const e=Fe(),{props:t,emit:n,proxy:a}=e;let i,l,o;const r=Q(!1);Ns(e)===!0&&de(()=>a.$route.fullPath,()=>{t.noRouteFullscreenExit!==!0&&d()}),de(()=>t.fullscreen,v=>{r.value!==v&&s()}),de(r,v=>{n("update:fullscreen",v),n("fullscreen",v)});function s(){r.value===!0?d():u()}function u(){r.value!==!0&&(r.value=!0,o=a.$el.parentNode,o.replaceChild(l,a.$el),document.body.appendChild(a.$el),Hn++,Hn===1&&document.body.classList.add("q-body--fullscreen-mixin"),i={handler:d},Nl.add(i))}function d(){r.value===!0&&(i!==void 0&&(Nl.remove(i),i=void 0),o.replaceChild(a.$el,l),r.value=!1,Hn=Math.max(0,Hn-1),Hn===0&&(document.body.classList.remove("q-body--fullscreen-mixin"),a.$el.scrollIntoView!==void 0&&setTimeout(()=>{a.$el.scrollIntoView()})))}return Ui(()=>{l=document.createElement("span")}),fn(()=>{t.fullscreen===!0&&u()}),Ke(d),Object.assign(a,{toggleFullscreen:s,setFullscreen:u,exitFullscreen:d}),{inFullscreen:r,toggleFullscreen:s}}const o0=["top","right","bottom","left"],r0=["regular","flat","outline","push","unelevated"];var s0=Se({name:"QCarousel",props:{...Vt,...jo,...a0,transitionPrev:{type:String,default:"fade"},transitionNext:{type:String,default:"fade"},height:String,padding:Boolean,controlColor:String,controlTextColor:String,controlType:{type:String,validator:e=>r0.includes(e),default:"flat"},autoplay:[Number,Boolean],arrows:Boolean,prevIcon:String,nextIcon:String,navigation:Boolean,navigationPosition:{type:String,validator:e=>o0.includes(e)},navigationIcon:String,navigationActiveIcon:String,thumbnails:Boolean},emits:[...i0,...Qo],setup(e,{slots:t}){const{proxy:{$q:n}}=Fe(),a=Ft(e,n);let i=null,l;const{updatePanelsList:o,getPanelContent:r,panelDirectives:s,goToPanel:u,previousPanel:d,nextPanel:v,getEnabledPanels:y,panelIndex:g}=Ko(),{inFullscreen:C}=l0(),w=k(()=>C.value!==!0&&e.height!==void 0?{height:e.height}:{}),T=k(()=>e.vertical===!0?"vertical":"horizontal"),q=k(()=>`q-carousel q-panel-parent q-carousel--with${e.padding===!0?"":"out"}-padding`+(C.value===!0?" fullscreen":"")+(a.value===!0?" q-carousel--dark q-dark":"")+(e.arrows===!0?` q-carousel--arrows-${T.value}`:"")+(e.navigation===!0?` q-carousel--navigation-${M.value}`:"")),P=k(()=>{const Z=[e.prevIcon||n.iconSet.carousel[e.vertical===!0?"up":"left"],e.nextIcon||n.iconSet.carousel[e.vertical===!0?"down":"right"]];return e.vertical===!1&&n.lang.rtl===!0?Z.reverse():Z}),p=k(()=>e.navigationIcon||n.iconSet.carousel.navigationIcon),b=k(()=>e.navigationActiveIcon||p.value),M=k(()=>e.navigationPosition||(e.vertical===!0?"right":"bottom")),B=k(()=>({color:e.controlColor,textColor:e.controlTextColor,round:!0,[e.controlType]:!0,dense:!0}));de(()=>e.modelValue,()=>{e.autoplay&&x()}),de(()=>e.autoplay,Z=>{Z?x():i!==null&&(clearTimeout(i),i=null)});function x(){const Z=Ls(e.autoplay)===!0?Math.abs(e.autoplay):5e3;i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,Z>=0?v():d()},Z)}fn(()=>{e.autoplay&&x()}),Ke(()=>{i!==null&&clearTimeout(i)});function $(Z,ce){return _("div",{class:`q-carousel__control q-carousel__navigation no-wrap absolute flex q-carousel__navigation--${Z} q-carousel__navigation--${M.value}`+(e.controlColor!==void 0?` text-${e.controlColor}`:"")},[_("div",{class:"q-carousel__navigation-inner flex flex-center no-wrap"},y().map(ce))])}function G(){const Z=[];if(e.navigation===!0){const ce=t["navigation-icon"]!==void 0?t["navigation-icon"]:E=>_(ee,{key:"nav"+E.name,class:`q-carousel__navigation-icon q-carousel__navigation-icon--${E.active===!0?"":"in"}active`,...E.btnProps,onClick:E.onClick}),$e=l-1;Z.push($("buttons",(E,le)=>{const ve=E.props.name,ke=g.value===le;return ce({index:le,maxIndex:$e,name:ve,active:ke,btnProps:{icon:ke===!0?b.value:p.value,size:"sm",...B.value},onClick:()=>{u(ve)}})}))}else if(e.thumbnails===!0){const ce=e.controlColor!==void 0?` text-${e.controlColor}`:"";Z.push($("thumbnails",$e=>{const E=$e.props;return _("img",{key:"tmb#"+E.name,class:`q-carousel__thumbnail q-carousel__thumbnail--${E.name===e.modelValue?"":"in"}active`+ce,src:E.imgSrc||E["img-src"],onClick:()=>{u(E.name)}})}))}return e.arrows===!0&&g.value>=0&&((e.infinite===!0||g.value>0)&&Z.push(_("div",{key:"prev",class:`q-carousel__control q-carousel__arrow q-carousel__prev-arrow q-carousel__prev-arrow--${T.value} absolute flex flex-center`},[_(ee,{icon:P.value[0],...B.value,onClick:d})])),(e.infinite===!0||g.value(l=o(t),_("div",{class:q.value,style:w.value},[Yi("div",{class:"q-carousel__slides-container"},r(),"sl-cont",e.swipeable,()=>s.value)].concat(G())))}});const u0=ot({name:"ProductDetail",props:["product","add-to-cart"],data:function(){return{slide:1}},computed:{},methods:{},created(){}}),c0={class:"row"},d0={class:"col-lg-5 col-md-5 col-sm-12 col-xs-12 q-mt-sm"},f0={key:0,class:"q-pr-md"},h0={key:1,class:"q-pr-md"},m0={class:"col-lg-7 col-md-7 col-sm-12 col-xs-12 q-mt-sm"},g0={class:"row"},v0={class:"text-subtitle1 q-mt-sm q-pt-xs"},y0={key:0,class:"text-subtitle1"},p0={class:"q-mt-sm text-weight-bold"},b0={key:0},_0={class:"text-h6"},w0={class:"q-ml-sm text-grey-6"},S0={key:1},k0={class:"text-h6"},C0={class:"q-ml-md text-caption text-green-8 text-weight-bolder q-mt-md"},T0={class:"q-mt-md"};function M0(e,t,n,a,i,l){return S(),V("div",c0,[m("div",d0,[e.product.images&&e.product.images[0]?(S(),V("div",f0,[c(s0,{swipeable:"",animated:"",modelValue:e.slide,"onUpdate:modelValue":t[0]||(t[0]=o=>e.slide=o),thumbnails:"",infinite:"",arrows:"","transition-prev":"slide-right","transition-next":"slide-left","navigation-icon":"radio_button_unchecked","control-type":"regular","control-color":"secondary","control-text-color":"white"},{default:f(()=>[(S(!0),V(et,null,at(e.product.images,(o,r)=>(S(),j(n0,{name:r+1,key:r,"img-src":o},null,8,["name","img-src"]))),128))]),_:1},8,["modelValue"])])):(S(),V("div",h0,[c(ji,{src:e.$q.config.staticPath+"/images/placeholder.png",ratio:16/9},null,8,["src"])]))]),m("div",m0,[c(lt,null,{default:f(()=>[c(we,null,{default:f(()=>[m("div",g0,[m("div",{class:Rs(["col-12",e.$q.platform.is.desktop?"":"q-px-md"])},[m("div",v0,W(e.product.name),1),e.product.categories?(S(),V("div",y0,[(S(!0),V(et,null,at(e.product.categories,(o,r)=>(S(),j(aa,{key:r,dense:""},{default:f(()=>[oe(W(o),1)]),_:2},1024))),128))])):fe("",!0),m("div",p0,W(e.product.description),1),m("div",null,[e.product.currency=="sat"?(S(),V("span",b0,[m("span",_0,W(e.product.price)+" sats",1),m("span",w0,"BTC "+W((e.product.price/1e8).toFixed(8)),1)])):(S(),V("span",S0,[m("span",k0,W(e.product.formatedPrice),1)])),m("span",C0,W(e.product.quantity>0?`In + stock. ${e.product.quantity} left.`:"Out of stock."),1)]),m("div",T0,[c(ee,{class:"q-mt-md",color:"primary",rounded:"",icon:"shopping_cart",label:"Add to cart",onClick:t[1]||(t[1]=o=>e.$emit("add-to-cart",e.product))})])],2)])]),_:1})]),_:1})])])}var q0=_t(u0,[["render",M0]]);const P0=ot({name:"CustomerStall",components:{ProductCard:Jo,ProductDetail:q0},props:["stall","products","product-detail"],data:function(){return{}},computed:{product(){if(this.productDetail)return this.products.find(e=>e.id==this.productDetail)}},methods:{changePageS(e,t){var n;e==="stall"&&(t==null?void 0:t.product)&&((n=document.getElementById("product-focus-area"))==null||n.scrollIntoView()),this.$emit("change-page",e,t)},addToCart(e){this.$emit("add-to-cart",e)}}}),D0=m("div",{id:"product-focus-area"},null,-1),$0={key:0,class:"row"},x0={class:"col-12 auto-width"},I0={class:"col-12 q-my-lg"},A0={class:"row q-col-gutter-md"};function O0(e,t,n,a,i,l){const o=Ci("product-detail"),r=Ci("product-card");return S(),V("div",null,[D0,e.productDetail&&e.product?(S(),V("div",$0,[m("div",x0,[c(o,{product:e.product,onAddToCart:e.addToCart},null,8,["product","onAddToCart"])]),m("div",I0,[c(Ae)])])):fe("",!0),m("div",A0,[(S(!0),V(et,null,at(e.products,(s,u)=>(S(),V("div",{class:"col-xs-12 col-sm-6 col-md-4 col-lg-3",key:u},[c(r,{product:s,onChangePage:e.changePageS,onAddToCart:e.addToCart,"is-stall":!0},null,8,["product","onChangePage","onAddToCart"])]))),128))])])}var E0=_t(P0,[["render",O0]]);const N0=ot({name:"CustomerStallList",props:["stalls"],data:function(){return{showStalls:!0}},watch:{stalls(){this.showProducts=!1,setTimeout(()=>{this.showProducts=!0},0)}},computed:{},methods:{},created(){}}),L0={key:0,class:"row q-col-gutter-md"},R0={class:"q-pa-md q-gutter-sm",style:{height:"80px"}},B0=["src"],V0={class:"row no-wrap items-center"},F0={class:"col text-subtitle2 ellipsis-2-lines"},Y0={class:"text-caption text-green-8 text-weight-bolder q-mt-md"},U0=["textContent"],H0=["textContent"],z0={key:0,class:"text-subtitle1"},W0=["textContent"],j0={key:1,class:"text-subtitle1"},Q0={class:"text-caption text-grey ellipsis-2-lines",style:{"min-height":"40px"}},K0={class:"q-ml-auto"};function G0(e,t,n,a,i,l){return e.showStalls?(S(),V("div",L0,[(S(!0),V(et,null,at(e.stalls,o=>(S(),V("div",{key:o.id,class:"col-xs-12 col-sm-6 col-md-4 col-lg-3"},[c(lt,{class:"card--product"},{default:f(()=>[c(we,{class:"q-pb-xs q-pt-md"},{default:f(()=>[m("div",R0,[(S(!0),V(et,null,at(o.images,(r,s)=>(S(),j(vt,{key:s,size:"40px",class:"overlapping",style:Bs(`left: ${s*25}px; border: 2px solid white; position: absolute`)},{default:f(()=>[m("img",{src:r},null,8,B0)]),_:2},1032,["style"]))),128))])]),_:2},1024),c(we,{class:"q-pb-xs q-pt-md"},{default:f(()=>[m("div",V0,[m("div",F0,W(o.name),1)])]),_:2},1024),c(Ae),c(we,{class:"q-pl-sm"},{default:f(()=>[m("div",null,[m("span",Y0,[m("span",{textContent:W(o.productCount)},null,8,U0),oe(" products")]),m("span",{textContent:W(o.currency),class:"float-right"},null,8,H0)])]),_:2},1024),c(we,{class:"q-pl-sm gt-sm"},{default:f(()=>[o.categories?(S(),V("div",z0,[c(Wi,{items:o.categories||[],"virtual-scroll-horizontal":""},{default:f(({item:r,index:s})=>[(S(),j(aa,{key:s,dense:""},{default:f(()=>[m("span",{textContent:W(r)},null,8,W0)]),_:2},1024))]),_:2},1032,["items"])])):(S(),V("div",j0," \xA0 ")),m("div",Q0,[m("p",null,W(o.description||""),1)])]),_:2},1024),c(Ae),c(In,null,{default:f(()=>[m("div",K0,[c(ee,{flat:"",class:"text-weight-bold text-capitalize q-ml-auto float-left",dense:"",color:"primary",onClick:r=>e.$emit("change-page","stall",{stall:o.id})},{default:f(()=>[oe(" Visit Stall ")]),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024)]))),128))])):fe("",!0)}var Z0=_t(N0,[["render",G0]]);const J0={class:"row q-mb-md q-pa-none"},X0=["src"],ey=m("div",{id:"search-text"},null,-1),ty={class:"float-right"},ny=["textContent"],ay={key:0,class:"gt-sm"},iy=["textContent","onClick"],ly=["textContent"],oy={key:1,class:"row q-mb-sm"},ry={class:"col-12 text-center"},sy={key:0,class:"absolute-bottom text-subtitle1 text-center"},uy=["textContent"],cy={class:"row q-mb-sm"},dy={class:"col-md-10 col-sm-1 auto-width"},fy={class:"col-md-2 col-sm-1"},hy={key:9},my=m("strong",{class:"text-h4"},"Welcome to the Nostr Market!",-1),gy=m("strong",{class:"text-h5 q-mt-lg"},"In order to start you can:",-1),vy={class:"text-h6"},yy={class:"text-h6"},py={class:"text-h6"},by=m("code",null,"naddr",-1),_y={key:10},wy=m("div",{class:"text-h6"},"Account Setup",-1),Sy=m("p",null,"Enter your Nostr private key or generate a new one.",-1),ky={class:"text-center q-mb-lg"},Cy={key:0,class:"q-my-lg"},Ty=["textContent"],My=["href"],qy={key:0,ratio:1},Py={key:1},Dy={class:"row q-mt-lg"},$y=ot({name:"MarketPage",components:{MarketConfig:Zo},data:function(){return{account:null,accountMetadata:null,accountDialog:{show:!1,data:{watchOnly:!1,key:null}},markets:[],merchants:[],shoppingCarts:[],checkoutCart:null,checkoutStall:null,activePage:"market",activeOrderId:null,dmSubscriptions:{},qrCodeDialog:{data:{payment_request:null,message:null},dismissMsg:null,show:!1},filterCategories:[],groupByStall:!1,relays:new Set,stalls:[],products:[],orders:{},bannerImage:null,logoImage:null,isLoading:!1,showFilterDetails:!1,searchText:null,activeStall:null,activeProduct:null,pool:null,config:{opts:null},defaultBanner:this.$q.config.staticPath+"/images/nostr-cover.png",defaultLogo:this.$q.config.staticPath+"/images/nostr-avatar.png",defaultMarketNaddr:"naddr1qqjrqd3jv9skvwfc956rserz956xyeps94snwd3h95cn2ctr8ymrqdpe89jxzqg5waehxw309aex2mrp0yhxgctdw4eju6t0qyv8wumn8ghj7un9d3shjtnndehhyapwwdhkx6tpdsq36amnwvaz7tmwdaehgu3dwp6kytnhv4kxcmmjv3jhytnwv46qzxthwden5te0dehhxarj9eax2cn9v3jk2tnrd3hh2eqpramhxue69uhkummnw3ezuampd3kx2ar0veekzar0wd5xjtnrdaksyg96ypff6u56q9tk99qnp2kghg5ynuse3v7wdu0xxkurdlggj82gmspsgqqqw4psj5pe0p",readNotes:{merchants:!1,marketUi:!1}}},watch:{config(e,t){var n,a,i,l;(a=(n=e==null?void 0:e.opts)==null?void 0:n.ui)!=null&&a.banner?(this.bannerImage=null,setTimeout(()=>{var o,r;this.bannerImage=this.sanitizeImageSrc((r=(o=e==null?void 0:e.opts)==null?void 0:o.ui)==null?void 0:r.banner,this.defaultBanner)})):this.bannerImage=this.defaultBanner,(l=(i=e==null?void 0:e.opts)==null?void 0:i.ui)!=null&&l.picture?(this.logoImage=null,setTimeout(()=>{var o,r;this.logoImage=this.sanitizeImageSrc((r=(o=e==null?void 0:e.opts)==null?void 0:o.ui)==null?void 0:r.picture,this.defaultLogo)})):this.logoImage=this.defaultLogo},searchText(e,t){if(!!e&&e.toLowerCase().startsWith("naddr"))try{const{type:n,data:a}=NostrTools.nip19.decode(e);if(n!=="naddr"||a.kind!==30019)return;this.$q.dialog(confirm("Do you want to import this market profile?")).onOk(async()=>{await this.addMarket(e),this.searchText=""})}catch{}}},computed:{filterProducts(){let e=this.products.filter(n=>this.hasCategory(n.categories));if(this.activeStall&&(e=e.filter(n=>n.stall_id==this.activeStall)),!this.searchText||this.searchText.length<2)return e;const t=this.searchText.toLowerCase();return e.filter(n=>n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.categories&&n.categories.toString().toLowerCase().includes(t))},filterStalls(){const e=this.stalls.map(n=>({...n,categories:this.allStallCatgories(n.id),images:this.allStallImages(n.id).slice(0,8),productCount:this.products.filter(a=>a.stall_id===n.id).length})).filter(n=>this.hasCategory(n.categories));if(!this.searchText||this.searchText.length<2)return e;const t=this.searchText.toLowerCase();return this.stalls.filter(n=>n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.categories&&n.categories.toString().toLowerCase().includes(t))},stallName(){var e;return((e=this.stalls.find(t=>t.id==this.activeStall))==null?void 0:e.name)||"Stall"},productName(){var e;return((e=this.products.find(t=>t.id==this.activeProduct))==null?void 0:e.name)||"Product"},isValidAccountKey(){return isValidKey(this.accountDialog.data.key)},allCartsItemCount(){return this.shoppingCarts.map(e=>e.products).flat().reduce((e,t)=>e+t.orderedQuantity,0)},allCategories(){const t=this.products.map(n=>n.categories).flat().filter(n=>!!n).reduce((n,a)=>(n[a]=(n[a]||0)+1,n),{});return Object.keys(t).map(n=>({category:n,count:t[n],selected:this.filterCategories.indexOf(n)!==-1})).sort((n,a)=>a.count-n.count)}},async created(){this.bannerImage=this.defaultBanner,this.logoImage=this.defaultLogo,this.restoreFromStorage();const e=new URLSearchParams(window.location.search);await this.addMarket(e.get("naddr")),await this.handleQueryParams(e),await this.initNostr(),await this.listenForIncommingDms(this.merchants.map(t=>({publicKey:t.publicKey,since:this.lastDmForPubkey(t.publicKey)}))),this.isLoading=!1},methods:{async handleQueryParams(e){const t=e.get("merchant"),n=e.get("stall"),a=e.get("product");n&&(this.setActivePage("customer-stall"),a&&(this.activeProduct=a),this.activeStall=n),t&&!this.merchants.find(i=>i.publicKey===t)&&this.$q.dialog(confirm("We found a merchant pubkey in your request. Do you want to add it to the merchants list?")).onOk(async()=>{this.merchants.push({publicKey:t,profile:null})})},restoreFromStorage(){var l;this.markets=this.$q.localStorage.getItem("nostrmarket.markets")||[],this.merchants=this.$q.localStorage.getItem("nostrmarket.merchants")||[],this.shoppingCarts=this.$q.localStorage.getItem("nostrmarket.shoppingCarts")||[],this.account=this.$q.localStorage.getItem("nostrmarket.account")||null;const e=this.$q.localStorage.getItem("nostrmarket.marketplaceConfig")||{ui:{darkMode:!1}};this.config={...this.config,opts:{...this.config.opts,...e}},this.applyUiConfigs((l=this.config)==null?void 0:l.opts);const t="nostrmarket.orders.";this.$q.localStorage.getAllKeys().filter(o=>o.startsWith(t)).forEach(o=>{const r=o.substring(t.length);this.orders[r]=this.$q.localStorage.getItem(o)});const a=this.$q.localStorage.getItem("nostrmarket.relays");this.relays=new Set(a!=null&&a.length?a:defaultRelays);const i=this.$q.localStorage.getItem("nostrmarket.readNotes")||{};this.readNotes={...this.readNotes,...i}},applyUiConfigs(e={}){var i,l;const{name:t,about:n,ui:a}=e;this.$q.localStorage.set("nostrmarket.marketplaceConfig",{name:t,about:n,ui:a}),(i=e.ui)!=null&&i.theme&&document.body.setAttribute("data-theme",e.ui.theme),this.$q.dark.set(!!((l=e.ui)!=null&&l.darkMode))},async createAccount(e=!1){let t;if(e&&(await this.getFromExtension(),t=!0),isValidKey(this.accountDialog.data.key,"nsec")){let{key:n,watchOnly:a}=this.accountDialog.data;if(n.startsWith("n")){let{type:o,data:r}=NostrTools.nip19.decode(n);n=r}const i=a?null:n,l=a?n:NostrTools.getPublicKey(n);this.$q.localStorage.set("nostrmarket.account",{privkey:i,pubkey:l,nsec:NostrTools.nip19.nsecEncode(n),npub:NostrTools.nip19.npubEncode(l),useExtension:t!=null?t:!1}),this.accountDialog.data={watchOnly:!1,key:null},this.accountDialog.show=!1,this.account=this.$q.localStorage.getItem("nostrmarket.account")}this.accountDialog.show=!1},generateKeyPair(){this.accountDialog.data.key=NostrTools.generatePrivateKey(),this.accountDialog.data.watchOnly=!1},async getFromExtension(){this.accountDialog.data.key=await window.nostr.getPublicKey(),this.accountDialog.data.watchOnly=!0},openAccountDialog(){this.accountDialog.show=!0},async updateUiConfig(e){var i;const{name:t,about:n,ui:a}=e;this.config={...this.config,opts:{...this.config.opts,name:t,about:n,ui:a}},this.applyUiConfigs((i=this.config)==null?void 0:i.opts)},async updateData(e){if(console.log("### updateData",e),e.length<1){this.$q.notify({message:"No matches were found!"});return}let t=new Map,n=new Map;const a=e.filter(i=>i.kind===5).map(i=>(i.tags||[]).filter(l=>l[0]==="e")).flat().map(i=>i[1]).filter(i=>!!i);this.stalls.forEach(i=>n.set(i.id,i)),this.products.forEach(i=>t.set(i.id,i)),e.map(eventToObj).map(i=>{var l;if(i.kind==0){i.pubkey==((l=this.account)==null?void 0:l.pubkey)&&(this.accountMetadata=i.content),this.merchants.filter(o=>o.publicKey===i.pubkey).forEach(o=>o.profile=i.content);return}else i.kind==5?console.log("### delete event",i):i.kind==30018?t.set(i.d,{...i.content,pubkey:i.pubkey,id:i.d,categories:i.t,eventId:i.id}):i.kind==30017&&n.set(i.d,{...i.content,pubkey:i.pubkey,id:i.d,pubkey:i.pubkey})}),this.stalls=await Array.from(n.values()),this.products=Array.from(t.values()).map(i=>{const l=this.stalls.find(o=>o.id==i.stall_id);if(!!l)return i.stallName=l.name,i.images=i.images||[i.image],i.currency!="sat"&&(i.formatedPrice=this.getAmountFormated(i.price,i.currency)),i}).filter(i=>i&&a.indexOf(i.eventId)===-1)},async initNostr(){this.isLoading=!0,this.pool=new NostrTools.SimplePool;const e=Array.from(this.relays),t=this.merchants.map(i=>i.publicKey),n=await this.pool.list(e,[{kinds:[0,30017,30018],authors:t}]);if(!n||n.length==0)return;await this.updateData(n);const a=n.sort((i,l)=>l.created_at-i.created_at)[0];this.poolSubscribe(a.created_at),this.isLoading=!1},async poolSubscribe(e){const t=this.merchants.map(n=>n.publicKey);this.pool.sub(Array.from(this.relays),[{kinds:[0,5,30017,30018],authors:t,since:e}]).on("event",n=>{this.updateData([n])},{id:"masterSub"})},async addMarket(e){var t,n;if(!!e){try{const{type:a,data:i}=NostrTools.nip19.decode(e);if(a!=="naddr"||i.kind!==30019)return;this.config={d:i.identifier,pubkey:i.pubkey,relays:i.relays}}catch(a){console.error(a);return}try{const a=new NostrTools.SimplePool;this.config.relays.forEach(l=>this.relays.add(l));const i=await a.get(this.config.relays,{kinds:[30019],limit:1,authors:[this.config.pubkey],"#d":[this.config.d]});if(!i)return;this.config={...this.config,opts:JSON.parse(i.content)},this.addMerchants((t=this.config.opts)==null?void 0:t.merchants),this.applyUiConfigs((n=this.config)==null?void 0:n.opts)}catch(a){console.warn(a)}}},navigateTo(e,t={stall:null,product:null,pubkey:null}){var r;console.log("### navigateTo",e,t);const{stall:n,product:a,pubkey:i}=t,l=new URL(window.location),o=i||((r=this.stalls.find(s=>s.id==n))==null?void 0:r.pubkey);l.searchParams.set("merchant",o),e==="stall"||e==="product"?n&&(this.activeStall=n,this.setActivePage("customer-stall"),l.searchParams.set("stall",n),this.activeProduct=a,a?l.searchParams.set("product",a):l.searchParams.delete("product")):(this.activeStall=null,this.activeProduct=null,l.searchParams.delete("merchant"),l.searchParams.delete("stall"),l.searchParams.delete("product"),this.setActivePage("market")),window.history.pushState({},"",l)},copyUrl:function(){this.copyText(window.location)},copyText:function(e){var t=this.$q.notify;Quasar.utils.copyToClipboard(e).then(function(){t({message:"Copied to clipboard!",position:"bottom"})})},getAmountFormated(e,t="USD"){return formatCurrency(e,t)},setActivePage(e="market"){this.activePage=e},async addRelay(e){let t=String(e).trim();this.relays.add(t),this.$q.localStorage.set("nostrmarket.relays",Array.from(this.relays)),this.initNostr()},removeRelay(e){this.relays.delete(e),this.relays=new Set(Array.from(this.relays)),this.$q.localStorage.set("nostrmarket.relays",Array.from(this.relays)),this.initNostr()},addMerchant(e){this.merchants.unshift({publicKey:e,profile:null}),this.$q.localStorage.set("nostrmarket.merchants",this.merchants),this.initNostr()},addMerchants(e=[]){const t=this.merchants.map(a=>a.publicKey),n=e.filter(a=>t.indexOf(a)===-1).map(a=>({publicKey:a,profile:null}));this.merchants.unshift(...n),this.$q.localStorage.set("nostrmarket.merchants",this.merchants),this.initNostr()},removeMerchant(e){this.merchants=this.merchants.filter(t=>t.publicKey!==e),this.$q.localStorage.set("nostrmarket.merchants",this.merchants),this.products=this.products.filter(t=>t.pubkey!==e),this.stalls=this.stalls.filter(t=>t.pubkey!==e),this.initNostr()},addProductToCart(e){let t=this.shoppingCarts.find(a=>a.id===e.stall_id);t||(t={id:e.stall_id,products:[]},this.shoppingCarts.push(t)),t.merchant=this.merchants.find(a=>a.publicKey===e.pubkey);let n=t.products.find(a=>a.id===e.id);n||(n={...e,orderedQuantity:0},t.products.push(n)),n.orderedQuantity=Math.min(n.quantity,e.orderedQuantity||n.orderedQuantity+1),this.$q.localStorage.set("nostrmarket.shoppingCarts",this.shoppingCarts),this.$q.notify({type:"positive",message:"Product added to cart!"})},removeProductFromCart(e){const t=this.shoppingCarts.find(n=>n.id===e.stallId);t&&(t.products=t.products.filter(n=>n.id!==e.productId),t.products.length||(this.shoppingCarts=this.shoppingCarts.filter(n=>n.id!==e.stallId)),this.$q.localStorage.set("nostrmarket.shoppingCarts",this.shoppingCarts))},removeCart(e){this.shoppingCarts=this.shoppingCarts.filter(t=>t.id!==e),this.$q.localStorage.set("nostrmarket.shoppingCarts",this.shoppingCarts)},checkoutStallCart(e){this.checkoutCart=e,this.checkoutStall=this.stalls.find(t=>t.id===e.id),this.setActivePage("shopping-cart-checkout")},async placeOrder({event:e,order:t,cartId:n}){var a;if(!((a=this.account)!=null&&a.privkey)){this.openAccountDialog();return}try{this.activeOrderId=t.id,e.content=await NostrTools.nip04.encrypt(this.account.privkey,this.checkoutStall.pubkey,JSON.stringify(t)),e.id=NostrTools.getEventHash(e),e.sig=await NostrTools.signEvent(e,this.account.privkey),this.sendOrderEvent(e),this.persistOrderUpdate(this.checkoutStall.pubkey,e.created_at,t),this.removeCart(n),this.setActivePage("shopping-cart-list")}catch(i){console.warn(i),this.$q.notify({type:"warning",message:"Failed to place order!"})}},sendOrderEvent(e){const t=this.pool.publish(Array.from(this.relays),e);this.$q.notify({type:"positive",message:"The order has been placed!"}),this.qrCodeDialog={data:{payment_request:null,message:null},dismissMsg:null,show:!0},t.on("ok",()=>{this.qrCodeDialog.show=!0}),t.on("failed",n=>{console.error(n)})},async listenForIncommingDms(e){var t;if(!!((t=this.account)!=null&&t.privkey))try{const n=[{kinds:[4],"#p":[this.account.pubkey]},{kinds:[4],authors:[this.account.pubkey]}],a=this.pool.sub(Array.from(this.relays),n);return a.on("event",async i=>{const l=i.tags.find(([s,u])=>s==="p"&&u&&u!=="")[1],o=i.pubkey===this.account.pubkey;if(l!==this.account.pubkey&&!o){console.warn("Unexpected DM. Dropped!");return}this.persistDMEvent(i);const r=o?l:i.pubkey;await this.handleIncommingDm(i,r)}),a}catch(n){console.error(`Error: ${n}`)}},async handleIncommingDm(e,t){try{const n=await NostrTools.nip04.decrypt(this.account.privkey,t,e.content);if(console.log("### plainText",n),!isJson(n))return;const a=JSON.parse(n);[0,1,2].indexOf(a.type)!==-1&&this.persistOrderUpdate(t,e.created_at,a),a.type===1?this.handlePaymentRequest(a):a.type===2&&this.handleOrderStatusUpdate(a)}catch(n){console.warn("Unable to handle incomming DM",n)}},handlePaymentRequest(e){var n;if(e.id&&e.id!==this.activeOrderId)return;if(!((n=e.payment_options)!=null&&n.length)){this.qrCodeDialog.data.message=e.message||"Unexpected error";return}const t=e.payment_options.find(a=>a.type=="ln").link;!t||(this.qrCodeDialog.data.payment_request=t,this.qrCodeDialog.dismissMsg=this.$q.notify({timeout:1e4,message:"Waiting for payment..."}))},handleOrderStatusUpdate(e){if(e.id&&e.id!==this.activeOrderId)return;this.qrCodeDialog.dismissMsg&&this.qrCodeDialog.dismissMsg(),this.qrCodeDialog.show=!1;const t=e.shipped?"Order shipped":e.paid?"Order paid":"Order notification";this.$q.notify({type:"positive",message:t,caption:e.message||""})},persistDMEvent(e){const t=this.$q.localStorage.getItem(`nostrmarket.dm.${e.pubkey}`)||{events:[],lastCreatedAt:0};t.events.find(a=>a.id===e.id)||(t.events.push(e),t.events.sort((a,i)=>a-i),t.lastCreatedAt=t.events[t.events.length-1].created_at,this.$q.localStorage.set(`nostrmarket.dm.${e.pubkey}`,t))},lastDmForPubkey(e){const t=this.$q.localStorage.getItem(`nostrmarket.dm.${e}`);return t?t.lastCreatedAt:0},persistOrderUpdate(e,t,n){let a=this.$q.localStorage.getItem(`nostrmarket.orders.${e}`)||[];const i=a.findIndex(o=>o.id===n.id);if(i===-1){a.unshift({...n,eventCreatedAt:t,createdAt:t}),this.orders[e]=a,this.orders={...this.orders},this.$q.localStorage.set(`nostrmarket.orders.${e}`,a);return}let l=a[i];n.type===0?(l.createdAt=t,l={...l,...n,message:l.message||n.message}):l=l.eventCreatedAtn.stall_id===e).map(n=>n.categories).flat().filter(n=>!!n);return Array.from(new Set(t))},allStallImages(e){const t=this.products.filter(n=>n.stall_id===e).map(n=>n.images&&n.images[0]).filter(n=>!!n);return Array.from(new Set(t))},sanitizeImageSrc(e,t){try{if(e)return new URL(e),e}catch{}return t},async publishNaddr(){var s,u,d;if(!((s=this.account)!=null&&s.privkey)){this.openAccountDialog(),this.$q.notify({message:"Login Required!",icon:"warning"});return}const e=Array.from(this.merchants.map(v=>v.publicKey)),{name:t,about:n,ui:a}=((u=this.config)==null?void 0:u.opts)||{},i={merchants:e,name:t,about:n,ui:a},l=(d=this.config.identifier)!=null?d:crypto.randomUUID(),o={...await NostrTools.getBlankEvent(),kind:30019,content:JSON.stringify(i),created_at:Math.floor(Date.now()/1e3),tags:[["d",l]],pubkey:this.account.pubkey};o.id=NostrTools.getEventHash(o);try{o.sig=await NostrTools.signEvent(o,this.account.privkey);const v=this.pool.publish(Array.from(this.relays),o);v.on("ok",()=>{console.debug("Config event was sent")}),v.on("failed",y=>{console.error(y)})}catch(v){console.error(v),this.$q.notify({message:"Cannot publish market profile",caption:`Error: ${v}`,color:"negative"});return}const r=NostrTools.nip19.naddrEncode({pubkey:o.pubkey,kind:30019,identifier:l,relays:Array.from(this.relays)});this.copyText(r)},logout(){window.localStorage.removeItem("nostrmarket.account"),window.location.href=window.location.origin+window.location.pathname,this.account=null,this.accountMetadata=null},clearAllData(){this.$q.dialog(confirm("This will remove all information about merchants, products, relays and others. You will NOT be logged out. Do you want to proceed?")).onOk(async()=>{this.$q.localStorage.getAllKeys().filter(e=>e!=="nostrmarket.account").forEach(e=>window.localStorage.removeItem(e)),this.merchants=[],this.relays=[],this.orders=[],this.config={opts:null},this.shoppingCarts=[],this.checkoutCart=null,window.location.href=window.location.origin+window.location.pathname})},markNoteAsRead(e){this.readNotes[e]=!0,this.$q.localStorage.set("nostrmarket.readNotes",this.readNotes)},focusOnElement(e){var t;(t=document.getElementById(e))==null||t.scrollIntoView(),this.showFilterDetails=!0}}}),Ay=Object.assign($y,{setup(e){return window.$q=du(),(t,n)=>(S(),V(et,null,[c(su,null,{default:f(()=>{var a,i,l,o;return[m("div",J0,[c(ri,{class:"col-lg-1 col-md-1 col-sm-0 q-pl-none"},{default:f(()=>[c(vt,{rounded:"",size:"64px",class:"q-ma-none q-pa-none gt-sm"},{default:f(()=>[t.logoImage?(S(),V("img",{key:0,src:t.logoImage},null,8,X0)):fe("",!0)]),_:1})]),_:1}),c(ri,{class:"col-lg-6 col-md-5 col-sm-12 auto-width"},{default:f(()=>[ey,c(Xe,{class:"rounded-pill",style:{width:"100%"},rounded:"",outlined:"",clearable:"",modelValue:t.searchText,"onUpdate:modelValue":n[0]||(n[0]=r=>t.searchText=r),modelModifiers:{trim:!0},label:"Filter products, load market profile..."},_o({append:f(()=>[t.searchText?fe("",!0):(S(),j(je,{key:0,name:"search"}))]),_:2},[t.showFilterDetails?{name:"label",fn:f(()=>[oe(" Filter or paste a "),c(rn,{class:"q-px-sm text-subtitle1",color:"secondary"},{default:f(()=>[oe("naddr")]),_:1}),oe(" here ")]),key:"0"}:void 0]),1032,["modelValue"])]),_:1}),c(ri,{class:"col-lg-5 col-md-6 col-sm-12 q-ma-none"},{default:f(()=>[m("div",ty,[c(ee,{color:"gray",icon:"travel_explore",flat:"",size:"lg",onClick:n[1]||(n[1]=r=>t.setActivePage("search-nostr"))},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("Search for products on Nostr")]),_:1})]),_:1}),c(ee,{color:"gray",icon:"settings",flat:"",size:"lg",onClick:n[2]||(n[2]=r=>t.setActivePage("market-config"))},{default:f(()=>[c(Tt,null,{default:f(()=>[oe(" Settings")]),_:1})]),_:1}),t.account?(S(),j(ee,{key:0,onClick:n[3]||(n[3]=r=>t.setActivePage("user-config")),color:"gray",icon:"perm_identity",flat:"",size:"lg"},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("User User Config")]),_:1})]),_:1})):(S(),j(ee,{key:1,onClick:n[4]||(n[4]=r=>t.accountDialog.show=!0),color:"gray",icon:"person_add",flat:"",size:"lg"},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("User Login")]),_:1})]),_:1})),c(ee,{onClick:n[5]||(n[5]=r=>t.setActivePage("user-chat")),color:"gray",icon:"chat",flat:"",size:"lg"},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("Chat")]),_:1})]),_:1}),c(ee,{onClick:n[6]||(n[6]=r=>t.setActivePage("customer-orders")),color:"gray",icon:"receipt_long",flat:"",size:"lg"},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("Orders")]),_:1})]),_:1}),c(ee,{color:"gray",icon:"shopping_cart",dense:"",round:"",flat:"",size:"lg",onClick:n[7]||(n[7]=r=>t.setActivePage("shopping-cart-list"))},{default:f(()=>[c(Tt,null,{default:f(()=>[oe("Shopping Cart")]),_:1}),t.allCartsItemCount?(S(),j(rn,{key:0,color:"secondary",floating:""},{default:f(()=>[m("span",{textContent:W(t.allCartsItemCount)},null,8,ny)]),_:1})):fe("",!0)]),_:1})])]),_:1})]),(a=t.products)!=null&&a.length?(S(),V("div",ay,[c(Wi,{items:t.allCategories,"virtual-scroll-horizontal":""},{default:f(({item:r,index:s})=>[(S(),j(aa,{key:s,color:r.selected?"grey":"",class:"cursor-pointer q-mb-md"},{default:f(()=>[m("span",{textContent:W(r.category),onClick:u=>t.toggleCategoryFilter(r.category)},null,8,iy),c(rn,{onClick:u=>t.toggleCategoryFilter(r.category),rounded:"",class:"q-ml-sm",color:"secondary"},{default:f(()=>[m("span",{textContent:W(r.count)},null,8,ly)]),_:2},1032,["onClick"])]),_:2},1032,["color"]))]),_:1},8,["items"])])):fe("",!0),t.isLoading?(S(),V("div",oy,[m("div",ry,[c(Do,{color:"primary",size:"xl"})])])):fe("",!0),c(lu,{class:"row q-pa-none q-mb-lg gt-sm shadow-2"},{default:f(()=>[t.bannerImage?(S(),j(ji,{key:0,src:t.bannerImage,class:"rounded-borders",style:{width:"100%",height:"250px"},cover:""},{default:f(()=>{var r,s;return[(s=(r=t.config)==null?void 0:r.opts)!=null&&s.about?(S(),V("div",sy,[m("span",{textContent:W(t.config.opts.about)},null,8,uy)])):fe("",!0)]}),_:1},8,["src"])):fe("",!0)]),_:1}),m("div",cy,[m("div",dy,[c(ru,{class:"cursor q-mt-sm q-mr-sm"},{default:f(()=>{var r,s;return[c(Wt,{label:((s=(r=t.config)==null?void 0:r.opts)==null?void 0:s.name)||"Market",icon:"home",onClick:n[9]||(n[9]=u=>t.navigateTo("market")),class:"cursor-pointer auto-width"},{default:f(()=>{var u;return[t.activePage==="market"&&((u=t.stalls)==null?void 0:u.length)?(S(),j(po,{key:0,modelValue:t.groupByStall,"onUpdate:modelValue":n[8]||(n[8]=d=>t.groupByStall=d),class:"q-pl-md float-right",size:"xs",val:"xs",label:"Group by stalls"},null,8,["modelValue"])):fe("",!0)]}),_:1},8,["label"]),t.activePage==="customer-stall"?(S(),j(Wt,{key:0,label:t.stallName,onClick:n[10]||(n[10]=u=>t.navigateTo("stall",{stall:t.activeStall})),icon:"storefront",class:"cursor-pointer"},null,8,["label"])):fe("",!0),t.activePage==="customer-stall"&&t.activeProduct?(S(),j(Wt,{key:1,label:t.productName,class:"cursor-pointer",icon:"widgets"},null,8,["label"])):fe("",!0),t.activePage==="shopping-cart-list"?(S(),j(Wt,{key:2,label:"Shoping Cart",icon:"shopping_cart"})):fe("",!0),t.activePage==="customer-orders"?(S(),j(Wt,{key:3,label:"Orders",icon:"receipt_long"})):fe("",!0),t.activePage==="market-config"?(S(),j(Wt,{key:4,label:"Settings",icon:"settings"})):fe("",!0),t.activePage==="user-config"?(S(),j(Wt,{key:5,label:"User Config",icon:"perm_identity"})):fe("",!0),t.activePage==="user-chat"?(S(),j(Wt,{key:6,label:"User Chat",icon:"chat"})):fe("",!0)]}),_:1})]),m("div",fy,[t.activePage==="customer-stall"?(S(),j(ee,{key:0,flat:"",color:"grey",icon:"content_copy",onClick:n[11]||(n[11]=r=>t.copyUrl()),class:"float-right"})):fe("",!0)])]),c(Ae,{class:"q-mt-sm q-mb-md"}),t.activePage==="market-config"?(S(),j(Zo,{key:2,merchants:t.merchants,onAddMerchant:t.addMerchant,onRemoveMerchant:t.removeMerchant,relays:t.relays,"read-notes":t.readNotes,onAddRelay:t.addRelay,onRemoveRelay:t.removeRelay,"config-ui":(i=t.config)==null?void 0:i.opts,onUiConfigUpdate:t.updateUiConfig,onPublishNaddr:t.publishNaddr,onClearAllData:t.clearAllData,onNoteRead:t.markNoteAsRead},null,8,["merchants","onAddMerchant","onRemoveMerchant","relays","read-notes","onAddRelay","onRemoveRelay","config-ui","onUiConfigUpdate","onPublishNaddr","onClearAllData","onNoteRead"])):t.activePage==="user-config"?(S(),j(Gc,{key:3,account:t.account,onLogout:t.logout,onCopyText:t.copyText},null,8,["account","onLogout","onCopyText"])):t.activePage==="user-chat"?(S(),j(ed,{key:4})):t.activePage==="shopping-cart-list"?(S(),j(fd,{key:5,carts:t.shoppingCarts,onAddToCart:t.addProductToCart,onRemoveFromCart:t.removeProductFromCart,onRemoveCart:t.removeCart,onCheckoutCart:t.checkoutStallCart},null,8,["carts","onAddToCart","onRemoveFromCart","onRemoveCart","onCheckoutCart"])):t.activePage==="shopping-cart-checkout"?(S(),j(Xd,{key:6,cart:t.checkoutCart,stall:t.checkoutStall,"customer-pubkey":(l=t.account)==null?void 0:l.pubkey,onLoginRequired:t.openAccountDialog,onPlaceOrder:t.placeOrder,onChangePage:t.navigateTo},null,8,["cart","stall","customer-pubkey","onLoginRequired","onPlaceOrder","onChangePage"])):t.activePage==="customer-orders"?(S(),j(t0,{key:7,orders:t.orders,products:t.products,stalls:t.stalls,merchants:t.merchants,onShowInvoice:t.showInvoiceQr},null,8,["orders","products","stalls","merchants","onShowInvoice"])):t.activePage==="customer-stall"?(S(),j(E0,{key:8,stall:t.stalls.find(r=>r.id==t.activeStall),products:t.filterProducts,"product-detail":t.activeProduct,onChangePage:t.navigateTo,onAddToCart:t.addProductToCart},null,8,["stall","products","product-detail","onChangePage","onAddToCart"])):(o=t.merchants)!=null&&o.length?(S(),V("div",_y,[t.groupByStall?(S(),j(Z0,{key:0,stalls:t.filterStalls,onChangePage:t.navigateTo},null,8,["stalls","onChangePage"])):(S(),j(Sf,{key:1,"filtered-products":t.filterProducts,"search-text":t.searchText,"filter-categories":t.filterCategories,onChangePage:t.navigateTo,onUpdateData:t.updateData,onAddToCart:t.addProductToCart},null,8,["filtered-products","search-text","filter-categories","onChangePage","onUpdateData","onAddToCart"]))])):(S(),V("div",hy,[c(Qt,{class:"q-mt-md",bordered:""},{default:f(()=>[c(nt,null,{default:f(()=>[c(ae,{class:"q-mt-sm q-ml-lg"},{default:f(()=>[c(se,null,{default:f(()=>[my]),_:1}),c(Ae,{class:"q-mb-xl q-mt-md"}),c(se,null,{default:f(()=>[gy]),_:1})]),_:1})]),_:1}),c(nt,null,{default:f(()=>[c(ae,{class:"q-mt-sm q-ml-lg"},{default:f(()=>[c(se,null,{default:f(()=>[m("ul",null,[m("li",null,[m("span",vy,[c(ee,{onClick:n[12]||(n[12]=r=>t.addMarket(t.defaultMarketNaddr)),size:"xl",flat:"",color:"secondary",class:"q-mb-xs"},{default:f(()=>[oe("Import")]),_:1}),oe(" a list of popular merchants, or ")])]),m("li",null,[m("span",yy,[c(ee,{onClick:n[13]||(n[13]=r=>t.setActivePage("market-config")),flat:"",size:"xl",color:"secondary",class:"q-mb-xs"},{default:f(()=>[oe("Add a merchant")]),_:1}),oe(" using its public key, or ")])]),m("li",null,[m("span",py,[c(ee,{onClick:n[14]||(n[14]=r=>t.focusOnElement("search-text")),flat:"",size:"xl",color:"secondary",class:"q-mb-xs"},{default:f(()=>[oe("Add a market profile")]),_:1}),oe(" using a shareable "),by,oe(" identifier ")])])])]),_:1})]),_:1}),c(ae,{side:""})]),_:1})]),_:1})]))]}),_:1}),c(Si,{modelValue:t.accountDialog.show,"onUpdate:modelValue":n[17]||(n[17]=a=>t.accountDialog.show=a),position:"top"},{default:f(()=>[c(lt,null,{default:f(()=>[c(we,{class:"row"},{default:f(()=>[wy,c(cu)]),_:1}),c(we,null,{default:f(()=>[Sy]),_:1}),c(we,{class:"q-pt-none"},{default:f(()=>[c(Xe,{dense:"",label:"Nsec/Hex",modelValue:t.accountDialog.data.key,"onUpdate:modelValue":n[15]||(n[15]=a=>t.accountDialog.data.key=a),autofocus:"",onKeyup:ki(t.createAccount,["enter"]),error:t.accountDialog.data.key&&!t.isValidAccountKey,hint:"Enter you private key"},null,8,["modelValue","onKeyup","error"])]),_:1}),c(In,{align:"right",class:"text-primary"},{default:f(()=>[t.isValidAccountKey?(S(),j(ee,{key:0,label:"Login",color:"primary",onClick:n[16]||(n[16]=()=>t.createAccount())})):(S(),j(ee,{key:1,flat:"",label:"Generate",onClick:t.generateKeyPair},null,8,["onClick"])),dn((S(),j(ee,{flat:"",color:"grey",class:"q-ml-auto"},{default:f(()=>[oe("Close")]),_:1})),[[Mi]])]),_:1})]),_:1})]),_:1},8,["modelValue"]),c(Si,{modelValue:t.qrCodeDialog.show,"onUpdate:modelValue":n[19]||(n[19]=a=>t.qrCodeDialog.show=a),position:"top"},{default:f(()=>[c(lt,{class:"q-pa-md q-pt-xl"},{default:f(()=>{var a;return[m("div",ky,[t.qrCodeDialog.data.message?(S(),V("div",Cy,[m("strong",null,[m("span",{textContent:W(t.qrCodeDialog.data.message)},null,8,Ty)])])):(S(),V("a",{key:1,href:"lightning:"+((a=t.qrCodeDialog.data)==null?void 0:a.payment_request)},[t.qrCodeDialog.data.payment_request?(S(),V("div",qy,[c(Vs(ac),{value:t.qrCodeDialog.data.payment_request,options:{width:340},class:"rounded-borders"},null,8,["value"])])):(S(),V("div",Py,[c(ro,{color:"primary",size:"2.55em"})]))],8,My))]),m("div",Dy,[t.qrCodeDialog.data.payment_request?(S(),j(ee,{key:0,outline:"",color:"grey",onClick:n[18]||(n[18]=i=>t.copyText(t.qrCodeDialog.data.payment_request))},{default:f(()=>[oe("Copy invoice")]),_:1})):fe("",!0),dn((S(),j(ee,{flat:"",color:"grey",class:"q-ml-auto"},{default:f(()=>[oe("Close")]),_:1})),[[Mi]])])]}),_:1})]),_:1},8,["modelValue"])],64))}});export{Ay as default}; diff --git a/static/market/assets/QResizeObserver.bcb70109.js b/static/market/assets/QResizeObserver.bcb70109.js new file mode 100644 index 0000000..f140acb --- /dev/null +++ b/static/market/assets/QResizeObserver.bcb70109.js @@ -0,0 +1 @@ +import{r as g,s as z,o as c,c as y,f,n as w,F as v,h as R,g as O,k as b}from"./index.725caa24.js";function x(){const r=g(!z.value);return r.value===!1&&c(()=>{r.value=!0}),r}const m=typeof ResizeObserver!="undefined",h=m===!0?{}:{style:"display:block;position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1;",url:"about:blank"};var L=y({name:"QResizeObserver",props:{debounce:{type:[String,Number],default:100}},emits:["resize"],setup(r,{emit:p}){let i=null,t,o={width:-1,height:-1};function s(e){e===!0||r.debounce===0||r.debounce==="0"?u():i===null&&(i=setTimeout(u,r.debounce))}function u(){if(i!==null&&(clearTimeout(i),i=null),t){const{offsetWidth:e,offsetHeight:n}=t;(e!==o.width||n!==o.height)&&(o={width:e,height:n},p("resize",o))}}const{proxy:a}=O();if(m===!0){let e;const n=l=>{t=a.$el.parentNode,t?(e=new ResizeObserver(s),e.observe(t),u()):l!==!0&&v(()=>{n(!0)})};return c(()=>{n()}),f(()=>{i!==null&&clearTimeout(i),e!==void 0&&(e.disconnect!==void 0?e.disconnect():t&&e.unobserve(t))}),w}else{let l=function(){i!==null&&(clearTimeout(i),i=null),n!==void 0&&(n.removeEventListener!==void 0&&n.removeEventListener("resize",s,b.passive),n=void 0)},d=function(){l(),t&&t.contentDocument&&(n=t.contentDocument.defaultView,n.addEventListener("resize",s,b.passive),u())};const e=x();let n;return c(()=>{v(()=>{t=a.$el,t&&d()})}),f(l),a.trigger=s,()=>{if(e.value===!0)return R("object",{style:h.style,tabindex:-1,type:"text/html",data:h.url,"aria-hidden":"true",onLoad:d})}}}});export{L as Q}; diff --git a/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff b/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff new file mode 100644 index 0000000..88fdf4d Binary files /dev/null and b/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff differ diff --git a/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 b/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 new file mode 100644 index 0000000..f1fd22f Binary files /dev/null and b/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 differ diff --git a/static/market/assets/index.5f2eed21.css b/static/market/assets/index.5f2eed21.css new file mode 100644 index 0000000..86a3cbe --- /dev/null +++ b/static/market/assets/index.5f2eed21.css @@ -0,0 +1 @@ +@font-face{font-family:Roboto;font-style:normal;font-weight:100;src:url(/nostrmarket/static/market/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff) format("woff")}@font-face{font-family:Roboto;font-style:normal;font-weight:300;src:url(/nostrmarket/static/market/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff) format("woff")}@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:url(/nostrmarket/static/market/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff) format("woff")}@font-face{font-family:Roboto;font-style:normal;font-weight:500;src:url(/nostrmarket/static/market/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff) format("woff")}@font-face{font-family:Roboto;font-style:normal;font-weight:700;src:url(/nostrmarket/static/market/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff) format("woff")}@font-face{font-family:Roboto;font-style:normal;font-weight:900;src:url(/nostrmarket/static/market/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff) format("woff")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;font-display:block;src:url(/nostrmarket/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2) format("woff2"),url(/nostrmarket/static/market/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff) format("woff")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent;-moz-tap-highlight-color:transparent}html,body,#q-app{width:100%;direction:ltr}body.platform-ios.within-iframe,body.platform-ios.within-iframe #q-app{width:100px;min-width:100%}html,body{margin:0;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;font-family:inherit;margin:0}optgroup{font-weight:700}button,input,select{overflow:visible;text-transform:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button:-moz-focusring,input:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.q-icon{line-height:1;width:1em;height:1em;flex-shrink:0;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr;text-align:center;position:relative;box-sizing:content-box;fill:currentColor}.q-icon:before,.q-icon:after{width:100%;height:100%;display:flex!important;align-items:center;justify-content:center}.q-icon>svg,.q-icon>img{width:100%;height:100%}.q-icon,.material-icons,.material-icons-outlined,.material-icons-round,.material-icons-sharp,.material-symbols-outlined,.material-symbols-rounded,.material-symbols-sharp{-webkit-user-select:none;user-select:none;cursor:inherit;font-size:inherit;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.q-panel{height:100%;width:100%}.q-panel>div{height:100%;width:100%}.q-panel-parent{overflow:hidden;position:relative}.q-loading-bar{position:fixed;z-index:9998;transition:transform .5s cubic-bezier(0,0,.2,1),opacity .5s;background:#f44336}.q-loading-bar--top{left:0;right:0;top:0;width:100%}.q-loading-bar--bottom{left:0;right:0;bottom:0;width:100%}.q-loading-bar--right{top:0;bottom:0;right:0;height:100%}.q-loading-bar--left{top:0;bottom:0;left:0;height:100%}.q-avatar{position:relative;vertical-align:middle;display:inline-block;border-radius:50%;font-size:48px;height:1em;width:1em}.q-avatar__content{font-size:.5em;line-height:.5em}.q-avatar__content,.q-avatar img:not(.q-icon):not(.q-img__image){border-radius:inherit;height:inherit;width:inherit}.q-avatar--square{border-radius:0}.q-badge{background-color:var(--q-primary);color:#fff;padding:2px 6px;border-radius:4px;font-size:12px;line-height:12px;min-height:12px;font-weight:400;vertical-align:baseline}.q-badge--single-line{white-space:nowrap}.q-badge--multi-line{word-break:break-all;word-wrap:break-word}.q-badge--floating{position:absolute;top:-4px;right:-3px;cursor:inherit}.q-badge--transparent{opacity:.8}.q-badge--outline{background-color:transparent;border:1px solid currentColor}.q-badge--rounded{border-radius:1em}.q-banner{min-height:54px;padding:8px 16px;background:#fff}.q-banner--top-padding{padding-top:14px}.q-banner__avatar{min-width:1px!important}.q-banner__avatar>.q-avatar{font-size:46px}.q-banner__avatar>.q-icon{font-size:40px}.q-banner__avatar:not(:empty)+.q-banner__content{padding-left:16px}.q-banner__actions.col-auto{padding-left:16px}.q-banner__actions.col-all .q-btn-item{margin:4px 0 0 4px}.q-banner--dense{min-height:32px;padding:8px}.q-banner--dense.q-banner--top-padding{padding-top:12px}.q-banner--dense .q-banner__avatar>.q-avatar,.q-banner--dense .q-banner__avatar>.q-icon{font-size:28px}.q-banner--dense .q-banner__avatar:not(:empty)+.q-banner__content{padding-left:8px}.q-banner--dense .q-banner__actions.col-auto{padding-left:8px}.q-bar{background:rgba(0,0,0,.2)}.q-bar>.q-icon{margin-left:2px}.q-bar>div,.q-bar>div+.q-icon{margin-left:8px}.q-bar>.q-btn{margin-left:2px}.q-bar>.q-icon:first-child,.q-bar>.q-btn:first-child,.q-bar>div:first-child{margin-left:0}.q-bar--standard{padding:0 12px;height:32px;font-size:18px}.q-bar--standard>div{font-size:16px}.q-bar--standard .q-btn{font-size:11px}.q-bar--dense{padding:0 8px;height:24px;font-size:14px}.q-bar--dense .q-btn{font-size:8px}.q-bar--dark{background:rgba(255,255,255,.15)}.q-breadcrumbs__el{color:inherit}.q-breadcrumbs__el-icon{font-size:125%}.q-breadcrumbs__el-icon--with-label{margin-right:8px}[dir=rtl] .q-breadcrumbs__separator .q-icon{transform:scaleX(-1)}.q-btn{display:inline-flex;flex-direction:column;align-items:stretch;position:relative;outline:0;border:0;vertical-align:middle;font-size:14px;line-height:1.715em;text-decoration:none;color:inherit;background:transparent;font-weight:500;text-transform:uppercase;text-align:center;width:auto;height:auto;cursor:default;padding:4px 16px;min-height:2.572em}.q-btn .q-icon,.q-btn .q-spinner{font-size:1.715em}.q-btn.disabled{opacity:.7!important}.q-btn:before{content:"";display:block;position:absolute;left:0;right:0;top:0;bottom:0;border-radius:inherit;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f}.q-btn--actionable{cursor:pointer}.q-btn--actionable.q-btn--standard:before{transition:box-shadow .3s cubic-bezier(.25,.8,.5,1)}.q-btn--actionable.q-btn--standard:active:before,.q-btn--actionable.q-btn--standard.q-btn--active:before{box-shadow:0 3px 5px -1px #0003,0 5px 8px #00000024,0 1px 14px #0000001f}.q-btn--no-uppercase{text-transform:none}.q-btn--rectangle{border-radius:3px}.q-btn--outline{background:transparent!important}.q-btn--outline:before{border:1px solid currentColor}.q-btn--push{border-radius:7px}.q-btn--push:before{border-bottom:3px solid rgba(0,0,0,.15)}.q-btn--push.q-btn--actionable{transition:transform .3s cubic-bezier(.25,.8,.5,1)}.q-btn--push.q-btn--actionable:before{transition:border-width .3s cubic-bezier(.25,.8,.5,1)}.q-btn--push.q-btn--actionable:active,.q-btn--push.q-btn--actionable.q-btn--active{transform:translateY(2px)}.q-btn--push.q-btn--actionable:active:before,.q-btn--push.q-btn--actionable.q-btn--active:before{border-bottom-width:0}.q-btn--rounded{border-radius:28px}.q-btn--round{border-radius:50%;padding:0;min-width:3em;min-height:3em}.q-btn--square{border-radius:0}.q-btn--flat:before,.q-btn--outline:before,.q-btn--unelevated:before{box-shadow:none}.q-btn--dense{padding:.285em;min-height:2em}.q-btn--dense.q-btn--round{padding:0;min-height:2.4em;min-width:2.4em}.q-btn--dense .on-left{margin-right:6px}.q-btn--dense .on-right{margin-left:6px}.q-btn--fab .q-icon,.q-btn--fab-mini .q-icon{font-size:24px}.q-btn--fab{padding:16px;min-height:56px;min-width:56px}.q-btn--fab .q-icon{margin:auto}.q-btn--fab-mini{padding:8px;min-height:40px;min-width:40px}.q-btn__content{transition:opacity .3s;z-index:0}.q-btn__content--hidden{opacity:0;pointer-events:none}.q-btn__progress{border-radius:inherit;z-index:0}.q-btn__progress-indicator{z-index:-1;transform:translate(-100%);background:rgba(255,255,255,.25)}.q-btn__progress--dark .q-btn__progress-indicator{background:rgba(0,0,0,.2)}.q-btn--flat .q-btn__progress-indicator,.q-btn--outline .q-btn__progress-indicator{opacity:.2;background:currentColor}.q-btn-dropdown--split .q-btn-dropdown__arrow-container{padding:0 4px}.q-btn-dropdown--split .q-btn-dropdown__arrow-container.q-btn--outline{border-left:1px solid currentColor}.q-btn-dropdown--split .q-btn-dropdown__arrow-container:not(.q-btn--outline){border-left:1px solid rgba(255,255,255,.3)}.q-btn-dropdown--simple *+.q-btn-dropdown__arrow{margin-left:8px}.q-btn-dropdown__arrow{transition:transform .28s}.q-btn-dropdown--current{flex-grow:1}.q-btn-group{border-radius:3px;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;vertical-align:middle}.q-btn-group>.q-btn-item{border-radius:inherit;align-self:stretch}.q-btn-group>.q-btn-item:before{box-shadow:none}.q-btn-group>.q-btn-item .q-badge--floating{right:0}.q-btn-group>.q-btn-group{box-shadow:none}.q-btn-group>.q-btn-group:first-child>.q-btn:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}.q-btn-group>.q-btn-group:last-child>.q-btn:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}.q-btn-group>.q-btn-group:not(:first-child)>.q-btn:first-child:before{border-left:0}.q-btn-group>.q-btn-group:not(:last-child)>.q-btn:last-child:before{border-right:0}.q-btn-group>.q-btn-item:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.q-btn-group>.q-btn-item:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.q-btn-group>.q-btn-item.q-btn--standard:before{z-index:-1}.q-btn-group--push{border-radius:7px}.q-btn-group--push>.q-btn--push.q-btn--actionable{transform:none}.q-btn-group--push>.q-btn--push.q-btn--actionable .q-btn__content{transition:margin-top .3s cubic-bezier(.25,.8,.5,1),margin-bottom .3s cubic-bezier(.25,.8,.5,1)}.q-btn-group--push>.q-btn--push.q-btn--actionable:active .q-btn__content,.q-btn-group--push>.q-btn--push.q-btn--actionable.q-btn--active .q-btn__content{margin-top:2px;margin-bottom:-2px}.q-btn-group--rounded{border-radius:28px}.q-btn-group--square{border-radius:0}.q-btn-group--flat,.q-btn-group--outline,.q-btn-group--unelevated{box-shadow:none}.q-btn-group--outline>.q-separator{display:none}.q-btn-group--outline>.q-btn-item+.q-btn-item:before{border-left:0}.q-btn-group--outline>.q-btn-item:not(:last-child):before{border-right:0}.q-btn-group--stretch{align-self:stretch;border-radius:0}.q-btn-group--glossy>.q-btn-item{background-image:linear-gradient(to bottom,rgba(255,255,255,.3),rgba(255,255,255,0) 50%,rgba(0,0,0,.12) 51%,rgba(0,0,0,.04))!important}.q-btn-group--spread>.q-btn-group{display:flex!important}.q-btn-group--spread>.q-btn-item,.q-btn-group--spread>.q-btn-group>.q-btn-item:not(.q-btn-dropdown__arrow-container){width:auto;min-width:0;max-width:100%;flex:10000 1 0%}.q-btn-toggle{position:relative}.q-card{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;vertical-align:top;background:#fff;position:relative}.q-card>div:first-child,.q-card>img:first-child{border-top:0;border-top-left-radius:inherit;border-top-right-radius:inherit}.q-card>div:last-child,.q-card>img:last-child{border-bottom:0;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.q-card>div:not(:first-child),.q-card>img:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.q-card>div:not(:last-child),.q-card>img:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0}.q-card>div{border-left:0;border-right:0;box-shadow:none}.q-card--bordered{border:1px solid rgba(0,0,0,.12)}.q-card--dark{border-color:#ffffff47;box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-card__section{position:relative}.q-card__section--vert{padding:16px}.q-card__section--horiz>div:first-child,.q-card__section--horiz>img:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}.q-card__section--horiz>div:last-child,.q-card__section--horiz>img:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}.q-card__section--horiz>div:not(:first-child),.q-card__section--horiz>img:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.q-card__section--horiz>div:not(:last-child),.q-card__section--horiz>img:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.q-card__section--horiz>div{border-top:0;border-bottom:0;box-shadow:none}.q-card__actions{padding:8px;align-items:center}.q-card__actions .q-btn--rectangle{padding:0 8px}.q-card__actions--horiz>.q-btn-item+.q-btn-item,.q-card__actions--horiz>.q-btn-group+.q-btn-item,.q-card__actions--horiz>.q-btn-item+.q-btn-group{margin-left:8px}.q-card__actions--vert>.q-btn-item.q-btn--round{align-self:center}.q-card__actions--vert>.q-btn-item+.q-btn-item,.q-card__actions--vert>.q-btn-group+.q-btn-item,.q-card__actions--vert>.q-btn-item+.q-btn-group{margin-top:4px}.q-card__actions--vert>.q-btn-group>.q-btn-item{flex-grow:1}.q-card>img{display:block;width:100%;max-width:100%;border:0}.q-carousel{background-color:#fff;height:400px}.q-carousel__slide{min-height:100%;background-size:cover;background-position:50%}.q-carousel__slide,.q-carousel .q-carousel--padding{padding:16px}.q-carousel__slides-container{height:100%}.q-carousel__control{color:#fff}.q-carousel__arrow{pointer-events:none}.q-carousel__arrow .q-icon{font-size:28px}.q-carousel__arrow .q-btn{pointer-events:all}.q-carousel__prev-arrow--horizontal,.q-carousel__next-arrow--horizontal{top:16px;bottom:16px}.q-carousel__prev-arrow--horizontal{left:16px}.q-carousel__next-arrow--horizontal{right:16px}.q-carousel__prev-arrow--vertical,.q-carousel__next-arrow--vertical{left:16px;right:16px}.q-carousel__prev-arrow--vertical{top:16px}.q-carousel__next-arrow--vertical{bottom:16px}.q-carousel__navigation--top,.q-carousel__navigation--bottom{left:16px;right:16px;overflow-x:auto;overflow-y:hidden}.q-carousel__navigation--top{top:16px}.q-carousel__navigation--bottom{bottom:16px}.q-carousel__navigation--left,.q-carousel__navigation--right{top:16px;bottom:16px;overflow-x:hidden;overflow-y:auto}.q-carousel__navigation--left>.q-carousel__navigation-inner,.q-carousel__navigation--right>.q-carousel__navigation-inner{flex-direction:column}.q-carousel__navigation--left{left:16px}.q-carousel__navigation--right{right:16px}.q-carousel__navigation-inner{flex:1 1 auto}.q-carousel__navigation .q-btn{margin:6px 4px;padding:5px}.q-carousel__navigation-icon--inactive{opacity:.7}.q-carousel .q-carousel__thumbnail{margin:2px;height:50px;width:auto;display:inline-block;cursor:pointer;border:1px solid transparent;border-radius:4px;vertical-align:middle;opacity:.7;transition:opacity .3s}.q-carousel .q-carousel__thumbnail:hover,.q-carousel .q-carousel__thumbnail--active{opacity:1}.q-carousel .q-carousel__thumbnail--active{border-color:currentColor;cursor:default}.q-carousel--navigation-top.q-carousel--with-padding .q-carousel__slide,.q-carousel--navigation-top .q-carousel--padding,.q-carousel--arrows-vertical.q-carousel--with-padding .q-carousel__slide,.q-carousel--arrows-vertical .q-carousel--padding{padding-top:60px}.q-carousel--navigation-bottom.q-carousel--with-padding .q-carousel__slide,.q-carousel--navigation-bottom .q-carousel--padding,.q-carousel--arrows-vertical.q-carousel--with-padding .q-carousel__slide,.q-carousel--arrows-vertical .q-carousel--padding{padding-bottom:60px}.q-carousel--navigation-left.q-carousel--with-padding .q-carousel__slide,.q-carousel--navigation-left .q-carousel--padding,.q-carousel--arrows-horizontal.q-carousel--with-padding .q-carousel__slide,.q-carousel--arrows-horizontal .q-carousel--padding{padding-left:60px}.q-carousel--navigation-right.q-carousel--with-padding .q-carousel__slide,.q-carousel--navigation-right .q-carousel--padding,.q-carousel--arrows-horizontal.q-carousel--with-padding .q-carousel__slide,.q-carousel--arrows-horizontal .q-carousel--padding{padding-right:60px}.q-carousel.fullscreen{height:100%}.q-message-name,.q-message-stamp,.q-message-label{font-size:small}.q-message-label{margin:24px 0;text-align:center}.q-message-stamp{color:inherit;margin-top:4px;opacity:.6;display:none}.q-message-avatar{border-radius:50%;width:48px;height:48px;min-width:48px}.q-message{margin-bottom:8px}.q-message:first-child .q-message-label{margin-top:0}.q-message-avatar--received{margin-right:8px}.q-message-text--received{color:#81c784;border-radius:4px 4px 4px 0}.q-message-text--received:last-child:before{right:100%;border-right:0 solid transparent;border-left:8px solid transparent;border-bottom:8px solid currentColor}.q-message-text-content--received{color:#000}.q-message-name--sent{text-align:right}.q-message-avatar--sent{margin-left:8px}.q-message-container--sent{flex-direction:row-reverse}.q-message-text--sent{color:#e0e0e0;border-radius:4px 4px 0}.q-message-text--sent:last-child:before{left:100%;border-left:0 solid transparent;border-right:8px solid transparent;border-bottom:8px solid currentColor}.q-message-text-content--sent{color:#000}.q-message-text{background:currentColor;padding:8px;line-height:1.2;word-break:break-word;position:relative}.q-message-text+.q-message-text{margin-top:3px}.q-message-text:last-child{min-height:48px}.q-message-text:last-child .q-message-stamp{display:block}.q-message-text:last-child:before{content:"";position:absolute;bottom:0;width:0;height:0}.q-checkbox{vertical-align:middle}.q-checkbox__native{width:1px;height:1px}.q-checkbox__bg,.q-checkbox__icon-container{-webkit-user-select:none;user-select:none}.q-checkbox__bg{top:25%;left:25%;width:50%;height:50%;border:2px solid currentColor;border-radius:2px;transition:background .22s cubic-bezier(0,0,.2,1) 0ms;-webkit-print-color-adjust:exact}.q-checkbox__icon{color:currentColor;font-size:.5em}.q-checkbox__svg{color:#fff}.q-checkbox__truthy{stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.78334;stroke-dasharray:29.78334}.q-checkbox__indet{fill:currentColor;transform-origin:50% 50%;transform:rotate(-280deg) scale(0)}.q-checkbox__inner{font-size:40px;width:1em;min-width:1em;height:1em;outline:0;border-radius:50%;color:#0000008a}.q-checkbox__inner--truthy,.q-checkbox__inner--indet{color:var(--q-primary)}.q-checkbox__inner--truthy .q-checkbox__bg,.q-checkbox__inner--indet .q-checkbox__bg{background:currentColor}.q-checkbox__inner--truthy path{stroke-dashoffset:0;transition:stroke-dashoffset .18s cubic-bezier(.4,0,.6,1) 0ms}.q-checkbox__inner--indet .q-checkbox__indet{transform:rotate(0) scale(1);transition:transform .22s cubic-bezier(0,0,.2,1) 0ms}.q-checkbox.disabled{opacity:.75!important}.q-checkbox--dark .q-checkbox__inner{color:#ffffffb3}.q-checkbox--dark .q-checkbox__inner:before{opacity:.32!important}.q-checkbox--dark .q-checkbox__inner--truthy,.q-checkbox--dark .q-checkbox__inner--indet{color:var(--q-primary)}.q-checkbox--dense .q-checkbox__inner{width:.5em;min-width:.5em;height:.5em}.q-checkbox--dense .q-checkbox__bg{left:5%;top:5%;width:90%;height:90%}.q-checkbox--dense .q-checkbox__label{padding-left:.5em}.q-checkbox--dense.reverse .q-checkbox__label{padding-left:0;padding-right:.5em}body.desktop .q-checkbox:not(.disabled) .q-checkbox__inner:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:currentColor;opacity:.12;transform:scale3d(0,0,1);transition:transform .22s cubic-bezier(0,0,.2,1)}body.desktop .q-checkbox:not(.disabled):focus .q-checkbox__inner:before,body.desktop .q-checkbox:not(.disabled):hover .q-checkbox__inner:before{transform:scaleZ(1)}body.desktop .q-checkbox--dense:not(.disabled):focus .q-checkbox__inner:before,body.desktop .q-checkbox--dense:not(.disabled):hover .q-checkbox__inner:before{transform:scale3d(1.4,1.4,1)}.q-chip{vertical-align:middle;border-radius:16px;outline:0;position:relative;height:2em;max-width:100%;margin:4px;background:#e0e0e0;color:#000000de;font-size:14px;padding:.5em .9em}.q-chip--colored .q-chip__icon,.q-chip--dark .q-chip__icon{color:inherit}.q-chip--outline{background:transparent!important;border:1px solid currentColor}.q-chip .q-avatar{font-size:2em;margin-left:-.45em;margin-right:.2em;border-radius:16px}.q-chip--selected .q-avatar{display:none}.q-chip__icon{color:#0000008a;font-size:1.5em;margin:-.2em}.q-chip__icon--left{margin-right:.2em}.q-chip__icon--right{margin-left:.2em}.q-chip__icon--remove{margin-left:.1em;margin-right:-.5em;opacity:.6;outline:0}.q-chip__icon--remove:hover,.q-chip__icon--remove:focus{opacity:1}.q-chip__content{white-space:nowrap}.q-chip--dense{border-radius:12px;padding:0 .4em;height:1.5em}.q-chip--dense .q-avatar{font-size:1.5em;margin-left:-.27em;margin-right:.1em;border-radius:12px}.q-chip--dense .q-chip__icon{font-size:1.25em}.q-chip--dense .q-chip__icon--left{margin-right:.195em}.q-chip--dense .q-chip__icon--remove{margin-right:-.25em}.q-chip--square{border-radius:4px}.q-chip--square .q-avatar{border-radius:3px 0 0 3px}body.desktop .q-chip--clickable:focus{box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f}body.desktop.body--dark .q-chip--clickable:focus{box-shadow:0 1px 3px #fff3,0 1px 1px #ffffff24,0 2px 1px -1px #ffffff1f}.q-circular-progress{display:inline-block;position:relative;vertical-align:middle;width:1em;height:1em;line-height:1}.q-circular-progress.q-focusable{border-radius:50%}.q-circular-progress__svg{width:100%;height:100%}.q-circular-progress__text{font-size:.25em}.q-circular-progress--indeterminate .q-circular-progress__svg{transform-origin:50% 50%;animation:q-spin 2s linear infinite}.q-circular-progress--indeterminate .q-circular-progress__circle{stroke-dasharray:1 400;stroke-dashoffset:0;animation:q-circular-progress-circle 1.5s ease-in-out infinite}@keyframes q-circular-progress-circle{0%{stroke-dasharray:1,400;stroke-dashoffset:0}50%{stroke-dasharray:400,400;stroke-dashoffset:-100}to{stroke-dasharray:400,400;stroke-dashoffset:-300}}.q-color-picker{overflow:hidden;background:#fff;max-width:350px;vertical-align:top;min-width:180px;border-radius:4px;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f}.q-color-picker .q-tab{padding:0!important}.q-color-picker--bordered{border:1px solid rgba(0,0,0,.12)}.q-color-picker__header-tabs{height:32px}.q-color-picker__header input{line-height:24px;border:0}.q-color-picker__header .q-tab{min-height:32px!important;height:32px!important}.q-color-picker__header .q-tab--inactive{background:linear-gradient(to top,rgba(0,0,0,.3) 0%,rgba(0,0,0,.15) 25%,rgba(0,0,0,.1))}.q-color-picker__error-icon{bottom:2px;right:2px;font-size:24px;opacity:0;transition:opacity .3s ease-in}.q-color-picker__header-content{position:relative;background:#fff}.q-color-picker__header-content--light{color:#000}.q-color-picker__header-content--dark{color:#fff}.q-color-picker__header-content--dark .q-tab--inactive:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(255,255,255,.2)}.q-color-picker__header-banner{height:36px}.q-color-picker__header-bg{background:#fff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAH0lEQVQoU2NkYGAwZkAFZ5G5jPRRgOYEVDeB3EBjBQBOZwTVugIGyAAAAABJRU5ErkJggg==)!important}.q-color-picker__footer{height:36px}.q-color-picker__footer .q-tab{min-height:36px!important;height:36px!important}.q-color-picker__footer .q-tab--inactive{background:linear-gradient(to bottom,rgba(0,0,0,.3) 0%,rgba(0,0,0,.15) 25%,rgba(0,0,0,.1))}.q-color-picker__spectrum{width:100%;height:100%}.q-color-picker__spectrum-tab{padding:0!important}.q-color-picker__spectrum-white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.q-color-picker__spectrum-black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.q-color-picker__spectrum-circle{width:10px;height:10px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-5px,-5px)}.q-color-picker__hue .q-slider__track{background:linear-gradient(to right,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100%)!important;opacity:1}.q-color-picker__alpha .q-slider__track-container{padding-top:0}.q-color-picker__alpha .q-slider__track:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;background:linear-gradient(90deg,rgba(255,255,255,0),#757575)}.q-color-picker__sliders{padding:0 16px}.q-color-picker__sliders .q-slider__thumb{color:#424242}.q-color-picker__sliders .q-slider__thumb path{stroke-width:2px;fill:transparent}.q-color-picker__sliders .q-slider--active path{stroke-width:3px}.q-color-picker__tune-tab .q-slider{margin-left:18px;margin-right:18px}.q-color-picker__tune-tab input{font-size:11px;border:1px solid #e0e0e0;border-radius:4px;width:3.5em}.q-color-picker__palette-tab{padding:0!important}.q-color-picker__palette-rows--editable .q-color-picker__cube{cursor:pointer}.q-color-picker__cube{padding-bottom:10%;width:10%!important}.q-color-picker input{color:inherit;background:transparent;outline:0;text-align:center}.q-color-picker .q-tabs{overflow:hidden}.q-color-picker .q-tab--active{box-shadow:0 0 14px 3px #0003}.q-color-picker .q-tab--active .q-focus-helper,.q-color-picker .q-tab__indicator{display:none}.q-color-picker .q-tab-panels{background:inherit}.q-color-picker--dark{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-color-picker--dark .q-color-picker__tune-tab input{border:1px solid rgba(255,255,255,.3)}.q-color-picker--dark .q-slider__thumb{color:#fafafa}.q-date{display:inline-flex;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;background:#fff;width:290px;min-width:290px;max-width:100%}.q-date--bordered{border:1px solid rgba(0,0,0,.12)}.q-date__header{border-top-left-radius:inherit;color:#fff;background-color:var(--q-primary);padding:16px}.q-date__actions{padding:0 16px 16px}.q-date__content,.q-date__main{outline:0}.q-date__content .q-btn{font-weight:400}.q-date__header-link{opacity:.64;outline:0;transition:opacity .3s ease-out}.q-date__header-link--active,.q-date__header-link:hover,.q-date__header-link:focus{opacity:1}.q-date__header-subtitle{font-size:14px;line-height:1.75;letter-spacing:.00938em}.q-date__header-title-label{font-size:24px;line-height:1.2;letter-spacing:.00735em}.q-date__view{height:100%;width:100%;min-height:290px;padding:16px}.q-date__navigation{height:12.5%}.q-date__navigation>div:first-child{width:8%;min-width:24px;justify-content:flex-end}.q-date__navigation>div:last-child{width:8%;min-width:24px;justify-content:flex-start}.q-date__calendar-weekdays{height:12.5%}.q-date__calendar-weekdays>div{opacity:.38;font-size:12px}.q-date__calendar-item{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;width:14.285%!important;height:12.5%!important;position:relative;padding:1px}.q-date__calendar-item:after{content:"";position:absolute;pointer-events:none;top:1px;right:0;bottom:1px;left:0;border-style:dashed;border-color:transparent;border-width:1px}.q-date__calendar-item>div,.q-date__calendar-item button{width:30px;height:30px;border-radius:50%}.q-date__calendar-item>div{line-height:30px;text-align:center}.q-date__calendar-item>button{line-height:22px}.q-date__calendar-item--out{opacity:.18}.q-date__calendar-item--fill{visibility:hidden}.q-date__range:before,.q-date__range-from:before,.q-date__range-to:before{content:"";background-color:currentColor;position:absolute;top:1px;bottom:1px;left:0;right:0;opacity:.3}.q-date__range:nth-child(7n-6):before,.q-date__range-from:nth-child(7n-6):before,.q-date__range-to:nth-child(7n-6):before{border-top-left-radius:0;border-bottom-left-radius:0}.q-date__range:nth-child(7n):before,.q-date__range-from:nth-child(7n):before,.q-date__range-to:nth-child(7n):before{border-top-right-radius:0;border-bottom-right-radius:0}.q-date__range-from:before{left:50%}.q-date__range-to:before{right:50%}.q-date__edit-range:after{border-color:currentColor transparent}.q-date__edit-range:nth-child(7n-6):after{border-top-left-radius:0;border-bottom-left-radius:0}.q-date__edit-range:nth-child(7n):after{border-top-right-radius:0;border-bottom-right-radius:0}.q-date__edit-range-from:after,.q-date__edit-range-from-to:after{left:4px;border-left-color:currentColor;border-top-color:currentColor;border-bottom-color:currentColor;border-top-left-radius:28px;border-bottom-left-radius:28px}.q-date__edit-range-to:after,.q-date__edit-range-from-to:after{right:4px;border-right-color:currentColor;border-top-color:currentColor;border-bottom-color:currentColor;border-top-right-radius:28px;border-bottom-right-radius:28px}.q-date__calendar-days-container{height:75%;min-height:192px}.q-date__calendar-days>div{height:16.66%!important}.q-date__event{position:absolute;bottom:2px;left:50%;height:5px;width:8px;border-radius:5px;background-color:var(--q-secondary);transform:translate3d(-50%,0,0)}.q-date__today{box-shadow:0 0 1px 0 currentColor}.q-date__years-content{padding:0 8px}.q-date__years-item,.q-date__months-item{flex:0 0 33.3333%}.q-date.disabled .q-date__header,.q-date.disabled .q-date__content,.q-date--readonly .q-date__header,.q-date--readonly .q-date__content{pointer-events:none}.q-date--readonly .q-date__navigation{display:none}.q-date--portrait{flex-direction:column}.q-date--portrait-standard .q-date__content{height:calc(100% - 86px)}.q-date--portrait-standard .q-date__header{border-top-right-radius:inherit;height:86px}.q-date--portrait-standard .q-date__header-title{align-items:center;height:30px}.q-date--portrait-minimal .q-date__content{height:100%}.q-date--landscape{flex-direction:row;align-items:stretch;min-width:420px}.q-date--landscape>div{display:flex;flex-direction:column}.q-date--landscape .q-date__content{height:100%}.q-date--landscape-standard{min-width:420px}.q-date--landscape-standard .q-date__header{border-bottom-left-radius:inherit;min-width:110px;width:110px}.q-date--landscape-standard .q-date__header-title{flex-direction:column}.q-date--landscape-standard .q-date__header-today{margin-top:12px;margin-left:-8px}.q-date--landscape-minimal{width:310px}.q-date--dark{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f;border-color:#ffffff47}.q-dialog__title{font-size:1.25rem;font-weight:500;line-height:2rem;letter-spacing:.0125em}.q-dialog__progress{font-size:4rem}.q-dialog__inner{outline:0}.q-dialog__inner>div{pointer-events:all;overflow:auto;-webkit-overflow-scrolling:touch;will-change:scroll-position;border-radius:4px}.q-dialog__inner--square>div{border-radius:0!important}.q-dialog__inner>.q-card>.q-card__actions .q-btn--rectangle{min-width:64px}.q-dialog__inner--minimized{padding:24px}.q-dialog__inner--minimized>div{max-height:calc(100vh - 48px)}.q-dialog__inner--maximized>div{height:100%;width:100%;max-height:100vh;max-width:100vw;border-radius:0!important;top:0!important;left:0!important}.q-dialog__inner--top,.q-dialog__inner--bottom{padding-top:0!important;padding-bottom:0!important}.q-dialog__inner--right,.q-dialog__inner--left{padding-right:0!important;padding-left:0!important}.q-dialog__inner--left:not(.q-dialog__inner--animating)>div,.q-dialog__inner--top:not(.q-dialog__inner--animating)>div{border-top-left-radius:0}.q-dialog__inner--right:not(.q-dialog__inner--animating)>div,.q-dialog__inner--top:not(.q-dialog__inner--animating)>div{border-top-right-radius:0}.q-dialog__inner--left:not(.q-dialog__inner--animating)>div,.q-dialog__inner--bottom:not(.q-dialog__inner--animating)>div{border-bottom-left-radius:0}.q-dialog__inner--right:not(.q-dialog__inner--animating)>div,.q-dialog__inner--bottom:not(.q-dialog__inner--animating)>div{border-bottom-right-radius:0}.q-dialog__inner--fullwidth>div{width:100%!important;max-width:100%!important}.q-dialog__inner--fullheight>div{height:100%!important;max-height:100%!important}.q-dialog__backdrop{z-index:-1;pointer-events:all;outline:0;background:rgba(0,0,0,.4)}body.platform-ios .q-dialog__inner--minimized>div,body.platform-android:not(.native-mobile) .q-dialog__inner--minimized>div{max-height:calc(100vh - 108px)}body.q-ios-padding .q-dialog__inner{padding-top:20px!important;padding-top:env(safe-area-inset-top)!important;padding-bottom:env(safe-area-inset-bottom)!important}body.q-ios-padding .q-dialog__inner>div{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important}@media (max-width: 599.98px){.q-dialog__inner--top,.q-dialog__inner--bottom{padding-left:0;padding-right:0}.q-dialog__inner--top>div,.q-dialog__inner--bottom>div{width:100%!important}}@media (min-width: 600px){.q-dialog__inner--minimized>div{max-width:560px}}.q-body--dialog{overflow:hidden}.q-bottom-sheet{padding-bottom:8px}.q-bottom-sheet__avatar{border-radius:50%}.q-bottom-sheet--list{width:400px}.q-bottom-sheet--list .q-icon,.q-bottom-sheet--list img{font-size:24px;width:24px;height:24px}.q-bottom-sheet--grid{width:700px}.q-bottom-sheet--grid .q-bottom-sheet__item{padding:8px;text-align:center;min-width:100px}.q-bottom-sheet--grid .q-icon,.q-bottom-sheet--grid img,.q-bottom-sheet--grid .q-bottom-sheet__empty-icon{font-size:48px;width:48px;height:48px;margin-bottom:8px}.q-bottom-sheet--grid .q-separator{margin:12px 0}.q-bottom-sheet__item{flex:0 0 33.3333%}@media (min-width: 600px){.q-bottom-sheet__item{flex:0 0 25%}}.q-dialog-plugin{width:400px}.q-dialog-plugin__form{max-height:50vh}.q-dialog-plugin .q-card__section+.q-card__section{padding-top:0}.q-dialog-plugin--progress{text-align:center}.q-editor{border:1px solid rgba(0,0,0,.12);border-radius:4px;background-color:#fff}.q-editor.disabled{border-style:dashed}.q-editor>div:first-child,.q-editor__toolbars-container,.q-editor__toolbars-container>div:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.q-editor__content{outline:0;padding:10px;min-height:10em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;overflow:auto;max-width:100%}.q-editor__content pre{white-space:pre-wrap}.q-editor__content hr{border:0;outline:0;margin:1px;height:1px;background:rgba(0,0,0,.12)}.q-editor__content:empty:not(:focus):before{content:attr(placeholder);opacity:.7}.q-editor__toolbar{border-bottom:1px solid rgba(0,0,0,.12);min-height:32px}.q-editor__toolbars-container{max-width:100%}.q-editor .q-btn{margin:4px}.q-editor__toolbar-group{position:relative;margin:0 4px}.q-editor__toolbar-group+.q-editor__toolbar-group:before{content:"";position:absolute;left:-4px;top:4px;bottom:4px;width:1px;background:rgba(0,0,0,.12)}.q-editor__link-input{color:inherit;text-decoration:none;text-transform:none;border:none;border-radius:0;background:none;outline:0}.q-editor--flat,.q-editor--flat .q-editor__toolbar{border:0}.q-editor--dense .q-editor__toolbar-group{display:flex;align-items:center;flex-wrap:nowrap}.q-editor--dark{border-color:#ffffff47}.q-editor--dark .q-editor__content hr{background:rgba(255,255,255,.28)}.q-editor--dark .q-editor__toolbar{border-color:#ffffff47}.q-editor--dark .q-editor__toolbar-group+.q-editor__toolbar-group:before{background:rgba(255,255,255,.28)}.q-expansion-item__border{opacity:0}.q-expansion-item__toggle-icon{position:relative;transition:transform .3s}.q-expansion-item__toggle-icon--rotated{transform:rotate(180deg)}.q-expansion-item__toggle-focus{width:1em!important;height:1em!important;position:relative!important}.q-expansion-item__toggle-focus+.q-expansion-item__toggle-icon{margin-top:-1em}.q-expansion-item--standard.q-expansion-item--expanded>div>.q-expansion-item__border{opacity:1}.q-expansion-item--popup{transition:padding .5s}.q-expansion-item--popup>.q-expansion-item__container{border:1px solid rgba(0,0,0,.12)}.q-expansion-item--popup>.q-expansion-item__container>.q-separator{display:none}.q-expansion-item--popup.q-expansion-item--collapsed{padding:0 15px}.q-expansion-item--popup.q-expansion-item--expanded{padding:15px 0}.q-expansion-item--popup.q-expansion-item--expanded+.q-expansion-item--popup.q-expansion-item--expanded{padding-top:0}.q-expansion-item--popup.q-expansion-item--collapsed:not(:first-child)>.q-expansion-item__container{border-top-width:0}.q-expansion-item--popup.q-expansion-item--expanded+.q-expansion-item--popup.q-expansion-item--collapsed>.q-expansion-item__container{border-top-width:1px}.q-expansion-item__content>.q-card{box-shadow:none;border-radius:0}.q-expansion-item:first-child>div>.q-expansion-item__border--top{opacity:0}.q-expansion-item:last-child>div>.q-expansion-item__border--bottom{opacity:0}.q-expansion-item--expanded+.q-expansion-item--expanded>div>.q-expansion-item__border--top{opacity:0}.q-expansion-item--expanded .q-textarea--autogrow textarea{animation:q-expansion-done 0s}@keyframes q-expansion-done{0%{--q-exp-done: 1}}.z-fab{z-index:990}.q-fab{position:relative;vertical-align:middle}.q-fab>.q-btn{width:100%}.q-fab--form-rounded{border-radius:28px}.q-fab--form-square{border-radius:4px}.q-fab__icon,.q-fab__active-icon{transition:opacity .4s,transform .4s}.q-fab__icon{opacity:1;transform:rotate(0)}.q-fab__active-icon{opacity:0;transform:rotate(-180deg)}.q-fab__label--external{position:absolute;padding:0 8px;transition:opacity .18s cubic-bezier(.65,.815,.735,.395)}.q-fab__label--external-hidden{opacity:0;pointer-events:none}.q-fab__label--external-left{top:50%;left:-12px;transform:translate(-100%,-50%)}.q-fab__label--external-right{top:50%;right:-12px;transform:translate(100%,-50%)}.q-fab__label--external-bottom{bottom:-12px;left:50%;transform:translate(-50%,100%)}.q-fab__label--external-top{top:-12px;left:50%;transform:translate(-50%,-100%)}.q-fab__label--internal{padding:0;transition:font-size .12s cubic-bezier(.65,.815,.735,.395),max-height .12s cubic-bezier(.65,.815,.735,.395),opacity .07s cubic-bezier(.65,.815,.735,.395);max-height:30px}.q-fab__label--internal-hidden{font-size:0;opacity:0}.q-fab__label--internal-top{padding-bottom:.12em}.q-fab__label--internal-bottom{padding-top:.12em}.q-fab__label--internal-top.q-fab__label--internal-hidden,.q-fab__label--internal-bottom.q-fab__label--internal-hidden{max-height:0}.q-fab__label--internal-left{padding-left:.285em;padding-right:.571em}.q-fab__label--internal-right{padding-right:.285em;padding-left:.571em}.q-fab__icon-holder{min-width:24px;min-height:24px;position:relative}.q-fab__icon-holder--opened .q-fab__icon{transform:rotate(180deg);opacity:0}.q-fab__icon-holder--opened .q-fab__active-icon{transform:rotate(0);opacity:1}.q-fab__actions{position:absolute;opacity:0;transition:transform .18s ease-in,opacity .18s ease-in;pointer-events:none;align-items:center;justify-content:center;align-self:center;padding:3px}.q-fab__actions .q-btn{margin:5px}.q-fab__actions--right{transform-origin:0 50%;transform:scale(.4) translate(-62px);height:56px;left:100%;margin-left:9px}.q-fab__actions--left{transform-origin:100% 50%;transform:scale(.4) translate(62px);height:56px;right:100%;margin-right:9px;flex-direction:row-reverse}.q-fab__actions--up{transform-origin:50% 100%;transform:scale(.4) translateY(62px);width:56px;bottom:100%;margin-bottom:9px;flex-direction:column-reverse}.q-fab__actions--down{transform-origin:50% 0;transform:scale(.4) translateY(-62px);width:56px;top:100%;margin-top:9px;flex-direction:column}.q-fab__actions--up,.q-fab__actions--down{left:50%;margin-left:-28px}.q-fab__actions--opened{opacity:1;transform:scale(1) translate(.1px);pointer-events:all}.q-fab--align-left>.q-fab__actions--up,.q-fab--align-left>.q-fab__actions--down{align-items:flex-start;left:28px}.q-fab--align-right>.q-fab__actions--up,.q-fab--align-right>.q-fab__actions--down{align-items:flex-end;left:auto;right:0}.q-field{font-size:14px}.q-field ::-ms-clear,.q-field ::-ms-reveal{display:none}.q-field--with-bottom{padding-bottom:20px}.q-field__marginal{height:56px;color:#0000008a;font-size:24px}.q-field__marginal>*+*{margin-left:2px}.q-field__marginal .q-avatar{font-size:32px}.q-field__before,.q-field__prepend{padding-right:12px}.q-field__after,.q-field__append{padding-left:12px}.q-field__after:empty,.q-field__append:empty{display:none}.q-field__append+.q-field__append{padding-left:2px}.q-field__inner{text-align:left}.q-field__bottom{font-size:12px;min-height:20px;line-height:1;color:#0000008a;padding:8px 12px 0;backface-visibility:hidden}.q-field__bottom--animated{transform:translateY(100%);position:absolute;left:0;right:0;bottom:0}.q-field__messages{line-height:1}.q-field__messages>div{word-break:break-word;word-wrap:break-word;overflow-wrap:break-word}.q-field__messages>div+div{margin-top:4px}.q-field__counter{padding-left:8px;line-height:1}.q-field--item-aligned{padding:8px 16px}.q-field--item-aligned .q-field__before{min-width:56px}.q-field__control-container{height:inherit}.q-field__control{color:var(--q-primary);height:56px;max-width:100%;outline:none}.q-field__control:before,.q-field__control:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.q-field__control:before{border-radius:inherit}.q-field__shadow{top:8px;opacity:0;overflow:hidden;white-space:pre-wrap;transition:opacity .36s cubic-bezier(.4,0,.2,1)}.q-field__shadow+.q-field__native::placeholder{transition:opacity .36s cubic-bezier(.4,0,.2,1)}.q-field__shadow+.q-field__native:focus::placeholder{opacity:0}.q-field__native,.q-field__prefix,.q-field__suffix,.q-field__input{font-weight:400;line-height:28px;letter-spacing:.00937em;text-decoration:inherit;text-transform:inherit;border:none;border-radius:0;background:none;color:#000000de;outline:0;padding:6px 0}.q-field__native,.q-field__input{width:100%;min-width:0;outline:0!important;-webkit-user-select:auto;user-select:auto}.q-field__native:-webkit-autofill,.q-field__input:-webkit-autofill{-webkit-animation-name:q-autofill;-webkit-animation-fill-mode:both}.q-field__native:-webkit-autofill+.q-field__label,.q-field__input:-webkit-autofill+.q-field__label{transform:translateY(-40%) scale(.75)}.q-field__native[type=color]+.q-field__label,.q-field__native[type=date]+.q-field__label,.q-field__native[type=datetime-local]+.q-field__label,.q-field__native[type=month]+.q-field__label,.q-field__native[type=time]+.q-field__label,.q-field__native[type=week]+.q-field__label,.q-field__input[type=color]+.q-field__label,.q-field__input[type=date]+.q-field__label,.q-field__input[type=datetime-local]+.q-field__label,.q-field__input[type=month]+.q-field__label,.q-field__input[type=time]+.q-field__label,.q-field__input[type=week]+.q-field__label{transform:translateY(-40%) scale(.75)}.q-field__native:invalid,.q-field__input:invalid{box-shadow:none}.q-field__native[type=file]{line-height:1em}.q-field__input{padding:0;height:0;min-height:24px;line-height:24px}.q-field__prefix,.q-field__suffix{transition:opacity .36s cubic-bezier(.4,0,.2,1);white-space:nowrap}.q-field__prefix{padding-right:4px}.q-field__suffix{padding-left:4px}.q-field--readonly .q-placeholder,.q-field--disabled .q-placeholder{opacity:1!important}.q-field--readonly.q-field--labeled .q-field__native,.q-field--readonly.q-field--labeled .q-field__input{cursor:default}.q-field--readonly.q-field--float .q-field__native,.q-field--readonly.q-field--float .q-field__input{cursor:text}.q-field--disabled .q-field__inner{cursor:not-allowed}.q-field--disabled .q-field__control{pointer-events:none}.q-field--disabled .q-field__control>div{opacity:.6!important}.q-field--disabled .q-field__control>div,.q-field--disabled .q-field__control>div *{outline:0!important}.q-field__label{left:0;top:18px;max-width:100%;color:#0009;font-size:16px;line-height:20px;font-weight:400;letter-spacing:.00937em;text-decoration:inherit;text-transform:inherit;transform-origin:left top;transition:transform .36s cubic-bezier(.4,0,.2,1),max-width .324s cubic-bezier(.4,0,.2,1);backface-visibility:hidden}.q-field--float .q-field__label{max-width:133%;transform:translateY(-40%) scale(.75);transition:transform .36s cubic-bezier(.4,0,.2,1),max-width .396s cubic-bezier(.4,0,.2,1)}.q-field--highlighted .q-field__label{color:currentColor}.q-field--highlighted .q-field__shadow{opacity:.5}.q-field--filled .q-field__control{padding:0 12px;background:rgba(0,0,0,.05);border-radius:4px 4px 0 0}.q-field--filled .q-field__control:before{background:rgba(0,0,0,.05);border-bottom:1px solid rgba(0,0,0,.42);opacity:0;transition:opacity .36s cubic-bezier(.4,0,.2,1),background .36s cubic-bezier(.4,0,.2,1)}.q-field--filled .q-field__control:hover:before{opacity:1}.q-field--filled .q-field__control:after{height:2px;top:auto;transform-origin:center bottom;transform:scale3d(0,1,1);background:currentColor;transition:transform .36s cubic-bezier(.4,0,.2,1)}.q-field--filled.q-field--rounded .q-field__control{border-radius:28px 28px 0 0}.q-field--filled.q-field--highlighted .q-field__control:before{opacity:1;background:rgba(0,0,0,.12)}.q-field--filled.q-field--highlighted .q-field__control:after{transform:scaleZ(1)}.q-field--filled.q-field--dark .q-field__control,.q-field--filled.q-field--dark .q-field__control:before{background:rgba(255,255,255,.07)}.q-field--filled.q-field--dark.q-field--highlighted .q-field__control:before{background:rgba(255,255,255,.1)}.q-field--filled.q-field--readonly .q-field__control:before{opacity:1;background:transparent;border-bottom-style:dashed}.q-field--outlined .q-field__control{border-radius:4px;padding:0 12px}.q-field--outlined .q-field__control:before{border:1px solid rgba(0,0,0,.24);transition:border-color .36s cubic-bezier(.4,0,.2,1)}.q-field--outlined .q-field__control:hover:before{border-color:#000}.q-field--outlined .q-field__control:after{height:inherit;border-radius:inherit;border:2px solid transparent;transition:border-color .36s cubic-bezier(.4,0,.2,1)}.q-field--outlined .q-field__native:-webkit-autofill,.q-field--outlined .q-field__input:-webkit-autofill{margin-top:1px;margin-bottom:1px}.q-field--outlined.q-field--rounded .q-field__control{border-radius:28px}.q-field--outlined.q-field--highlighted .q-field__control:hover:before{border-color:transparent}.q-field--outlined.q-field--highlighted .q-field__control:after{border-color:currentColor;border-width:2px;transform:scaleZ(1)}.q-field--outlined.q-field--readonly .q-field__control:before{border-style:dashed}.q-field--standard .q-field__control:before{border-bottom:1px solid rgba(0,0,0,.24);transition:border-color .36s cubic-bezier(.4,0,.2,1)}.q-field--standard .q-field__control:hover:before{border-color:#000}.q-field--standard .q-field__control:after{height:2px;top:auto;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;transform-origin:center bottom;transform:scale3d(0,1,1);background:currentColor;transition:transform .36s cubic-bezier(.4,0,.2,1)}.q-field--standard.q-field--highlighted .q-field__control:after{transform:scaleZ(1)}.q-field--standard.q-field--readonly .q-field__control:before{border-bottom-style:dashed}.q-field--dark .q-field__control:before{border-color:#fff9}.q-field--dark .q-field__control:hover:before{border-color:#fff}.q-field--dark .q-field__native,.q-field--dark .q-field__prefix,.q-field--dark .q-field__suffix,.q-field--dark .q-field__input{color:#fff}.q-field--dark:not(.q-field--highlighted) .q-field__label,.q-field--dark .q-field__marginal,.q-field--dark .q-field__bottom{color:#ffffffb3}.q-field--standout .q-field__control{padding:0 12px;background:rgba(0,0,0,.05);border-radius:4px;transition:box-shadow .36s cubic-bezier(.4,0,.2,1),background-color .36s cubic-bezier(.4,0,.2,1)}.q-field--standout .q-field__control:before{background:rgba(0,0,0,.07);opacity:0;transition:opacity .36s cubic-bezier(.4,0,.2,1),background .36s cubic-bezier(.4,0,.2,1)}.q-field--standout .q-field__control:hover:before{opacity:1}.q-field--standout.q-field--rounded .q-field__control{border-radius:28px}.q-field--standout.q-field--highlighted .q-field__control{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;background:#000}.q-field--standout.q-field--highlighted .q-field__native,.q-field--standout.q-field--highlighted .q-field__prefix,.q-field--standout.q-field--highlighted .q-field__suffix,.q-field--standout.q-field--highlighted .q-field__prepend,.q-field--standout.q-field--highlighted .q-field__append,.q-field--standout.q-field--highlighted .q-field__input{color:#fff}.q-field--standout.q-field--readonly .q-field__control:before{opacity:1;background:transparent;border:1px dashed rgba(0,0,0,.24)}.q-field--standout.q-field--dark .q-field__control{background:rgba(255,255,255,.07)}.q-field--standout.q-field--dark .q-field__control:before{background:rgba(255,255,255,.07)}.q-field--standout.q-field--dark.q-field--highlighted .q-field__control{background:#fff}.q-field--standout.q-field--dark.q-field--highlighted .q-field__native,.q-field--standout.q-field--dark.q-field--highlighted .q-field__prefix,.q-field--standout.q-field--dark.q-field--highlighted .q-field__suffix,.q-field--standout.q-field--dark.q-field--highlighted .q-field__prepend,.q-field--standout.q-field--dark.q-field--highlighted .q-field__append,.q-field--standout.q-field--dark.q-field--highlighted .q-field__input{color:#000}.q-field--standout.q-field--dark.q-field--readonly .q-field__control:before{border-color:#ffffff3d}.q-field--labeled .q-field__native,.q-field--labeled .q-field__prefix,.q-field--labeled .q-field__suffix{line-height:24px;padding-top:24px;padding-bottom:8px}.q-field--labeled .q-field__shadow{top:0}.q-field--labeled:not(.q-field--float) .q-field__prefix,.q-field--labeled:not(.q-field--float) .q-field__suffix{opacity:0}.q-field--labeled:not(.q-field--float) .q-field__native::placeholder,.q-field--labeled:not(.q-field--float) .q-field__input::placeholder{color:transparent}.q-field--labeled.q-field--dense .q-field__native,.q-field--labeled.q-field--dense .q-field__prefix,.q-field--labeled.q-field--dense .q-field__suffix{padding-top:14px;padding-bottom:2px}.q-field--dense .q-field__shadow{top:0}.q-field--dense .q-field__control,.q-field--dense .q-field__marginal{height:40px}.q-field--dense .q-field__bottom{font-size:11px}.q-field--dense .q-field__label{font-size:14px;top:10px}.q-field--dense .q-field__before,.q-field--dense .q-field__prepend{padding-right:6px}.q-field--dense .q-field__after,.q-field--dense .q-field__append{padding-left:6px}.q-field--dense .q-field__append+.q-field__append{padding-left:2px}.q-field--dense .q-field__marginal .q-avatar{font-size:24px}.q-field--dense.q-field--float .q-field__label{transform:translateY(-30%) scale(.75)}.q-field--dense .q-field__native:-webkit-autofill+.q-field__label,.q-field--dense .q-field__input:-webkit-autofill+.q-field__label{transform:translateY(-30%) scale(.75)}.q-field--dense .q-field__native[type=color]+.q-field__label,.q-field--dense .q-field__native[type=date]+.q-field__label,.q-field--dense .q-field__native[type=datetime-local]+.q-field__label,.q-field--dense .q-field__native[type=month]+.q-field__label,.q-field--dense .q-field__native[type=time]+.q-field__label,.q-field--dense .q-field__native[type=week]+.q-field__label,.q-field--dense .q-field__input[type=color]+.q-field__label,.q-field--dense .q-field__input[type=date]+.q-field__label,.q-field--dense .q-field__input[type=datetime-local]+.q-field__label,.q-field--dense .q-field__input[type=month]+.q-field__label,.q-field--dense .q-field__input[type=time]+.q-field__label,.q-field--dense .q-field__input[type=week]+.q-field__label{transform:translateY(-30%) scale(.75)}.q-field--borderless .q-field__bottom,.q-field--borderless.q-field--dense .q-field__control,.q-field--standard .q-field__bottom,.q-field--standard.q-field--dense .q-field__control{padding-left:0;padding-right:0}.q-field--error .q-field__label{animation:q-field-label .36s}.q-field--error .q-field__bottom{color:var(--q-negative)}.q-field__focusable-action{opacity:.6;cursor:pointer;outline:0!important;border:0;color:inherit;background:transparent;padding:0}.q-field__focusable-action:hover,.q-field__focusable-action:focus{opacity:1}.q-field--auto-height .q-field__control{height:auto}.q-field--auto-height .q-field__control,.q-field--auto-height .q-field__native{min-height:56px}.q-field--auto-height .q-field__native{align-items:center}.q-field--auto-height .q-field__control-container{padding-top:0}.q-field--auto-height .q-field__native,.q-field--auto-height .q-field__prefix,.q-field--auto-height .q-field__suffix{line-height:18px}.q-field--auto-height.q-field--labeled .q-field__control-container{padding-top:24px}.q-field--auto-height.q-field--labeled .q-field__shadow{top:24px}.q-field--auto-height.q-field--labeled .q-field__native,.q-field--auto-height.q-field--labeled .q-field__prefix,.q-field--auto-height.q-field--labeled .q-field__suffix{padding-top:0}.q-field--auto-height.q-field--labeled .q-field__native{min-height:24px}.q-field--auto-height.q-field--dense .q-field__control,.q-field--auto-height.q-field--dense .q-field__native{min-height:40px}.q-field--auto-height.q-field--dense.q-field--labeled .q-field__control-container{padding-top:14px}.q-field--auto-height.q-field--dense.q-field--labeled .q-field__shadow{top:14px}.q-field--auto-height.q-field--dense.q-field--labeled .q-field__native{min-height:24px}.q-field--square .q-field__control{border-radius:0!important}.q-transition--field-message-enter-active,.q-transition--field-message-leave-active{transition:transform .6s cubic-bezier(.86,0,.07,1),opacity .6s cubic-bezier(.86,0,.07,1)}.q-transition--field-message-enter-from,.q-transition--field-message-leave-to{opacity:0;transform:translateY(-10px)}.q-transition--field-message-leave-from,.q-transition--field-message-leave-active{position:absolute}@keyframes q-field-label{40%{margin-left:2px}60%,80%{margin-left:-2px}70%,90%{margin-left:2px}}@keyframes q-autofill{to{background:transparent;color:inherit}}.q-file .q-field__native{word-break:break-all;overflow:hidden}.q-file .q-field__input{opacity:0!important}.q-file .q-field__input::-webkit-file-upload-button{cursor:pointer}.q-file__filler{visibility:hidden;width:100%;border:none;padding:0}.q-file__dnd{outline:1px dashed currentColor;outline-offset:-4px}.q-form{position:relative}.q-img{position:relative;width:100%;display:inline-block;vertical-align:middle;overflow:hidden}.q-img__loading .q-spinner{font-size:50px}.q-img__container{border-radius:inherit;font-size:0}.q-img__image{border-radius:inherit;width:100%;height:100%;opacity:0}.q-img__image--with-transition{transition:opacity .28s ease-in}.q-img__image--loaded{opacity:1}.q-img__content{border-radius:inherit;pointer-events:none}.q-img__content>div{pointer-events:all;position:absolute;padding:16px;color:#fff;background:rgba(0,0,0,.47)}.q-img--no-menu .q-img__image,.q-img--no-menu .q-img__placeholder{pointer-events:none}.q-inner-loading{background:rgba(255,255,255,.6)}.q-inner-loading--dark{background:rgba(0,0,0,.4)}.q-inner-loading__label{margin-top:8px}.q-textarea .q-field__control{min-height:56px;height:auto}.q-textarea .q-field__control-container{padding-top:2px;padding-bottom:2px}.q-textarea .q-field__shadow{top:2px;bottom:2px}.q-textarea .q-field__native,.q-textarea .q-field__prefix,.q-textarea .q-field__suffix{line-height:18px}.q-textarea .q-field__native{resize:vertical;padding-top:17px;min-height:52px}.q-textarea.q-field--labeled .q-field__control-container{padding-top:26px}.q-textarea.q-field--labeled .q-field__shadow{top:26px}.q-textarea.q-field--labeled .q-field__native,.q-textarea.q-field--labeled .q-field__prefix,.q-textarea.q-field--labeled .q-field__suffix{padding-top:0}.q-textarea.q-field--labeled .q-field__native{min-height:26px;padding-top:1px}.q-textarea--autogrow .q-field__native{resize:none}.q-textarea.q-field--dense .q-field__control,.q-textarea.q-field--dense .q-field__native{min-height:36px}.q-textarea.q-field--dense .q-field__native{padding-top:9px}.q-textarea.q-field--dense.q-field--labeled .q-field__control-container{padding-top:14px}.q-textarea.q-field--dense.q-field--labeled .q-field__shadow{top:14px}.q-textarea.q-field--dense.q-field--labeled .q-field__native{min-height:24px;padding-top:3px}.q-textarea.q-field--dense.q-field--labeled .q-field__prefix,.q-textarea.q-field--dense.q-field--labeled .q-field__suffix{padding-top:2px}body.mobile .q-textarea .q-field__native,.q-textarea.disabled .q-field__native{resize:none}.q-intersection{position:relative}.q-item{min-height:48px;padding:8px 16px;color:inherit;transition:color .3s,background-color .3s}.q-item__section--side{color:#757575;align-items:flex-start;padding-right:16px;width:auto;min-width:0;max-width:100%}.q-item__section--side>.q-icon{font-size:24px}.q-item__section--side>.q-avatar{font-size:40px}.q-item__section--avatar{color:inherit;min-width:56px}.q-item__section--thumbnail img{width:100px;height:56px}.q-item__section--nowrap{white-space:nowrap}.q-item>.q-item__section--thumbnail:first-child,.q-item>.q-focus-helper+.q-item__section--thumbnail{margin-left:-16px}.q-item>.q-item__section--thumbnail:last-of-type{margin-right:-16px}.q-item__label{line-height:1.2em!important;max-width:100%}.q-item__label--overline{color:#000000b3}.q-item__label--caption{color:#0000008a}.q-item__label--header{color:#757575;padding:16px;font-size:.875rem;line-height:1.25rem;letter-spacing:.01786em}.q-separator--spaced+.q-item__label--header,.q-list--padding .q-item__label--header{padding-top:8px}.q-item__label+.q-item__label{margin-top:4px}.q-item__section--main{width:auto;min-width:0;max-width:100%;flex:10000 1 0%}.q-item__section--main+.q-item__section--main{margin-left:8px}.q-item__section--main~.q-item__section--side{align-items:flex-end;padding-right:0;padding-left:16px}.q-item__section--main.q-item__section--thumbnail{margin-left:0;margin-right:-16px}.q-list--bordered{border:1px solid rgba(0,0,0,.12)}.q-list--separator>.q-item-type+.q-item-type,.q-list--separator>.q-virtual-scroll__content>.q-item-type+.q-item-type{border-top:1px solid rgba(0,0,0,.12)}.q-list--padding{padding:8px 0}.q-list--dense>.q-item,.q-item--dense{min-height:32px;padding:2px 16px}.q-list--dark.q-list--separator>.q-item-type+.q-item-type,.q-list--dark.q-list--separator>.q-virtual-scroll__content>.q-item-type+.q-item-type{border-top-color:#ffffff47}.q-list--dark,.q-item--dark{color:#fff;border-color:#ffffff47}.q-list--dark .q-item__section--side:not(.q-item__section--avatar),.q-item--dark .q-item__section--side:not(.q-item__section--avatar){color:#ffffffb3}.q-list--dark .q-item__label--header,.q-item--dark .q-item__label--header{color:#ffffffa3}.q-list--dark .q-item__label--overline,.q-list--dark .q-item__label--caption,.q-item--dark .q-item__label--overline,.q-item--dark .q-item__label--caption{color:#fffc}.q-item{position:relative}.q-item.q-router-link--active,.q-item--active{color:var(--q-primary)}.q-knob{font-size:48px}.q-knob--editable{cursor:pointer;outline:0}.q-knob--editable:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;box-shadow:none;transition:box-shadow .24s ease-in-out}.q-knob--editable:focus:before{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f}body.body--dark .q-knob--editable:focus:before{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-layout{width:100%;outline:0}.q-layout-container{position:relative;width:100%;height:100%}.q-layout-container .q-layout{min-height:100%}.q-layout-container>div{transform:translateZ(0)}.q-layout-container>div>div{min-height:0;max-height:100%}.q-layout__shadow{width:100%}.q-layout__shadow:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;box-shadow:0 0 10px 2px #0003,0 0 10px #0000003d}.q-layout__section--marginal{background-color:var(--q-primary);color:#fff}.q-header--hidden{transform:translateY(-110%)}.q-header--bordered{border-bottom:1px solid rgba(0,0,0,.12)}.q-header .q-layout__shadow{bottom:-10px}.q-header .q-layout__shadow:after{bottom:10px}.q-footer--hidden{transform:translateY(110%)}.q-footer--bordered{border-top:1px solid rgba(0,0,0,.12)}.q-footer .q-layout__shadow{top:-10px}.q-footer .q-layout__shadow:after{top:10px}.q-header,.q-footer{z-index:2000}.q-drawer{position:absolute;top:0;bottom:0;background:#fff;z-index:1000}.q-drawer--on-top{z-index:3000}.q-drawer--left{left:0;transform:translate(-100%)}.q-drawer--left.q-drawer--bordered{border-right:1px solid rgba(0,0,0,.12)}.q-drawer--left .q-layout__shadow{left:10px;right:-10px}.q-drawer--left .q-layout__shadow:after{right:10px}.q-drawer--right{right:0;transform:translate(100%)}.q-drawer--right.q-drawer--bordered{border-left:1px solid rgba(0,0,0,.12)}.q-drawer--right .q-layout__shadow{left:-10px}.q-drawer--right .q-layout__shadow:after{left:10px}.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini{padding:0!important}.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini .q-item,.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini .q-item__section{text-align:center;justify-content:center;padding-left:0;padding-right:0;min-width:0}.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini .q-item__label,.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini .q-item__section--main,.q-drawer-container:not(.q-drawer--mini-animate) .q-drawer--mini .q-item__section--side~.q-item__section--side{display:none}.q-drawer--mini .q-mini-drawer-hide,.q-drawer--mini .q-expansion-item__content{display:none}.q-drawer--mini-animate .q-drawer__content{overflow-x:hidden!important;white-space:nowrap}.q-drawer--standard .q-mini-drawer-only,.q-drawer--mobile .q-mini-drawer-only,.q-drawer--mobile .q-mini-drawer-hide{display:none}.q-drawer__backdrop{z-index:2999!important;will-change:background-color}.q-drawer__opener{z-index:2001;height:100%;width:15px;-webkit-user-select:none;user-select:none}.q-layout,.q-header,.q-footer,.q-page{position:relative}.q-page-sticky--shrink{pointer-events:none}.q-page-sticky--shrink>div{display:inline-block;pointer-events:auto}body.q-ios-padding .q-layout--standard .q-header>.q-toolbar:nth-child(1),body.q-ios-padding .q-layout--standard .q-header>.q-tabs:nth-child(1) .q-tabs-head,body.q-ios-padding .q-layout--standard .q-drawer--top-padding .q-drawer__content{padding-top:20px;min-height:70px;padding-top:env(safe-area-inset-top);min-height:calc(env(safe-area-inset-top) + 50px)}body.q-ios-padding .q-layout--standard .q-footer>.q-toolbar:last-child,body.q-ios-padding .q-layout--standard .q-footer>.q-tabs:last-child .q-tabs-head,body.q-ios-padding .q-layout--standard .q-drawer--top-padding .q-drawer__content{padding-bottom:env(safe-area-inset-bottom);min-height:calc(env(safe-area-inset-bottom) + 50px)}.q-body--layout-animate .q-drawer__backdrop{transition:background-color .12s!important}.q-body--layout-animate .q-drawer{transition:transform .12s,width .12s,top .12s,bottom .12s!important}.q-body--layout-animate .q-layout__section--marginal{transition:transform .12s,left .12s,right .12s!important}.q-body--layout-animate .q-page-container{transition:padding-top .12s,padding-right .12s,padding-bottom .12s,padding-left .12s!important}.q-body--layout-animate .q-page-sticky{transition:transform .12s,left .12s,right .12s,top .12s,bottom .12s!important}body:not(.q-body--layout-animate) .q-layout--prevent-focus{visibility:hidden}.q-body--drawer-toggle{overflow-x:hidden!important}@media (max-width: 599.98px){.q-layout-padding{padding:8px}}@media (min-width: 600px) and (max-width: 1439.98px){.q-layout-padding{padding:16px}}@media (min-width: 1440px){.q-layout-padding{padding:24px}}body.body--dark .q-header,body.body--dark .q-footer,body.body--dark .q-drawer{border-color:#ffffff47}body.body--dark .q-layout__shadow:after{box-shadow:0 0 10px 2px #fff3,0 0 10px #ffffff3d}body.platform-ios .q-layout--containerized{position:unset!important}.q-linear-progress{--q-linear-progress-speed: .3s;position:relative;width:100%;overflow:hidden;font-size:4px;height:1em;color:var(--q-primary);transform:scaleZ(1)}.q-linear-progress__model,.q-linear-progress__track{transform-origin:0 0}.q-linear-progress__model--with-transition,.q-linear-progress__track--with-transition{transition:transform var(--q-linear-progress-speed)}.q-linear-progress--reverse .q-linear-progress__model,.q-linear-progress--reverse .q-linear-progress__track{transform-origin:0 100%}.q-linear-progress__model--determinate{background:currentColor}.q-linear-progress__model--indeterminate,.q-linear-progress__model--query{transition:none}.q-linear-progress__model--indeterminate:before,.q-linear-progress__model--indeterminate:after,.q-linear-progress__model--query:before,.q-linear-progress__model--query:after{background:currentColor;content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:0 0}.q-linear-progress__model--indeterminate:before,.q-linear-progress__model--query:before{animation:q-linear-progress--indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.q-linear-progress__model--indeterminate:after,.q-linear-progress__model--query:after{transform:translate3d(-101%,0,0) scaleZ(1);animation:q-linear-progress--indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}.q-linear-progress__track{opacity:.4}.q-linear-progress__track--light{background:rgba(0,0,0,.26)}.q-linear-progress__track--dark{background:rgba(255,255,255,.6)}.q-linear-progress__stripe{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,rgba(255,255,255,0) 25%,rgba(255,255,255,0) 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,rgba(255,255,255,0) 75%,rgba(255,255,255,0))!important;background-size:40px 40px!important}.q-linear-progress__stripe--with-transition{transition:width var(--q-linear-progress-speed)}@keyframes q-linear-progress--indeterminate{0%{transform:translate3d(-35%,0,0) scale3d(.35,1,1)}60%{transform:translate3d(100%,0,0) scale3d(.9,1,1)}to{transform:translate3d(100%,0,0) scale3d(.9,1,1)}}@keyframes q-linear-progress--indeterminate-short{0%{transform:translate3d(-101%,0,0) scaleZ(1)}60%{transform:translate3d(107%,0,0) scale3d(.01,1,1)}to{transform:translate3d(107%,0,0) scale3d(.01,1,1)}}.q-menu{position:fixed!important;display:inline-block;max-width:95vw;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;background:#fff;border-radius:4px;overflow-y:auto;overflow-x:hidden;outline:0;max-height:65vh;z-index:6000}.q-menu--square{border-radius:0}.q-menu--dark{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-option-group--inline>div{display:inline-block}.q-pagination input{text-align:center;-moz-appearance:textfield}.q-pagination input::-webkit-outer-spin-button,.q-pagination input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.q-pagination__content{--q-pagination-gutter-parent: -2px;--q-pagination-gutter-child: 2px;margin-top:var(--q-pagination-gutter-parent);margin-left:var(--q-pagination-gutter-parent)}.q-pagination__content>.q-btn,.q-pagination__content>.q-input,.q-pagination__middle>.q-btn{margin-top:var(--q-pagination-gutter-child);margin-left:var(--q-pagination-gutter-child)}.q-parallax{position:relative;width:100%;overflow:hidden;border-radius:inherit}.q-parallax__media>img,.q-parallax__media>video{position:absolute;left:50%;bottom:0;min-width:100%;min-height:100%;will-change:transform;display:none}.q-popup-edit{padding:8px 16px}.q-popup-edit__buttons{margin-top:8px}.q-popup-edit__buttons .q-btn+.q-btn{margin-left:8px}.q-pull-to-refresh{position:relative}.q-pull-to-refresh__puller{border-radius:50%;width:40px;height:40px;color:var(--q-primary);background:#fff;box-shadow:0 0 4px #0000004d}.q-pull-to-refresh__puller--animating{transition:transform .3s,opacity .3s}.q-radio{vertical-align:middle}.q-radio__native{width:1px;height:1px}.q-radio__bg,.q-radio__icon-container{-webkit-user-select:none;user-select:none}.q-radio__bg{top:25%;left:25%;width:50%;height:50%;-webkit-print-color-adjust:exact}.q-radio__bg path{fill:currentColor}.q-radio__icon{color:currentColor;font-size:.5em}.q-radio__check{transform-origin:50% 50%;transform:scale3d(0,0,1);transition:transform .22s cubic-bezier(0,0,.2,1) 0ms}.q-radio__inner{font-size:40px;width:1em;min-width:1em;height:1em;outline:0;border-radius:50%;color:#0000008a}.q-radio__inner--truthy{color:var(--q-primary)}.q-radio__inner--truthy .q-radio__check{transform:scaleZ(1)}.q-radio.disabled{opacity:.75!important}.q-radio--dark .q-radio__inner{color:#ffffffb3}.q-radio--dark .q-radio__inner:before{opacity:.32!important}.q-radio--dark .q-radio__inner--truthy{color:var(--q-primary)}.q-radio--dense .q-radio__inner{width:.5em;min-width:.5em;height:.5em}.q-radio--dense .q-radio__bg{left:0;top:0;width:100%;height:100%}.q-radio--dense .q-radio__label{padding-left:.5em}.q-radio--dense.reverse .q-radio__label{padding-left:0;padding-right:.5em}body.desktop .q-radio:not(.disabled) .q-radio__inner:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:currentColor;opacity:.12;transform:scale3d(0,0,1);transition:transform .22s cubic-bezier(0,0,.2,1) 0ms}body.desktop .q-radio:not(.disabled):focus .q-radio__inner:before,body.desktop .q-radio:not(.disabled):hover .q-radio__inner:before{transform:scaleZ(1)}body.desktop .q-radio--dense:not(.disabled):focus .q-radio__inner:before,body.desktop .q-radio--dense:not(.disabled):hover .q-radio__inner:before{transform:scale3d(1.5,1.5,1)}.q-rating{color:#ffeb3b;vertical-align:middle}.q-rating__icon-container{height:1em;outline:0}.q-rating__icon-container+.q-rating__icon-container{margin-left:2px}.q-rating__icon{color:currentColor;text-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);position:relative;opacity:.4;transition:transform .2s ease-in,opacity .2s ease-in}.q-rating__icon--hovered{transform:scale(1.3)}.q-rating__icon--active{opacity:1}.q-rating__icon--exselected{opacity:.7}.q-rating--no-dimming .q-rating__icon{opacity:1}.q-rating--editable .q-rating__icon-container{cursor:pointer}.q-responsive{position:relative;max-width:100%;max-height:100%}.q-responsive__filler{width:inherit;max-width:inherit;height:inherit;max-height:inherit}.q-responsive__content{border-radius:inherit}.q-responsive__content>*{width:100%!important;height:100%!important;max-height:100%!important;max-width:100%!important}.q-scrollarea{position:relative;contain:strict}.q-scrollarea__bar,.q-scrollarea__thumb{opacity:.2;transition:opacity .3s;will-change:opacity;cursor:grab}.q-scrollarea__bar--v,.q-scrollarea__thumb--v{right:0;width:10px}.q-scrollarea__bar--h,.q-scrollarea__thumb--h{bottom:0;height:10px}.q-scrollarea__bar--invisible,.q-scrollarea__thumb--invisible{opacity:0!important;pointer-events:none}.q-scrollarea__thumb{background:#000;border-radius:3px}.q-scrollarea__thumb:hover{opacity:.3}.q-scrollarea__thumb:active{opacity:.5}.q-scrollarea__content{min-height:100%;min-width:100%}.q-scrollarea--dark .q-scrollarea__thumb{background:#fff}.q-select--without-input .q-field__control{cursor:pointer}.q-select--with-input .q-field__control{cursor:text}.q-select .q-field__input{min-width:50px!important;cursor:text}.q-select .q-field__input--padding{padding-left:4px}.q-select__focus-target,.q-select__autocomplete-input{position:absolute;outline:0!important;width:1px;height:1px;padding:0;border:0;opacity:0}.q-select__dropdown-icon{cursor:pointer;transition:transform .28s}.q-select.q-field--readonly .q-field__control,.q-select.q-field--readonly .q-select__dropdown-icon{cursor:default}.q-select__dialog{width:90vw!important;max-width:90vw!important;max-height:calc(100vh - 70px)!important;background:#fff;display:flex;flex-direction:column}.q-select__dialog>.scroll{position:relative;background:inherit}body.mobile:not(.native-mobile) .q-select__dialog{max-height:calc(100vh - 108px)!important}body.platform-android.native-mobile .q-dialog__inner--top .q-select__dialog{max-height:calc(100vh - 24px)!important}body.platform-android:not(.native-mobile) .q-dialog__inner--top .q-select__dialog{max-height:calc(100vh - 80px)!important}body.platform-ios.native-mobile .q-dialog__inner--top>div{border-radius:4px}body.platform-ios.native-mobile .q-dialog__inner--top .q-select__dialog--focused{max-height:47vh!important}body.platform-ios:not(.native-mobile) .q-dialog__inner--top .q-select__dialog--focused{max-height:50vh!important}.q-separator{border:0;background:rgba(0,0,0,.12);margin:0;transition:background .3s,opacity .3s;flex-shrink:0}.q-separator--dark{background:rgba(255,255,255,.28)}.q-separator--horizontal{display:block;height:1px}.q-separator--horizontal-inset{margin-left:16px;margin-right:16px}.q-separator--horizontal-item-inset{margin-left:72px;margin-right:0}.q-separator--horizontal-item-thumbnail-inset{margin-left:116px;margin-right:0}.q-separator--vertical{width:1px;height:auto;align-self:stretch}.q-separator--vertical-inset{margin-top:8px;margin-bottom:8px}.q-skeleton{--q-skeleton-speed: 1.5s;background:rgba(0,0,0,.12);border-radius:4px;box-sizing:border-box}.q-skeleton--anim{cursor:wait}.q-skeleton:before{content:"\a0"}.q-skeleton--type-text{transform:scaleY(.5)}.q-skeleton--type-circle,.q-skeleton--type-QAvatar{height:48px;width:48px;border-radius:50%}.q-skeleton--type-QBtn{width:90px;height:36px}.q-skeleton--type-QBadge{width:70px;height:16px}.q-skeleton--type-QChip{width:90px;height:28px;border-radius:16px}.q-skeleton--type-QToolbar{height:50px}.q-skeleton--type-QCheckbox,.q-skeleton--type-QRadio{width:40px;height:40px;border-radius:50%}.q-skeleton--type-QToggle{width:56px;height:40px;border-radius:7px}.q-skeleton--type-QSlider,.q-skeleton--type-QRange{height:40px}.q-skeleton--type-QInput{height:56px}.q-skeleton--bordered{border:1px solid rgba(0,0,0,.05)}.q-skeleton--square{border-radius:0}.q-skeleton--anim-fade{animation:q-skeleton--fade var(--q-skeleton-speed) linear .5s infinite}.q-skeleton--anim-pulse{animation:q-skeleton--pulse var(--q-skeleton-speed) ease-in-out .5s infinite}.q-skeleton--anim-pulse-x{animation:q-skeleton--pulse-x var(--q-skeleton-speed) ease-in-out .5s infinite}.q-skeleton--anim-pulse-y{animation:q-skeleton--pulse-y var(--q-skeleton-speed) ease-in-out .5s infinite}.q-skeleton--anim-wave,.q-skeleton--anim-blink,.q-skeleton--anim-pop{position:relative;overflow:hidden;z-index:1}.q-skeleton--anim-wave:after,.q-skeleton--anim-blink:after,.q-skeleton--anim-pop:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0}.q-skeleton--anim-blink:after{background:rgba(255,255,255,.7);animation:q-skeleton--fade var(--q-skeleton-speed) linear .5s infinite}.q-skeleton--anim-wave:after{background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.5),rgba(255,255,255,0));animation:q-skeleton--wave var(--q-skeleton-speed) linear .5s infinite}.q-skeleton--dark{background:rgba(255,255,255,.05)}.q-skeleton--dark.q-skeleton--bordered{border:1px solid rgba(255,255,255,.25)}.q-skeleton--dark.q-skeleton--anim-wave:after{background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.1),rgba(255,255,255,0))}.q-skeleton--dark.q-skeleton--anim-blink:after{background:rgba(255,255,255,.2)}@keyframes q-skeleton--fade{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes q-skeleton--pulse{0%{transform:scale(1)}50%{transform:scale(.85)}to{transform:scale(1)}}@keyframes q-skeleton--pulse-x{0%{transform:scaleX(1)}50%{transform:scaleX(.75)}to{transform:scaleX(1)}}@keyframes q-skeleton--pulse-y{0%{transform:scaleY(1)}50%{transform:scaleY(.75)}to{transform:scaleY(1)}}@keyframes q-skeleton--wave{0%{transform:translate(-100%)}to{transform:translate(100%)}}.q-slide-item{position:relative;background:white}.q-slide-item__left,.q-slide-item__right,.q-slide-item__top,.q-slide-item__bottom{visibility:hidden;font-size:14px;color:#fff}.q-slide-item__left .q-icon,.q-slide-item__right .q-icon,.q-slide-item__top .q-icon,.q-slide-item__bottom .q-icon{font-size:1.714em}.q-slide-item__left{background:#4caf50;padding:8px 16px}.q-slide-item__left>div{transform-origin:left center}.q-slide-item__right{background:#ff9800;padding:8px 16px}.q-slide-item__right>div{transform-origin:right center}.q-slide-item__top{background:#2196f3;padding:16px 8px}.q-slide-item__top>div{transform-origin:top center}.q-slide-item__bottom{background:#9c27b0;padding:16px 8px}.q-slide-item__bottom>div{transform-origin:bottom center}.q-slide-item__content{background:inherit;transition:transform .2s ease-in;-webkit-user-select:none;user-select:none;cursor:pointer}.q-slider{position:relative}.q-slider--h{width:100%}.q-slider--v{height:200px}.q-slider--editable .q-slider__track-container{cursor:grab}.q-slider__track-container{outline:0}.q-slider__track-container--h{width:100%;padding:12px 0}.q-slider__track-container--h .q-slider__selection{will-change:width,left}.q-slider__track-container--v{height:100%;padding:0 12px}.q-slider__track-container--v .q-slider__selection{will-change:height,top}.q-slider__track{color:var(--q-primary);background:rgba(0,0,0,.1);border-radius:4px;width:inherit;height:inherit}.q-slider__inner{background:rgba(0,0,0,.1);border-radius:inherit;width:100%;height:100%}.q-slider__selection{background:currentColor;border-radius:inherit;width:100%;height:100%}.q-slider__markers{color:#0000004d;border-radius:inherit;width:100%;height:100%}.q-slider__markers:after{content:"";position:absolute;background:currentColor}.q-slider__markers--h{background-image:repeating-linear-gradient(to right,currentColor,currentColor 2px,rgba(255,255,255,0) 0,rgba(255,255,255,0))}.q-slider__markers--h:after{height:100%;width:2px;top:0;right:0}.q-slider__markers--v{background-image:repeating-linear-gradient(to bottom,currentColor,currentColor 2px,rgba(255,255,255,0) 0,rgba(255,255,255,0))}.q-slider__markers--v:after{width:100%;height:2px;left:0;bottom:0}.q-slider__marker-labels-container{position:relative;width:100%;height:100%;min-height:24px;min-width:24px}.q-slider__marker-labels{position:absolute}.q-slider__marker-labels--h-standard{top:0}.q-slider__marker-labels--h-switched{bottom:0}.q-slider__marker-labels--h-ltr{transform:translate(-50%)}.q-slider__marker-labels--h-rtl{transform:translate(50%)}.q-slider__marker-labels--v-standard{left:4px}.q-slider__marker-labels--v-switched{right:4px}.q-slider__marker-labels--v-ltr{transform:translateY(-50%)}.q-slider__marker-labels--v-rtl{transform:translateY(50%)}.q-slider__thumb{z-index:1;outline:0;color:var(--q-primary);transition:transform .18s ease-out,fill .18s ease-out,stroke .18s ease-out}.q-slider__thumb.q-slider--focus{opacity:1!important}.q-slider__thumb--h{top:50%;will-change:left}.q-slider__thumb--h-ltr{transform:scale(1) translate(-50%,-50%)}.q-slider__thumb--h-rtl{transform:scale(1) translate(50%,-50%)}.q-slider__thumb--v{left:50%;will-change:top}.q-slider__thumb--v-ltr{transform:scale(1) translate(-50%,-50%)}.q-slider__thumb--v-rtl{transform:scale(1) translate(-50%,50%)}.q-slider__thumb-shape{top:0;left:0;stroke-width:3.5;stroke:currentColor;transition:transform .28s}.q-slider__thumb-shape path{stroke:currentColor;fill:currentColor}.q-slider__focus-ring{border-radius:50%;opacity:0;transition:transform .26667s ease-out,opacity .26667s ease-out,background-color .26667s ease-out;transition-delay:.14s}.q-slider__pin{opacity:0;white-space:nowrap;transition:opacity .28s ease-out;transition-delay:.14s}.q-slider__pin:before{content:"";width:0;height:0;position:absolute}.q-slider__pin--h:before{border-left:6px solid transparent;border-right:6px solid transparent;left:50%;transform:translate(-50%)}.q-slider__pin--h-standard{bottom:100%}.q-slider__pin--h-standard:before{bottom:2px;border-top:6px solid currentColor}.q-slider__pin--h-switched{top:100%}.q-slider__pin--h-switched:before{top:2px;border-bottom:6px solid currentColor}.q-slider__pin--v{top:0}.q-slider__pin--v:before{top:50%;transform:translateY(-50%);border-top:6px solid transparent;border-bottom:6px solid transparent}.q-slider__pin--v-standard{left:100%}.q-slider__pin--v-standard:before{left:2px;border-right:6px solid currentColor}.q-slider__pin--v-switched{right:100%}.q-slider__pin--v-switched:before{right:2px;border-left:6px solid currentColor}.q-slider__label{z-index:1;white-space:nowrap;position:absolute}.q-slider__label--h{left:50%;transform:translate(-50%)}.q-slider__label--h-standard{bottom:7px}.q-slider__label--h-switched{top:7px}.q-slider__label--v{top:50%;transform:translateY(-50%)}.q-slider__label--v-standard{left:7px}.q-slider__label--v-switched{right:7px}.q-slider__text-container{min-height:25px;padding:2px 8px;border-radius:4px;background:currentColor;position:relative;text-align:center}.q-slider__text{color:#fff;font-size:12px}.q-slider--no-value .q-slider__thumb,.q-slider--no-value .q-slider__inner,.q-slider--no-value .q-slider__selection{opacity:0}.q-slider--focus .q-slider__focus-ring,body.desktop .q-slider.q-slider--editable .q-slider__track-container:hover .q-slider__focus-ring{background:currentColor;transform:scale3d(1.55,1.55,1);opacity:.25}.q-slider--focus .q-slider__thumb,.q-slider--focus .q-slider__inner,.q-slider--focus .q-slider__selection,body.desktop .q-slider.q-slider--editable .q-slider__track-container:hover .q-slider__thumb,body.desktop .q-slider.q-slider--editable .q-slider__track-container:hover .q-slider__inner,body.desktop .q-slider.q-slider--editable .q-slider__track-container:hover .q-slider__selection{opacity:1}.q-slider--inactive .q-slider__thumb--h{transition:left .28s,right .28s}.q-slider--inactive .q-slider__thumb--v{transition:top .28s,bottom .28s}.q-slider--inactive .q-slider__selection{transition:width .28s,left .28s,right .28s,height .28s,top .28s,bottom .28s}.q-slider--inactive .q-slider__text-container{transition:transform .28s}.q-slider--active{cursor:grabbing}.q-slider--active .q-slider__thumb-shape{transform:scale(1.5)}.q-slider--active .q-slider__focus-ring,.q-slider--active.q-slider--label .q-slider__thumb-shape{transform:scale(0)!important}body.desktop .q-slider.q-slider--enabled .q-slider__track-container:hover .q-slider__pin,.q-slider--label.q-slider--active .q-slider__pin,.q-slider--label .q-slider--focus .q-slider__pin,.q-slider--label.q-slider--label-always .q-slider__pin{opacity:1}.q-slider--dark .q-slider__track,.q-slider--dark .q-slider__inner{background:rgba(255,255,255,.1)}.q-slider--dark .q-slider__markers{color:#ffffff4d}.q-slider--dense .q-slider__track-container--h{padding:6px 0}.q-slider--dense .q-slider__track-container--v{padding:0 6px}.q-space{flex-grow:1!important}.q-spinner{vertical-align:middle}.q-spinner-mat{animation:q-spin 2s linear infinite;transform-origin:center center}.q-spinner-mat .path{stroke-dasharray:1,200;stroke-dashoffset:0;animation:q-mat-dash 1.5s ease-in-out infinite}@keyframes q-spin{0%{transform:rotate3d(0,0,1,0)}25%{transform:rotate3d(0,0,1,90deg)}50%{transform:rotate3d(0,0,1,180deg)}75%{transform:rotate3d(0,0,1,270deg)}to{transform:rotate3d(0,0,1,359deg)}}@keyframes q-mat-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.q-splitter__panel{position:relative;z-index:0}.q-splitter__panel>.q-splitter{width:100%;height:100%}.q-splitter__separator{background-color:#0000001f;-webkit-user-select:none;user-select:none;position:relative;z-index:1}.q-splitter__separator-area>*{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.q-splitter--dark .q-splitter__separator{background-color:#ffffff47}.q-splitter--vertical>.q-splitter__panel{height:100%}.q-splitter--vertical.q-splitter--active{cursor:col-resize}.q-splitter--vertical>.q-splitter__separator{width:1px}.q-splitter--vertical>.q-splitter__separator>div{left:-6px;right:-6px}.q-splitter--vertical.q-splitter--workable>.q-splitter__separator{cursor:col-resize}.q-splitter--horizontal>.q-splitter__panel{width:100%}.q-splitter--horizontal.q-splitter--active{cursor:row-resize}.q-splitter--horizontal>.q-splitter__separator{height:1px}.q-splitter--horizontal>.q-splitter__separator>div{top:-6px;bottom:-6px}.q-splitter--horizontal.q-splitter--workable>.q-splitter__separator{cursor:row-resize}.q-splitter__before,.q-splitter__after{overflow:auto}.q-stepper{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;background:#fff}.q-stepper__title{font-size:14px;line-height:18px;letter-spacing:.1px}.q-stepper__caption{font-size:12px;line-height:14px}.q-stepper__dot{contain:layout;margin-right:8px;font-size:14px;width:24px;min-width:24px;height:24px;border-radius:50%;background:currentColor}.q-stepper__dot span{color:#fff}.q-stepper__tab{padding:8px 24px;font-size:14px;color:#9e9e9e;flex-direction:row}.q-stepper--dark{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-stepper--dark .q-stepper__dot span{color:#000}.q-stepper__tab--navigation{-webkit-user-select:none;user-select:none;cursor:pointer}.q-stepper__tab--active,.q-stepper__tab--done{color:var(--q-primary)}.q-stepper__tab--active .q-stepper__dot,.q-stepper__tab--active .q-stepper__label,.q-stepper__tab--done .q-stepper__dot,.q-stepper__tab--done .q-stepper__label{text-shadow:0 0 0 currentColor}.q-stepper__tab--disabled .q-stepper__dot{background:rgba(0,0,0,.22)}.q-stepper__tab--disabled .q-stepper__label{color:#00000052}.q-stepper__tab--error{color:var(--q-negative)}.q-stepper__tab--error-with-icon .q-stepper__dot{background:transparent!important}.q-stepper__tab--error-with-icon .q-stepper__dot span{color:currentColor;font-size:24px}.q-stepper__header{border-top-left-radius:inherit;border-top-right-radius:inherit}.q-stepper__header--border{border-bottom:1px solid rgba(0,0,0,.12)}.q-stepper__header--standard-labels .q-stepper__tab{min-height:72px;justify-content:center}.q-stepper__header--standard-labels .q-stepper__tab:first-child{justify-content:flex-start}.q-stepper__header--standard-labels .q-stepper__tab:last-child{justify-content:flex-end}.q-stepper__header--standard-labels .q-stepper__tab:only-child{justify-content:center}.q-stepper__header--standard-labels .q-stepper__dot:after{display:none}.q-stepper__header--alternative-labels .q-stepper__tab{min-height:104px;padding:24px 32px;flex-direction:column;justify-content:flex-start}.q-stepper__header--alternative-labels .q-stepper__dot{margin-right:0}.q-stepper__header--alternative-labels .q-stepper__label{margin-top:8px;text-align:center}.q-stepper__header--alternative-labels .q-stepper__label:before,.q-stepper__header--alternative-labels .q-stepper__label:after{display:none}.q-stepper__header--contracted,.q-stepper__header--contracted.q-stepper__header--alternative-labels .q-stepper__tab{min-height:72px}.q-stepper__header--contracted.q-stepper__header--alternative-labels .q-stepper__tab:first-child{align-items:flex-start}.q-stepper__header--contracted.q-stepper__header--alternative-labels .q-stepper__tab:last-child{align-items:flex-end}.q-stepper__header--contracted .q-stepper__tab{padding:24px 0}.q-stepper__header--contracted .q-stepper__tab:first-child .q-stepper__dot{transform:translate(24px)}.q-stepper__header--contracted .q-stepper__tab:last-child .q-stepper__dot{transform:translate(-24px)}.q-stepper__header--contracted .q-stepper__tab:not(:last-child) .q-stepper__dot:after{display:block!important}.q-stepper__header--contracted .q-stepper__dot{margin:0}.q-stepper__header--contracted .q-stepper__label{display:none}.q-stepper__nav{padding-top:24px}.q-stepper--flat{box-shadow:none}.q-stepper--bordered{border:1px solid rgba(0,0,0,.12)}.q-stepper--horizontal .q-stepper__step-inner{padding:24px}.q-stepper--horizontal .q-stepper__tab:first-child{border-top-left-radius:inherit}.q-stepper--horizontal .q-stepper__tab:last-child{border-top-right-radius:inherit}.q-stepper--horizontal .q-stepper__tab:first-child .q-stepper__dot:before,.q-stepper--horizontal .q-stepper__tab:last-child .q-stepper__label:after,.q-stepper--horizontal .q-stepper__tab:last-child .q-stepper__dot:after{display:none}.q-stepper--horizontal .q-stepper__tab{overflow:hidden}.q-stepper--horizontal .q-stepper__line{contain:layout}.q-stepper--horizontal .q-stepper__line:before,.q-stepper--horizontal .q-stepper__line:after{position:absolute;top:50%;height:1px;width:100vw;background:rgba(0,0,0,.12)}.q-stepper--horizontal .q-stepper__label:after,.q-stepper--horizontal .q-stepper__dot:after{content:"";left:100%;margin-left:8px}.q-stepper--horizontal .q-stepper__dot:before{content:"";right:100%;margin-right:8px}.q-stepper--horizontal>.q-stepper__nav{padding:0 24px 24px}.q-stepper--vertical{padding:16px 0}.q-stepper--vertical .q-stepper__tab{padding:12px 24px}.q-stepper--vertical .q-stepper__title{line-height:18px}.q-stepper--vertical .q-stepper__step-inner{padding:0 24px 32px 60px}.q-stepper--vertical>.q-stepper__nav{padding:24px 24px 0}.q-stepper--vertical .q-stepper__step{overflow:hidden}.q-stepper--vertical .q-stepper__dot{margin-right:12px}.q-stepper--vertical .q-stepper__dot:before,.q-stepper--vertical .q-stepper__dot:after{content:"";position:absolute;left:50%;width:1px;height:99999px;background:rgba(0,0,0,.12)}.q-stepper--vertical .q-stepper__dot:before{bottom:100%;margin-bottom:8px}.q-stepper--vertical .q-stepper__dot:after{top:100%;margin-top:8px}.q-stepper--vertical .q-stepper__step:first-child .q-stepper__dot:before,.q-stepper--vertical .q-stepper__step:last-child .q-stepper__dot:after{display:none}.q-stepper--vertical .q-stepper__step:last-child .q-stepper__step-inner{padding-bottom:8px}.q-stepper--dark.q-stepper--bordered,.q-stepper--dark .q-stepper__header--border{border-color:#ffffff47}.q-stepper--dark.q-stepper--horizontal .q-stepper__line:before,.q-stepper--dark.q-stepper--horizontal .q-stepper__line:after{background:rgba(255,255,255,.28)}.q-stepper--dark.q-stepper--vertical .q-stepper__dot:before,.q-stepper--dark.q-stepper--vertical .q-stepper__dot:after{background:rgba(255,255,255,.28)}.q-stepper--dark .q-stepper__tab--disabled{color:#ffffff47}.q-stepper--dark .q-stepper__tab--disabled .q-stepper__dot{background:rgba(255,255,255,.28)}.q-stepper--dark .q-stepper__tab--disabled .q-stepper__label{color:#ffffff8a}.q-tab-panels{background:#fff}.q-tab-panel{padding:16px}.q-markup-table{overflow:auto;background:#fff}.q-table{width:100%;max-width:100%;border-collapse:separate;border-spacing:0}.q-table thead tr,.q-table tbody td{height:48px}.q-table th{font-weight:500;font-size:12px;-webkit-user-select:none;user-select:none}.q-table th.sortable{cursor:pointer}.q-table th.sortable:hover .q-table__sort-icon{opacity:.64}.q-table th.sorted .q-table__sort-icon{opacity:.86!important}.q-table th.sort-desc .q-table__sort-icon{transform:rotate(180deg)}.q-table th,.q-table td{padding:7px 16px;background-color:inherit}.q-table thead,.q-table td,.q-table th{border-style:solid;border-width:0}.q-table tbody td{font-size:13px}.q-table__card{color:#000;background-color:#fff;border-radius:4px;box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f}.q-table__card .q-table__middle{flex:1 1 auto}.q-table__card .q-table__top,.q-table__card .q-table__bottom{flex:0 0 auto}.q-table__container{position:relative}.q-table__container>div:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.q-table__container>div:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.q-table__container>.q-inner-loading{border-radius:inherit!important}.q-table__top{padding:12px 16px}.q-table__top .q-table__control{flex-wrap:wrap}.q-table__title{font-size:20px;letter-spacing:.005em;font-weight:400}.q-table__separator{min-width:8px!important}.q-table__progress{height:0!important}.q-table__progress th{padding:0!important;border:0!important}.q-table__progress .q-linear-progress{position:absolute;bottom:0}.q-table__middle{max-width:100%}.q-table__bottom{min-height:50px;padding:4px 14px 4px 16px;font-size:12px}.q-table__bottom .q-table__control{min-height:24px}.q-table__bottom-nodata-icon{font-size:200%;margin-right:8px}.q-table__bottom-item{margin-right:16px}.q-table__control{display:flex;align-items:center}.q-table__sort-icon{transition:transform .3s cubic-bezier(.25,.8,.5,1);opacity:0;font-size:120%}.q-table__sort-icon--left,.q-table__sort-icon--center{margin-left:4px}.q-table__sort-icon--right{margin-right:4px}.q-table--col-auto-width{width:1px}.q-table__card--dark,.q-table--dark{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-table--flat{box-shadow:none}.q-table--bordered{border:1px solid rgba(0,0,0,.12)}.q-table--square{border-radius:0}.q-table__linear-progress{height:2px}.q-table--no-wrap th,.q-table--no-wrap td{white-space:nowrap}.q-table--grid{box-shadow:none;border-radius:4px}.q-table--grid .q-table__top{padding-bottom:4px}.q-table--grid .q-table__middle{min-height:2px;margin-bottom:4px}.q-table--grid .q-table__middle thead,.q-table--grid .q-table__middle thead th{border:0!important}.q-table--grid .q-table__linear-progress{bottom:0}.q-table--grid .q-table__bottom{border-top:0}.q-table--grid .q-table__grid-content{flex:1 1 auto}.q-table--grid.fullscreen{background:inherit}.q-table__grid-item-card{vertical-align:top;padding:12px}.q-table__grid-item-card .q-separator{margin:12px 0}.q-table__grid-item-row+.q-table__grid-item-row{margin-top:8px}.q-table__grid-item-title{opacity:.54;font-weight:500;font-size:12px}.q-table__grid-item-value{font-size:13px}.q-table__grid-item{padding:4px;transition:transform .3s cubic-bezier(.25,.8,.5,1)}.q-table__grid-item--selected{transform:scale(.95)}.q-table--horizontal-separator thead th,.q-table--horizontal-separator tbody tr:not(:last-child)>td,.q-table--cell-separator thead th,.q-table--cell-separator tbody tr:not(:last-child)>td{border-bottom-width:1px}.q-table--vertical-separator td,.q-table--vertical-separator th,.q-table--cell-separator td,.q-table--cell-separator th{border-left-width:1px}.q-table--vertical-separator thead tr:last-child th,.q-table--vertical-separator.q-table--loading tr:nth-last-child(2) th,.q-table--cell-separator thead tr:last-child th,.q-table--cell-separator.q-table--loading tr:nth-last-child(2) th{border-bottom-width:1px}.q-table--vertical-separator td:first-child,.q-table--vertical-separator th:first-child,.q-table--cell-separator td:first-child,.q-table--cell-separator th:first-child{border-left:0}.q-table--vertical-separator .q-table__top,.q-table--cell-separator .q-table__top{border-bottom:1px solid rgba(0,0,0,.12)}.q-table--dense .q-table__top{padding:6px 16px}.q-table--dense .q-table__bottom{min-height:33px}.q-table--dense .q-table__sort-icon{font-size:110%}.q-table--dense .q-table th,.q-table--dense .q-table td{padding:4px 8px}.q-table--dense .q-table thead tr,.q-table--dense .q-table tbody tr,.q-table--dense .q-table tbody td{height:28px}.q-table--dense .q-table th:first-child,.q-table--dense .q-table td:first-child{padding-left:16px}.q-table--dense .q-table th:last-child,.q-table--dense .q-table td:last-child{padding-right:16px}.q-table--dense .q-table__bottom-item{margin-right:8px}.q-table--dense .q-table__select .q-field__control,.q-table--dense .q-table__select .q-field__native{min-height:24px;padding:0}.q-table--dense .q-table__select .q-field__marginal{height:24px}.q-table__bottom{border-top:1px solid rgba(0,0,0,.12)}.q-table thead,.q-table tr,.q-table th,.q-table td{border-color:#0000001f}.q-table tbody td{position:relative}.q-table tbody td:before,.q-table tbody td:after{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.q-table tbody td:before{background:rgba(0,0,0,.03)}.q-table tbody td:after{background:rgba(0,0,0,.06)}.q-table tbody tr.selected td:after{content:""}body.desktop .q-table>tbody>tr:not(.q-tr--no-hover):hover>td:not(.q-td--no-hover):before{content:""}.q-table__card--dark,.q-table--dark,.q-table--dark .q-table__bottom,.q-table--dark thead,.q-table--dark tr,.q-table--dark th,.q-table--dark td{border-color:#ffffff47}.q-table--dark tbody td:before{background:rgba(255,255,255,.07)}.q-table--dark tbody td:after{background:rgba(255,255,255,.1)}.q-table--dark.q-table--vertical-separator .q-table__top,.q-table--dark.q-table--cell-separator .q-table__top{border-color:#ffffff47}.q-tab{padding:0 16px;min-height:48px;transition:color .3s,background-color .3s;text-transform:uppercase;white-space:nowrap;color:inherit;text-decoration:none}.q-tab--full{min-height:72px}.q-tab--no-caps{text-transform:none}.q-tab__content{height:inherit;padding:4px 0;min-width:40px}.q-tab__content--inline .q-tab__icon+.q-tab__label{padding-left:8px}.q-tab__content .q-chip--floating{top:0;right:-16px}.q-tab__icon{width:24px;height:24px;font-size:24px}.q-tab__label{font-size:14px;line-height:1.715em;font-weight:500}.q-tab .q-badge{top:3px;right:-12px}.q-tab__alert,.q-tab__alert-icon{position:absolute}.q-tab__alert{top:7px;right:-9px;height:10px;width:10px;border-radius:50%;background:currentColor}.q-tab__alert-icon{top:2px;right:-12px;font-size:18px}.q-tab__indicator{opacity:0;height:2px;background:currentColor}.q-tab--active .q-tab__indicator{opacity:1;transform-origin:left}.q-tab--inactive{opacity:.85}.q-tabs{position:relative;transition:color .3s,background-color .3s}.q-tabs--scrollable.q-tabs__arrows--outside.q-tabs--horizontal{padding-left:36px;padding-right:36px}.q-tabs--scrollable.q-tabs__arrows--outside.q-tabs--vertical{padding-top:36px;padding-bottom:36px}.q-tabs--scrollable.q-tabs__arrows--outside .q-tabs__arrow--faded{opacity:.3;pointer-events:none}.q-tabs--scrollable.q-tabs__arrows--inside .q-tabs__arrow--faded{display:none}.q-tabs--not-scrollable.q-tabs__arrows--outside,body.mobile .q-tabs--scrollable.q-tabs--mobile-without-arrows.q-tabs__arrows--outside{padding-left:0;padding-right:0}.q-tabs--not-scrollable .q-tabs__arrow,body.mobile .q-tabs--scrollable.q-tabs--mobile-without-arrows .q-tabs__arrow{display:none}.q-tabs--not-scrollable .q-tabs__content,body.mobile .q-tabs--scrollable.q-tabs--mobile-without-arrows .q-tabs__content{border-radius:inherit}.q-tabs__arrow{cursor:pointer;font-size:32px;min-width:36px;text-shadow:0 0 3px #fff,0 0 1px #fff,0 0 1px #000;transition:opacity .3s}.q-tabs__content{overflow:hidden;flex:1 1 auto}.q-tabs__content--align-center{justify-content:center}.q-tabs__content--align-right{justify-content:flex-end}.q-tabs__content--align-justify .q-tab{flex:1 1 auto}.q-tabs__offset{display:none}.q-tabs--horizontal .q-tabs__arrow{height:100%}.q-tabs--horizontal .q-tabs__arrow--left{top:0;left:0;bottom:0}.q-tabs--horizontal .q-tabs__arrow--right{top:0;right:0;bottom:0}.q-tabs--vertical,.q-tabs--vertical .q-tabs__content{display:block!important;height:100%}.q-tabs--vertical .q-tabs__arrow{width:100%;height:36px;text-align:center}.q-tabs--vertical .q-tabs__arrow--left{top:0;left:0;right:0}.q-tabs--vertical .q-tabs__arrow--right{left:0;right:0;bottom:0}.q-tabs--vertical .q-tab{padding:0 8px}.q-tabs--vertical .q-tab__indicator{height:unset;width:2px}.q-tabs--vertical.q-tabs--not-scrollable .q-tabs__content{height:100%}.q-tabs--vertical.q-tabs--dense .q-tab__content{min-width:24px}.q-tabs--dense .q-tab{min-height:36px}.q-tabs--dense .q-tab--full{min-height:52px}.q-time{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;background:#fff;outline:0;width:290px;min-width:290px;max-width:100%}.q-time--bordered{border:1px solid rgba(0,0,0,.12)}.q-time__header{border-top-left-radius:inherit;color:#fff;background-color:var(--q-primary);padding:16px;font-weight:300}.q-time__actions{padding:0 16px 16px}.q-time__header-label{font-size:28px;line-height:1;letter-spacing:-.00833em}.q-time__header-label>div+div{margin-left:4px}.q-time__link{opacity:.56;outline:0;transition:opacity .3s ease-out}.q-time__link--active,.q-time__link:hover,.q-time__link:focus{opacity:1}.q-time__header-ampm{font-size:16px;letter-spacing:.1em}.q-time__content{padding:16px}.q-time__content:before{content:"";display:block;padding-bottom:100%}.q-time__container-parent{padding:16px}.q-time__container-child{border-radius:50%;background:rgba(0,0,0,.12)}.q-time__clock{padding:24px;width:100%;height:100%;max-width:100%;max-height:100%;font-size:14px}.q-time__clock-circle{position:relative}.q-time__clock-center{height:6px;width:6px;margin:auto;border-radius:50%;min-height:0;background:currentColor}.q-time__clock-pointer{width:2px;height:50%;transform-origin:0 0;min-height:0;position:absolute;left:50%;right:0;bottom:0;color:var(--q-primary);background:currentColor;transform:translate(-50%)}.q-time__clock-pointer:before,.q-time__clock-pointer:after{content:"";position:absolute;left:50%;border-radius:50%;background:currentColor;transform:translate(-50%)}.q-time__clock-pointer:before{bottom:-4px;width:8px;height:8px}.q-time__clock-pointer:after{top:-3px;height:6px;width:6px}.q-time__clock-position{position:absolute;min-height:32px;width:32px;height:32px;font-size:12px;line-height:32px;margin:0;padding:0;transform:translate(-50%,-50%);border-radius:50%}.q-time__clock-position--disable{opacity:.4}.q-time__clock-position--active{background-color:var(--q-primary);color:#fff}.q-time__clock-pos-0{top:0%;left:50%}.q-time__clock-pos-1{top:6.7%;left:75%}.q-time__clock-pos-2{top:25%;left:93.3%}.q-time__clock-pos-3{top:50%;left:100%}.q-time__clock-pos-4{top:75%;left:93.3%}.q-time__clock-pos-5{top:93.3%;left:75%}.q-time__clock-pos-6{top:100%;left:50%}.q-time__clock-pos-7{top:93.3%;left:25%}.q-time__clock-pos-8{top:75%;left:6.7%}.q-time__clock-pos-9{top:50%;left:0%}.q-time__clock-pos-10{top:25%;left:6.7%}.q-time__clock-pos-11{top:6.7%;left:25%}.q-time__clock-pos-12{top:15%;left:50%}.q-time__clock-pos-13{top:19.69%;left:67.5%}.q-time__clock-pos-14{top:32.5%;left:80.31%}.q-time__clock-pos-15{top:50%;left:85%}.q-time__clock-pos-16{top:67.5%;left:80.31%}.q-time__clock-pos-17{top:80.31%;left:67.5%}.q-time__clock-pos-18{top:85%;left:50%}.q-time__clock-pos-19{top:80.31%;left:32.5%}.q-time__clock-pos-20{top:67.5%;left:19.69%}.q-time__clock-pos-21{top:50%;left:15%}.q-time__clock-pos-22{top:32.5%;left:19.69%}.q-time__clock-pos-23{top:19.69%;left:32.5%}.q-time__now-button{background-color:var(--q-primary);color:#fff;top:12px;right:12px}.q-time.disabled .q-time__header-ampm,.q-time.disabled .q-time__content,.q-time--readonly .q-time__header-ampm,.q-time--readonly .q-time__content{pointer-events:none}.q-time--portrait{display:inline-flex;flex-direction:column}.q-time--portrait .q-time__header{border-top-right-radius:inherit;min-height:86px}.q-time--portrait .q-time__header-ampm{margin-left:12px}.q-time--portrait.q-time--bordered .q-time__content{margin:1px 0}.q-time--landscape{display:inline-flex;align-items:stretch;min-width:420px}.q-time--landscape>div{display:flex;flex-direction:column;justify-content:center}.q-time--landscape .q-time__header{border-bottom-left-radius:inherit;min-width:156px}.q-time--landscape .q-time__header-ampm{margin-top:12px}.q-time--dark{border-color:#ffffff47;box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-timeline{padding:0;width:100%;list-style:none}.q-timeline h6{line-height:inherit}.q-timeline--dark{color:#fff}.q-timeline--dark .q-timeline__subtitle{opacity:.7}.q-timeline__content{padding-bottom:24px}.q-timeline__title{margin-top:0;margin-bottom:16px}.q-timeline__subtitle{font-size:12px;margin-bottom:8px;opacity:.6;text-transform:uppercase;letter-spacing:1px;font-weight:700}.q-timeline__dot{position:absolute;top:0;bottom:0;width:15px}.q-timeline__dot:before,.q-timeline__dot:after{content:"";background:currentColor;display:block;position:absolute}.q-timeline__dot:before{border:3px solid transparent;border-radius:100%;height:15px;width:15px;top:4px;left:0;transition:background .3s ease-in-out,border .3s ease-in-out}.q-timeline__dot:after{width:3px;opacity:.4;top:24px;bottom:0;left:6px}.q-timeline__dot .q-icon{position:absolute;top:0;left:0;right:0;font-size:16px;height:38px;line-height:38px;width:100%;color:#fff}.q-timeline__dot .q-icon>svg,.q-timeline__dot .q-icon>img{width:1em;height:1em}.q-timeline__dot-img{position:absolute;top:4px;left:0;right:0;height:31px;width:31px;background:currentColor;border-radius:50%}.q-timeline__heading{position:relative}.q-timeline__heading:first-child .q-timeline__heading-title{padding-top:0}.q-timeline__heading:last-child .q-timeline__heading-title{padding-bottom:0}.q-timeline__heading-title{padding:32px 0;margin:0}.q-timeline__entry{position:relative;line-height:22px}.q-timeline__entry:last-child{padding-bottom:0!important}.q-timeline__entry:last-child .q-timeline__dot:after{content:none}.q-timeline__entry--icon .q-timeline__dot{width:31px}.q-timeline__entry--icon .q-timeline__dot:before{height:31px;width:31px}.q-timeline__entry--icon .q-timeline__dot:after{top:41px;left:14px}.q-timeline__entry--icon .q-timeline__subtitle{padding-top:8px}.q-timeline--dense--right .q-timeline__entry{padding-left:40px}.q-timeline--dense--right .q-timeline__entry--icon .q-timeline__dot{left:-8px}.q-timeline--dense--right .q-timeline__dot{left:0}.q-timeline--dense--left .q-timeline__heading{text-align:right}.q-timeline--dense--left .q-timeline__entry{padding-right:40px}.q-timeline--dense--left .q-timeline__entry--icon .q-timeline__dot{right:-8px}.q-timeline--dense--left .q-timeline__content,.q-timeline--dense--left .q-timeline__title,.q-timeline--dense--left .q-timeline__subtitle{text-align:right}.q-timeline--dense--left .q-timeline__dot{right:0}.q-timeline--comfortable{display:table}.q-timeline--comfortable .q-timeline__heading{display:table-row;font-size:200%}.q-timeline--comfortable .q-timeline__heading>div{display:table-cell}.q-timeline--comfortable .q-timeline__entry{display:table-row;padding:0}.q-timeline--comfortable .q-timeline__entry--icon .q-timeline__content{padding-top:8px}.q-timeline--comfortable .q-timeline__subtitle,.q-timeline--comfortable .q-timeline__dot,.q-timeline--comfortable .q-timeline__content{display:table-cell;vertical-align:top}.q-timeline--comfortable .q-timeline__subtitle{width:35%}.q-timeline--comfortable .q-timeline__dot{position:relative;min-width:31px}.q-timeline--comfortable--right .q-timeline__heading .q-timeline__heading-title{margin-left:-50px}.q-timeline--comfortable--right .q-timeline__subtitle{text-align:right;padding-right:30px}.q-timeline--comfortable--right .q-timeline__content{padding-left:30px}.q-timeline--comfortable--right .q-timeline__entry--icon .q-timeline__dot{left:-8px}.q-timeline--comfortable--left .q-timeline__heading{text-align:right}.q-timeline--comfortable--left .q-timeline__heading .q-timeline__heading-title{margin-right:-50px}.q-timeline--comfortable--left .q-timeline__subtitle{padding-left:30px}.q-timeline--comfortable--left .q-timeline__content{padding-right:30px}.q-timeline--comfortable--left .q-timeline__content,.q-timeline--comfortable--left .q-timeline__title{text-align:right}.q-timeline--comfortable--left .q-timeline__entry--icon .q-timeline__dot{right:0}.q-timeline--comfortable--left .q-timeline__dot{right:-8px}.q-timeline--loose .q-timeline__heading-title{text-align:center;margin-left:0}.q-timeline--loose .q-timeline__entry,.q-timeline--loose .q-timeline__subtitle,.q-timeline--loose .q-timeline__dot,.q-timeline--loose .q-timeline__content{display:block;margin:0;padding:0}.q-timeline--loose .q-timeline__dot{position:absolute;left:50%;margin-left:-7.15px}.q-timeline--loose .q-timeline__entry{padding-bottom:24px;overflow:hidden}.q-timeline--loose .q-timeline__entry--icon .q-timeline__dot{margin-left:-15px}.q-timeline--loose .q-timeline__entry--icon .q-timeline__subtitle{line-height:38px}.q-timeline--loose .q-timeline__entry--icon .q-timeline__content{padding-top:8px}.q-timeline--loose .q-timeline__entry--left .q-timeline__content,.q-timeline--loose .q-timeline__entry--right .q-timeline__subtitle{float:left;padding-right:30px;text-align:right}.q-timeline--loose .q-timeline__entry--left .q-timeline__subtitle,.q-timeline--loose .q-timeline__entry--right .q-timeline__content{float:right;text-align:left;padding-left:30px}.q-timeline--loose .q-timeline__subtitle,.q-timeline--loose .q-timeline__content{width:50%}.q-toggle{vertical-align:middle}.q-toggle__native{width:1px;height:1px}.q-toggle__track{height:.35em;border-radius:.175em;opacity:.38;background:currentColor}.q-toggle__thumb{top:.25em;left:.25em;width:.5em;height:.5em;transition:left .22s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none;z-index:0}.q-toggle__thumb:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:#fff;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.q-toggle__thumb .q-icon{font-size:.3em;min-width:1em;color:#000;opacity:.54;z-index:1}.q-toggle__inner{font-size:40px;width:1.4em;min-width:1.4em;height:1em;padding:.325em .3em;-webkit-print-color-adjust:exact}.q-toggle__inner--indet .q-toggle__thumb{left:.45em}.q-toggle__inner--truthy{color:var(--q-primary)}.q-toggle__inner--truthy .q-toggle__track{opacity:.54}.q-toggle__inner--truthy .q-toggle__thumb{left:.65em}.q-toggle__inner--truthy .q-toggle__thumb:after{background-color:currentColor}.q-toggle__inner--truthy .q-toggle__thumb .q-icon{color:#fff;opacity:1}.q-toggle.disabled{opacity:.75!important}.q-toggle--dark .q-toggle__inner{color:#fff}.q-toggle--dark .q-toggle__inner--truthy{color:var(--q-primary)}.q-toggle--dark .q-toggle__thumb:after{box-shadow:none}.q-toggle--dark .q-toggle__thumb:before{opacity:.32!important}.q-toggle--dense .q-toggle__inner{width:.8em;min-width:.8em;height:.5em;padding:.07625em 0}.q-toggle--dense .q-toggle__thumb{top:0;left:0}.q-toggle--dense .q-toggle__inner--indet .q-toggle__thumb{left:.15em}.q-toggle--dense .q-toggle__inner--truthy .q-toggle__thumb{left:.3em}.q-toggle--dense .q-toggle__label{padding-left:.5em}.q-toggle--dense.reverse .q-toggle__label{padding-left:0;padding-right:.5em}body.desktop .q-toggle:not(.disabled) .q-toggle__thumb:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:currentColor;opacity:.12;transform:scale3d(0,0,1);transition:transform .22s cubic-bezier(0,0,.2,1)}body.desktop .q-toggle:not(.disabled):focus .q-toggle__thumb:before,body.desktop .q-toggle:not(.disabled):hover .q-toggle__thumb:before{transform:scale3d(2,2,1)}body.desktop .q-toggle--dense:not(.disabled):focus .q-toggle__thumb:before,body.desktop .q-toggle--dense:not(.disabled):hover .q-toggle__thumb:before{transform:scale3d(1.5,1.5,1)}.q-toolbar{position:relative;padding:0 12px;min-height:50px;width:100%}.q-toolbar--inset{padding-left:58px}.q-toolbar .q-avatar{font-size:38px}.q-toolbar__title{flex:1 1 0%;min-width:1px;max-width:100%;font-size:21px;font-weight:400;letter-spacing:.01em;padding:0 12px}.q-toolbar__title:first-child{padding-left:0}.q-toolbar__title:last-child{padding-right:0}.q-tooltip--style{font-size:10px;color:#fafafa;background:#757575;border-radius:4px;text-transform:none;font-weight:400}.q-tooltip{z-index:9000;position:fixed!important;overflow-y:auto;overflow-x:hidden;padding:6px 10px}@media (max-width: 599.98px){.q-tooltip{font-size:14px;padding:8px 16px}}.q-tree{position:relative;color:#9e9e9e}.q-tree__node{padding:0 0 3px 22px}.q-tree__node:after{content:"";position:absolute;top:-3px;bottom:0;width:2px;right:auto;left:-13px;border-left:1px solid currentColor}.q-tree__node:last-child:after{display:none}.q-tree__node--disabled{pointer-events:none}.q-tree__node--disabled .disabled{opacity:1!important}.q-tree__node--disabled>div,.q-tree__node--disabled>i,.q-tree__node--disabled>.disabled{opacity:.6!important}.q-tree__node--disabled>div .q-tree__node--disabled>div,.q-tree__node--disabled>div .q-tree__node--disabled>i,.q-tree__node--disabled>div .q-tree__node--disabled>.disabled,.q-tree__node--disabled>i .q-tree__node--disabled>div,.q-tree__node--disabled>i .q-tree__node--disabled>i,.q-tree__node--disabled>i .q-tree__node--disabled>.disabled,.q-tree__node--disabled>.disabled .q-tree__node--disabled>div,.q-tree__node--disabled>.disabled .q-tree__node--disabled>i,.q-tree__node--disabled>.disabled .q-tree__node--disabled>.disabled{opacity:1!important}.q-tree__node-header:before{content:"";position:absolute;top:-3px;bottom:50%;width:31px;left:-35px;border-left:1px solid currentColor;border-bottom:1px solid currentColor}.q-tree__children{padding-left:25px}.q-tree__node-body{padding:5px 0 8px 5px}.q-tree__node--parent{padding-left:2px}.q-tree__node--parent>.q-tree__node-header:before{width:15px;left:-15px}.q-tree__node--parent>.q-tree__node-collapsible>.q-tree__node-body{padding:5px 0 8px 27px}.q-tree__node--parent>.q-tree__node-collapsible>.q-tree__node-body:after{content:"";position:absolute;top:0;width:2px;height:100%;right:auto;left:12px;border-left:1px solid currentColor;bottom:50px}.q-tree__node--link{cursor:pointer}.q-tree__node-header{padding:4px;margin-top:3px;border-radius:4px;outline:0}.q-tree__node-header-content{color:#000;transition:color .3s}.q-tree__node--selected .q-tree__node-header-content{color:#9e9e9e}.q-tree__icon,.q-tree__node-header-content .q-icon{font-size:21px}.q-tree__img{height:42px;border-radius:2px}.q-tree__avatar,.q-tree__node-header-content .q-avatar{font-size:28px;border-radius:50%;width:28px;height:28px}.q-tree__arrow,.q-tree__spinner{font-size:16px;margin-right:4px}.q-tree__arrow{transition:transform .3s}.q-tree__arrow--rotate{transform:rotate3d(0,0,1,90deg)}.q-tree__tickbox{margin-right:4px}.q-tree>.q-tree__node{padding:0}.q-tree>.q-tree__node:after,.q-tree>.q-tree__node>.q-tree__node-header:before{display:none}.q-tree>.q-tree__node--child>.q-tree__node-header{padding-left:24px}.q-tree--dark .q-tree__node-header-content{color:#fff}.q-tree--no-connectors .q-tree__node:after,.q-tree--no-connectors .q-tree__node-header:before,.q-tree--no-connectors .q-tree__node-body:after{display:none!important}.q-tree--dense>.q-tree__node--child>.q-tree__node-header{padding-left:1px}.q-tree--dense .q-tree__arrow,.q-tree--dense .q-tree__spinner{margin-right:1px}.q-tree--dense .q-tree__img{height:32px}.q-tree--dense .q-tree__tickbox{margin-right:3px}.q-tree--dense .q-tree__node{padding:0}.q-tree--dense .q-tree__node:after{top:0;left:-8px}.q-tree--dense .q-tree__node-header{margin-top:0;padding:1px}.q-tree--dense .q-tree__node-header:before{top:0;left:-8px;width:8px}.q-tree--dense .q-tree__node--child{padding-left:17px}.q-tree--dense .q-tree__node--child>.q-tree__node-header:before{left:-25px;width:21px}.q-tree--dense .q-tree__node-body{padding:0 0 2px}.q-tree--dense .q-tree__node--parent>.q-tree__node-collapsible>.q-tree__node-body{padding:0 0 2px 20px}.q-tree--dense .q-tree__node--parent>.q-tree__node-collapsible>.q-tree__node-body:after{left:8px}.q-tree--dense .q-tree__children{padding-left:16px}[dir=rtl] .q-tree__arrow{transform:rotate3d(0,0,1,180deg)}[dir=rtl] .q-tree__arrow--rotate{transform:rotate3d(0,0,1,90deg)}.q-uploader{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;vertical-align:top;background:#fff;position:relative;width:320px;max-height:320px}.q-uploader--bordered{border:1px solid rgba(0,0,0,.12)}.q-uploader__input{opacity:0;width:100%;height:100%;cursor:pointer!important;z-index:1}.q-uploader__input::-webkit-file-upload-button{cursor:pointer}.q-uploader__file:before{content:"";border-top-left-radius:inherit;border-top-right-radius:inherit;position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;background:currentColor;opacity:.04}.q-uploader__header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:var(--q-primary);color:#fff;width:100%}.q-uploader__spinner{font-size:24px;margin-right:4px}.q-uploader__header-content{padding:8px}.q-uploader__dnd{outline:1px dashed currentColor;outline-offset:-4px;background:rgba(255,255,255,.6)}.q-uploader__overlay{font-size:36px;color:#000;background-color:#fff9}.q-uploader__list{position:relative;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;padding:8px;min-height:60px;flex:1 1 auto}.q-uploader__file{border-radius:4px 4px 0 0;border:1px solid rgba(0,0,0,.12)}.q-uploader__file .q-circular-progress{font-size:24px}.q-uploader__file--img{color:#fff;height:200px;min-width:200px;background-position:50% 50%;background-size:cover;background-repeat:no-repeat}.q-uploader__file--img:before{content:none}.q-uploader__file--img .q-circular-progress{color:#fff}.q-uploader__file--img .q-uploader__file-header{padding-bottom:24px;background:linear-gradient(to bottom,rgba(0,0,0,.7) 20%,rgba(255,255,255,0))}.q-uploader__file+.q-uploader__file{margin-top:8px}.q-uploader__file-header{position:relative;padding:4px 8px;border-top-left-radius:inherit;border-top-right-radius:inherit}.q-uploader__file-header-content{padding-right:8px}.q-uploader__file-status{font-size:24px;margin-right:4px}.q-uploader__title{font-size:14px;font-weight:700;line-height:18px;word-break:break-word}.q-uploader__subtitle{font-size:12px;line-height:18px}.q-uploader--disable .q-uploader__header,.q-uploader--disable .q-uploader__list{pointer-events:none}.q-uploader--dark{border-color:#ffffff47;box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}.q-uploader--dark .q-uploader__file{border-color:#ffffff47}.q-uploader--dark .q-uploader__dnd,.q-uploader--dark .q-uploader__overlay{background:rgba(255,255,255,.3)}.q-uploader--dark .q-uploader__overlay{color:#fff}img.responsive{max-width:100%;height:auto}.q-video{position:relative;overflow:hidden;border-radius:inherit}.q-video iframe,.q-video object,.q-video embed{width:100%;height:100%}.q-video--responsive{height:0}.q-video--responsive iframe,.q-video--responsive object,.q-video--responsive embed{position:absolute;top:0;left:0}.q-virtual-scroll:focus{outline:0}.q-virtual-scroll__content{outline:none;contain:content}.q-virtual-scroll__content>*{overflow-anchor:none}.q-virtual-scroll__content>[data-q-vs-anchor]{overflow-anchor:auto}.q-virtual-scroll__padding{background:linear-gradient(rgba(255,255,255,0),rgba(255,255,255,0) 20%,rgba(128,128,128,.03) 20%,rgba(128,128,128,.08) 50%,rgba(128,128,128,.03) 80%,rgba(255,255,255,0) 80%,rgba(255,255,255,0));background-size:var(--q-virtual-scroll-item-width, 100%) var(--q-virtual-scroll-item-height, 50px)}.q-table .q-virtual-scroll__padding tr{height:0!important}.q-table .q-virtual-scroll__padding td{padding:0!important}.q-virtual-scroll--horizontal{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.q-virtual-scroll--horizontal .q-virtual-scroll__content{display:flex;flex-direction:row;flex-wrap:nowrap}.q-virtual-scroll--horizontal .q-virtual-scroll__padding,.q-virtual-scroll--horizontal .q-virtual-scroll__content,.q-virtual-scroll--horizontal .q-virtual-scroll__content>*{flex:0 0 auto}.q-virtual-scroll--horizontal .q-virtual-scroll__padding{background:linear-gradient(to left,rgba(255,255,255,0),rgba(255,255,255,0) 20%,rgba(128,128,128,.03) 20%,rgba(128,128,128,.08) 50%,rgba(128,128,128,.03) 80%,rgba(255,255,255,0) 80%,rgba(255,255,255,0));background-size:var(--q-virtual-scroll-item-width, 50px) var(--q-virtual-scroll-item-height, 100%)}.q-ripple{position:absolute;top:0;left:0;width:100%;height:100%;color:inherit;border-radius:inherit;z-index:0;pointer-events:none;overflow:hidden;contain:strict}.q-ripple__inner{position:absolute;top:0;left:0;opacity:0;color:inherit;border-radius:50%;background:currentColor;pointer-events:none;will-change:transform,opacity}.q-ripple__inner--enter{transition:transform .225s cubic-bezier(.4,0,.2,1),opacity .1s cubic-bezier(.4,0,.2,1)}.q-ripple__inner--leave{transition:opacity .25s cubic-bezier(.4,0,.2,1)}.q-morph--invisible,.q-morph--internal{opacity:0!important;pointer-events:none!important;position:fixed!important;right:200vw!important;bottom:200vh!important}.q-loading{color:#000;position:fixed!important}.q-loading__backdrop{position:fixed;top:0;right:0;bottom:0;left:0;opacity:.5;z-index:-1;background-color:#000;transition:background-color .28s}.q-loading__box{border-radius:4px;padding:18px;color:#fff;max-width:450px}.q-loading__message{margin:40px 20px 0;text-align:center}.q-notifications__list{z-index:9500;pointer-events:none;left:0;right:0;margin-bottom:10px;position:relative}.q-notifications__list--center{top:0;bottom:0}.q-notifications__list--top{top:0}.q-notifications__list--bottom{bottom:0}body.q-ios-padding .q-notifications__list--center,body.q-ios-padding .q-notifications__list--top{top:20px;top:env(safe-area-inset-top)}body.q-ios-padding .q-notifications__list--center,body.q-ios-padding .q-notifications__list--bottom{bottom:env(safe-area-inset-bottom)}.q-notification{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f;border-radius:4px;pointer-events:all;display:inline-flex;margin:10px 10px 0;transition:transform 1s,opacity 1s;z-index:9500;flex-shrink:0;max-width:95vw;background:#323232;color:#fff;font-size:14px}.q-notification__icon{font-size:24px;flex:0 0 1em}.q-notification__icon--additional{margin-right:16px}.q-notification__avatar{font-size:32px}.q-notification__avatar--additional{margin-right:8px}.q-notification__spinner{font-size:32px}.q-notification__spinner--additional{margin-right:8px}.q-notification__message{padding:8px 0}.q-notification__caption{font-size:.9em;opacity:.7}.q-notification__actions{color:var(--q-primary)}.q-notification__badge{animation:q-notif-badge .42s;padding:4px 8px;position:absolute;box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;background-color:var(--q-negative);color:#fff;border-radius:4px;font-size:12px;line-height:12px}.q-notification__badge--top-left,.q-notification__badge--top-right{top:-6px}.q-notification__badge--bottom-left,.q-notification__badge--bottom-right{bottom:-6px}.q-notification__badge--top-left,.q-notification__badge--bottom-left{left:-22px}.q-notification__badge--top-right,.q-notification__badge--bottom-right{right:-22px}.q-notification__progress{z-index:-1;position:absolute;height:3px;bottom:0;left:-10px;right:-10px;animation:q-notif-progress linear;background:currentColor;opacity:.3;border-radius:4px 4px 0 0;transform-origin:0 50%;transform:scaleX(0)}.q-notification--standard{padding:0 16px;min-height:48px}.q-notification--standard .q-notification__actions{padding:6px 0 6px 8px;margin-right:-8px}.q-notification--multi-line{min-height:68px;padding:8px 16px}.q-notification--multi-line .q-notification__badge--top-left,.q-notification--multi-line .q-notification__badge--top-right{top:-15px}.q-notification--multi-line .q-notification__badge--bottom-left,.q-notification--multi-line .q-notification__badge--bottom-right{bottom:-15px}.q-notification--multi-line .q-notification__progress{bottom:-8px}.q-notification--multi-line .q-notification__actions{padding:0}.q-notification--multi-line .q-notification__actions--with-media{padding-left:25px}.q-notification--top-left-enter-from,.q-notification--top-left-leave-to,.q-notification--top-enter-from,.q-notification--top-leave-to,.q-notification--top-right-enter-from,.q-notification--top-right-leave-to{opacity:0;transform:translateY(-50px);z-index:9499}.q-notification--left-enter-from,.q-notification--left-leave-to,.q-notification--center-enter-from,.q-notification--center-leave-to,.q-notification--right-enter-from,.q-notification--right-leave-to{opacity:0;transform:rotateX(90deg);z-index:9499}.q-notification--bottom-left-enter-from,.q-notification--bottom-left-leave-to,.q-notification--bottom-enter-from,.q-notification--bottom-leave-to,.q-notification--bottom-right-enter-from,.q-notification--bottom-right-leave-to{opacity:0;transform:translateY(50px);z-index:9499}.q-notification--top-left-leave-active,.q-notification--top-leave-active,.q-notification--top-right-leave-active,.q-notification--left-leave-active,.q-notification--center-leave-active,.q-notification--right-leave-active,.q-notification--bottom-left-leave-active,.q-notification--bottom-leave-active,.q-notification--bottom-right-leave-active{position:absolute;z-index:9499;margin-left:0;margin-right:0}.q-notification--top-leave-active,.q-notification--center-leave-active{top:0}.q-notification--bottom-left-leave-active,.q-notification--bottom-leave-active,.q-notification--bottom-right-leave-active{bottom:0}@media (min-width: 600px){.q-notification{max-width:65vw}}@keyframes q-notif-badge{15%{transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg)}30%{transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg)}45%{transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg)}60%{transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg)}75%{transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg)}}@keyframes q-notif-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}:root{--animate-duration: .3s;--animate-delay: .3s;--animate-repeat: 1}.animated{animation-duration:var(--animate-duration);animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.hinge{animation-duration:2s}.animated.repeat-1{animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{animation-iteration-count:calc(var(--animate-repeat) * 2)}.animated.repeat-3{animation-iteration-count:calc(var(--animate-repeat) * 3)}.animated.delay-1s{animation-delay:var(--animate-delay)}.animated.delay-2s{animation-delay:calc(var(--animate-delay) * 2)}.animated.delay-3s{animation-delay:calc(var(--animate-delay) * 3)}.animated.delay-4s{animation-delay:calc(var(--animate-delay) * 4)}.animated.delay-5s{animation-delay:calc(var(--animate-delay) * 5)}.animated.faster{animation-duration:calc(var(--animate-duration) / 2)}.animated.fast{animation-duration:calc(var(--animate-duration) * .8)}.animated.slow{animation-duration:calc(var(--animate-duration) * 2)}.animated.slower{animation-duration:calc(var(--animate-duration) * 3)}@media print,(prefers-reduced-motion: reduce){.animated{animation-duration:1ms!important;transition-duration:1ms!important;animation-iteration-count:1!important}.animated[class*=Out]{opacity:0}}.q-animate--scale{animation:q-scale .15s;animation-timing-function:cubic-bezier(.25,.8,.25,1)}@keyframes q-scale{0%{transform:scale(1)}50%{transform:scale(1.04)}to{transform:scale(1)}}.q-animate--fade{animation:q-fade .2s}@keyframes q-fade{0%{opacity:0}to{opacity:1}}:root{--q-primary: #1976D2;--q-secondary: #26A69A;--q-accent: #9C27B0;--q-positive: #21BA45;--q-negative: #C10015;--q-info: #31CCEC;--q-warning: #F2C037;--q-dark: #1d1d1d;--q-dark-page: #121212}.text-dark{color:var(--q-dark)!important}.bg-dark{background:var(--q-dark)!important}.text-primary{color:var(--q-primary)!important}.bg-primary{background:var(--q-primary)!important}.text-secondary{color:var(--q-secondary)!important}.bg-secondary{background:var(--q-secondary)!important}.text-accent{color:var(--q-accent)!important}.bg-accent{background:var(--q-accent)!important}.text-positive{color:var(--q-positive)!important}.bg-positive{background:var(--q-positive)!important}.text-negative{color:var(--q-negative)!important}.bg-negative{background:var(--q-negative)!important}.text-info{color:var(--q-info)!important}.bg-info{background:var(--q-info)!important}.text-warning{color:var(--q-warning)!important}.bg-warning{background:var(--q-warning)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.text-transparent{color:transparent!important}.bg-transparent{background:transparent!important}.text-separator{color:#0000001f!important}.bg-separator{background:rgba(0,0,0,.12)!important}.text-dark-separator{color:#ffffff47!important}.bg-dark-separator{background:rgba(255,255,255,.28)!important}.text-red{color:#f44336!important}.text-red-1{color:#ffebee!important}.text-red-2{color:#ffcdd2!important}.text-red-3{color:#ef9a9a!important}.text-red-4{color:#e57373!important}.text-red-5{color:#ef5350!important}.text-red-6{color:#f44336!important}.text-red-7{color:#e53935!important}.text-red-8{color:#d32f2f!important}.text-red-9{color:#c62828!important}.text-red-10{color:#b71c1c!important}.text-red-11{color:#ff8a80!important}.text-red-12{color:#ff5252!important}.text-red-13{color:#ff1744!important}.text-red-14{color:#d50000!important}.text-pink{color:#e91e63!important}.text-pink-1{color:#fce4ec!important}.text-pink-2{color:#f8bbd0!important}.text-pink-3{color:#f48fb1!important}.text-pink-4{color:#f06292!important}.text-pink-5{color:#ec407a!important}.text-pink-6{color:#e91e63!important}.text-pink-7{color:#d81b60!important}.text-pink-8{color:#c2185b!important}.text-pink-9{color:#ad1457!important}.text-pink-10{color:#880e4f!important}.text-pink-11{color:#ff80ab!important}.text-pink-12{color:#ff4081!important}.text-pink-13{color:#f50057!important}.text-pink-14{color:#c51162!important}.text-purple{color:#9c27b0!important}.text-purple-1{color:#f3e5f5!important}.text-purple-2{color:#e1bee7!important}.text-purple-3{color:#ce93d8!important}.text-purple-4{color:#ba68c8!important}.text-purple-5{color:#ab47bc!important}.text-purple-6{color:#9c27b0!important}.text-purple-7{color:#8e24aa!important}.text-purple-8{color:#7b1fa2!important}.text-purple-9{color:#6a1b9a!important}.text-purple-10{color:#4a148c!important}.text-purple-11{color:#ea80fc!important}.text-purple-12{color:#e040fb!important}.text-purple-13{color:#d500f9!important}.text-purple-14{color:#a0f!important}.text-deep-purple{color:#673ab7!important}.text-deep-purple-1{color:#ede7f6!important}.text-deep-purple-2{color:#d1c4e9!important}.text-deep-purple-3{color:#b39ddb!important}.text-deep-purple-4{color:#9575cd!important}.text-deep-purple-5{color:#7e57c2!important}.text-deep-purple-6{color:#673ab7!important}.text-deep-purple-7{color:#5e35b1!important}.text-deep-purple-8{color:#512da8!important}.text-deep-purple-9{color:#4527a0!important}.text-deep-purple-10{color:#311b92!important}.text-deep-purple-11{color:#b388ff!important}.text-deep-purple-12{color:#7c4dff!important}.text-deep-purple-13{color:#651fff!important}.text-deep-purple-14{color:#6200ea!important}.text-indigo{color:#3f51b5!important}.text-indigo-1{color:#e8eaf6!important}.text-indigo-2{color:#c5cae9!important}.text-indigo-3{color:#9fa8da!important}.text-indigo-4{color:#7986cb!important}.text-indigo-5{color:#5c6bc0!important}.text-indigo-6{color:#3f51b5!important}.text-indigo-7{color:#3949ab!important}.text-indigo-8{color:#303f9f!important}.text-indigo-9{color:#283593!important}.text-indigo-10{color:#1a237e!important}.text-indigo-11{color:#8c9eff!important}.text-indigo-12{color:#536dfe!important}.text-indigo-13{color:#3d5afe!important}.text-indigo-14{color:#304ffe!important}.text-blue{color:#2196f3!important}.text-blue-1{color:#e3f2fd!important}.text-blue-2{color:#bbdefb!important}.text-blue-3{color:#90caf9!important}.text-blue-4{color:#64b5f6!important}.text-blue-5{color:#42a5f5!important}.text-blue-6{color:#2196f3!important}.text-blue-7{color:#1e88e5!important}.text-blue-8{color:#1976d2!important}.text-blue-9{color:#1565c0!important}.text-blue-10{color:#0d47a1!important}.text-blue-11{color:#82b1ff!important}.text-blue-12{color:#448aff!important}.text-blue-13{color:#2979ff!important}.text-blue-14{color:#2962ff!important}.text-light-blue{color:#03a9f4!important}.text-light-blue-1{color:#e1f5fe!important}.text-light-blue-2{color:#b3e5fc!important}.text-light-blue-3{color:#81d4fa!important}.text-light-blue-4{color:#4fc3f7!important}.text-light-blue-5{color:#29b6f6!important}.text-light-blue-6{color:#03a9f4!important}.text-light-blue-7{color:#039be5!important}.text-light-blue-8{color:#0288d1!important}.text-light-blue-9{color:#0277bd!important}.text-light-blue-10{color:#01579b!important}.text-light-blue-11{color:#80d8ff!important}.text-light-blue-12{color:#40c4ff!important}.text-light-blue-13{color:#00b0ff!important}.text-light-blue-14{color:#0091ea!important}.text-cyan{color:#00bcd4!important}.text-cyan-1{color:#e0f7fa!important}.text-cyan-2{color:#b2ebf2!important}.text-cyan-3{color:#80deea!important}.text-cyan-4{color:#4dd0e1!important}.text-cyan-5{color:#26c6da!important}.text-cyan-6{color:#00bcd4!important}.text-cyan-7{color:#00acc1!important}.text-cyan-8{color:#0097a7!important}.text-cyan-9{color:#00838f!important}.text-cyan-10{color:#006064!important}.text-cyan-11{color:#84ffff!important}.text-cyan-12{color:#18ffff!important}.text-cyan-13{color:#00e5ff!important}.text-cyan-14{color:#00b8d4!important}.text-teal{color:#009688!important}.text-teal-1{color:#e0f2f1!important}.text-teal-2{color:#b2dfdb!important}.text-teal-3{color:#80cbc4!important}.text-teal-4{color:#4db6ac!important}.text-teal-5{color:#26a69a!important}.text-teal-6{color:#009688!important}.text-teal-7{color:#00897b!important}.text-teal-8{color:#00796b!important}.text-teal-9{color:#00695c!important}.text-teal-10{color:#004d40!important}.text-teal-11{color:#a7ffeb!important}.text-teal-12{color:#64ffda!important}.text-teal-13{color:#1de9b6!important}.text-teal-14{color:#00bfa5!important}.text-green{color:#4caf50!important}.text-green-1{color:#e8f5e9!important}.text-green-2{color:#c8e6c9!important}.text-green-3{color:#a5d6a7!important}.text-green-4{color:#81c784!important}.text-green-5{color:#66bb6a!important}.text-green-6{color:#4caf50!important}.text-green-7{color:#43a047!important}.text-green-8{color:#388e3c!important}.text-green-9{color:#2e7d32!important}.text-green-10{color:#1b5e20!important}.text-green-11{color:#b9f6ca!important}.text-green-12{color:#69f0ae!important}.text-green-13{color:#00e676!important}.text-green-14{color:#00c853!important}.text-light-green{color:#8bc34a!important}.text-light-green-1{color:#f1f8e9!important}.text-light-green-2{color:#dcedc8!important}.text-light-green-3{color:#c5e1a5!important}.text-light-green-4{color:#aed581!important}.text-light-green-5{color:#9ccc65!important}.text-light-green-6{color:#8bc34a!important}.text-light-green-7{color:#7cb342!important}.text-light-green-8{color:#689f38!important}.text-light-green-9{color:#558b2f!important}.text-light-green-10{color:#33691e!important}.text-light-green-11{color:#ccff90!important}.text-light-green-12{color:#b2ff59!important}.text-light-green-13{color:#76ff03!important}.text-light-green-14{color:#64dd17!important}.text-lime{color:#cddc39!important}.text-lime-1{color:#f9fbe7!important}.text-lime-2{color:#f0f4c3!important}.text-lime-3{color:#e6ee9c!important}.text-lime-4{color:#dce775!important}.text-lime-5{color:#d4e157!important}.text-lime-6{color:#cddc39!important}.text-lime-7{color:#c0ca33!important}.text-lime-8{color:#afb42b!important}.text-lime-9{color:#9e9d24!important}.text-lime-10{color:#827717!important}.text-lime-11{color:#f4ff81!important}.text-lime-12{color:#eeff41!important}.text-lime-13{color:#c6ff00!important}.text-lime-14{color:#aeea00!important}.text-yellow{color:#ffeb3b!important}.text-yellow-1{color:#fffde7!important}.text-yellow-2{color:#fff9c4!important}.text-yellow-3{color:#fff59d!important}.text-yellow-4{color:#fff176!important}.text-yellow-5{color:#ffee58!important}.text-yellow-6{color:#ffeb3b!important}.text-yellow-7{color:#fdd835!important}.text-yellow-8{color:#fbc02d!important}.text-yellow-9{color:#f9a825!important}.text-yellow-10{color:#f57f17!important}.text-yellow-11{color:#ffff8d!important}.text-yellow-12{color:#ff0!important}.text-yellow-13{color:#ffea00!important}.text-yellow-14{color:#ffd600!important}.text-amber{color:#ffc107!important}.text-amber-1{color:#fff8e1!important}.text-amber-2{color:#ffecb3!important}.text-amber-3{color:#ffe082!important}.text-amber-4{color:#ffd54f!important}.text-amber-5{color:#ffca28!important}.text-amber-6{color:#ffc107!important}.text-amber-7{color:#ffb300!important}.text-amber-8{color:#ffa000!important}.text-amber-9{color:#ff8f00!important}.text-amber-10{color:#ff6f00!important}.text-amber-11{color:#ffe57f!important}.text-amber-12{color:#ffd740!important}.text-amber-13{color:#ffc400!important}.text-amber-14{color:#ffab00!important}.text-orange{color:#ff9800!important}.text-orange-1{color:#fff3e0!important}.text-orange-2{color:#ffe0b2!important}.text-orange-3{color:#ffcc80!important}.text-orange-4{color:#ffb74d!important}.text-orange-5{color:#ffa726!important}.text-orange-6{color:#ff9800!important}.text-orange-7{color:#fb8c00!important}.text-orange-8{color:#f57c00!important}.text-orange-9{color:#ef6c00!important}.text-orange-10{color:#e65100!important}.text-orange-11{color:#ffd180!important}.text-orange-12{color:#ffab40!important}.text-orange-13{color:#ff9100!important}.text-orange-14{color:#ff6d00!important}.text-deep-orange{color:#ff5722!important}.text-deep-orange-1{color:#fbe9e7!important}.text-deep-orange-2{color:#ffccbc!important}.text-deep-orange-3{color:#ffab91!important}.text-deep-orange-4{color:#ff8a65!important}.text-deep-orange-5{color:#ff7043!important}.text-deep-orange-6{color:#ff5722!important}.text-deep-orange-7{color:#f4511e!important}.text-deep-orange-8{color:#e64a19!important}.text-deep-orange-9{color:#d84315!important}.text-deep-orange-10{color:#bf360c!important}.text-deep-orange-11{color:#ff9e80!important}.text-deep-orange-12{color:#ff6e40!important}.text-deep-orange-13{color:#ff3d00!important}.text-deep-orange-14{color:#dd2c00!important}.text-brown{color:#795548!important}.text-brown-1{color:#efebe9!important}.text-brown-2{color:#d7ccc8!important}.text-brown-3{color:#bcaaa4!important}.text-brown-4{color:#a1887f!important}.text-brown-5{color:#8d6e63!important}.text-brown-6{color:#795548!important}.text-brown-7{color:#6d4c41!important}.text-brown-8{color:#5d4037!important}.text-brown-9{color:#4e342e!important}.text-brown-10{color:#3e2723!important}.text-brown-11{color:#d7ccc8!important}.text-brown-12{color:#bcaaa4!important}.text-brown-13{color:#8d6e63!important}.text-brown-14{color:#5d4037!important}.text-grey{color:#9e9e9e!important}.text-grey-1{color:#fafafa!important}.text-grey-2{color:#f5f5f5!important}.text-grey-3{color:#eee!important}.text-grey-4{color:#e0e0e0!important}.text-grey-5{color:#bdbdbd!important}.text-grey-6{color:#9e9e9e!important}.text-grey-7{color:#757575!important}.text-grey-8{color:#616161!important}.text-grey-9{color:#424242!important}.text-grey-10{color:#212121!important}.text-grey-11{color:#f5f5f5!important}.text-grey-12{color:#eee!important}.text-grey-13{color:#bdbdbd!important}.text-grey-14{color:#616161!important}.text-blue-grey{color:#607d8b!important}.text-blue-grey-1{color:#eceff1!important}.text-blue-grey-2{color:#cfd8dc!important}.text-blue-grey-3{color:#b0bec5!important}.text-blue-grey-4{color:#90a4ae!important}.text-blue-grey-5{color:#78909c!important}.text-blue-grey-6{color:#607d8b!important}.text-blue-grey-7{color:#546e7a!important}.text-blue-grey-8{color:#455a64!important}.text-blue-grey-9{color:#37474f!important}.text-blue-grey-10{color:#263238!important}.text-blue-grey-11{color:#cfd8dc!important}.text-blue-grey-12{color:#b0bec5!important}.text-blue-grey-13{color:#78909c!important}.text-blue-grey-14{color:#455a64!important}.bg-red{background:#f44336!important}.bg-red-1{background:#ffebee!important}.bg-red-2{background:#ffcdd2!important}.bg-red-3{background:#ef9a9a!important}.bg-red-4{background:#e57373!important}.bg-red-5{background:#ef5350!important}.bg-red-6{background:#f44336!important}.bg-red-7{background:#e53935!important}.bg-red-8{background:#d32f2f!important}.bg-red-9{background:#c62828!important}.bg-red-10{background:#b71c1c!important}.bg-red-11{background:#ff8a80!important}.bg-red-12{background:#ff5252!important}.bg-red-13{background:#ff1744!important}.bg-red-14{background:#d50000!important}.bg-pink{background:#e91e63!important}.bg-pink-1{background:#fce4ec!important}.bg-pink-2{background:#f8bbd0!important}.bg-pink-3{background:#f48fb1!important}.bg-pink-4{background:#f06292!important}.bg-pink-5{background:#ec407a!important}.bg-pink-6{background:#e91e63!important}.bg-pink-7{background:#d81b60!important}.bg-pink-8{background:#c2185b!important}.bg-pink-9{background:#ad1457!important}.bg-pink-10{background:#880e4f!important}.bg-pink-11{background:#ff80ab!important}.bg-pink-12{background:#ff4081!important}.bg-pink-13{background:#f50057!important}.bg-pink-14{background:#c51162!important}.bg-purple{background:#9c27b0!important}.bg-purple-1{background:#f3e5f5!important}.bg-purple-2{background:#e1bee7!important}.bg-purple-3{background:#ce93d8!important}.bg-purple-4{background:#ba68c8!important}.bg-purple-5{background:#ab47bc!important}.bg-purple-6{background:#9c27b0!important}.bg-purple-7{background:#8e24aa!important}.bg-purple-8{background:#7b1fa2!important}.bg-purple-9{background:#6a1b9a!important}.bg-purple-10{background:#4a148c!important}.bg-purple-11{background:#ea80fc!important}.bg-purple-12{background:#e040fb!important}.bg-purple-13{background:#d500f9!important}.bg-purple-14{background:#aa00ff!important}.bg-deep-purple{background:#673ab7!important}.bg-deep-purple-1{background:#ede7f6!important}.bg-deep-purple-2{background:#d1c4e9!important}.bg-deep-purple-3{background:#b39ddb!important}.bg-deep-purple-4{background:#9575cd!important}.bg-deep-purple-5{background:#7e57c2!important}.bg-deep-purple-6{background:#673ab7!important}.bg-deep-purple-7{background:#5e35b1!important}.bg-deep-purple-8{background:#512da8!important}.bg-deep-purple-9{background:#4527a0!important}.bg-deep-purple-10{background:#311b92!important}.bg-deep-purple-11{background:#b388ff!important}.bg-deep-purple-12{background:#7c4dff!important}.bg-deep-purple-13{background:#651fff!important}.bg-deep-purple-14{background:#6200ea!important}.bg-indigo{background:#3f51b5!important}.bg-indigo-1{background:#e8eaf6!important}.bg-indigo-2{background:#c5cae9!important}.bg-indigo-3{background:#9fa8da!important}.bg-indigo-4{background:#7986cb!important}.bg-indigo-5{background:#5c6bc0!important}.bg-indigo-6{background:#3f51b5!important}.bg-indigo-7{background:#3949ab!important}.bg-indigo-8{background:#303f9f!important}.bg-indigo-9{background:#283593!important}.bg-indigo-10{background:#1a237e!important}.bg-indigo-11{background:#8c9eff!important}.bg-indigo-12{background:#536dfe!important}.bg-indigo-13{background:#3d5afe!important}.bg-indigo-14{background:#304ffe!important}.bg-blue{background:#2196f3!important}.bg-blue-1{background:#e3f2fd!important}.bg-blue-2{background:#bbdefb!important}.bg-blue-3{background:#90caf9!important}.bg-blue-4{background:#64b5f6!important}.bg-blue-5{background:#42a5f5!important}.bg-blue-6{background:#2196f3!important}.bg-blue-7{background:#1e88e5!important}.bg-blue-8{background:#1976d2!important}.bg-blue-9{background:#1565c0!important}.bg-blue-10{background:#0d47a1!important}.bg-blue-11{background:#82b1ff!important}.bg-blue-12{background:#448aff!important}.bg-blue-13{background:#2979ff!important}.bg-blue-14{background:#2962ff!important}.bg-light-blue{background:#03a9f4!important}.bg-light-blue-1{background:#e1f5fe!important}.bg-light-blue-2{background:#b3e5fc!important}.bg-light-blue-3{background:#81d4fa!important}.bg-light-blue-4{background:#4fc3f7!important}.bg-light-blue-5{background:#29b6f6!important}.bg-light-blue-6{background:#03a9f4!important}.bg-light-blue-7{background:#039be5!important}.bg-light-blue-8{background:#0288d1!important}.bg-light-blue-9{background:#0277bd!important}.bg-light-blue-10{background:#01579b!important}.bg-light-blue-11{background:#80d8ff!important}.bg-light-blue-12{background:#40c4ff!important}.bg-light-blue-13{background:#00b0ff!important}.bg-light-blue-14{background:#0091ea!important}.bg-cyan{background:#00bcd4!important}.bg-cyan-1{background:#e0f7fa!important}.bg-cyan-2{background:#b2ebf2!important}.bg-cyan-3{background:#80deea!important}.bg-cyan-4{background:#4dd0e1!important}.bg-cyan-5{background:#26c6da!important}.bg-cyan-6{background:#00bcd4!important}.bg-cyan-7{background:#00acc1!important}.bg-cyan-8{background:#0097a7!important}.bg-cyan-9{background:#00838f!important}.bg-cyan-10{background:#006064!important}.bg-cyan-11{background:#84ffff!important}.bg-cyan-12{background:#18ffff!important}.bg-cyan-13{background:#00e5ff!important}.bg-cyan-14{background:#00b8d4!important}.bg-teal{background:#009688!important}.bg-teal-1{background:#e0f2f1!important}.bg-teal-2{background:#b2dfdb!important}.bg-teal-3{background:#80cbc4!important}.bg-teal-4{background:#4db6ac!important}.bg-teal-5{background:#26a69a!important}.bg-teal-6{background:#009688!important}.bg-teal-7{background:#00897b!important}.bg-teal-8{background:#00796b!important}.bg-teal-9{background:#00695c!important}.bg-teal-10{background:#004d40!important}.bg-teal-11{background:#a7ffeb!important}.bg-teal-12{background:#64ffda!important}.bg-teal-13{background:#1de9b6!important}.bg-teal-14{background:#00bfa5!important}.bg-green{background:#4caf50!important}.bg-green-1{background:#e8f5e9!important}.bg-green-2{background:#c8e6c9!important}.bg-green-3{background:#a5d6a7!important}.bg-green-4{background:#81c784!important}.bg-green-5{background:#66bb6a!important}.bg-green-6{background:#4caf50!important}.bg-green-7{background:#43a047!important}.bg-green-8{background:#388e3c!important}.bg-green-9{background:#2e7d32!important}.bg-green-10{background:#1b5e20!important}.bg-green-11{background:#b9f6ca!important}.bg-green-12{background:#69f0ae!important}.bg-green-13{background:#00e676!important}.bg-green-14{background:#00c853!important}.bg-light-green{background:#8bc34a!important}.bg-light-green-1{background:#f1f8e9!important}.bg-light-green-2{background:#dcedc8!important}.bg-light-green-3{background:#c5e1a5!important}.bg-light-green-4{background:#aed581!important}.bg-light-green-5{background:#9ccc65!important}.bg-light-green-6{background:#8bc34a!important}.bg-light-green-7{background:#7cb342!important}.bg-light-green-8{background:#689f38!important}.bg-light-green-9{background:#558b2f!important}.bg-light-green-10{background:#33691e!important}.bg-light-green-11{background:#ccff90!important}.bg-light-green-12{background:#b2ff59!important}.bg-light-green-13{background:#76ff03!important}.bg-light-green-14{background:#64dd17!important}.bg-lime{background:#cddc39!important}.bg-lime-1{background:#f9fbe7!important}.bg-lime-2{background:#f0f4c3!important}.bg-lime-3{background:#e6ee9c!important}.bg-lime-4{background:#dce775!important}.bg-lime-5{background:#d4e157!important}.bg-lime-6{background:#cddc39!important}.bg-lime-7{background:#c0ca33!important}.bg-lime-8{background:#afb42b!important}.bg-lime-9{background:#9e9d24!important}.bg-lime-10{background:#827717!important}.bg-lime-11{background:#f4ff81!important}.bg-lime-12{background:#eeff41!important}.bg-lime-13{background:#c6ff00!important}.bg-lime-14{background:#aeea00!important}.bg-yellow{background:#ffeb3b!important}.bg-yellow-1{background:#fffde7!important}.bg-yellow-2{background:#fff9c4!important}.bg-yellow-3{background:#fff59d!important}.bg-yellow-4{background:#fff176!important}.bg-yellow-5{background:#ffee58!important}.bg-yellow-6{background:#ffeb3b!important}.bg-yellow-7{background:#fdd835!important}.bg-yellow-8{background:#fbc02d!important}.bg-yellow-9{background:#f9a825!important}.bg-yellow-10{background:#f57f17!important}.bg-yellow-11{background:#ffff8d!important}.bg-yellow-12{background:#ffff00!important}.bg-yellow-13{background:#ffea00!important}.bg-yellow-14{background:#ffd600!important}.bg-amber{background:#ffc107!important}.bg-amber-1{background:#fff8e1!important}.bg-amber-2{background:#ffecb3!important}.bg-amber-3{background:#ffe082!important}.bg-amber-4{background:#ffd54f!important}.bg-amber-5{background:#ffca28!important}.bg-amber-6{background:#ffc107!important}.bg-amber-7{background:#ffb300!important}.bg-amber-8{background:#ffa000!important}.bg-amber-9{background:#ff8f00!important}.bg-amber-10{background:#ff6f00!important}.bg-amber-11{background:#ffe57f!important}.bg-amber-12{background:#ffd740!important}.bg-amber-13{background:#ffc400!important}.bg-amber-14{background:#ffab00!important}.bg-orange{background:#ff9800!important}.bg-orange-1{background:#fff3e0!important}.bg-orange-2{background:#ffe0b2!important}.bg-orange-3{background:#ffcc80!important}.bg-orange-4{background:#ffb74d!important}.bg-orange-5{background:#ffa726!important}.bg-orange-6{background:#ff9800!important}.bg-orange-7{background:#fb8c00!important}.bg-orange-8{background:#f57c00!important}.bg-orange-9{background:#ef6c00!important}.bg-orange-10{background:#e65100!important}.bg-orange-11{background:#ffd180!important}.bg-orange-12{background:#ffab40!important}.bg-orange-13{background:#ff9100!important}.bg-orange-14{background:#ff6d00!important}.bg-deep-orange{background:#ff5722!important}.bg-deep-orange-1{background:#fbe9e7!important}.bg-deep-orange-2{background:#ffccbc!important}.bg-deep-orange-3{background:#ffab91!important}.bg-deep-orange-4{background:#ff8a65!important}.bg-deep-orange-5{background:#ff7043!important}.bg-deep-orange-6{background:#ff5722!important}.bg-deep-orange-7{background:#f4511e!important}.bg-deep-orange-8{background:#e64a19!important}.bg-deep-orange-9{background:#d84315!important}.bg-deep-orange-10{background:#bf360c!important}.bg-deep-orange-11{background:#ff9e80!important}.bg-deep-orange-12{background:#ff6e40!important}.bg-deep-orange-13{background:#ff3d00!important}.bg-deep-orange-14{background:#dd2c00!important}.bg-brown{background:#795548!important}.bg-brown-1{background:#efebe9!important}.bg-brown-2{background:#d7ccc8!important}.bg-brown-3{background:#bcaaa4!important}.bg-brown-4{background:#a1887f!important}.bg-brown-5{background:#8d6e63!important}.bg-brown-6{background:#795548!important}.bg-brown-7{background:#6d4c41!important}.bg-brown-8{background:#5d4037!important}.bg-brown-9{background:#4e342e!important}.bg-brown-10{background:#3e2723!important}.bg-brown-11{background:#d7ccc8!important}.bg-brown-12{background:#bcaaa4!important}.bg-brown-13{background:#8d6e63!important}.bg-brown-14{background:#5d4037!important}.bg-grey{background:#9e9e9e!important}.bg-grey-1{background:#fafafa!important}.bg-grey-2{background:#f5f5f5!important}.bg-grey-3{background:#eeeeee!important}.bg-grey-4{background:#e0e0e0!important}.bg-grey-5{background:#bdbdbd!important}.bg-grey-6{background:#9e9e9e!important}.bg-grey-7{background:#757575!important}.bg-grey-8{background:#616161!important}.bg-grey-9{background:#424242!important}.bg-grey-10{background:#212121!important}.bg-grey-11{background:#f5f5f5!important}.bg-grey-12{background:#eeeeee!important}.bg-grey-13{background:#bdbdbd!important}.bg-grey-14{background:#616161!important}.bg-blue-grey{background:#607d8b!important}.bg-blue-grey-1{background:#eceff1!important}.bg-blue-grey-2{background:#cfd8dc!important}.bg-blue-grey-3{background:#b0bec5!important}.bg-blue-grey-4{background:#90a4ae!important}.bg-blue-grey-5{background:#78909c!important}.bg-blue-grey-6{background:#607d8b!important}.bg-blue-grey-7{background:#546e7a!important}.bg-blue-grey-8{background:#455a64!important}.bg-blue-grey-9{background:#37474f!important}.bg-blue-grey-10{background:#263238!important}.bg-blue-grey-11{background:#cfd8dc!important}.bg-blue-grey-12{background:#b0bec5!important}.bg-blue-grey-13{background:#78909c!important}.bg-blue-grey-14{background:#455a64!important}.shadow-transition{transition:box-shadow .28s cubic-bezier(.4,0,.2,1)!important}.shadow-1{box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f}.shadow-up-1{box-shadow:0 -1px 3px #0003,0 -1px 1px #00000024,0 -2px 1px -1px #0000001f}.shadow-2{box-shadow:0 1px 5px #0003,0 2px 2px #00000024,0 3px 1px -2px #0000001f}.shadow-up-2{box-shadow:0 -1px 5px #0003,0 -2px 2px #00000024,0 -3px 1px -2px #0000001f}.shadow-3{box-shadow:0 1px 8px #0003,0 3px 4px #00000024,0 3px 3px -2px #0000001f}.shadow-up-3{box-shadow:0 -1px 8px #0003,0 -3px 4px #00000024,0 -3px 3px -2px #0000001f}.shadow-4{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.shadow-up-4{box-shadow:0 -2px 4px -1px #0003,0 -4px 5px #00000024,0 -1px 10px #0000001f}.shadow-5{box-shadow:0 3px 5px -1px #0003,0 5px 8px #00000024,0 1px 14px #0000001f}.shadow-up-5{box-shadow:0 -3px 5px -1px #0003,0 -5px 8px #00000024,0 -1px 14px #0000001f}.shadow-6{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.shadow-up-6{box-shadow:0 -3px 5px -1px #0003,0 -6px 10px #00000024,0 -1px 18px #0000001f}.shadow-7{box-shadow:0 4px 5px -2px #0003,0 7px 10px 1px #00000024,0 2px 16px 1px #0000001f}.shadow-up-7{box-shadow:0 -4px 5px -2px #0003,0 -7px 10px 1px #00000024,0 -2px 16px 1px #0000001f}.shadow-8{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.shadow-up-8{box-shadow:0 -5px 5px -3px #0003,0 -8px 10px 1px #00000024,0 -3px 14px 2px #0000001f}.shadow-9{box-shadow:0 5px 6px -3px #0003,0 9px 12px 1px #00000024,0 3px 16px 2px #0000001f}.shadow-up-9{box-shadow:0 -5px 6px -3px #0003,0 -9px 12px 1px #00000024,0 -3px 16px 2px #0000001f}.shadow-10{box-shadow:0 6px 6px -3px #0003,0 10px 14px 1px #00000024,0 4px 18px 3px #0000001f}.shadow-up-10{box-shadow:0 -6px 6px -3px #0003,0 -10px 14px 1px #00000024,0 -4px 18px 3px #0000001f}.shadow-11{box-shadow:0 6px 7px -4px #0003,0 11px 15px 1px #00000024,0 4px 20px 3px #0000001f}.shadow-up-11{box-shadow:0 -6px 7px -4px #0003,0 -11px 15px 1px #00000024,0 -4px 20px 3px #0000001f}.shadow-12{box-shadow:0 7px 8px -4px #0003,0 12px 17px 2px #00000024,0 5px 22px 4px #0000001f}.shadow-up-12{box-shadow:0 -7px 8px -4px #0003,0 -12px 17px 2px #00000024,0 -5px 22px 4px #0000001f}.shadow-13{box-shadow:0 7px 8px -4px #0003,0 13px 19px 2px #00000024,0 5px 24px 4px #0000001f}.shadow-up-13{box-shadow:0 -7px 8px -4px #0003,0 -13px 19px 2px #00000024,0 -5px 24px 4px #0000001f}.shadow-14{box-shadow:0 7px 9px -4px #0003,0 14px 21px 2px #00000024,0 5px 26px 4px #0000001f}.shadow-up-14{box-shadow:0 -7px 9px -4px #0003,0 -14px 21px 2px #00000024,0 -5px 26px 4px #0000001f}.shadow-15{box-shadow:0 8px 9px -5px #0003,0 15px 22px 2px #00000024,0 6px 28px 5px #0000001f}.shadow-up-15{box-shadow:0 -8px 9px -5px #0003,0 -15px 22px 2px #00000024,0 -6px 28px 5px #0000001f}.shadow-16{box-shadow:0 8px 10px -5px #0003,0 16px 24px 2px #00000024,0 6px 30px 5px #0000001f}.shadow-up-16{box-shadow:0 -8px 10px -5px #0003,0 -16px 24px 2px #00000024,0 -6px 30px 5px #0000001f}.shadow-17{box-shadow:0 8px 11px -5px #0003,0 17px 26px 2px #00000024,0 6px 32px 5px #0000001f}.shadow-up-17{box-shadow:0 -8px 11px -5px #0003,0 -17px 26px 2px #00000024,0 -6px 32px 5px #0000001f}.shadow-18{box-shadow:0 9px 11px -5px #0003,0 18px 28px 2px #00000024,0 7px 34px 6px #0000001f}.shadow-up-18{box-shadow:0 -9px 11px -5px #0003,0 -18px 28px 2px #00000024,0 -7px 34px 6px #0000001f}.shadow-19{box-shadow:0 9px 12px -6px #0003,0 19px 29px 2px #00000024,0 7px 36px 6px #0000001f}.shadow-up-19{box-shadow:0 -9px 12px -6px #0003,0 -19px 29px 2px #00000024,0 -7px 36px 6px #0000001f}.shadow-20{box-shadow:0 10px 13px -6px #0003,0 20px 31px 3px #00000024,0 8px 38px 7px #0000001f}.shadow-up-20{box-shadow:0 -10px 13px -6px #0003,0 -20px 31px 3px #00000024,0 -8px 38px 7px #0000001f}.shadow-21{box-shadow:0 10px 13px -6px #0003,0 21px 33px 3px #00000024,0 8px 40px 7px #0000001f}.shadow-up-21{box-shadow:0 -10px 13px -6px #0003,0 -21px 33px 3px #00000024,0 -8px 40px 7px #0000001f}.shadow-22{box-shadow:0 10px 14px -6px #0003,0 22px 35px 3px #00000024,0 8px 42px 7px #0000001f}.shadow-up-22{box-shadow:0 -10px 14px -6px #0003,0 -22px 35px 3px #00000024,0 -8px 42px 7px #0000001f}.shadow-23{box-shadow:0 11px 14px -7px #0003,0 23px 36px 3px #00000024,0 9px 44px 8px #0000001f}.shadow-up-23{box-shadow:0 -11px 14px -7px #0003,0 -23px 36px 3px #00000024,0 -9px 44px 8px #0000001f}.shadow-24{box-shadow:0 11px 15px -7px #0003,0 24px 38px 3px #00000024,0 9px 46px 8px #0000001f}.shadow-up-24{box-shadow:0 -11px 15px -7px #0003,0 -24px 38px 3px #00000024,0 -9px 46px 8px #0000001f}.inset-shadow{box-shadow:0 7px 9px -7px #000000b3 inset}.inset-shadow-down{box-shadow:0 -7px 9px -7px #000000b3 inset}body.body--dark .shadow-1{box-shadow:0 1px 3px #fff3,0 1px 1px #ffffff24,0 2px 1px -1px #ffffff1f}body.body--dark .shadow-up-1{box-shadow:0 -1px 3px #fff3,0 -1px 1px #ffffff24,0 -2px 1px -1px #ffffff1f}body.body--dark .shadow-2{box-shadow:0 1px 5px #fff3,0 2px 2px #ffffff24,0 3px 1px -2px #ffffff1f}body.body--dark .shadow-up-2{box-shadow:0 -1px 5px #fff3,0 -2px 2px #ffffff24,0 -3px 1px -2px #ffffff1f}body.body--dark .shadow-3{box-shadow:0 1px 8px #fff3,0 3px 4px #ffffff24,0 3px 3px -2px #ffffff1f}body.body--dark .shadow-up-3{box-shadow:0 -1px 8px #fff3,0 -3px 4px #ffffff24,0 -3px 3px -2px #ffffff1f}body.body--dark .shadow-4{box-shadow:0 2px 4px -1px #fff3,0 4px 5px #ffffff24,0 1px 10px #ffffff1f}body.body--dark .shadow-up-4{box-shadow:0 -2px 4px -1px #fff3,0 -4px 5px #ffffff24,0 -1px 10px #ffffff1f}body.body--dark .shadow-5{box-shadow:0 3px 5px -1px #fff3,0 5px 8px #ffffff24,0 1px 14px #ffffff1f}body.body--dark .shadow-up-5{box-shadow:0 -3px 5px -1px #fff3,0 -5px 8px #ffffff24,0 -1px 14px #ffffff1f}body.body--dark .shadow-6{box-shadow:0 3px 5px -1px #fff3,0 6px 10px #ffffff24,0 1px 18px #ffffff1f}body.body--dark .shadow-up-6{box-shadow:0 -3px 5px -1px #fff3,0 -6px 10px #ffffff24,0 -1px 18px #ffffff1f}body.body--dark .shadow-7{box-shadow:0 4px 5px -2px #fff3,0 7px 10px 1px #ffffff24,0 2px 16px 1px #ffffff1f}body.body--dark .shadow-up-7{box-shadow:0 -4px 5px -2px #fff3,0 -7px 10px 1px #ffffff24,0 -2px 16px 1px #ffffff1f}body.body--dark .shadow-8{box-shadow:0 5px 5px -3px #fff3,0 8px 10px 1px #ffffff24,0 3px 14px 2px #ffffff1f}body.body--dark .shadow-up-8{box-shadow:0 -5px 5px -3px #fff3,0 -8px 10px 1px #ffffff24,0 -3px 14px 2px #ffffff1f}body.body--dark .shadow-9{box-shadow:0 5px 6px -3px #fff3,0 9px 12px 1px #ffffff24,0 3px 16px 2px #ffffff1f}body.body--dark .shadow-up-9{box-shadow:0 -5px 6px -3px #fff3,0 -9px 12px 1px #ffffff24,0 -3px 16px 2px #ffffff1f}body.body--dark .shadow-10{box-shadow:0 6px 6px -3px #fff3,0 10px 14px 1px #ffffff24,0 4px 18px 3px #ffffff1f}body.body--dark .shadow-up-10{box-shadow:0 -6px 6px -3px #fff3,0 -10px 14px 1px #ffffff24,0 -4px 18px 3px #ffffff1f}body.body--dark .shadow-11{box-shadow:0 6px 7px -4px #fff3,0 11px 15px 1px #ffffff24,0 4px 20px 3px #ffffff1f}body.body--dark .shadow-up-11{box-shadow:0 -6px 7px -4px #fff3,0 -11px 15px 1px #ffffff24,0 -4px 20px 3px #ffffff1f}body.body--dark .shadow-12{box-shadow:0 7px 8px -4px #fff3,0 12px 17px 2px #ffffff24,0 5px 22px 4px #ffffff1f}body.body--dark .shadow-up-12{box-shadow:0 -7px 8px -4px #fff3,0 -12px 17px 2px #ffffff24,0 -5px 22px 4px #ffffff1f}body.body--dark .shadow-13{box-shadow:0 7px 8px -4px #fff3,0 13px 19px 2px #ffffff24,0 5px 24px 4px #ffffff1f}body.body--dark .shadow-up-13{box-shadow:0 -7px 8px -4px #fff3,0 -13px 19px 2px #ffffff24,0 -5px 24px 4px #ffffff1f}body.body--dark .shadow-14{box-shadow:0 7px 9px -4px #fff3,0 14px 21px 2px #ffffff24,0 5px 26px 4px #ffffff1f}body.body--dark .shadow-up-14{box-shadow:0 -7px 9px -4px #fff3,0 -14px 21px 2px #ffffff24,0 -5px 26px 4px #ffffff1f}body.body--dark .shadow-15{box-shadow:0 8px 9px -5px #fff3,0 15px 22px 2px #ffffff24,0 6px 28px 5px #ffffff1f}body.body--dark .shadow-up-15{box-shadow:0 -8px 9px -5px #fff3,0 -15px 22px 2px #ffffff24,0 -6px 28px 5px #ffffff1f}body.body--dark .shadow-16{box-shadow:0 8px 10px -5px #fff3,0 16px 24px 2px #ffffff24,0 6px 30px 5px #ffffff1f}body.body--dark .shadow-up-16{box-shadow:0 -8px 10px -5px #fff3,0 -16px 24px 2px #ffffff24,0 -6px 30px 5px #ffffff1f}body.body--dark .shadow-17{box-shadow:0 8px 11px -5px #fff3,0 17px 26px 2px #ffffff24,0 6px 32px 5px #ffffff1f}body.body--dark .shadow-up-17{box-shadow:0 -8px 11px -5px #fff3,0 -17px 26px 2px #ffffff24,0 -6px 32px 5px #ffffff1f}body.body--dark .shadow-18{box-shadow:0 9px 11px -5px #fff3,0 18px 28px 2px #ffffff24,0 7px 34px 6px #ffffff1f}body.body--dark .shadow-up-18{box-shadow:0 -9px 11px -5px #fff3,0 -18px 28px 2px #ffffff24,0 -7px 34px 6px #ffffff1f}body.body--dark .shadow-19{box-shadow:0 9px 12px -6px #fff3,0 19px 29px 2px #ffffff24,0 7px 36px 6px #ffffff1f}body.body--dark .shadow-up-19{box-shadow:0 -9px 12px -6px #fff3,0 -19px 29px 2px #ffffff24,0 -7px 36px 6px #ffffff1f}body.body--dark .shadow-20{box-shadow:0 10px 13px -6px #fff3,0 20px 31px 3px #ffffff24,0 8px 38px 7px #ffffff1f}body.body--dark .shadow-up-20{box-shadow:0 -10px 13px -6px #fff3,0 -20px 31px 3px #ffffff24,0 -8px 38px 7px #ffffff1f}body.body--dark .shadow-21{box-shadow:0 10px 13px -6px #fff3,0 21px 33px 3px #ffffff24,0 8px 40px 7px #ffffff1f}body.body--dark .shadow-up-21{box-shadow:0 -10px 13px -6px #fff3,0 -21px 33px 3px #ffffff24,0 -8px 40px 7px #ffffff1f}body.body--dark .shadow-22{box-shadow:0 10px 14px -6px #fff3,0 22px 35px 3px #ffffff24,0 8px 42px 7px #ffffff1f}body.body--dark .shadow-up-22{box-shadow:0 -10px 14px -6px #fff3,0 -22px 35px 3px #ffffff24,0 -8px 42px 7px #ffffff1f}body.body--dark .shadow-23{box-shadow:0 11px 14px -7px #fff3,0 23px 36px 3px #ffffff24,0 9px 44px 8px #ffffff1f}body.body--dark .shadow-up-23{box-shadow:0 -11px 14px -7px #fff3,0 -23px 36px 3px #ffffff24,0 -9px 44px 8px #ffffff1f}body.body--dark .shadow-24{box-shadow:0 11px 15px -7px #fff3,0 24px 38px 3px #ffffff24,0 9px 46px 8px #ffffff1f}body.body--dark .shadow-up-24{box-shadow:0 -11px 15px -7px #fff3,0 -24px 38px 3px #ffffff24,0 -9px 46px 8px #ffffff1f}body.body--dark .inset-shadow{box-shadow:0 7px 9px -7px #ffffffb3 inset}body.body--dark .inset-shadow-down{box-shadow:0 -7px 9px -7px #ffffffb3 inset}.no-shadow,.shadow-0{box-shadow:none!important}.z-marginals{z-index:2000}.z-notify{z-index:9500}.z-fullscreen{z-index:6000}.z-inherit{z-index:inherit!important}.row,.column,.flex{display:flex;flex-wrap:wrap}.row.inline,.column.inline,.flex.inline{display:inline-flex}.row.reverse{flex-direction:row-reverse}.column{flex-direction:column}.column.reverse{flex-direction:column-reverse}.wrap{flex-wrap:wrap}.no-wrap{flex-wrap:nowrap}.reverse-wrap{flex-wrap:wrap-reverse}.order-first{order:-10000}.order-last{order:10000}.order-none{order:0}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center,.flex-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center,.flex-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.content-start{align-content:flex-start}.content-end{align-content:flex-end}.content-center{align-content:center}.content-stretch{align-content:stretch}.content-between{align-content:space-between}.content-around{align-content:space-around}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.self-baseline{align-self:baseline}.self-stretch{align-self:stretch}.q-gutter-x-none,.q-gutter-none{margin-left:0}.q-gutter-x-none>*,.q-gutter-none>*{margin-left:0}.q-gutter-y-none,.q-gutter-none{margin-top:0}.q-gutter-y-none>*,.q-gutter-none>*{margin-top:0}.q-col-gutter-x-none,.q-col-gutter-none{margin-left:0}.q-col-gutter-x-none>*,.q-col-gutter-none>*{padding-left:0}.q-col-gutter-y-none,.q-col-gutter-none{margin-top:0}.q-col-gutter-y-none>*,.q-col-gutter-none>*{padding-top:0}.q-gutter-x-xs,.q-gutter-xs{margin-left:-4px}.q-gutter-x-xs>*,.q-gutter-xs>*{margin-left:4px}.q-gutter-y-xs,.q-gutter-xs{margin-top:-4px}.q-gutter-y-xs>*,.q-gutter-xs>*{margin-top:4px}.q-col-gutter-x-xs,.q-col-gutter-xs{margin-left:-4px}.q-col-gutter-x-xs>*,.q-col-gutter-xs>*{padding-left:4px}.q-col-gutter-y-xs,.q-col-gutter-xs{margin-top:-4px}.q-col-gutter-y-xs>*,.q-col-gutter-xs>*{padding-top:4px}.q-gutter-x-sm,.q-gutter-sm{margin-left:-8px}.q-gutter-x-sm>*,.q-gutter-sm>*{margin-left:8px}.q-gutter-y-sm,.q-gutter-sm{margin-top:-8px}.q-gutter-y-sm>*,.q-gutter-sm>*{margin-top:8px}.q-col-gutter-x-sm,.q-col-gutter-sm{margin-left:-8px}.q-col-gutter-x-sm>*,.q-col-gutter-sm>*{padding-left:8px}.q-col-gutter-y-sm,.q-col-gutter-sm{margin-top:-8px}.q-col-gutter-y-sm>*,.q-col-gutter-sm>*{padding-top:8px}.q-gutter-x-md,.q-gutter-md{margin-left:-16px}.q-gutter-x-md>*,.q-gutter-md>*{margin-left:16px}.q-gutter-y-md,.q-gutter-md{margin-top:-16px}.q-gutter-y-md>*,.q-gutter-md>*{margin-top:16px}.q-col-gutter-x-md,.q-col-gutter-md{margin-left:-16px}.q-col-gutter-x-md>*,.q-col-gutter-md>*{padding-left:16px}.q-col-gutter-y-md,.q-col-gutter-md{margin-top:-16px}.q-col-gutter-y-md>*,.q-col-gutter-md>*{padding-top:16px}.q-gutter-x-lg,.q-gutter-lg{margin-left:-24px}.q-gutter-x-lg>*,.q-gutter-lg>*{margin-left:24px}.q-gutter-y-lg,.q-gutter-lg{margin-top:-24px}.q-gutter-y-lg>*,.q-gutter-lg>*{margin-top:24px}.q-col-gutter-x-lg,.q-col-gutter-lg{margin-left:-24px}.q-col-gutter-x-lg>*,.q-col-gutter-lg>*{padding-left:24px}.q-col-gutter-y-lg,.q-col-gutter-lg{margin-top:-24px}.q-col-gutter-y-lg>*,.q-col-gutter-lg>*{padding-top:24px}.q-gutter-x-xl,.q-gutter-xl{margin-left:-48px}.q-gutter-x-xl>*,.q-gutter-xl>*{margin-left:48px}.q-gutter-y-xl,.q-gutter-xl{margin-top:-48px}.q-gutter-y-xl>*,.q-gutter-xl>*{margin-top:48px}.q-col-gutter-x-xl,.q-col-gutter-xl{margin-left:-48px}.q-col-gutter-x-xl>*,.q-col-gutter-xl>*{padding-left:48px}.q-col-gutter-y-xl,.q-col-gutter-xl{margin-top:-48px}.q-col-gutter-y-xl>*,.q-col-gutter-xl>*{padding-top:48px}@media (min-width: 0){.row>.col,.flex>.col,.row>.col-auto,.flex>.col-auto,.row>.col-grow,.flex>.col-grow,.row>.col-shrink,.flex>.col-shrink,.row>.col-xs,.flex>.col-xs,.row>.col-xs-auto,.row>.col-12,.row>.col-xs-12,.row>.col-11,.row>.col-xs-11,.row>.col-10,.row>.col-xs-10,.row>.col-9,.row>.col-xs-9,.row>.col-8,.row>.col-xs-8,.row>.col-7,.row>.col-xs-7,.row>.col-6,.row>.col-xs-6,.row>.col-5,.row>.col-xs-5,.row>.col-4,.row>.col-xs-4,.row>.col-3,.row>.col-xs-3,.row>.col-2,.row>.col-xs-2,.row>.col-1,.row>.col-xs-1,.row>.col-0,.row>.col-xs-0,.flex>.col-xs-auto,.flex>.col-12,.flex>.col-xs-12,.flex>.col-11,.flex>.col-xs-11,.flex>.col-10,.flex>.col-xs-10,.flex>.col-9,.flex>.col-xs-9,.flex>.col-8,.flex>.col-xs-8,.flex>.col-7,.flex>.col-xs-7,.flex>.col-6,.flex>.col-xs-6,.flex>.col-5,.flex>.col-xs-5,.flex>.col-4,.flex>.col-xs-4,.flex>.col-3,.flex>.col-xs-3,.flex>.col-2,.flex>.col-xs-2,.flex>.col-1,.flex>.col-xs-1,.flex>.col-0,.flex>.col-xs-0,.row>.col-xs-grow,.flex>.col-xs-grow,.row>.col-xs-shrink,.flex>.col-xs-shrink{width:auto;min-width:0;max-width:100%}.column>.col,.flex>.col,.column>.col-auto,.flex>.col-auto,.column>.col-grow,.flex>.col-grow,.column>.col-shrink,.flex>.col-shrink,.column>.col-xs,.flex>.col-xs,.column>.col-xs-auto,.column>.col-12,.column>.col-xs-12,.column>.col-11,.column>.col-xs-11,.column>.col-10,.column>.col-xs-10,.column>.col-9,.column>.col-xs-9,.column>.col-8,.column>.col-xs-8,.column>.col-7,.column>.col-xs-7,.column>.col-6,.column>.col-xs-6,.column>.col-5,.column>.col-xs-5,.column>.col-4,.column>.col-xs-4,.column>.col-3,.column>.col-xs-3,.column>.col-2,.column>.col-xs-2,.column>.col-1,.column>.col-xs-1,.column>.col-0,.column>.col-xs-0,.flex>.col-xs-auto,.flex>.col-12,.flex>.col-xs-12,.flex>.col-11,.flex>.col-xs-11,.flex>.col-10,.flex>.col-xs-10,.flex>.col-9,.flex>.col-xs-9,.flex>.col-8,.flex>.col-xs-8,.flex>.col-7,.flex>.col-xs-7,.flex>.col-6,.flex>.col-xs-6,.flex>.col-5,.flex>.col-xs-5,.flex>.col-4,.flex>.col-xs-4,.flex>.col-3,.flex>.col-xs-3,.flex>.col-2,.flex>.col-xs-2,.flex>.col-1,.flex>.col-xs-1,.flex>.col-0,.flex>.col-xs-0,.column>.col-xs-grow,.flex>.col-xs-grow,.column>.col-xs-shrink,.flex>.col-xs-shrink{height:auto;min-height:0;max-height:100%}.col,.col-xs{flex:10000 1 0%}.col-auto,.col-xs-auto,.col-12,.col-xs-12,.col-11,.col-xs-11,.col-10,.col-xs-10,.col-9,.col-xs-9,.col-8,.col-xs-8,.col-7,.col-xs-7,.col-6,.col-xs-6,.col-5,.col-xs-5,.col-4,.col-xs-4,.col-3,.col-xs-3,.col-2,.col-xs-2,.col-1,.col-xs-1,.col-0,.col-xs-0{flex:0 0 auto}.col-grow,.col-xs-grow{flex:1 0 auto}.col-shrink,.col-xs-shrink{flex:0 1 auto}.row>.col-0,.row>.col-xs-0{height:auto;width:0%}.row>.offset-0,.row>.offset-xs-0{margin-left:0%}.column>.col-0,.column>.col-xs-0{height:0%;width:auto}.row>.col-1,.row>.col-xs-1{height:auto;width:8.3333%}.row>.offset-1,.row>.offset-xs-1{margin-left:8.3333%}.column>.col-1,.column>.col-xs-1{height:8.3333%;width:auto}.row>.col-2,.row>.col-xs-2{height:auto;width:16.6667%}.row>.offset-2,.row>.offset-xs-2{margin-left:16.6667%}.column>.col-2,.column>.col-xs-2{height:16.6667%;width:auto}.row>.col-3,.row>.col-xs-3{height:auto;width:25%}.row>.offset-3,.row>.offset-xs-3{margin-left:25%}.column>.col-3,.column>.col-xs-3{height:25%;width:auto}.row>.col-4,.row>.col-xs-4{height:auto;width:33.3333%}.row>.offset-4,.row>.offset-xs-4{margin-left:33.3333%}.column>.col-4,.column>.col-xs-4{height:33.3333%;width:auto}.row>.col-5,.row>.col-xs-5{height:auto;width:41.6667%}.row>.offset-5,.row>.offset-xs-5{margin-left:41.6667%}.column>.col-5,.column>.col-xs-5{height:41.6667%;width:auto}.row>.col-6,.row>.col-xs-6{height:auto;width:50%}.row>.offset-6,.row>.offset-xs-6{margin-left:50%}.column>.col-6,.column>.col-xs-6{height:50%;width:auto}.row>.col-7,.row>.col-xs-7{height:auto;width:58.3333%}.row>.offset-7,.row>.offset-xs-7{margin-left:58.3333%}.column>.col-7,.column>.col-xs-7{height:58.3333%;width:auto}.row>.col-8,.row>.col-xs-8{height:auto;width:66.6667%}.row>.offset-8,.row>.offset-xs-8{margin-left:66.6667%}.column>.col-8,.column>.col-xs-8{height:66.6667%;width:auto}.row>.col-9,.row>.col-xs-9{height:auto;width:75%}.row>.offset-9,.row>.offset-xs-9{margin-left:75%}.column>.col-9,.column>.col-xs-9{height:75%;width:auto}.row>.col-10,.row>.col-xs-10{height:auto;width:83.3333%}.row>.offset-10,.row>.offset-xs-10{margin-left:83.3333%}.column>.col-10,.column>.col-xs-10{height:83.3333%;width:auto}.row>.col-11,.row>.col-xs-11{height:auto;width:91.6667%}.row>.offset-11,.row>.offset-xs-11{margin-left:91.6667%}.column>.col-11,.column>.col-xs-11{height:91.6667%;width:auto}.row>.col-12,.row>.col-xs-12{height:auto;width:100%}.row>.offset-12,.row>.offset-xs-12{margin-left:100%}.column>.col-12,.column>.col-xs-12{height:100%;width:auto}.row>.col-all{height:auto;flex:0 0 100%}}@media (min-width: 600px){.row>.col-sm,.flex>.col-sm,.row>.col-sm-auto,.row>.col-sm-12,.row>.col-sm-11,.row>.col-sm-10,.row>.col-sm-9,.row>.col-sm-8,.row>.col-sm-7,.row>.col-sm-6,.row>.col-sm-5,.row>.col-sm-4,.row>.col-sm-3,.row>.col-sm-2,.row>.col-sm-1,.row>.col-sm-0,.flex>.col-sm-auto,.flex>.col-sm-12,.flex>.col-sm-11,.flex>.col-sm-10,.flex>.col-sm-9,.flex>.col-sm-8,.flex>.col-sm-7,.flex>.col-sm-6,.flex>.col-sm-5,.flex>.col-sm-4,.flex>.col-sm-3,.flex>.col-sm-2,.flex>.col-sm-1,.flex>.col-sm-0,.row>.col-sm-grow,.flex>.col-sm-grow,.row>.col-sm-shrink,.flex>.col-sm-shrink{width:auto;min-width:0;max-width:100%}.column>.col-sm,.flex>.col-sm,.column>.col-sm-auto,.column>.col-sm-12,.column>.col-sm-11,.column>.col-sm-10,.column>.col-sm-9,.column>.col-sm-8,.column>.col-sm-7,.column>.col-sm-6,.column>.col-sm-5,.column>.col-sm-4,.column>.col-sm-3,.column>.col-sm-2,.column>.col-sm-1,.column>.col-sm-0,.flex>.col-sm-auto,.flex>.col-sm-12,.flex>.col-sm-11,.flex>.col-sm-10,.flex>.col-sm-9,.flex>.col-sm-8,.flex>.col-sm-7,.flex>.col-sm-6,.flex>.col-sm-5,.flex>.col-sm-4,.flex>.col-sm-3,.flex>.col-sm-2,.flex>.col-sm-1,.flex>.col-sm-0,.column>.col-sm-grow,.flex>.col-sm-grow,.column>.col-sm-shrink,.flex>.col-sm-shrink{height:auto;min-height:0;max-height:100%}.col-sm{flex:10000 1 0%}.col-sm-auto,.col-sm-12,.col-sm-11,.col-sm-10,.col-sm-9,.col-sm-8,.col-sm-7,.col-sm-6,.col-sm-5,.col-sm-4,.col-sm-3,.col-sm-2,.col-sm-1,.col-sm-0{flex:0 0 auto}.col-sm-grow{flex:1 0 auto}.col-sm-shrink{flex:0 1 auto}.row>.col-sm-0{height:auto;width:0%}.row>.offset-sm-0{margin-left:0%}.column>.col-sm-0{height:0%;width:auto}.row>.col-sm-1{height:auto;width:8.3333%}.row>.offset-sm-1{margin-left:8.3333%}.column>.col-sm-1{height:8.3333%;width:auto}.row>.col-sm-2{height:auto;width:16.6667%}.row>.offset-sm-2{margin-left:16.6667%}.column>.col-sm-2{height:16.6667%;width:auto}.row>.col-sm-3{height:auto;width:25%}.row>.offset-sm-3{margin-left:25%}.column>.col-sm-3{height:25%;width:auto}.row>.col-sm-4{height:auto;width:33.3333%}.row>.offset-sm-4{margin-left:33.3333%}.column>.col-sm-4{height:33.3333%;width:auto}.row>.col-sm-5{height:auto;width:41.6667%}.row>.offset-sm-5{margin-left:41.6667%}.column>.col-sm-5{height:41.6667%;width:auto}.row>.col-sm-6{height:auto;width:50%}.row>.offset-sm-6{margin-left:50%}.column>.col-sm-6{height:50%;width:auto}.row>.col-sm-7{height:auto;width:58.3333%}.row>.offset-sm-7{margin-left:58.3333%}.column>.col-sm-7{height:58.3333%;width:auto}.row>.col-sm-8{height:auto;width:66.6667%}.row>.offset-sm-8{margin-left:66.6667%}.column>.col-sm-8{height:66.6667%;width:auto}.row>.col-sm-9{height:auto;width:75%}.row>.offset-sm-9{margin-left:75%}.column>.col-sm-9{height:75%;width:auto}.row>.col-sm-10{height:auto;width:83.3333%}.row>.offset-sm-10{margin-left:83.3333%}.column>.col-sm-10{height:83.3333%;width:auto}.row>.col-sm-11{height:auto;width:91.6667%}.row>.offset-sm-11{margin-left:91.6667%}.column>.col-sm-11{height:91.6667%;width:auto}.row>.col-sm-12{height:auto;width:100%}.row>.offset-sm-12{margin-left:100%}.column>.col-sm-12{height:100%;width:auto}}@media (min-width: 1024px){.row>.col-md,.flex>.col-md,.row>.col-md-auto,.row>.col-md-12,.row>.col-md-11,.row>.col-md-10,.row>.col-md-9,.row>.col-md-8,.row>.col-md-7,.row>.col-md-6,.row>.col-md-5,.row>.col-md-4,.row>.col-md-3,.row>.col-md-2,.row>.col-md-1,.row>.col-md-0,.flex>.col-md-auto,.flex>.col-md-12,.flex>.col-md-11,.flex>.col-md-10,.flex>.col-md-9,.flex>.col-md-8,.flex>.col-md-7,.flex>.col-md-6,.flex>.col-md-5,.flex>.col-md-4,.flex>.col-md-3,.flex>.col-md-2,.flex>.col-md-1,.flex>.col-md-0,.row>.col-md-grow,.flex>.col-md-grow,.row>.col-md-shrink,.flex>.col-md-shrink{width:auto;min-width:0;max-width:100%}.column>.col-md,.flex>.col-md,.column>.col-md-auto,.column>.col-md-12,.column>.col-md-11,.column>.col-md-10,.column>.col-md-9,.column>.col-md-8,.column>.col-md-7,.column>.col-md-6,.column>.col-md-5,.column>.col-md-4,.column>.col-md-3,.column>.col-md-2,.column>.col-md-1,.column>.col-md-0,.flex>.col-md-auto,.flex>.col-md-12,.flex>.col-md-11,.flex>.col-md-10,.flex>.col-md-9,.flex>.col-md-8,.flex>.col-md-7,.flex>.col-md-6,.flex>.col-md-5,.flex>.col-md-4,.flex>.col-md-3,.flex>.col-md-2,.flex>.col-md-1,.flex>.col-md-0,.column>.col-md-grow,.flex>.col-md-grow,.column>.col-md-shrink,.flex>.col-md-shrink{height:auto;min-height:0;max-height:100%}.col-md{flex:10000 1 0%}.col-md-auto,.col-md-12,.col-md-11,.col-md-10,.col-md-9,.col-md-8,.col-md-7,.col-md-6,.col-md-5,.col-md-4,.col-md-3,.col-md-2,.col-md-1,.col-md-0{flex:0 0 auto}.col-md-grow{flex:1 0 auto}.col-md-shrink{flex:0 1 auto}.row>.col-md-0{height:auto;width:0%}.row>.offset-md-0{margin-left:0%}.column>.col-md-0{height:0%;width:auto}.row>.col-md-1{height:auto;width:8.3333%}.row>.offset-md-1{margin-left:8.3333%}.column>.col-md-1{height:8.3333%;width:auto}.row>.col-md-2{height:auto;width:16.6667%}.row>.offset-md-2{margin-left:16.6667%}.column>.col-md-2{height:16.6667%;width:auto}.row>.col-md-3{height:auto;width:25%}.row>.offset-md-3{margin-left:25%}.column>.col-md-3{height:25%;width:auto}.row>.col-md-4{height:auto;width:33.3333%}.row>.offset-md-4{margin-left:33.3333%}.column>.col-md-4{height:33.3333%;width:auto}.row>.col-md-5{height:auto;width:41.6667%}.row>.offset-md-5{margin-left:41.6667%}.column>.col-md-5{height:41.6667%;width:auto}.row>.col-md-6{height:auto;width:50%}.row>.offset-md-6{margin-left:50%}.column>.col-md-6{height:50%;width:auto}.row>.col-md-7{height:auto;width:58.3333%}.row>.offset-md-7{margin-left:58.3333%}.column>.col-md-7{height:58.3333%;width:auto}.row>.col-md-8{height:auto;width:66.6667%}.row>.offset-md-8{margin-left:66.6667%}.column>.col-md-8{height:66.6667%;width:auto}.row>.col-md-9{height:auto;width:75%}.row>.offset-md-9{margin-left:75%}.column>.col-md-9{height:75%;width:auto}.row>.col-md-10{height:auto;width:83.3333%}.row>.offset-md-10{margin-left:83.3333%}.column>.col-md-10{height:83.3333%;width:auto}.row>.col-md-11{height:auto;width:91.6667%}.row>.offset-md-11{margin-left:91.6667%}.column>.col-md-11{height:91.6667%;width:auto}.row>.col-md-12{height:auto;width:100%}.row>.offset-md-12{margin-left:100%}.column>.col-md-12{height:100%;width:auto}}@media (min-width: 1440px){.row>.col-lg,.flex>.col-lg,.row>.col-lg-auto,.row>.col-lg-12,.row>.col-lg-11,.row>.col-lg-10,.row>.col-lg-9,.row>.col-lg-8,.row>.col-lg-7,.row>.col-lg-6,.row>.col-lg-5,.row>.col-lg-4,.row>.col-lg-3,.row>.col-lg-2,.row>.col-lg-1,.row>.col-lg-0,.flex>.col-lg-auto,.flex>.col-lg-12,.flex>.col-lg-11,.flex>.col-lg-10,.flex>.col-lg-9,.flex>.col-lg-8,.flex>.col-lg-7,.flex>.col-lg-6,.flex>.col-lg-5,.flex>.col-lg-4,.flex>.col-lg-3,.flex>.col-lg-2,.flex>.col-lg-1,.flex>.col-lg-0,.row>.col-lg-grow,.flex>.col-lg-grow,.row>.col-lg-shrink,.flex>.col-lg-shrink{width:auto;min-width:0;max-width:100%}.column>.col-lg,.flex>.col-lg,.column>.col-lg-auto,.column>.col-lg-12,.column>.col-lg-11,.column>.col-lg-10,.column>.col-lg-9,.column>.col-lg-8,.column>.col-lg-7,.column>.col-lg-6,.column>.col-lg-5,.column>.col-lg-4,.column>.col-lg-3,.column>.col-lg-2,.column>.col-lg-1,.column>.col-lg-0,.flex>.col-lg-auto,.flex>.col-lg-12,.flex>.col-lg-11,.flex>.col-lg-10,.flex>.col-lg-9,.flex>.col-lg-8,.flex>.col-lg-7,.flex>.col-lg-6,.flex>.col-lg-5,.flex>.col-lg-4,.flex>.col-lg-3,.flex>.col-lg-2,.flex>.col-lg-1,.flex>.col-lg-0,.column>.col-lg-grow,.flex>.col-lg-grow,.column>.col-lg-shrink,.flex>.col-lg-shrink{height:auto;min-height:0;max-height:100%}.col-lg{flex:10000 1 0%}.col-lg-auto,.col-lg-12,.col-lg-11,.col-lg-10,.col-lg-9,.col-lg-8,.col-lg-7,.col-lg-6,.col-lg-5,.col-lg-4,.col-lg-3,.col-lg-2,.col-lg-1,.col-lg-0{flex:0 0 auto}.col-lg-grow{flex:1 0 auto}.col-lg-shrink{flex:0 1 auto}.row>.col-lg-0{height:auto;width:0%}.row>.offset-lg-0{margin-left:0%}.column>.col-lg-0{height:0%;width:auto}.row>.col-lg-1{height:auto;width:8.3333%}.row>.offset-lg-1{margin-left:8.3333%}.column>.col-lg-1{height:8.3333%;width:auto}.row>.col-lg-2{height:auto;width:16.6667%}.row>.offset-lg-2{margin-left:16.6667%}.column>.col-lg-2{height:16.6667%;width:auto}.row>.col-lg-3{height:auto;width:25%}.row>.offset-lg-3{margin-left:25%}.column>.col-lg-3{height:25%;width:auto}.row>.col-lg-4{height:auto;width:33.3333%}.row>.offset-lg-4{margin-left:33.3333%}.column>.col-lg-4{height:33.3333%;width:auto}.row>.col-lg-5{height:auto;width:41.6667%}.row>.offset-lg-5{margin-left:41.6667%}.column>.col-lg-5{height:41.6667%;width:auto}.row>.col-lg-6{height:auto;width:50%}.row>.offset-lg-6{margin-left:50%}.column>.col-lg-6{height:50%;width:auto}.row>.col-lg-7{height:auto;width:58.3333%}.row>.offset-lg-7{margin-left:58.3333%}.column>.col-lg-7{height:58.3333%;width:auto}.row>.col-lg-8{height:auto;width:66.6667%}.row>.offset-lg-8{margin-left:66.6667%}.column>.col-lg-8{height:66.6667%;width:auto}.row>.col-lg-9{height:auto;width:75%}.row>.offset-lg-9{margin-left:75%}.column>.col-lg-9{height:75%;width:auto}.row>.col-lg-10{height:auto;width:83.3333%}.row>.offset-lg-10{margin-left:83.3333%}.column>.col-lg-10{height:83.3333%;width:auto}.row>.col-lg-11{height:auto;width:91.6667%}.row>.offset-lg-11{margin-left:91.6667%}.column>.col-lg-11{height:91.6667%;width:auto}.row>.col-lg-12{height:auto;width:100%}.row>.offset-lg-12{margin-left:100%}.column>.col-lg-12{height:100%;width:auto}}@media (min-width: 1920px){.row>.col-xl,.flex>.col-xl,.row>.col-xl-auto,.row>.col-xl-12,.row>.col-xl-11,.row>.col-xl-10,.row>.col-xl-9,.row>.col-xl-8,.row>.col-xl-7,.row>.col-xl-6,.row>.col-xl-5,.row>.col-xl-4,.row>.col-xl-3,.row>.col-xl-2,.row>.col-xl-1,.row>.col-xl-0,.flex>.col-xl-auto,.flex>.col-xl-12,.flex>.col-xl-11,.flex>.col-xl-10,.flex>.col-xl-9,.flex>.col-xl-8,.flex>.col-xl-7,.flex>.col-xl-6,.flex>.col-xl-5,.flex>.col-xl-4,.flex>.col-xl-3,.flex>.col-xl-2,.flex>.col-xl-1,.flex>.col-xl-0,.row>.col-xl-grow,.flex>.col-xl-grow,.row>.col-xl-shrink,.flex>.col-xl-shrink{width:auto;min-width:0;max-width:100%}.column>.col-xl,.flex>.col-xl,.column>.col-xl-auto,.column>.col-xl-12,.column>.col-xl-11,.column>.col-xl-10,.column>.col-xl-9,.column>.col-xl-8,.column>.col-xl-7,.column>.col-xl-6,.column>.col-xl-5,.column>.col-xl-4,.column>.col-xl-3,.column>.col-xl-2,.column>.col-xl-1,.column>.col-xl-0,.flex>.col-xl-auto,.flex>.col-xl-12,.flex>.col-xl-11,.flex>.col-xl-10,.flex>.col-xl-9,.flex>.col-xl-8,.flex>.col-xl-7,.flex>.col-xl-6,.flex>.col-xl-5,.flex>.col-xl-4,.flex>.col-xl-3,.flex>.col-xl-2,.flex>.col-xl-1,.flex>.col-xl-0,.column>.col-xl-grow,.flex>.col-xl-grow,.column>.col-xl-shrink,.flex>.col-xl-shrink{height:auto;min-height:0;max-height:100%}.col-xl{flex:10000 1 0%}.col-xl-auto,.col-xl-12,.col-xl-11,.col-xl-10,.col-xl-9,.col-xl-8,.col-xl-7,.col-xl-6,.col-xl-5,.col-xl-4,.col-xl-3,.col-xl-2,.col-xl-1,.col-xl-0{flex:0 0 auto}.col-xl-grow{flex:1 0 auto}.col-xl-shrink{flex:0 1 auto}.row>.col-xl-0{height:auto;width:0%}.row>.offset-xl-0{margin-left:0%}.column>.col-xl-0{height:0%;width:auto}.row>.col-xl-1{height:auto;width:8.3333%}.row>.offset-xl-1{margin-left:8.3333%}.column>.col-xl-1{height:8.3333%;width:auto}.row>.col-xl-2{height:auto;width:16.6667%}.row>.offset-xl-2{margin-left:16.6667%}.column>.col-xl-2{height:16.6667%;width:auto}.row>.col-xl-3{height:auto;width:25%}.row>.offset-xl-3{margin-left:25%}.column>.col-xl-3{height:25%;width:auto}.row>.col-xl-4{height:auto;width:33.3333%}.row>.offset-xl-4{margin-left:33.3333%}.column>.col-xl-4{height:33.3333%;width:auto}.row>.col-xl-5{height:auto;width:41.6667%}.row>.offset-xl-5{margin-left:41.6667%}.column>.col-xl-5{height:41.6667%;width:auto}.row>.col-xl-6{height:auto;width:50%}.row>.offset-xl-6{margin-left:50%}.column>.col-xl-6{height:50%;width:auto}.row>.col-xl-7{height:auto;width:58.3333%}.row>.offset-xl-7{margin-left:58.3333%}.column>.col-xl-7{height:58.3333%;width:auto}.row>.col-xl-8{height:auto;width:66.6667%}.row>.offset-xl-8{margin-left:66.6667%}.column>.col-xl-8{height:66.6667%;width:auto}.row>.col-xl-9{height:auto;width:75%}.row>.offset-xl-9{margin-left:75%}.column>.col-xl-9{height:75%;width:auto}.row>.col-xl-10{height:auto;width:83.3333%}.row>.offset-xl-10{margin-left:83.3333%}.column>.col-xl-10{height:83.3333%;width:auto}.row>.col-xl-11{height:auto;width:91.6667%}.row>.offset-xl-11{margin-left:91.6667%}.column>.col-xl-11{height:91.6667%;width:auto}.row>.col-xl-12{height:auto;width:100%}.row>.offset-xl-12{margin-left:100%}.column>.col-xl-12{height:100%;width:auto}}.rounded-borders{border-radius:4px}.border-radius-inherit{border-radius:inherit}.no-transition{transition:none!important}.transition-0{transition:0s!important}.glossy{background-image:linear-gradient(to bottom,rgba(255,255,255,.3),rgba(255,255,255,0) 50%,rgba(0,0,0,.12) 51%,rgba(0,0,0,.04))!important}.q-placeholder::placeholder{color:inherit;opacity:.7}.q-body--fullscreen-mixin,.q-body--prevent-scroll{position:fixed!important}.q-body--force-scrollbar-x{overflow-x:scroll}.q-body--force-scrollbar-y{overflow-y:scroll}.q-no-input-spinner{-moz-appearance:textfield!important}.q-no-input-spinner::-webkit-outer-spin-button,.q-no-input-spinner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.q-link{outline:0;text-decoration:none}.q-link--focusable:focus-visible{-webkit-text-decoration:underline dashed currentColor 1px;text-decoration:underline dashed currentColor 1px}body.electron .q-electron-drag{-webkit-user-select:none;-webkit-app-region:drag}body.electron .q-electron-drag .q-btn-item,body.electron .q-electron-drag--exception{-webkit-app-region:no-drag}img.responsive{max-width:100%;height:auto}.non-selectable{-webkit-user-select:none!important;user-select:none!important}.scroll,body.mobile .scroll--mobile{overflow:auto}.scroll,.scroll-x,.scroll-y{-webkit-overflow-scrolling:touch;will-change:scroll-position}.scroll-x{overflow-x:auto}.scroll-y{overflow-y:auto}.no-scroll{overflow:hidden!important}.no-pointer-events,.no-pointer-events--children,.no-pointer-events--children *{pointer-events:none!important}.all-pointer-events{pointer-events:all!important}.cursor-pointer{cursor:pointer!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-inherit{cursor:inherit!important}.cursor-none{cursor:none!important}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}.rotate-45{transform:rotate(45deg)}.rotate-90{transform:rotate(90deg)}.rotate-135{transform:rotate(135deg)}.rotate-180{transform:rotate(180deg)}.rotate-225{transform:rotate(225deg)}.rotate-270{transform:rotate(270deg)}.rotate-315{transform:rotate(315deg)}.flip-horizontal{transform:scaleX(-1)}.flip-vertical{transform:scaleY(-1)}.float-left{float:left}.float-right{float:right}.relative-position{position:relative}.fixed,.fixed-full,.fullscreen,.fixed-center,.fixed-bottom,.fixed-left,.fixed-right,.fixed-top,.fixed-top-left,.fixed-top-right,.fixed-bottom-left,.fixed-bottom-right{position:fixed}.absolute,.absolute-full,.absolute-center,.absolute-bottom,.absolute-left,.absolute-right,.absolute-top,.absolute-top-left,.absolute-top-right,.absolute-bottom-left,.absolute-bottom-right{position:absolute}.fixed-top,.absolute-top{top:0;left:0;right:0}.fixed-right,.absolute-right{top:0;right:0;bottom:0}.fixed-bottom,.absolute-bottom{right:0;bottom:0;left:0}.fixed-left,.absolute-left{top:0;bottom:0;left:0}.fixed-top-left,.absolute-top-left{top:0;left:0}.fixed-top-right,.absolute-top-right{top:0;right:0}.fixed-bottom-left,.absolute-bottom-left{bottom:0;left:0}.fixed-bottom-right,.absolute-bottom-right{bottom:0;right:0}.fullscreen{z-index:6000;border-radius:0!important;max-width:100vw;max-height:100vh}body.q-ios-padding .fullscreen{padding-top:20px!important;padding-top:env(safe-area-inset-top)!important;padding-bottom:env(safe-area-inset-bottom)!important}.absolute-full,.fullscreen,.fixed-full{top:0;right:0;bottom:0;left:0}.fixed-center,.absolute-center{top:50%;left:50%;transform:translate(-50%,-50%)}.vertical-top{vertical-align:top!important}.vertical-middle{vertical-align:middle!important}.vertical-bottom{vertical-align:bottom!important}.on-left{margin-right:12px}.on-right{margin-left:12px}.q-position-engine{margin-top:var(--q-pe-top, 0)!important;margin-left:var(--q-pe-left, 0)!important;will-change:auto;visibility:collapse}:root{--q-size-xs: 0;--q-size-sm: 600px;--q-size-md: 1024px;--q-size-lg: 1440px;--q-size-xl: 1920px}.fit{width:100%!important;height:100%!important}.full-height{height:100%!important}.full-width{width:100%!important;margin-left:0!important;margin-right:0!important}.window-height{margin-top:0!important;margin-bottom:0!important;height:100vh!important}.window-width{margin-left:0!important;margin-right:0!important;width:100vw!important}.block{display:block!important}.inline-block{display:inline-block!important}.q-pa-none{padding:0}.q-pl-none{padding-left:0}.q-pr-none{padding-right:0}.q-pt-none{padding-top:0}.q-pb-none{padding-bottom:0}.q-px-none{padding-left:0;padding-right:0}.q-py-none{padding-top:0;padding-bottom:0}.q-ma-none{margin:0}.q-ml-none{margin-left:0}.q-mr-none{margin-right:0}.q-mt-none{margin-top:0}.q-mb-none{margin-bottom:0}.q-mx-none{margin-left:0;margin-right:0}.q-my-none{margin-top:0;margin-bottom:0}.q-pa-xs{padding:4px}.q-pl-xs{padding-left:4px}.q-pr-xs{padding-right:4px}.q-pt-xs{padding-top:4px}.q-pb-xs{padding-bottom:4px}.q-px-xs{padding-left:4px;padding-right:4px}.q-py-xs{padding-top:4px;padding-bottom:4px}.q-ma-xs{margin:4px}.q-ml-xs{margin-left:4px}.q-mr-xs{margin-right:4px}.q-mt-xs{margin-top:4px}.q-mb-xs{margin-bottom:4px}.q-mx-xs{margin-left:4px;margin-right:4px}.q-my-xs{margin-top:4px;margin-bottom:4px}.q-pa-sm{padding:8px}.q-pl-sm{padding-left:8px}.q-pr-sm{padding-right:8px}.q-pt-sm{padding-top:8px}.q-pb-sm{padding-bottom:8px}.q-px-sm{padding-left:8px;padding-right:8px}.q-py-sm{padding-top:8px;padding-bottom:8px}.q-ma-sm{margin:8px}.q-ml-sm{margin-left:8px}.q-mr-sm{margin-right:8px}.q-mt-sm{margin-top:8px}.q-mb-sm{margin-bottom:8px}.q-mx-sm{margin-left:8px;margin-right:8px}.q-my-sm{margin-top:8px;margin-bottom:8px}.q-pa-md{padding:16px}.q-pl-md{padding-left:16px}.q-pr-md{padding-right:16px}.q-pt-md{padding-top:16px}.q-pb-md{padding-bottom:16px}.q-px-md{padding-left:16px;padding-right:16px}.q-py-md{padding-top:16px;padding-bottom:16px}.q-ma-md{margin:16px}.q-ml-md{margin-left:16px}.q-mr-md{margin-right:16px}.q-mt-md{margin-top:16px}.q-mb-md{margin-bottom:16px}.q-mx-md{margin-left:16px;margin-right:16px}.q-my-md{margin-top:16px;margin-bottom:16px}.q-pa-lg{padding:24px}.q-pl-lg{padding-left:24px}.q-pr-lg{padding-right:24px}.q-pt-lg{padding-top:24px}.q-pb-lg{padding-bottom:24px}.q-px-lg{padding-left:24px;padding-right:24px}.q-py-lg{padding-top:24px;padding-bottom:24px}.q-ma-lg{margin:24px}.q-ml-lg{margin-left:24px}.q-mr-lg{margin-right:24px}.q-mt-lg{margin-top:24px}.q-mb-lg{margin-bottom:24px}.q-mx-lg{margin-left:24px;margin-right:24px}.q-my-lg{margin-top:24px;margin-bottom:24px}.q-pa-xl{padding:48px}.q-pl-xl{padding-left:48px}.q-pr-xl{padding-right:48px}.q-pt-xl{padding-top:48px}.q-pb-xl{padding-bottom:48px}.q-px-xl{padding-left:48px;padding-right:48px}.q-py-xl{padding-top:48px;padding-bottom:48px}.q-ma-xl{margin:48px}.q-ml-xl{margin-left:48px}.q-mr-xl{margin-right:48px}.q-mt-xl{margin-top:48px}.q-mb-xl{margin-bottom:48px}.q-mx-xl{margin-left:48px;margin-right:48px}.q-my-xl{margin-top:48px;margin-bottom:48px}.q-mt-auto,.q-my-auto{margin-top:auto}.q-ml-auto{margin-left:auto}.q-mb-auto,.q-my-auto{margin-bottom:auto}.q-mr-auto{margin-right:auto}.q-mx-auto{margin-left:auto;margin-right:auto}.q-touch{-webkit-user-select:none;user-select:none;user-drag:none;-khtml-user-drag:none;-webkit-user-drag:none}.q-touch-x{touch-action:pan-x}.q-touch-y{touch-action:pan-y}:root{--q-transition-duration: .3s}.q-transition--slide-right-enter-active,.q-transition--slide-right-leave-active,.q-transition--slide-left-enter-active,.q-transition--slide-left-leave-active,.q-transition--slide-up-enter-active,.q-transition--slide-up-leave-active,.q-transition--slide-down-enter-active,.q-transition--slide-down-leave-active,.q-transition--jump-right-enter-active,.q-transition--jump-right-leave-active,.q-transition--jump-left-enter-active,.q-transition--jump-left-leave-active,.q-transition--jump-up-enter-active,.q-transition--jump-up-leave-active,.q-transition--jump-down-enter-active,.q-transition--jump-down-leave-active,.q-transition--fade-enter-active,.q-transition--fade-leave-active,.q-transition--scale-enter-active,.q-transition--scale-leave-active,.q-transition--rotate-enter-active,.q-transition--rotate-leave-active,.q-transition--flip-enter-active,.q-transition--flip-leave-active{--q-transition-duration: .3s;--q-transition-easing: cubic-bezier(.215,.61,.355,1)}.q-transition--slide-right-leave-active,.q-transition--slide-left-leave-active,.q-transition--slide-up-leave-active,.q-transition--slide-down-leave-active,.q-transition--jump-right-leave-active,.q-transition--jump-left-leave-active,.q-transition--jump-up-leave-active,.q-transition--jump-down-leave-active,.q-transition--fade-leave-active,.q-transition--scale-leave-active,.q-transition--rotate-leave-active,.q-transition--flip-leave-active{position:absolute}.q-transition--slide-right-enter-active,.q-transition--slide-right-leave-active,.q-transition--slide-left-enter-active,.q-transition--slide-left-leave-active,.q-transition--slide-up-enter-active,.q-transition--slide-up-leave-active,.q-transition--slide-down-enter-active,.q-transition--slide-down-leave-active{transition:transform var(--q-transition-duration) var(--q-transition-easing)}.q-transition--slide-right-enter-from{transform:translate3d(-100%,0,0)}.q-transition--slide-right-leave-to,.q-transition--slide-left-enter-from{transform:translate3d(100%,0,0)}.q-transition--slide-left-leave-to{transform:translate3d(-100%,0,0)}.q-transition--slide-up-enter-from{transform:translate3d(0,100%,0)}.q-transition--slide-up-leave-to,.q-transition--slide-down-enter-from{transform:translate3d(0,-100%,0)}.q-transition--slide-down-leave-to{transform:translate3d(0,100%,0)}.q-transition--jump-right-enter-active,.q-transition--jump-right-leave-active,.q-transition--jump-left-enter-active,.q-transition--jump-left-leave-active,.q-transition--jump-up-enter-active,.q-transition--jump-up-leave-active,.q-transition--jump-down-enter-active,.q-transition--jump-down-leave-active{transition:opacity var(--q-transition-duration),transform var(--q-transition-duration)}.q-transition--jump-right-enter-from,.q-transition--jump-right-leave-to,.q-transition--jump-left-enter-from,.q-transition--jump-left-leave-to,.q-transition--jump-up-enter-from,.q-transition--jump-up-leave-to,.q-transition--jump-down-enter-from,.q-transition--jump-down-leave-to{opacity:0}.q-transition--jump-right-enter-from{transform:translate3d(-15px,0,0)}.q-transition--jump-right-leave-to,.q-transition--jump-left-enter-from{transform:translate3d(15px,0,0)}.q-transition--jump-left-leave-to{transform:translate(-15px)}.q-transition--jump-up-enter-from{transform:translate3d(0,15px,0)}.q-transition--jump-up-leave-to,.q-transition--jump-down-enter-from{transform:translate3d(0,-15px,0)}.q-transition--jump-down-leave-to{transform:translate3d(0,15px,0)}.q-transition--fade-enter-active,.q-transition--fade-leave-active{transition:opacity var(--q-transition-duration) ease-out}.q-transition--fade-enter-from,.q-transition--fade-leave-to{opacity:0}.q-transition--scale-enter-active,.q-transition--scale-leave-active{transition:opacity var(--q-transition-duration),transform var(--q-transition-duration) var(--q-transition-easing)}.q-transition--scale-enter-from,.q-transition--scale-leave-to{opacity:0;transform:scale3d(0,0,1)}.q-transition--rotate-enter-active,.q-transition--rotate-leave-active{transition:opacity var(--q-transition-duration),transform var(--q-transition-duration) var(--q-transition-easing);transform-style:preserve-3d}.q-transition--rotate-enter-from,.q-transition--rotate-leave-to{opacity:0;transform:scale3d(0,0,1) rotate3d(0,0,1,90deg)}.q-transition--flip-right-enter-active,.q-transition--flip-right-leave-active,.q-transition--flip-left-enter-active,.q-transition--flip-left-leave-active,.q-transition--flip-up-enter-active,.q-transition--flip-up-leave-active,.q-transition--flip-down-enter-active,.q-transition--flip-down-leave-active{transition:transform var(--q-transition-duration);backface-visibility:hidden}.q-transition--flip-right-enter-to,.q-transition--flip-right-leave-from,.q-transition--flip-left-enter-to,.q-transition--flip-left-leave-from,.q-transition--flip-up-enter-to,.q-transition--flip-up-leave-from,.q-transition--flip-down-enter-to,.q-transition--flip-down-leave-from{transform:perspective(400px) rotate3d(1,1,0,0)}.q-transition--flip-right-enter-from{transform:perspective(400px) rotateY(-180deg)}.q-transition--flip-right-leave-to,.q-transition--flip-left-enter-from{transform:perspective(400px) rotateY(180deg)}.q-transition--flip-left-leave-to{transform:perspective(400px) rotateY(-180deg)}.q-transition--flip-up-enter-from{transform:perspective(400px) rotateX(-180deg)}.q-transition--flip-up-leave-to,.q-transition--flip-down-enter-from{transform:perspective(400px) rotateX(180deg)}.q-transition--flip-down-leave-to{transform:perspective(400px) rotateX(-180deg)}body{min-width:100px;min-height:100%;font-family:Roboto,-apple-system,Helvetica Neue,Helvetica,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased;line-height:1.5;font-size:14px}h1{font-size:6rem;font-weight:300;line-height:6rem;letter-spacing:-.01562em}h2{font-size:3.75rem;font-weight:300;line-height:3.75rem;letter-spacing:-.00833em}h3{font-size:3rem;font-weight:400;line-height:3.125rem;letter-spacing:normal}h4{font-size:2.125rem;font-weight:400;line-height:2.5rem;letter-spacing:.00735em}h5{font-size:1.5rem;font-weight:400;line-height:2rem;letter-spacing:normal}h6{font-size:1.25rem;font-weight:500;line-height:2rem;letter-spacing:.0125em}p{margin:0 0 16px}.text-h1{font-size:6rem;font-weight:300;line-height:6rem;letter-spacing:-.01562em}.text-h2{font-size:3.75rem;font-weight:300;line-height:3.75rem;letter-spacing:-.00833em}.text-h3{font-size:3rem;font-weight:400;line-height:3.125rem;letter-spacing:normal}.text-h4{font-size:2.125rem;font-weight:400;line-height:2.5rem;letter-spacing:.00735em}.text-h5{font-size:1.5rem;font-weight:400;line-height:2rem;letter-spacing:normal}.text-h6{font-size:1.25rem;font-weight:500;line-height:2rem;letter-spacing:.0125em}.text-subtitle1{font-size:1rem;font-weight:400;line-height:1.75rem;letter-spacing:.00937em}.text-subtitle2{font-size:.875rem;font-weight:500;line-height:1.375rem;letter-spacing:.00714em}.text-body1{font-size:1rem;font-weight:400;line-height:1.5rem;letter-spacing:.03125em}.text-body2{font-size:.875rem;font-weight:400;line-height:1.25rem;letter-spacing:.01786em}.text-overline{font-size:.75rem;font-weight:500;line-height:2rem;letter-spacing:.16667em}.text-caption{font-size:.75rem;font-weight:400;line-height:1.25rem;letter-spacing:.03333em}.text-uppercase{text-transform:uppercase}.text-lowercase{text-transform:lowercase}.text-capitalize{text-transform:capitalize}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-justify{text-align:justify;-webkit-hyphens:auto;hyphens:auto}.text-italic{font-style:italic}.text-bold{font-weight:700}.text-no-wrap{white-space:nowrap}.text-strike{text-decoration:line-through}.text-weight-thin{font-weight:100}.text-weight-light{font-weight:300}.text-weight-regular{font-weight:400}.text-weight-medium{font-weight:500}.text-weight-bold{font-weight:700}.text-weight-bolder{font-weight:900}small{font-size:80%}big{font-size:170%}sub{bottom:-.25em}sup{top:-.5em}.no-margin{margin:0!important}.no-padding{padding:0!important}.no-border{border:0!important}.no-border-radius{border-radius:0!important}.no-box-shadow{box-shadow:none!important}.no-outline{outline:0!important}.ellipsis{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ellipsis-2-lines,.ellipsis-3-lines{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical}.ellipsis-2-lines{-webkit-line-clamp:2}.ellipsis-3-lines{-webkit-line-clamp:3}.readonly{cursor:default!important}.disabled,.disabled *,[disabled],[disabled] *{outline:0!important;cursor:not-allowed!important}.disabled,[disabled]{opacity:.6!important}.hidden{display:none!important}.invisible,.invisible *{visibility:hidden!important;transition:none!important;animation:none!important}.transparent{background:transparent!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-hidden-y{overflow-y:hidden!important}.hide-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbar::-webkit-scrollbar{width:0;height:0;display:none}.dimmed:after,.light-dimmed:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.dimmed:after{background:rgba(0,0,0,.4)!important}.light-dimmed:after{background:rgba(255,255,255,.6)!important}.z-top{z-index:7000!important}.z-max{z-index:9998!important}body:not(.desktop) .desktop-only,body.desktop .desktop-hide{display:none!important}body:not(.mobile) .mobile-only,body.mobile .mobile-hide{display:none!important}body:not(.native-mobile) .native-mobile-only,body.native-mobile .native-mobile-hide{display:none!important}body:not(.cordova) .cordova-only,body.cordova .cordova-hide{display:none!important}body:not(.capacitor) .capacitor-only,body.capacitor .capacitor-hide{display:none!important}body:not(.electron) .electron-only,body.electron .electron-hide{display:none!important}body:not(.touch) .touch-only,body.touch .touch-hide{display:none!important}body:not(.within-iframe) .within-iframe-only,body.within-iframe .within-iframe-hide{display:none!important}body:not(.platform-ios) .platform-ios-only,body.platform-ios .platform-ios-hide{display:none!important}body:not(.platform-android) .platform-android-only,body.platform-android .platform-android-hide{display:none!important}@media all and (orientation: portrait){.orientation-landscape{display:none!important}}@media all and (orientation: landscape){.orientation-portrait{display:none!important}}@media screen{.print-only{display:none!important}}@media print{.print-hide{display:none!important}}@media (max-width: 599.98px){.xs-hide,.gt-xs,.sm,.gt-sm,.md,.gt-md,.lg,.gt-lg,.xl{display:none!important}}@media (min-width: 600px) and (max-width: 1023.98px){.sm-hide,.xs,.lt-sm,.gt-sm,.md,.gt-md,.lg,.gt-lg,.xl{display:none!important}}@media (min-width: 1024px) and (max-width: 1439.98px){.md-hide,.xs,.lt-sm,.sm,.lt-md,.gt-md,.lg,.gt-lg,.xl{display:none!important}}@media (min-width: 1440px) and (max-width: 1919.98px){.lg-hide,.xs,.lt-sm,.sm,.lt-md,.md,.lt-lg,.gt-lg,.xl{display:none!important}}@media (min-width: 1920px){.xl-hide,.xs,.lt-sm,.sm,.lt-md,.md,.lt-lg,.lg,.lt-xl{display:none!important}}.q-focus-helper,.q-focusable,.q-manual-focusable,.q-hoverable{outline:0}body.desktop .q-focus-helper{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;opacity:0;transition:background-color .3s cubic-bezier(.25,.8,.5,1),opacity .4s cubic-bezier(.25,.8,.5,1)}body.desktop .q-focus-helper:before,body.desktop .q-focus-helper:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;border-radius:inherit;transition:background-color .3s cubic-bezier(.25,.8,.5,1),opacity .6s cubic-bezier(.25,.8,.5,1)}body.desktop .q-focus-helper:before{background:#000}body.desktop .q-focus-helper:after{background:#fff}body.desktop .q-focus-helper--rounded{border-radius:4px}body.desktop .q-focus-helper--round{border-radius:50%}body.desktop .q-focusable:focus>.q-focus-helper,body.desktop .q-manual-focusable--focused>.q-focus-helper,body.desktop .q-hoverable:hover>.q-focus-helper{background:currentColor;opacity:.15}body.desktop .q-focusable:focus>.q-focus-helper:before,body.desktop .q-manual-focusable--focused>.q-focus-helper:before,body.desktop .q-hoverable:hover>.q-focus-helper:before{opacity:.1}body.desktop .q-focusable:focus>.q-focus-helper:after,body.desktop .q-manual-focusable--focused>.q-focus-helper:after,body.desktop .q-hoverable:hover>.q-focus-helper:after{opacity:.4}body.desktop .q-focusable:focus>.q-focus-helper,body.desktop .q-manual-focusable--focused>.q-focus-helper{opacity:.22}body.body--dark{color:#fff;background:var(--q-dark-page)}.q-dark{color:#fff;background:var(--q-dark)}[data-theme=classic] .q-drawer--dark,body[data-theme=classic].body--dark,[data-theme=classic] .q-menu--dark{background:#1f2234!important}[data-theme=classic] .q-card--dark,[data-theme=classic] .q-stepper--dark{background:#333646!important}[data-theme=classic] .bg-primary{background:#673ab7!important}[data-theme=classic] .text-primary{color:#673ab7!important}[data-theme=classic] .bg-secondary{background:#9c27b0!important}[data-theme=classic] .text-secondary{color:#9c27b0!important}[data-theme=classic] .bg-dark{background:#1f2234!important}[data-theme=classic] .text-dark{color:#1f2234!important}[data-theme=classic] .bg-info{background:#333646!important}[data-theme=classic] .text-info{color:#333646!important}[data-theme=classic] .bg-marginal-bg{background:#1f2234!important}[data-theme=classic] .text-marginal-bg{color:#1f2234!important}[data-theme=classic] .bg-marginal-text{background:#fff!important}[data-theme=classic] .text-marginal-text{color:#fff!important}[data-theme=bitcoin] .q-drawer--dark,body[data-theme=bitcoin].body--dark,[data-theme=bitcoin] .q-menu--dark{background:#2d293b!important}[data-theme=bitcoin] .q-card--dark,[data-theme=bitcoin] .q-stepper--dark{background:#333646!important}[data-theme=bitcoin] .bg-primary{background:#ff9853!important}[data-theme=bitcoin] .text-primary{color:#ff9853!important}[data-theme=bitcoin] .bg-secondary{background:#ff7353!important}[data-theme=bitcoin] .text-secondary{color:#ff7353!important}[data-theme=bitcoin] .bg-dark{background:#2d293b!important}[data-theme=bitcoin] .text-dark{color:#2d293b!important}[data-theme=bitcoin] .bg-info{background:#333646!important}[data-theme=bitcoin] .text-info{color:#333646!important}[data-theme=bitcoin] .bg-marginal-bg{background:#2d293b!important}[data-theme=bitcoin] .text-marginal-bg{color:#2d293b!important}[data-theme=bitcoin] .bg-marginal-text{background:#fff!important}[data-theme=bitcoin] .text-marginal-text{color:#fff!important}[data-theme=freedom] .q-drawer--dark,body[data-theme=freedom].body--dark,[data-theme=freedom] .q-menu--dark{background:#0a0a0a!important}[data-theme=freedom] .q-card--dark,[data-theme=freedom] .q-stepper--dark{background:#1b1b1b!important}[data-theme=freedom] .bg-primary{background:#e22156!important}[data-theme=freedom] .text-primary{color:#e22156!important}[data-theme=freedom] .bg-secondary{background:#b91a45!important}[data-theme=freedom] .text-secondary{color:#b91a45!important}[data-theme=freedom] .bg-dark{background:#0a0a0a!important}[data-theme=freedom] .text-dark{color:#0a0a0a!important}[data-theme=freedom] .bg-info{background:#1b1b1b!important}[data-theme=freedom] .text-info{color:#1b1b1b!important}[data-theme=freedom] .bg-marginal-bg{background:#2d293b!important}[data-theme=freedom] .text-marginal-bg{color:#2d293b!important}[data-theme=freedom] .bg-marginal-text{background:#fff!important}[data-theme=freedom] .text-marginal-text{color:#fff!important}[data-theme=cyber] .q-drawer--dark,body[data-theme=cyber].body--dark,[data-theme=cyber] .q-menu--dark{background:#0a0a0a!important}[data-theme=cyber] .q-card--dark,[data-theme=cyber] .q-stepper--dark{background:#1b1b1b!important}[data-theme=cyber] .bg-primary{background:#7cb342!important}[data-theme=cyber] .text-primary{color:#7cb342!important}[data-theme=cyber] .bg-secondary{background:#558b2f!important}[data-theme=cyber] .text-secondary{color:#558b2f!important}[data-theme=cyber] .bg-dark{background:#0a0a0a!important}[data-theme=cyber] .text-dark{color:#0a0a0a!important}[data-theme=cyber] .bg-info{background:#1b1b1b!important}[data-theme=cyber] .text-info{color:#1b1b1b!important}[data-theme=cyber] .bg-marginal-bg{background:#2d293b!important}[data-theme=cyber] .text-marginal-bg{color:#2d293b!important}[data-theme=cyber] .bg-marginal-text{background:#fff!important}[data-theme=cyber] .text-marginal-text{color:#fff!important}[data-theme=mint] .q-drawer--dark,body[data-theme=mint].body--dark,[data-theme=mint] .q-menu--dark{background:#1f342b!important}[data-theme=mint] .q-card--dark,[data-theme=mint] .q-stepper--dark{background:#334642!important}[data-theme=mint] .bg-primary{background:#3ab77d!important}[data-theme=mint] .text-primary{color:#3ab77d!important}[data-theme=mint] .bg-secondary{background:#27b065!important}[data-theme=mint] .text-secondary{color:#27b065!important}[data-theme=mint] .bg-dark{background:#1f342b!important}[data-theme=mint] .text-dark{color:#1f342b!important}[data-theme=mint] .bg-info{background:#334642!important}[data-theme=mint] .text-info{color:#334642!important}[data-theme=mint] .bg-marginal-bg{background:#1f342b!important}[data-theme=mint] .text-marginal-bg{color:#1f342b!important}[data-theme=mint] .bg-marginal-text{background:#fff!important}[data-theme=mint] .text-marginal-text{color:#fff!important}[data-theme=autumn] .q-drawer--dark,body[data-theme=autumn].body--dark,[data-theme=autumn] .q-menu--dark{background:#34291f!important}[data-theme=autumn] .q-card--dark,[data-theme=autumn] .q-stepper--dark{background:#463f33!important}[data-theme=autumn] .bg-primary{background:#b7763a!important}[data-theme=autumn] .text-primary{color:#b7763a!important}[data-theme=autumn] .bg-secondary{background:#b07927!important}[data-theme=autumn] .text-secondary{color:#b07927!important}[data-theme=autumn] .bg-dark{background:#34291f!important}[data-theme=autumn] .text-dark{color:#34291f!important}[data-theme=autumn] .bg-info{background:#463f33!important}[data-theme=autumn] .text-info{color:#463f33!important}[data-theme=autumn] .bg-marginal-bg{background:#342a1f!important}[data-theme=autumn] .text-marginal-bg{color:#342a1f!important}[data-theme=autumn] .bg-marginal-text{background:rgb(255,255,255)!important}[data-theme=autumn] .text-marginal-text{color:#fff!important}[data-theme=flamingo] .q-drawer--dark,body[data-theme=flamingo].body--dark,[data-theme=flamingo] .q-menu--dark{background:#2f032f!important}[data-theme=flamingo] .q-card--dark,[data-theme=flamingo] .q-stepper--dark{background:#bc23bc!important}[data-theme=flamingo] .bg-primary{background:#ff00ff!important}[data-theme=flamingo] .text-primary{color:#f0f!important}[data-theme=flamingo] .bg-secondary{background:#fda3fd!important}[data-theme=flamingo] .text-secondary{color:#fda3fd!important}[data-theme=flamingo] .bg-dark{background:#2f032f!important}[data-theme=flamingo] .text-dark{color:#2f032f!important}[data-theme=flamingo] .bg-info{background:#bc23bc!important}[data-theme=flamingo] .text-info{color:#bc23bc!important}[data-theme=flamingo] .bg-marginal-bg{background:#311231!important}[data-theme=flamingo] .text-marginal-bg{color:#311231!important}[data-theme=flamingo] .bg-marginal-text{background:rgb(255,255,255)!important}[data-theme=flamingo] .text-marginal-text{color:#fff!important}[data-theme=monochrome] .q-drawer--dark,body[data-theme=monochrome].body--dark,[data-theme=monochrome] .q-menu--dark{background:#000!important}[data-theme=monochrome] .q-card--dark,[data-theme=monochrome] .q-stepper--dark{background:rgb(39,39,39)!important}[data-theme=monochrome] .bg-primary{background:#494949!important}[data-theme=monochrome] .text-primary{color:#494949!important}[data-theme=monochrome] .bg-secondary{background:#6b6b6b!important}[data-theme=monochrome] .text-secondary{color:#6b6b6b!important}[data-theme=monochrome] .bg-dark{background:#000!important}[data-theme=monochrome] .text-dark{color:#000!important}[data-theme=monochrome] .bg-info{background:rgb(39,39,39)!important}[data-theme=monochrome] .text-info{color:#272727!important}[data-theme=monochrome] .bg-marginal-bg{background:#000!important}[data-theme=monochrome] .text-marginal-bg{color:#000!important}[data-theme=monochrome] .bg-marginal-text{background:rgb(255,255,255)!important}[data-theme=monochrome] .text-marginal-text{color:#fff!important}[data-theme=freedom] .q-drawer--dark,[data-theme=freedom] .q-header,[data-theme=cyber] .q-drawer--dark,[data-theme=cyber] .q-header{background:#0a0a0a!important}[data-theme=salvador] .q-drawer--dark{background:#242424!important}[data-theme=salvador] .q-header{background:#0f47af!important}[v-cloak]{display:none}body.body--dark .q-table--dark{background:transparent}body.body--dark .q-field--error .text-negative,body.body--dark .q-field--error .q-field__messages{color:#ff0!important}.lnbits-drawer__q-list .q-item{padding-top:5px!important;padding-bottom:5px!important;border-top-right-radius:3px;border-bottom-right-radius:3px}.lnbits-drawer__q-list .q-item.q-item--active{color:inherit;font-weight:700}.lnbits__dialog-card{width:500px}.q-table--dense th:first-child,.q-table--dense td:first-child,.q-table--dense .q-table__bottom{padding-left:6px!important}.q-table--dense th:last-child,.q-table--dense td:last-child,.q-table--dense .q-table__bottom{padding-right:6px!important}a.inherit{color:inherit;text-decoration:none}video{border-radius:3px}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(/static/fonts/material-icons-v50.woff2) format("woff2")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-moz-font-feature-settings:"liga";-moz-osx-font-smoothing:grayscale}.q-rating__icon{font-size:1em}.text-wrap{word-break:break-word}.q-card code{overflow-wrap:break-word} diff --git a/static/market/assets/index.725caa24.js b/static/market/assets/index.725caa24.js new file mode 100644 index 0000000..fd6585c --- /dev/null +++ b/static/market/assets/index.725caa24.js @@ -0,0 +1,5 @@ +function jr(e,t){const n=Object.create(null),o=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}const ve={},nn=[],nt=()=>{},ou=()=>!1,ru=/^on[^a-z]/,To=e=>ru.test(e),Vr=e=>e.startsWith("onUpdate:"),Ce=Object.assign,Dr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},iu=Object.prototype.hasOwnProperty,ce=(e,t)=>iu.call(e,t),te=Array.isArray,on=e=>Qn(e)==="[object Map]",Xs=e=>Qn(e)==="[object Set]",su=e=>Qn(e)==="[object RegExp]",le=e=>typeof e=="function",xe=e=>typeof e=="string",Hr=e=>typeof e=="symbol",ye=e=>e!==null&&typeof e=="object",Gs=e=>ye(e)&&le(e.then)&&le(e.catch),el=Object.prototype.toString,Qn=e=>el.call(e),lu=e=>Qn(e).slice(8,-1),tl=e=>Qn(e)==="[object Object]",zr=e=>xe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,co=jr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qo=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},au=/-(\w)/g,ct=qo(e=>e.replace(au,(t,n)=>n?n.toUpperCase():"")),uu=/\B([A-Z])/g,Kt=qo(e=>e.replace(uu,"-$1").toLowerCase()),Ao=qo(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ko=qo(e=>e?`on${Ao(e)}`:""),Fn=(e,t)=>!Object.is(e,t),qn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},cu=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fu=e=>{const t=xe(e)?Number(e):NaN;return isNaN(t)?e:t};let yi;const mr=()=>yi||(yi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Kr(e){if(te(e)){const t={};for(let n=0;n{if(n){const o=n.split(hu);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Ur(e){let t="";if(xe(e))t=e;else if(te(e))for(let n=0;nxe(e)?e:e==null?"":te(e)||ye(e)&&(e.toString===el||!le(e.toString))?JSON.stringify(e,ol,2):String(e),ol=(e,t)=>t&&t.__v_isRef?ol(e,t.value):on(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r])=>(n[`${o} =>`]=r,n),{})}:Xs(t)?{[`Set(${t.size})`]:[...t.values()]}:ye(t)&&!te(t)&&!tl(t)?String(t):t;let Ye;class bu{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Ye,!t&&Ye&&(this.index=(Ye.scopes||(Ye.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Ye;try{return Ye=this,t()}finally{Ye=n}}}on(){Ye=this}off(){Ye=this.parent}stop(t){if(this._active){let n,o;for(n=0,o=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},rl=e=>(e.w&Tt)>0,il=e=>(e.n&Tt)>0,wu=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{(u==="length"||u>=a)&&l.push(c)})}else switch(n!==void 0&&l.push(s.get(n)),t){case"add":te(e)?zr(n)&&l.push(s.get("length")):(l.push(s.get(jt)),on(e)&&l.push(s.get(br)));break;case"delete":te(e)||(l.push(s.get(jt)),on(e)&&l.push(s.get(br)));break;case"set":on(e)&&l.push(s.get(jt));break}if(l.length===1)l[0]&&yr(l[0]);else{const a=[];for(const c of l)c&&a.push(...c);yr(Wr(a))}}function yr(e,t){const n=te(e)?e:[...e];for(const o of n)o.computed&&wi(o);for(const o of n)o.computed||wi(o)}function wi(e,t){(e!==Ge||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const Cu=jr("__proto__,__v_isRef,__isVue"),al=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Hr)),ku=Yr(),Eu=Yr(!1,!0),Su=Yr(!0),xi=Ru();function Ru(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=ie(this);for(let i=0,s=this.length;i{e[t]=function(...n){gn();const o=ie(this)[t].apply(this,n);return mn(),o}}),e}function Pu(e){const t=ie(this);return Ie(t,"has",e),t.hasOwnProperty(e)}function Yr(e=!1,t=!1){return function(o,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&i===(e?t?zu:hl:t?dl:fl).get(o))return o;const s=te(o);if(!e){if(s&&ce(xi,r))return Reflect.get(xi,r,i);if(r==="hasOwnProperty")return Pu}const l=Reflect.get(o,r,i);return(Hr(r)?al.has(r):Cu(r))||(e||Ie(o,"get",r),t)?l:Oe(l)?s&&zr(r)?l:l.value:ye(l)?e?ml(l):pn(l):l}}const Tu=ul(),qu=ul(!0);function ul(e=!1){return function(n,o,r,i){let s=n[o];if(ln(s)&&Oe(s)&&!Oe(r))return!1;if(!e&&(!yo(r)&&!ln(r)&&(s=ie(s),r=ie(r)),!te(n)&&Oe(s)&&!Oe(r)))return s.value=r,!0;const l=te(n)&&zr(o)?Number(o)e,Mo=e=>Reflect.getPrototypeOf(e);function Jn(e,t,n=!1,o=!1){e=e.__v_raw;const r=ie(e),i=ie(t);n||(t!==i&&Ie(r,"get",t),Ie(r,"get",i));const{has:s}=Mo(r),l=o?Zr:n?Gr:In;if(s.call(r,t))return l(e.get(t));if(s.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function Xn(e,t=!1){const n=this.__v_raw,o=ie(n),r=ie(e);return t||(e!==r&&Ie(o,"has",e),Ie(o,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function Gn(e,t=!1){return e=e.__v_raw,!t&&Ie(ie(e),"iterate",jt),Reflect.get(e,"size",e)}function Ci(e){e=ie(e);const t=ie(this);return Mo(t).has.call(t,e)||(t.add(e),gt(t,"add",e,e)),this}function ki(e,t){t=ie(t);const n=ie(this),{has:o,get:r}=Mo(n);let i=o.call(n,e);i||(e=ie(e),i=o.call(n,e));const s=r.call(n,e);return n.set(e,t),i?Fn(t,s)&>(n,"set",e,t):gt(n,"add",e,t),this}function Ei(e){const t=ie(this),{has:n,get:o}=Mo(t);let r=n.call(t,e);r||(e=ie(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&>(t,"delete",e,void 0),i}function Si(){const e=ie(this),t=e.size!==0,n=e.clear();return t&>(e,"clear",void 0,void 0),n}function eo(e,t){return function(o,r){const i=this,s=i.__v_raw,l=ie(s),a=t?Zr:e?Gr:In;return!e&&Ie(l,"iterate",jt),s.forEach((c,u)=>o.call(r,a(c),a(u),i))}}function to(e,t,n){return function(...o){const r=this.__v_raw,i=ie(r),s=on(i),l=e==="entries"||e===Symbol.iterator&&s,a=e==="keys"&&s,c=r[e](...o),u=n?Zr:t?Gr:In;return!t&&Ie(i,"iterate",a?br:jt),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}},[Symbol.iterator](){return this}}}}function bt(e){return function(...t){return e==="delete"?!1:this}}function Bu(){const e={get(i){return Jn(this,i)},get size(){return Gn(this)},has:Xn,add:Ci,set:ki,delete:Ei,clear:Si,forEach:eo(!1,!1)},t={get(i){return Jn(this,i,!1,!0)},get size(){return Gn(this)},has:Xn,add:Ci,set:ki,delete:Ei,clear:Si,forEach:eo(!1,!0)},n={get(i){return Jn(this,i,!0)},get size(){return Gn(this,!0)},has(i){return Xn.call(this,i,!0)},add:bt("add"),set:bt("set"),delete:bt("delete"),clear:bt("clear"),forEach:eo(!0,!1)},o={get(i){return Jn(this,i,!0,!0)},get size(){return Gn(this,!0)},has(i){return Xn.call(this,i,!0)},add:bt("add"),set:bt("set"),delete:bt("delete"),clear:bt("clear"),forEach:eo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=to(i,!1,!1),n[i]=to(i,!0,!1),t[i]=to(i,!1,!0),o[i]=to(i,!0,!0)}),[e,n,t,o]}const[Fu,Iu,Nu,ju]=Bu();function Jr(e,t){const n=t?e?ju:Nu:e?Iu:Fu;return(o,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(ce(n,r)&&r in o?n:o,r,i)}const Vu={get:Jr(!1,!1)},Du={get:Jr(!1,!0)},Hu={get:Jr(!0,!1)},fl=new WeakMap,dl=new WeakMap,hl=new WeakMap,zu=new WeakMap;function Ku(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Ku(lu(e))}function pn(e){return ln(e)?e:Xr(e,!1,cl,Vu,fl)}function gl(e){return Xr(e,!1,Lu,Du,dl)}function ml(e){return Xr(e,!0,$u,Hu,hl)}function Xr(e,t,n,o,r){if(!ye(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const s=Uu(e);if(s===0)return e;const l=new Proxy(e,s===2?o:n);return r.set(e,l),l}function rn(e){return ln(e)?rn(e.__v_raw):!!(e&&e.__v_isReactive)}function ln(e){return!!(e&&e.__v_isReadonly)}function yo(e){return!!(e&&e.__v_isShallow)}function pl(e){return rn(e)||ln(e)}function ie(e){const t=e&&e.__v_raw;return t?ie(t):e}function vn(e){return bo(e,"__v_skip",!0),e}const In=e=>ye(e)?pn(e):e,Gr=e=>ye(e)?ml(e):e;function vl(e){St&&Ge&&(e=ie(e),ll(e.dep||(e.dep=Wr())))}function bl(e,t){e=ie(e);const n=e.dep;n&&yr(n)}function Oe(e){return!!(e&&e.__v_isRef===!0)}function he(e){return yl(e,!1)}function Wu(e){return yl(e,!0)}function yl(e,t){return Oe(e)?e:new Qu(e,t)}class Qu{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:ie(t),this._value=n?t:In(t)}get value(){return vl(this),this._value}set value(t){const n=this.__v_isShallow||yo(t)||ln(t);t=n?t:ie(t),Fn(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:In(t),bl(this))}}function Vt(e){return Oe(e)?e.value:e}const Yu={get:(e,t,n)=>Vt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return Oe(r)&&!Oe(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function _l(e){return rn(e)?e:new Proxy(e,Yu)}class Zu{constructor(t,n,o,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Qr(t,()=>{this._dirty||(this._dirty=!0,bl(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=o}get value(){const t=ie(this);return vl(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Ju(e,t,n=!1){let o,r;const i=le(e);return i?(o=e,r=nt):(o=e.get,r=e.set),new Zu(o,r,i||!r,n)}function Rt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){Oo(i,t,n)}return r}function Ue(e,t,n,o){if(le(e)){const i=Rt(e,t,n,o);return i&&Gs(i)&&i.catch(s=>{Oo(s,t,n)}),i}const r=[];for(let i=0;i>>1;jn(Me[o])lt&&Me.splice(t,1)}function tc(e){te(e)?sn.push(...e):(!ht||!ht.includes(e,e.allowRecurse?Lt+1:Lt))&&sn.push(e),xl()}function Ri(e,t=Nn?lt+1:0){for(;tjn(n)-jn(o)),Lt=0;Lte.id==null?1/0:e.id,nc=(e,t)=>{const n=jn(e)-jn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function kl(e){_r=!1,Nn=!0,Me.sort(nc);const t=nt;try{for(lt=0;ltxe(p)?p.trim():p)),d&&(r=n.map(cu))}let l,a=o[l=Ko(t)]||o[l=Ko(ct(t))];!a&&i&&(a=o[l=Ko(Kt(t))]),a&&Ue(a,e,6,r);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ue(c,e,6,r)}}function El(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(r!==void 0)return r;const i=e.emits;let s={},l=!1;if(!le(e)){const a=c=>{const u=El(c,t,!0);u&&(l=!0,Ce(s,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(ye(e)&&o.set(e,null),null):(te(i)?i.forEach(a=>s[a]=null):Ce(s,i),ye(e)&&o.set(e,s),s)}function $o(e,t){return!e||!To(t)?!1:(t=t.slice(2).replace(/Once$/,""),ce(e,t[0].toLowerCase()+t.slice(1))||ce(e,Kt(t))||ce(e,t))}let Ve=null,Sl=null;function _o(e){const t=Ve;return Ve=e,Sl=e&&e.type.__scopeId||null,t}function rc(e,t=Ve,n){if(!t||e._n)return e;const o=(...r)=>{o._d&&ji(-1);const i=_o(t);let s;try{s=e(...r)}finally{_o(i),o._d&&ji(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Uo(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[s],slots:l,attrs:a,emit:c,render:u,renderCache:d,data:f,setupState:p,ctx:y,inheritAttrs:T}=e;let q,M;const m=_o(e);try{if(n.shapeFlag&4){const w=r||o;q=st(u.call(w,w,d,i,p,f,y)),M=a}else{const w=t;q=st(w.length>1?w(i,{attrs:a,slots:l,emit:c}):w(i,null)),M=t.props?a:ic(a)}}catch(w){$n.length=0,Oo(w,e,1),q=Fe(ot)}let _=q;if(M&&T!==!1){const w=Object.keys(M),{shapeFlag:F}=_;w.length&&F&7&&(s&&w.some(Vr)&&(M=sc(M,s)),_=mt(_,M))}return n.dirs&&(_=mt(_),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&(_.transition=n.transition),q=_,_o(m),q}const ic=e=>{let t;for(const n in e)(n==="class"||n==="style"||To(n))&&((t||(t={}))[n]=e[n]);return t},sc=(e,t)=>{const n={};for(const o in e)(!Vr(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function lc(e,t,n){const{props:o,children:r,component:i}=e,{props:s,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?Pi(o,s,c):!!s;if(a&8){const u=t.dynamicProps;for(let d=0;de.__isSuspense;function uc(e,t){t&&t.pendingBranch?te(e)?t.effects.push(...e):t.effects.push(e):tc(e)}const no={};function be(e,t,n){return Pl(e,t,n)}function Pl(e,t,{immediate:n,deep:o,flush:r,onTrack:i,onTrigger:s}=ve){var l;const a=_u()===((l=Pe)==null?void 0:l.scope)?Pe:null;let c,u=!1,d=!1;if(Oe(e)?(c=()=>e.value,u=yo(e)):rn(e)?(c=()=>e,o=!0):te(e)?(d=!0,u=e.some(w=>rn(w)||yo(w)),c=()=>e.map(w=>{if(Oe(w))return w.value;if(rn(w))return Ft(w);if(le(w))return Rt(w,a,2)})):le(e)?t?c=()=>Rt(e,a,2):c=()=>{if(!(a&&a.isUnmounted))return f&&f(),Ue(e,a,3,[p])}:c=nt,t&&o){const w=c;c=()=>Ft(w())}let f,p=w=>{f=m.onStop=()=>{Rt(w,a,4)}},y;if(Hn)if(p=nt,t?n&&Ue(t,a,3,[c(),d?[]:void 0,p]):c(),r==="sync"){const w=of();y=w.__watcherHandles||(w.__watcherHandles=[])}else return nt;let T=d?new Array(e.length).fill(no):no;const q=()=>{if(!!m.active)if(t){const w=m.run();(o||u||(d?w.some((F,j)=>Fn(F,T[j])):Fn(w,T)))&&(f&&f(),Ue(t,a,3,[w,T===no?void 0:d&&T[0]===no?[]:T,p]),T=w)}else m.run()};q.allowRecurse=!!t;let M;r==="sync"?M=q:r==="post"?M=()=>qe(q,a&&a.suspense):(q.pre=!0,a&&(q.id=a.uid),M=()=>ti(q));const m=new Qr(c,M);t?n?q():T=m.run():r==="post"?qe(m.run.bind(m),a&&a.suspense):m.run();const _=()=>{m.stop(),a&&a.scope&&Dr(a.scope.effects,m)};return y&&y.push(_),_}function cc(e,t,n){const o=this.proxy,r=xe(e)?e.includes(".")?Tl(o,e):()=>o[e]:e.bind(o,o);let i;le(t)?i=t:(i=t.handler,n=t);const s=Pe;un(this);const l=Pl(r,i.bind(o),n);return s?un(s):Dt(),l}function Tl(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;r{Ft(n,t)});else if(tl(e))for(const n in e)Ft(e[n],t);return e}function ql(e,t){const n=Ve;if(n===null)return e;const o=Vo(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let i=0;i{e.isMounted=!0}),We(()=>{e.isUnmounting=!0}),e}const De=[Function,Array],Ml={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:De,onEnter:De,onAfterEnter:De,onEnterCancelled:De,onBeforeLeave:De,onLeave:De,onAfterLeave:De,onLeaveCancelled:De,onBeforeAppear:De,onAppear:De,onAfterAppear:De,onAppearCancelled:De},fc={name:"BaseTransition",props:Ml,setup(e,{slots:t}){const n=ke(),o=Al();let r;return()=>{const i=t.default&&ni(t.default(),!0);if(!i||!i.length)return;let s=i[0];if(i.length>1){for(const T of i)if(T.type!==ot){s=T;break}}const l=ie(e),{mode:a}=l;if(o.isLeaving)return Wo(s);const c=Ti(s);if(!c)return Wo(s);const u=Vn(c,l,o,n);an(c,u);const d=n.subTree,f=d&&Ti(d);let p=!1;const{getTransitionKey:y}=c.type;if(y){const T=y();r===void 0?r=T:T!==r&&(r=T,p=!0)}if(f&&f.type!==ot&&(!kt(c,f)||p)){const T=Vn(f,l,o,n);if(an(f,T),a==="out-in")return o.isLeaving=!0,T.afterLeave=()=>{o.isLeaving=!1,n.update.active!==!1&&n.update()},Wo(s);a==="in-out"&&c.type!==ot&&(T.delayLeave=(q,M,m)=>{const _=Ol(o,f);_[String(f.key)]=f,q._leaveCb=()=>{M(),q._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=m})}return s}}},dc=fc;function Ol(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Vn(e,t,n,o){const{appear:r,mode:i,persisted:s=!1,onBeforeEnter:l,onEnter:a,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:y,onBeforeAppear:T,onAppear:q,onAfterAppear:M,onAppearCancelled:m}=t,_=String(e.key),w=Ol(n,e),F=(N,C)=>{N&&Ue(N,o,9,C)},j=(N,C)=>{const x=C[1];F(N,C),te(N)?N.every($=>$.length<=1)&&x():N.length<=1&&x()},V={mode:i,persisted:s,beforeEnter(N){let C=l;if(!n.isMounted)if(r)C=T||l;else return;N._leaveCb&&N._leaveCb(!0);const x=w[_];x&&kt(e,x)&&x.el._leaveCb&&x.el._leaveCb(),F(C,[N])},enter(N){let C=a,x=c,$=u;if(!n.isMounted)if(r)C=q||a,x=M||c,$=m||u;else return;let v=!1;const H=N._enterCb=k=>{v||(v=!0,k?F($,[N]):F(x,[N]),V.delayedLeave&&V.delayedLeave(),N._enterCb=void 0)};C?j(C,[N,H]):H()},leave(N,C){const x=String(e.key);if(N._enterCb&&N._enterCb(!0),n.isUnmounting)return C();F(d,[N]);let $=!1;const v=N._leaveCb=H=>{$||($=!0,C(),H?F(y,[N]):F(p,[N]),N._leaveCb=void 0,w[x]===e&&delete w[x])};w[x]=e,f?j(f,[N,v]):v()},clone(N){return Vn(N,t,n,o)}};return V}function Wo(e){if(Bo(e))return e=mt(e),e.children=null,e}function Ti(e){return Bo(e)?e.children?e.children[0]:void 0:e}function an(e,t){e.shapeFlag&6&&e.component?an(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ni(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;iCe({name:e.name},t,{setup:e}))():e}const An=e=>!!e.type.__asyncLoader,Bo=e=>e.type.__isKeepAlive,hc={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ke(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};const r=new Map,i=new Set;let s=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(m,_,w,F,j)=>{const V=m.component;c(m,_,w,0,l),a(V.vnode,m,_,w,V,l,F,m.slotScopeIds,j),qe(()=>{V.isDeactivated=!1,V.a&&qn(V.a);const N=m.props&&m.props.onVnodeMounted;N&&ze(N,V.parent,m)},l)},o.deactivate=m=>{const _=m.component;c(m,f,null,1,l),qe(()=>{_.da&&qn(_.da);const w=m.props&&m.props.onVnodeUnmounted;w&&ze(w,_.parent,m),_.isDeactivated=!0},l)};function p(m){Qo(m),u(m,n,l,!0)}function y(m){r.forEach((_,w)=>{const F=Rr(_.type);F&&(!m||!m(F))&&T(w)})}function T(m){const _=r.get(m);!s||!kt(_,s)?p(_):s&&Qo(s),r.delete(m),i.delete(m)}be(()=>[e.include,e.exclude],([m,_])=>{m&&y(w=>Rn(m,w)),_&&y(w=>!Rn(_,w))},{flush:"post",deep:!0});let q=null;const M=()=>{q!=null&&r.set(q,Yo(n.subTree))};return Ut(M),oi(M),We(()=>{r.forEach(m=>{const{subTree:_,suspense:w}=n,F=Yo(_);if(m.type===F.type&&m.key===F.key){Qo(F);const j=F.component.da;j&&qe(j,w);return}p(m)})}),()=>{if(q=null,!t.default)return null;const m=t.default(),_=m[0];if(m.length>1)return s=null,m;if(!Co(_)||!(_.shapeFlag&4)&&!(_.shapeFlag&128))return s=null,_;let w=Yo(_);const F=w.type,j=Rr(An(w)?w.type.__asyncResolved||{}:F),{include:V,exclude:N,max:C}=e;if(V&&(!j||!Rn(V,j))||N&&j&&Rn(N,j))return s=w,_;const x=w.key==null?F:w.key,$=r.get(x);return w.el&&(w=mt(w),_.shapeFlag&128&&(_.ssContent=w)),q=x,$?(w.el=$.el,w.component=$.component,w.transition&&an(w,w.transition),w.shapeFlag|=512,i.delete(x),i.add(x)):(i.add(x),C&&i.size>parseInt(C,10)&&T(i.values().next().value)),w.shapeFlag|=256,s=w,Rl(_.type)?_:w}}},ym=hc;function Rn(e,t){return te(e)?e.some(n=>Rn(n,t)):xe(e)?e.split(",").includes(t):su(e)?e.test(t):!1}function $l(e,t){Ll(e,"a",t)}function Fo(e,t){Ll(e,"da",t)}function Ll(e,t,n=Pe){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Io(t,o,n),n){let r=n.parent;for(;r&&r.parent;)Bo(r.parent.vnode)&&gc(o,t,n,r),r=r.parent}}function gc(e,t,n,o){const r=Io(t,e,o,!0);ri(()=>{Dr(o[t],r)},n)}function Qo(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Yo(e){return e.shapeFlag&128?e.ssContent:e}function Io(e,t,n=Pe,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;gn(),un(n);const l=Ue(t,n,e,s);return Dt(),mn(),l});return o?r.unshift(i):r.push(i),i}}const vt=e=>(t,n=Pe)=>(!Hn||e==="sp")&&Io(e,(...o)=>t(...o),n),mc=vt("bm"),Ut=vt("m"),Bl=vt("bu"),oi=vt("u"),We=vt("bum"),ri=vt("um"),pc=vt("sp"),vc=vt("rtg"),bc=vt("rtc");function yc(e,t=Pe){Io("ec",e,t)}const Fl="components",_c="directives";function wc(e,t){return Il(Fl,e,!0,t)||e}const xc=Symbol.for("v-ndc");function _m(e){return Il(_c,e)}function Il(e,t,n=!0,o=!1){const r=Ve||Pe;if(r){const i=r.type;if(e===Fl){const l=Rr(i,!1);if(l&&(l===t||l===ct(t)||l===Ao(ct(t))))return i}const s=qi(r[e]||i[e],t)||qi(r.appContext[e],t);return!s&&o?i:s}}function qi(e,t){return e&&(e[t]||e[ct(t)]||e[Ao(ct(t))])}function wm(e,t,n,o){let r;const i=n&&n[o];if(te(e)||xe(e)){r=new Array(e.length);for(let s=0,l=e.length;st(s,l,void 0,i&&i[l]));else{const s=Object.keys(e);r=new Array(s.length);for(let l=0,a=s.length;l{const i=o.fn(...r);return i&&(i.key=o.key),i}:o.fn)}return e}const wr=e=>e?Xl(e)?Vo(e)||e.proxy:wr(e.parent):null,Mn=Ce(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>wr(e.parent),$root:e=>wr(e.root),$emit:e=>e.emit,$options:e=>ii(e),$forceUpdate:e=>e.f||(e.f=()=>ti(e.update)),$nextTick:e=>e.n||(e.n=je.bind(e.proxy)),$watch:e=>cc.bind(e)}),Zo=(e,t)=>e!==ve&&!e.__isScriptSetup&&ce(e,t),Cc={get({_:e},t){const{ctx:n,setupState:o,data:r,props:i,accessCache:s,type:l,appContext:a}=e;let c;if(t[0]!=="$"){const p=s[t];if(p!==void 0)switch(p){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Zo(o,t))return s[t]=1,o[t];if(r!==ve&&ce(r,t))return s[t]=2,r[t];if((c=e.propsOptions[0])&&ce(c,t))return s[t]=3,i[t];if(n!==ve&&ce(n,t))return s[t]=4,n[t];xr&&(s[t]=0)}}const u=Mn[t];let d,f;if(u)return t==="$attrs"&&Ie(e,"get",t),u(e);if((d=l.__cssModules)&&(d=d[t]))return d;if(n!==ve&&ce(n,t))return s[t]=4,n[t];if(f=a.config.globalProperties,ce(f,t))return f[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:i}=e;return Zo(r,t)?(r[t]=n,!0):o!==ve&&ce(o,t)?(o[t]=n,!0):ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,propsOptions:i}},s){let l;return!!n[s]||e!==ve&&ce(e,s)||Zo(t,s)||(l=i[0])&&ce(l,s)||ce(o,s)||ce(Mn,s)||ce(r.config.globalProperties,s)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ce(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ai(e){return te(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xr=!0;function kc(e){const t=ii(e),n=e.proxy,o=e.ctx;xr=!1,t.beforeCreate&&Mi(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:s,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:y,activated:T,deactivated:q,beforeDestroy:M,beforeUnmount:m,destroyed:_,unmounted:w,render:F,renderTracked:j,renderTriggered:V,errorCaptured:N,serverPrefetch:C,expose:x,inheritAttrs:$,components:v,directives:H,filters:k}=t;if(c&&Ec(c,o,null),s)for(const A in s){const W=s[A];le(W)&&(o[A]=W.bind(n))}if(r){const A=r.call(n,n);ye(A)&&(e.data=pn(A))}if(xr=!0,i)for(const A in i){const W=i[A],_e=le(W)?W.bind(n,n):le(W.get)?W.get.bind(n,n):nt,se=!le(W)&&le(W.set)?W.set.bind(n):nt,fe=R({get:_e,set:se});Object.defineProperty(o,A,{enumerable:!0,configurable:!0,get:()=>fe.value,set:L=>fe.value=L})}if(l)for(const A in l)Nl(l[A],o,n,A);if(a){const A=le(a)?a.call(n):a;Reflect.ownKeys(A).forEach(W=>{fo(W,A[W])})}u&&Mi(u,e,"c");function Y(A,W){te(W)?W.forEach(_e=>A(_e.bind(n))):W&&A(W.bind(n))}if(Y(mc,d),Y(Ut,f),Y(Bl,p),Y(oi,y),Y($l,T),Y(Fo,q),Y(yc,N),Y(bc,j),Y(vc,V),Y(We,m),Y(ri,w),Y(pc,C),te(x))if(x.length){const A=e.exposed||(e.exposed={});x.forEach(W=>{Object.defineProperty(A,W,{get:()=>n[W],set:_e=>n[W]=_e})})}else e.exposed||(e.exposed={});F&&e.render===nt&&(e.render=F),$!=null&&(e.inheritAttrs=$),v&&(e.components=v),H&&(e.directives=H)}function Ec(e,t,n=nt){te(e)&&(e=Cr(e));for(const o in e){const r=e[o];let i;ye(r)?"default"in r?i=ut(r.from||o,r.default,!0):i=ut(r.from||o):i=ut(r),Oe(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):t[o]=i}}function Mi(e,t,n){Ue(te(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Nl(e,t,n,o){const r=o.includes(".")?Tl(n,o):()=>n[o];if(xe(e)){const i=t[e];le(i)&&be(r,i)}else if(le(e))be(r,e.bind(n));else if(ye(e))if(te(e))e.forEach(i=>Nl(i,t,n,o));else{const i=le(e.handler)?e.handler.bind(n):t[e.handler];le(i)&&be(r,i,e)}}function ii(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,l=i.get(t);let a;return l?a=l:!r.length&&!n&&!o?a=t:(a={},r.length&&r.forEach(c=>wo(a,c,s,!0)),wo(a,t,s)),ye(t)&&i.set(t,a),a}function wo(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&wo(e,i,n,!0),r&&r.forEach(s=>wo(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const l=Sc[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const Sc={data:Oi,props:$i,emits:$i,methods:Pn,computed:Pn,beforeCreate:Le,created:Le,beforeMount:Le,mounted:Le,beforeUpdate:Le,updated:Le,beforeDestroy:Le,beforeUnmount:Le,destroyed:Le,unmounted:Le,activated:Le,deactivated:Le,errorCaptured:Le,serverPrefetch:Le,components:Pn,directives:Pn,watch:Pc,provide:Oi,inject:Rc};function Oi(e,t){return t?e?function(){return Ce(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function Rc(e,t){return Pn(Cr(e),Cr(t))}function Cr(e){if(te(e)){const t={};for(let n=0;n1)return n&&le(t)?t.call(o&&o.proxy):t}}function Ac(e,t,n,o=!1){const r={},i={};bo(i,jo,1),e.propsDefaults=Object.create(null),Vl(e,t,r,i);for(const s in e.propsOptions[0])s in r||(r[s]=void 0);n?e.props=o?r:gl(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Mc(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=e,l=ie(r),[a]=e.propsOptions;let c=!1;if((o||s>0)&&!(s&16)){if(s&8){const u=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[f,p]=Dl(d,t,!0);Ce(s,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return ye(e)&&o.set(e,nn),nn;if(te(i))for(let u=0;u-1,p[1]=T<0||y-1||ce(p,"default"))&&l.push(d)}}}const c=[s,l];return ye(e)&&o.set(e,c),c}function Li(e){return e[0]!=="$"}function Bi(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function Fi(e,t){return Bi(e)===Bi(t)}function Ii(e,t){return te(t)?t.findIndex(n=>Fi(n,e)):le(t)&&Fi(t,e)?0:-1}const Hl=e=>e[0]==="_"||e==="$stable",si=e=>te(e)?e.map(st):[st(e)],Oc=(e,t,n)=>{if(t._n)return t;const o=rc((...r)=>si(t(...r)),n);return o._c=!1,o},zl=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Hl(r))continue;const i=e[r];if(le(i))t[r]=Oc(r,i,o);else if(i!=null){const s=si(i);t[r]=()=>s}}},Kl=(e,t)=>{const n=si(t);e.slots.default=()=>n},$c=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=ie(t),bo(t,"_",n)):zl(t,e.slots={})}else e.slots={},t&&Kl(e,t);bo(e.slots,jo,1)},Lc=(e,t,n)=>{const{vnode:o,slots:r}=e;let i=!0,s=ve;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(Ce(r,t),!n&&l===1&&delete r._):(i=!t.$stable,zl(t,r)),s=t}else t&&(Kl(e,t),s={default:1});if(i)for(const l in r)!Hl(l)&&!(l in s)&&delete r[l]};function Er(e,t,n,o,r=!1){if(te(e)){e.forEach((f,p)=>Er(f,t&&(te(t)?t[p]:t),n,o,r));return}if(An(o)&&!r)return;const i=o.shapeFlag&4?Vo(o.component)||o.component.proxy:o.el,s=r?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===ve?l.refs={}:l.refs,d=l.setupState;if(c!=null&&c!==a&&(xe(c)?(u[c]=null,ce(d,c)&&(d[c]=null)):Oe(c)&&(c.value=null)),le(a))Rt(a,l,12,[s,u]);else{const f=xe(a),p=Oe(a);if(f||p){const y=()=>{if(e.f){const T=f?ce(d,a)?d[a]:u[a]:a.value;r?te(T)&&Dr(T,i):te(T)?T.includes(i)||T.push(i):f?(u[a]=[i],ce(d,a)&&(d[a]=u[a])):(a.value=[i],e.k&&(u[e.k]=a.value))}else f?(u[a]=s,ce(d,a)&&(d[a]=s)):p&&(a.value=s,e.k&&(u[e.k]=s))};s?(y.id=-1,qe(y,n)):y()}}}const qe=uc;function Bc(e){return Fc(e)}function Fc(e,t){const n=mr();n.__VUE__=!0;const{insert:o,remove:r,patchProp:i,createElement:s,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=nt,insertStaticContent:y}=e,T=(h,g,b,P=null,O=null,B=null,U=!1,D=null,K=!!g.dynamicChildren)=>{if(h===g)return;h&&!kt(h,g)&&(P=S(h),L(h,O,B,!0),h=null),g.patchFlag===-2&&(K=!1,g.dynamicChildren=null);const{type:I,ref:G,shapeFlag:J}=g;switch(I){case No:q(h,g,b,P);break;case ot:M(h,g,b,P);break;case Jo:h==null&&m(g,b,P,U);break;case Xe:v(h,g,b,P,O,B,U,D,K);break;default:J&1?F(h,g,b,P,O,B,U,D,K):J&6?H(h,g,b,P,O,B,U,D,K):(J&64||J&128)&&I.process(h,g,b,P,O,B,U,D,K,z)}G!=null&&O&&Er(G,h&&h.ref,B,g||h,!g)},q=(h,g,b,P)=>{if(h==null)o(g.el=l(g.children),b,P);else{const O=g.el=h.el;g.children!==h.children&&c(O,g.children)}},M=(h,g,b,P)=>{h==null?o(g.el=a(g.children||""),b,P):g.el=h.el},m=(h,g,b,P)=>{[h.el,h.anchor]=y(h.children,g,b,P,h.el,h.anchor)},_=({el:h,anchor:g},b,P)=>{let O;for(;h&&h!==g;)O=f(h),o(h,b,P),h=O;o(g,b,P)},w=({el:h,anchor:g})=>{let b;for(;h&&h!==g;)b=f(h),r(h),h=b;r(g)},F=(h,g,b,P,O,B,U,D,K)=>{U=U||g.type==="svg",h==null?j(g,b,P,O,B,U,D,K):C(h,g,O,B,U,D,K)},j=(h,g,b,P,O,B,U,D)=>{let K,I;const{type:G,props:J,shapeFlag:ee,transition:re,dirs:ae}=h;if(K=h.el=s(h.type,B,J&&J.is,J),ee&8?u(K,h.children):ee&16&&N(h.children,K,null,P,O,B&&G!=="foreignObject",U,D),ae&&At(h,null,P,"created"),V(K,h,h.scopeId,U,P),J){for(const me in J)me!=="value"&&!co(me)&&i(K,me,null,J[me],B,h.children,P,O,ne);"value"in J&&i(K,"value",null,J.value),(I=J.onVnodeBeforeMount)&&ze(I,P,h)}ae&&At(h,null,P,"beforeMount");const pe=(!O||O&&!O.pendingBranch)&&re&&!re.persisted;pe&&re.beforeEnter(K),o(K,g,b),((I=J&&J.onVnodeMounted)||pe||ae)&&qe(()=>{I&&ze(I,P,h),pe&&re.enter(K),ae&&At(h,null,P,"mounted")},O)},V=(h,g,b,P,O)=>{if(b&&p(h,b),P)for(let B=0;B{for(let I=K;I{const D=g.el=h.el;let{patchFlag:K,dynamicChildren:I,dirs:G}=g;K|=h.patchFlag&16;const J=h.props||ve,ee=g.props||ve;let re;b&&Mt(b,!1),(re=ee.onVnodeBeforeUpdate)&&ze(re,b,g,h),G&&At(g,h,b,"beforeUpdate"),b&&Mt(b,!0);const ae=O&&g.type!=="foreignObject";if(I?x(h.dynamicChildren,I,D,b,P,ae,B):U||W(h,g,D,null,b,P,ae,B,!1),K>0){if(K&16)$(D,g,J,ee,b,P,O);else if(K&2&&J.class!==ee.class&&i(D,"class",null,ee.class,O),K&4&&i(D,"style",J.style,ee.style,O),K&8){const pe=g.dynamicProps;for(let me=0;me{re&&ze(re,b,g,h),G&&At(g,h,b,"updated")},P)},x=(h,g,b,P,O,B,U)=>{for(let D=0;D{if(b!==P){if(b!==ve)for(const D in b)!co(D)&&!(D in P)&&i(h,D,b[D],null,U,g.children,O,B,ne);for(const D in P){if(co(D))continue;const K=P[D],I=b[D];K!==I&&D!=="value"&&i(h,D,I,K,U,g.children,O,B,ne)}"value"in P&&i(h,"value",b.value,P.value)}},v=(h,g,b,P,O,B,U,D,K)=>{const I=g.el=h?h.el:l(""),G=g.anchor=h?h.anchor:l("");let{patchFlag:J,dynamicChildren:ee,slotScopeIds:re}=g;re&&(D=D?D.concat(re):re),h==null?(o(I,b,P),o(G,b,P),N(g.children,b,G,O,B,U,D,K)):J>0&&J&64&&ee&&h.dynamicChildren?(x(h.dynamicChildren,ee,b,O,B,U,D),(g.key!=null||O&&g===O.subTree)&&li(h,g,!0)):W(h,g,b,G,O,B,U,D,K)},H=(h,g,b,P,O,B,U,D,K)=>{g.slotScopeIds=D,h==null?g.shapeFlag&512?O.ctx.activate(g,b,P,U,K):k(g,b,P,O,B,U,K):Z(h,g,K)},k=(h,g,b,P,O,B,U)=>{const D=h.component=Zc(h,P,O);if(Bo(h)&&(D.ctx.renderer=z),Jc(D),D.asyncDep){if(O&&O.registerDep(D,Y),!h.el){const K=D.subTree=Fe(ot);M(null,K,g,b)}return}Y(D,h,g,b,O,B,U)},Z=(h,g,b)=>{const P=g.component=h.component;if(lc(h,g,b))if(P.asyncDep&&!P.asyncResolved){A(P,g,b);return}else P.next=g,ec(P.update),P.update();else g.el=h.el,P.vnode=g},Y=(h,g,b,P,O,B,U)=>{const D=()=>{if(h.isMounted){let{next:G,bu:J,u:ee,parent:re,vnode:ae}=h,pe=G,me;Mt(h,!1),G?(G.el=ae.el,A(h,G,U)):G=ae,J&&qn(J),(me=G.props&&G.props.onVnodeBeforeUpdate)&&ze(me,re,G,ae),Mt(h,!0);const Ee=Uo(h),Qe=h.subTree;h.subTree=Ee,T(Qe,Ee,d(Qe.el),S(Qe),h,O,B),G.el=Ee.el,pe===null&&ac(h,Ee.el),ee&&qe(ee,O),(me=G.props&&G.props.onVnodeUpdated)&&qe(()=>ze(me,re,G,ae),O)}else{let G;const{el:J,props:ee}=g,{bm:re,m:ae,parent:pe}=h,me=An(g);if(Mt(h,!1),re&&qn(re),!me&&(G=ee&&ee.onVnodeBeforeMount)&&ze(G,pe,g),Mt(h,!0),J&&de){const Ee=()=>{h.subTree=Uo(h),de(J,h.subTree,h,O,null)};me?g.type.__asyncLoader().then(()=>!h.isUnmounted&&Ee()):Ee()}else{const Ee=h.subTree=Uo(h);T(null,Ee,b,P,h,O,B),g.el=Ee.el}if(ae&&qe(ae,O),!me&&(G=ee&&ee.onVnodeMounted)){const Ee=g;qe(()=>ze(G,pe,Ee),O)}(g.shapeFlag&256||pe&&An(pe.vnode)&&pe.vnode.shapeFlag&256)&&h.a&&qe(h.a,O),h.isMounted=!0,g=b=P=null}},K=h.effect=new Qr(D,()=>ti(I),h.scope),I=h.update=()=>K.run();I.id=h.uid,Mt(h,!0),I()},A=(h,g,b)=>{g.component=h;const P=h.vnode.props;h.vnode=g,h.next=null,Mc(h,g.props,P,b),Lc(h,g.children,b),gn(),Ri(),mn()},W=(h,g,b,P,O,B,U,D,K=!1)=>{const I=h&&h.children,G=h?h.shapeFlag:0,J=g.children,{patchFlag:ee,shapeFlag:re}=g;if(ee>0){if(ee&128){se(I,J,b,P,O,B,U,D,K);return}else if(ee&256){_e(I,J,b,P,O,B,U,D,K);return}}re&8?(G&16&&ne(I,O,B),J!==I&&u(b,J)):G&16?re&16?se(I,J,b,P,O,B,U,D,K):ne(I,O,B,!0):(G&8&&u(b,""),re&16&&N(J,b,P,O,B,U,D,K))},_e=(h,g,b,P,O,B,U,D,K)=>{h=h||nn,g=g||nn;const I=h.length,G=g.length,J=Math.min(I,G);let ee;for(ee=0;eeG?ne(h,O,B,!0,!1,J):N(g,b,P,O,B,U,D,K,J)},se=(h,g,b,P,O,B,U,D,K)=>{let I=0;const G=g.length;let J=h.length-1,ee=G-1;for(;I<=J&&I<=ee;){const re=h[I],ae=g[I]=K?xt(g[I]):st(g[I]);if(kt(re,ae))T(re,ae,b,null,O,B,U,D,K);else break;I++}for(;I<=J&&I<=ee;){const re=h[J],ae=g[ee]=K?xt(g[ee]):st(g[ee]);if(kt(re,ae))T(re,ae,b,null,O,B,U,D,K);else break;J--,ee--}if(I>J){if(I<=ee){const re=ee+1,ae=reee)for(;I<=J;)L(h[I],O,B,!0),I++;else{const re=I,ae=I,pe=new Map;for(I=ae;I<=ee;I++){const Ne=g[I]=K?xt(g[I]):st(g[I]);Ne.key!=null&&pe.set(Ne.key,I)}let me,Ee=0;const Qe=ee-ae+1;let Yt=!1,pi=0;const yn=new Array(Qe);for(I=0;I=Qe){L(Ne,O,B,!0);continue}let it;if(Ne.key!=null)it=pe.get(Ne.key);else for(me=ae;me<=ee;me++)if(yn[me-ae]===0&&kt(Ne,g[me])){it=me;break}it===void 0?L(Ne,O,B,!0):(yn[it-ae]=I+1,it>=pi?pi=it:Yt=!0,T(Ne,g[it],b,null,O,B,U,D,K),Ee++)}const vi=Yt?Ic(yn):nn;for(me=vi.length-1,I=Qe-1;I>=0;I--){const Ne=ae+I,it=g[Ne],bi=Ne+1{const{el:B,type:U,transition:D,children:K,shapeFlag:I}=h;if(I&6){fe(h.component.subTree,g,b,P);return}if(I&128){h.suspense.move(g,b,P);return}if(I&64){U.move(h,g,b,z);return}if(U===Xe){o(B,g,b);for(let J=0;JD.enter(B),O);else{const{leave:J,delayLeave:ee,afterLeave:re}=D,ae=()=>o(B,g,b),pe=()=>{J(B,()=>{ae(),re&&re()})};ee?ee(B,ae,pe):pe()}else o(B,g,b)},L=(h,g,b,P=!1,O=!1)=>{const{type:B,props:U,ref:D,children:K,dynamicChildren:I,shapeFlag:G,patchFlag:J,dirs:ee}=h;if(D!=null&&Er(D,null,b,h,!0),G&256){g.ctx.deactivate(h);return}const re=G&1&&ee,ae=!An(h);let pe;if(ae&&(pe=U&&U.onVnodeBeforeUnmount)&&ze(pe,g,h),G&6)oe(h.component,b,P);else{if(G&128){h.suspense.unmount(b,P);return}re&&At(h,null,g,"beforeUnmount"),G&64?h.type.remove(h,g,b,O,z,P):I&&(B!==Xe||J>0&&J&64)?ne(I,g,b,!1,!0):(B===Xe&&J&384||!O&&G&16)&&ne(K,g,b),P&&ue(h)}(ae&&(pe=U&&U.onVnodeUnmounted)||re)&&qe(()=>{pe&&ze(pe,g,h),re&&At(h,null,g,"unmounted")},b)},ue=h=>{const{type:g,el:b,anchor:P,transition:O}=h;if(g===Xe){Re(b,P);return}if(g===Jo){w(h);return}const B=()=>{r(b),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(h.shapeFlag&1&&O&&!O.persisted){const{leave:U,delayLeave:D}=O,K=()=>U(b,B);D?D(h.el,B,K):K()}else B()},Re=(h,g)=>{let b;for(;h!==g;)b=f(h),r(h),h=b;r(g)},oe=(h,g,b)=>{const{bum:P,scope:O,update:B,subTree:U,um:D}=h;P&&qn(P),O.stop(),B&&(B.active=!1,L(U,h,g,b)),D&&qe(D,g),qe(()=>{h.isUnmounted=!0},g),g&&g.pendingBranch&&!g.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===g.pendingId&&(g.deps--,g.deps===0&&g.resolve())},ne=(h,g,b,P=!1,O=!1,B=0)=>{for(let U=B;Uh.shapeFlag&6?S(h.component.subTree):h.shapeFlag&128?h.suspense.next():f(h.anchor||h.el),Q=(h,g,b)=>{h==null?g._vnode&&L(g._vnode,null,null,!0):T(g._vnode||null,h,g,null,null,null,b),Ri(),Cl(),g._vnode=h},z={p:T,um:L,m:fe,r:ue,mt:k,mc:N,pc:W,pbc:x,n:S,o:e};let X,de;return t&&([X,de]=t(z)),{render:Q,hydrate:X,createApp:qc(Q,X)}}function Mt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function li(e,t,n=!1){const o=e.children,r=t.children;if(te(o)&&te(r))for(let i=0;i>1,e[n[l]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=t[s];return n}const Nc=e=>e.__isTeleport,On=e=>e&&(e.disabled||e.disabled===""),Ni=e=>typeof SVGElement!="undefined"&&e instanceof SVGElement,Sr=(e,t)=>{const n=e&&e.to;return xe(n)?t?t(n):null:n},jc={__isTeleport:!0,process(e,t,n,o,r,i,s,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:y,createText:T,createComment:q}}=c,M=On(t.props);let{shapeFlag:m,children:_,dynamicChildren:w}=t;if(e==null){const F=t.el=T(""),j=t.anchor=T("");p(F,n,o),p(j,n,o);const V=t.target=Sr(t.props,y),N=t.targetAnchor=T("");V&&(p(N,V),s=s||Ni(V));const C=(x,$)=>{m&16&&u(_,x,$,r,i,s,l,a)};M?C(n,j):V&&C(V,N)}else{t.el=e.el;const F=t.anchor=e.anchor,j=t.target=e.target,V=t.targetAnchor=e.targetAnchor,N=On(e.props),C=N?n:j,x=N?F:V;if(s=s||Ni(j),w?(f(e.dynamicChildren,w,C,r,i,s,l),li(e,t,!0)):a||d(e,t,C,x,r,i,s,l,!1),M)N||oo(t,n,F,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const $=t.target=Sr(t.props,y);$&&oo(t,$,null,c,0)}else N&&oo(t,j,V,c,1)}Ul(t)},remove(e,t,n,o,{um:r,o:{remove:i}},s){const{shapeFlag:l,children:a,anchor:c,targetAnchor:u,target:d,props:f}=e;if(d&&i(u),(s||!On(f))&&(i(c),l&16))for(let p=0;p0?et||nn:null,Hc(),Dn>0&&et&&et.push(e),e}function Cm(e,t,n,o,r,i){return Ql(Jl(e,t,n,o,r,i,!0))}function Yl(e,t,n,o,r){return Ql(Fe(e,t,n,o,r,!0))}function Co(e){return e?e.__v_isVNode===!0:!1}function kt(e,t){return e.type===t.type&&e.key===t.key}const jo="__vInternal",Zl=({key:e})=>e!=null?e:null,ho=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?xe(e)||Oe(e)||le(e)?{i:Ve,r:e,k:t,f:!!n}:e:null);function Jl(e,t=null,n=null,o=0,r=null,i=e===Xe?0:1,s=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zl(t),ref:t&&ho(t),scopeId:Sl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ve};return l?(ai(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=xe(n)?8:16),Dn>0&&!s&&et&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&et.push(a),a}const Fe=zc;function zc(e,t=null,n=null,o=0,r=null,i=!1){if((!e||e===xc)&&(e=ot),Co(e)){const l=mt(e,t,!0);return n&&ai(l,n),Dn>0&&!i&&et&&(l.shapeFlag&6?et[et.indexOf(e)]=l:et.push(l)),l.patchFlag|=-2,l}if(tf(e)&&(e=e.__vccOpts),t){t=Kc(t);let{class:l,style:a}=t;l&&!xe(l)&&(t.class=Ur(l)),ye(a)&&(pl(a)&&!te(a)&&(a=Ce({},a)),t.style=Kr(a))}const s=xe(e)?1:Rl(e)?128:Nc(e)?64:ye(e)?4:le(e)?2:0;return Jl(e,t,n,o,r,s,i,!0)}function Kc(e){return e?pl(e)||jo in e?Ce({},e):e:null}function mt(e,t,n=!1){const{props:o,ref:r,patchFlag:i,children:s}=e,l=t?Wc(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Zl(l),ref:t&&t.ref?n&&r?te(r)?r.concat(ho(t)):[r,ho(t)]:ho(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Xe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&mt(e.ssContent),ssFallback:e.ssFallback&&mt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Uc(e=" ",t=0){return Fe(No,null,e,t)}function km(e="",t=!1){return t?(Wl(),Yl(ot,null,e)):Fe(ot,null,e)}function st(e){return e==null||typeof e=="boolean"?Fe(ot):te(e)?Fe(Xe,null,e.slice()):typeof e=="object"?xt(e):Fe(No,null,String(e))}function xt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:mt(e)}function ai(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(te(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),ai(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(jo in t)?t._ctx=Ve:r===3&&Ve&&(Ve.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else le(t)?(t={default:t,_ctx:Ve},n=32):(t=String(t),o&64?(n=16,t=[Uc(t)]):n=8);e.children=t,e.shapeFlag|=n}function Wc(...e){const t={};for(let n=0;nPe||Ve;let ui,Zt,Vi="__VUE_INSTANCE_SETTERS__";(Zt=mr()[Vi])||(Zt=mr()[Vi]=[]),Zt.push(e=>Pe=e),ui=e=>{Zt.length>1?Zt.forEach(t=>t(e)):Zt[0](e)};const un=e=>{ui(e),e.scope.on()},Dt=()=>{Pe&&Pe.scope.off(),ui(null)};function Xl(e){return e.vnode.shapeFlag&4}let Hn=!1;function Jc(e,t=!1){Hn=t;const{props:n,children:o}=e.vnode,r=Xl(e);Ac(e,n,r,t),$c(e,o);const i=r?Xc(e,t):void 0;return Hn=!1,i}function Xc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=vn(new Proxy(e.ctx,Cc));const{setup:o}=n;if(o){const r=e.setupContext=o.length>1?ef(e):null;un(e),gn();const i=Rt(o,e,0,[e.props,r]);if(mn(),Dt(),Gs(i)){if(i.then(Dt,Dt),t)return i.then(s=>{Di(e,s,t)}).catch(s=>{Oo(s,e,0)});e.asyncDep=i}else Di(e,i,t)}else Gl(e,t)}function Di(e,t,n){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ye(t)&&(e.setupState=_l(t)),Gl(e,n)}let Hi;function Gl(e,t,n){const o=e.type;if(!e.render){if(!t&&Hi&&!o.render){const r=o.template||ii(e).template;if(r){const{isCustomElement:i,compilerOptions:s}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=Ce(Ce({isCustomElement:i,delimiters:l},s),a);o.render=Hi(r,c)}}e.render=o.render||nt}un(e),gn(),kc(e),mn(),Dt()}function Gc(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Ie(e,"get","$attrs"),t[n]}}))}function ef(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Gc(e)},slots:e.slots,emit:e.emit,expose:t}}function Vo(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(_l(vn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Mn)return Mn[n](e)},has(t,n){return n in t||n in Mn}}))}function Rr(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function tf(e){return le(e)&&"__vccOpts"in e}const R=(e,t)=>Ju(e,t,Hn);function E(e,t,n){const o=arguments.length;return o===2?ye(t)&&!te(t)?Co(t)?Fe(e,null,[t]):Fe(e,t):Fe(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Co(n)&&(n=[n]),Fe(e,t,n))}const nf=Symbol.for("v-scx"),of=()=>ut(nf),rf="3.3.4",sf="http://www.w3.org/2000/svg",Bt=typeof document!="undefined"?document:null,zi=Bt&&Bt.createElement("template"),lf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?Bt.createElementNS(sf,e):Bt.createElement(e,n?{is:n}:void 0);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>Bt.createTextNode(e),createComment:e=>Bt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Bt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{zi.innerHTML=o?`${e}`:e;const l=zi.content;if(o){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function af(e,t,n){const o=e._vtc;o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function uf(e,t,n){const o=e.style,r=xe(n);if(n&&!r){if(t&&!xe(t))for(const i in t)n[i]==null&&Pr(o,i,"");for(const i in n)Pr(o,i,n[i])}else{const i=o.display;r?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=i)}}const Ki=/\s*!important$/;function Pr(e,t,n){if(te(n))n.forEach(o=>Pr(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=cf(e,t);Ki.test(n)?e.setProperty(Kt(o),n.replace(Ki,""),"important"):e[o]=n}}const Ui=["Webkit","Moz","ms"],Xo={};function cf(e,t){const n=Xo[t];if(n)return n;let o=ct(t);if(o!=="filter"&&o in e)return Xo[t]=o;o=Ao(o);for(let r=0;rGo||(vf.then(()=>Go=0),Go=Date.now());function yf(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Ue(_f(o,n.value),t,5,[o])};return n.value=e,n.attached=bf(),n}function _f(e,t){if(te(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>r=>!r._stopped&&o&&o(r))}else return t}const Yi=/^on[a-z]/,wf=(e,t,n,o,r=!1,i,s,l,a)=>{t==="class"?af(e,o,r):t==="style"?uf(e,n,o):To(t)?Vr(t)||mf(e,t,n,o,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):xf(e,t,o,r))?df(e,t,o,i,s,l,a):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),ff(e,t,o,r))};function xf(e,t,n,o){return o?!!(t==="innerHTML"||t==="textContent"||t in e&&Yi.test(t)&&le(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Yi.test(t)&&xe(n)?!1:t in e}const yt="transition",_n="animation",cn=(e,{slots:t})=>E(dc,ta(e),t);cn.displayName="Transition";const ea={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Cf=cn.props=Ce({},Ml,ea),Ot=(e,t=[])=>{te(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zi=e=>e?te(e)?e.some(t=>t.length>1):e.length>1:!1;function ta(e){const t={};for(const v in e)v in ea||(t[v]=e[v]);if(e.css===!1)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=s,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,y=kf(r),T=y&&y[0],q=y&&y[1],{onBeforeEnter:M,onEnter:m,onEnterCancelled:_,onLeave:w,onLeaveCancelled:F,onBeforeAppear:j=M,onAppear:V=m,onAppearCancelled:N=_}=t,C=(v,H,k)=>{wt(v,H?u:l),wt(v,H?c:s),k&&k()},x=(v,H)=>{v._isLeaving=!1,wt(v,d),wt(v,p),wt(v,f),H&&H()},$=v=>(H,k)=>{const Z=v?V:m,Y=()=>C(H,v,k);Ot(Z,[H,Y]),Ji(()=>{wt(H,v?a:i),dt(H,v?u:l),Zi(Z)||Xi(H,o,T,Y)})};return Ce(t,{onBeforeEnter(v){Ot(M,[v]),dt(v,i),dt(v,s)},onBeforeAppear(v){Ot(j,[v]),dt(v,a),dt(v,c)},onEnter:$(!1),onAppear:$(!0),onLeave(v,H){v._isLeaving=!0;const k=()=>x(v,H);dt(v,d),oa(),dt(v,f),Ji(()=>{!v._isLeaving||(wt(v,d),dt(v,p),Zi(w)||Xi(v,o,q,k))}),Ot(w,[v,k])},onEnterCancelled(v){C(v,!1),Ot(_,[v])},onAppearCancelled(v){C(v,!0),Ot(N,[v])},onLeaveCancelled(v){x(v),Ot(F,[v])}})}function kf(e){if(e==null)return null;if(ye(e))return[er(e.enter),er(e.leave)];{const t=er(e);return[t,t]}}function er(e){return fu(e)}function dt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function wt(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function Ji(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Ef=0;function Xi(e,t,n,o){const r=e._endId=++Ef,i=()=>{r===e._endId&&o()};if(n)return setTimeout(i,n);const{type:s,timeout:l,propCount:a}=na(e,t);if(!s)return o();const c=s+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[y]||"").split(", "),r=o(`${yt}Delay`),i=o(`${yt}Duration`),s=Gi(r,i),l=o(`${_n}Delay`),a=o(`${_n}Duration`),c=Gi(l,a);let u=null,d=0,f=0;t===yt?s>0&&(u=yt,d=s,f=i.length):t===_n?c>0&&(u=_n,d=c,f=a.length):(d=Math.max(s,c),u=d>0?s>c?yt:_n:null,f=u?u===yt?i.length:a.length:0);const p=u===yt&&/\b(transform|all)(,|$)/.test(o(`${yt}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Gi(e,t){for(;e.lengthes(n)+es(e[o])))}function es(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function oa(){return document.body.offsetHeight}const ra=new WeakMap,ia=new WeakMap,sa={name:"TransitionGroup",props:Ce({},Cf,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ke(),o=Al();let r,i;return oi(()=>{if(!r.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!Af(r[0].el,n.vnode.el,s))return;r.forEach(Pf),r.forEach(Tf);const l=r.filter(qf);oa(),l.forEach(a=>{const c=a.el,u=c.style;dt(c,s),u.transform=u.webkitTransform=u.transitionDuration="";const d=c._moveCb=f=>{f&&f.target!==c||(!f||/transform$/.test(f.propertyName))&&(c.removeEventListener("transitionend",d),c._moveCb=null,wt(c,s))};c.addEventListener("transitionend",d)})}),()=>{const s=ie(e),l=ta(s);let a=s.tag||Xe;r=i,i=t.default?ni(t.default()):[];for(let c=0;cdelete e.mode;sa.props;const Rf=sa;function Pf(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function Tf(e){ia.set(e,e.el.getBoundingClientRect())}function qf(e){const t=ra.get(e),n=ia.get(e),o=t.left-n.left,r=t.top-n.top;if(o||r){const i=e.el.style;return i.transform=i.webkitTransform=`translate(${o}px,${r}px)`,i.transitionDuration="0s",e}}function Af(e,t,n){const o=e.cloneNode();e._vtc&&e._vtc.forEach(s=>{s.split(/\s+/).forEach(l=>l&&o.classList.remove(l))}),n.split(/\s+/).forEach(s=>s&&o.classList.add(s)),o.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(o);const{hasTransform:i}=na(o);return r.removeChild(o),i}const Mf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Em=(e,t)=>n=>{if(!("key"in n))return;const o=Kt(n.key);if(t.some(r=>r===o||Mf[r]===o))return e(n)},Sm={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):wn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),wn(e,!0),o.enter(e)):o.leave(e,()=>{wn(e,!1)}):wn(e,t))},beforeUnmount(e,{value:t}){wn(e,t)}};function wn(e,t){e.style.display=t?e._vod:"none"}const Of=Ce({patchProp:wf},lf);let ts;function $f(){return ts||(ts=Bc(Of))}const la=(...e)=>{const t=$f().createApp(...e),{mount:n}=t;return t.mount=o=>{const r=Lf(o);if(!r)return;const i=t._component;!le(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.innerHTML="";const s=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Lf(e){return xe(e)?document.querySelector(e):e}function bn(e,t,n,o){return Object.defineProperty(e,t,{get:n,set:o,enumerable:!0}),e}const qt=he(!1);let Do;function Bf(e,t){const n=/(edg|edge|edga|edgios)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(vivaldi)[\/]([\w.]+)/.exec(e)||/(chrome|crios)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e)||/(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e)||/(firefox|fxios)[\/]([\w.]+)/.exec(e)||/(webkit)[\/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[\/]([\w.]+)/.exec(e)||[];return{browser:n[5]||n[3]||n[1]||"",version:n[2]||n[4]||"0",versionNumber:n[4]||n[2]||"0",platform:t[0]||""}}function Ff(e){return/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(silk)/.exec(e)||/(android)/.exec(e)||/(win)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||/(playbook)/.exec(e)||/(bb)/.exec(e)||/(blackberry)/.exec(e)||[]}const aa="ontouchstart"in window||window.navigator.maxTouchPoints>0;function If(e){Do={is:{...e}},delete e.mac,delete e.desktop;const t=Math.min(window.innerHeight,window.innerWidth)>414?"ipad":"iphone";Object.assign(e,{mobile:!0,ios:!0,platform:t,[t]:!0})}function Nf(e){const t=e.toLowerCase(),n=Ff(t),o=Bf(t,n),r={};o.browser&&(r[o.browser]=!0,r.version=o.version,r.versionNumber=parseInt(o.versionNumber,10)),o.platform&&(r[o.platform]=!0);const i=r.android||r.ios||r.bb||r.blackberry||r.ipad||r.iphone||r.ipod||r.kindle||r.playbook||r.silk||r["windows phone"];return i===!0||t.indexOf("mobile")>-1?(r.mobile=!0,r.edga||r.edgios?(r.edge=!0,o.browser="edge"):r.crios?(r.chrome=!0,o.browser="chrome"):r.fxios&&(r.firefox=!0,o.browser="firefox")):r.desktop=!0,(r.ipod||r.ipad||r.iphone)&&(r.ios=!0),r["windows phone"]&&(r.winphone=!0,delete r["windows phone"]),(r.chrome||r.opr||r.safari||r.vivaldi||r.mobile===!0&&r.ios!==!0&&i!==!0)&&(r.webkit=!0),r.edg&&(o.browser="edgechromium",r.edgeChromium=!0),(r.safari&&r.blackberry||r.bb)&&(o.browser="blackberry",r.blackberry=!0),r.safari&&r.playbook&&(o.browser="playbook",r.playbook=!0),r.opr&&(o.browser="opera",r.opera=!0),r.safari&&r.android&&(o.browser="android",r.android=!0),r.safari&&r.kindle&&(o.browser="kindle",r.kindle=!0),r.safari&&r.silk&&(o.browser="silk",r.silk=!0),r.vivaldi&&(o.browser="vivaldi",r.vivaldi=!0),r.name=o.browser,r.platform=o.platform,t.indexOf("electron")>-1?r.electron=!0:document.location.href.indexOf("-extension://")>-1?r.bex=!0:(window.Capacitor!==void 0?(r.capacitor=!0,r.nativeMobile=!0,r.nativeMobileWrapper="capacitor"):(window._cordovaNative!==void 0||window.cordova!==void 0)&&(r.cordova=!0,r.nativeMobile=!0,r.nativeMobileWrapper="cordova"),aa===!0&&r.mac===!0&&(r.desktop===!0&&r.safari===!0||r.nativeMobile===!0&&r.android!==!0&&r.ios!==!0&&r.ipad!==!0)&&If(r)),r}const ns=navigator.userAgent||navigator.vendor||window.opera,jf={has:{touch:!1,webStorage:!1},within:{iframe:!1}},we={userAgent:ns,is:Nf(ns),has:{touch:aa},within:{iframe:window.self!==window.top}},Tr={install(e){const{$q:t}=e;qt.value===!0?(e.onSSRHydrated.push(()=>{Object.assign(t.platform,we),qt.value=!1,Do=void 0}),t.platform=pn(this)):t.platform=this}};{let e;bn(we.has,"webStorage",()=>{if(e!==void 0)return e;try{if(window.localStorage)return e=!0,!0}catch{}return e=!1,!1}),we.is.ios===!0&&window.navigator.vendor.toLowerCase().indexOf("apple"),qt.value===!0?Object.assign(Tr,we,Do,jf):Object.assign(Tr,we)}var Ho=(e,t)=>{const n=pn(e);for(const o in e)bn(t,o,()=>n[o],r=>{n[o]=r});return t};const Be={hasPassive:!1,passiveCapture:!0,notPassiveCapture:!0};try{const e=Object.defineProperty({},"passive",{get(){Object.assign(Be,{hasPassive:!0,passive:{passive:!0},notPassive:{passive:!1},passiveCapture:{passive:!0,capture:!0},notPassiveCapture:{passive:!1,capture:!0}})}});window.addEventListener("qtest",null,e),window.removeEventListener("qtest",null,e)}catch{}function Pt(){}function Rm(e){return e.button===0}function Vf(e){return e.touches&&e.touches[0]?e=e.touches[0]:e.changedTouches&&e.changedTouches[0]?e=e.changedTouches[0]:e.targetTouches&&e.targetTouches[0]&&(e=e.targetTouches[0]),{top:e.clientY,left:e.clientX}}function Df(e){if(e.path)return e.path;if(e.composedPath)return e.composedPath();const t=[];let n=e.target;for(;n;){if(t.push(n),n.tagName==="HTML")return t.push(document),t.push(window),t;n=n.parentElement}}function ko(e){e.stopPropagation()}function Et(e){e.cancelable!==!1&&e.preventDefault()}function Ke(e){e.cancelable!==!1&&e.preventDefault(),e.stopPropagation()}function Pm(e,t){if(e===void 0||t===!0&&e.__dragPrevented===!0)return;const n=t===!0?o=>{o.__dragPrevented=!0,o.addEventListener("dragstart",Et,Be.notPassiveCapture)}:o=>{delete o.__dragPrevented,o.removeEventListener("dragstart",Et,Be.notPassiveCapture)};e.querySelectorAll("a, img").forEach(n)}function Hf(e,t,n){const o=`__q_${t}_evt`;e[o]=e[o]!==void 0?e[o].concat(n):n,n.forEach(r=>{r[0].addEventListener(r[1],e[r[2]],Be[r[3]])})}function zf(e,t){const n=`__q_${t}_evt`;e[n]!==void 0&&(e[n].forEach(o=>{o[0].removeEventListener(o[1],e[o[2]],Be[o[3]])}),e[n]=void 0)}function ua(e,t=250,n){let o=null;function r(){const i=arguments,s=()=>{o=null,n!==!0&&e.apply(this,i)};o!==null?clearTimeout(o):n===!0&&e.apply(this,i),o=setTimeout(s,t)}return r.cancel=()=>{o!==null&&clearTimeout(o)},r}const tr=["sm","md","lg","xl"],{passive:os}=Be;var Kf=Ho({width:0,height:0,name:"xs",sizes:{sm:600,md:1024,lg:1440,xl:1920},lt:{sm:!0,md:!0,lg:!0,xl:!0},gt:{xs:!1,sm:!1,md:!1,lg:!1},xs:!0,sm:!1,md:!1,lg:!1,xl:!1},{setSizes:Pt,setDebounce:Pt,install({$q:e,onSSRHydrated:t}){if(e.screen=this,this.__installed===!0){e.config.screen!==void 0&&(e.config.screen.bodyClasses===!1?document.body.classList.remove(`screen--${this.name}`):this.__update(!0));return}const{visualViewport:n}=window,o=n||window,r=document.scrollingElement||document.documentElement,i=n===void 0||we.is.mobile===!0?()=>[Math.max(window.innerWidth,r.clientWidth),Math.max(window.innerHeight,r.clientHeight)]:()=>[n.width*n.scale+window.innerWidth-r.clientWidth,n.height*n.scale+window.innerHeight-r.clientHeight],s=e.config.screen!==void 0&&e.config.screen.bodyClasses===!0;this.__update=d=>{const[f,p]=i();if(p!==this.height&&(this.height=p),f!==this.width)this.width=f;else if(d!==!0)return;let y=this.sizes;this.gt.xs=f>=y.sm,this.gt.sm=f>=y.md,this.gt.md=f>=y.lg,this.gt.lg=f>=y.xl,this.lt.sm=f{tr.forEach(f=>{d[f]!==void 0&&(a[f]=d[f])})},this.setDebounce=d=>{c=d};const u=()=>{const d=getComputedStyle(document.body);d.getPropertyValue("--q-size-sm")&&tr.forEach(f=>{this.sizes[f]=parseInt(d.getPropertyValue(`--q-size-${f}`),10)}),this.setSizes=f=>{tr.forEach(p=>{f[p]&&(this.sizes[p]=f[p])}),this.__update(!0)},this.setDebounce=f=>{l!==void 0&&o.removeEventListener("resize",l,os),l=f>0?ua(this.__update,f):this.__update,o.addEventListener("resize",l,os)},this.setDebounce(c),Object.keys(a).length!==0?(this.setSizes(a),a=void 0):this.__update(),s===!0&&this.name==="xs"&&document.body.classList.add("screen--xs")};qt.value===!0?t.push(u):u()}});const Ae=Ho({isActive:!1,mode:!1},{__media:void 0,set(e){Ae.mode=e,e==="auto"?(Ae.__media===void 0&&(Ae.__media=window.matchMedia("(prefers-color-scheme: dark)"),Ae.__updateMedia=()=>{Ae.set("auto")},Ae.__media.addListener(Ae.__updateMedia)),e=Ae.__media.matches):Ae.__media!==void 0&&(Ae.__media.removeListener(Ae.__updateMedia),Ae.__media=void 0),Ae.isActive=e===!0,document.body.classList.remove(`body--${e===!0?"light":"dark"}`),document.body.classList.add(`body--${e===!0?"dark":"light"}`)},toggle(){Ae.set(Ae.isActive===!1)},install({$q:e,onSSRHydrated:t,ssrContext:n}){const{dark:o}=e.config;if(e.dark=this,this.__installed===!0&&o===void 0)return;this.isActive=o===!0;const r=o!==void 0?o:!1;if(qt.value===!0){const i=l=>{this.__fromSSR=l},s=this.set;this.set=i,i(r),t.push(()=>{this.set=s,this.set(this.__fromSSR)})}else this.set(r)}}),ca=()=>!0;function Uf(e){return typeof e=="string"&&e!==""&&e!=="/"&&e!=="#/"}function Wf(e){return e.startsWith("#")===!0&&(e=e.substring(1)),e.startsWith("/")===!1&&(e="/"+e),e.endsWith("/")===!0&&(e=e.substring(0,e.length-1)),"#"+e}function Qf(e){if(e.backButtonExit===!1)return()=>!1;if(e.backButtonExit==="*")return ca;const t=["#/"];return Array.isArray(e.backButtonExit)===!0&&t.push(...e.backButtonExit.filter(Uf).map(Wf)),()=>t.includes(window.location.hash)}var qr={__history:[],add:Pt,remove:Pt,install({$q:e}){if(this.__installed===!0)return;const{cordova:t,capacitor:n}=we.is;if(t!==!0&&n!==!0)return;const o=e.config[t===!0?"cordova":"capacitor"];if(o!==void 0&&o.backButton===!1||n===!0&&(window.Capacitor===void 0||window.Capacitor.Plugins.App===void 0))return;this.add=s=>{s.condition===void 0&&(s.condition=ca),this.__history.push(s)},this.remove=s=>{const l=this.__history.indexOf(s);l>=0&&this.__history.splice(l,1)};const r=Qf(Object.assign({backButtonExit:!0},o)),i=()=>{if(this.__history.length){const s=this.__history[this.__history.length-1];s.condition()===!0&&(this.__history.pop(),s.handler())}else r()===!0?navigator.app.exitApp():window.history.back()};t===!0?document.addEventListener("deviceready",()=>{document.addEventListener("backbutton",i,!1)}):window.Capacitor.Plugins.App.addListener("backButton",i)}},rs={isoName:"en-US",nativeName:"English (US)",label:{clear:"Clear",ok:"OK",cancel:"Cancel",close:"Close",set:"Set",select:"Select",reset:"Reset",remove:"Remove",update:"Update",create:"Create",search:"Search",filter:"Filter",refresh:"Refresh",expand:e=>e?`Expand "${e}"`:"Expand",collapse:e=>e?`Collapse "${e}"`:"Collapse"},date:{days:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),daysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),firstDayOfWeek:0,format24h:!1,pluralDay:"days"},table:{noData:"No data available",noResults:"No matching records found",loading:"Loading...",selectedRecords:e=>e===1?"1 record selected.":(e===0?"No":e)+" records selected.",recordsPerPage:"Records per page:",allRows:"All",pagination:(e,t,n)=>e+"-"+t+" of "+n,columns:"Columns"},editor:{url:"URL",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",unorderedList:"Unordered List",orderedList:"Ordered List",subscript:"Subscript",superscript:"Superscript",hyperlink:"Hyperlink",toggleFullscreen:"Toggle Fullscreen",quote:"Quote",left:"Left align",center:"Center align",right:"Right align",justify:"Justify align",print:"Print",outdent:"Decrease indentation",indent:"Increase indentation",removeFormat:"Remove formatting",formatting:"Formatting",fontSize:"Font Size",align:"Align",hr:"Insert Horizontal Rule",undo:"Undo",redo:"Redo",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph",code:"Code",size1:"Very small",size2:"A bit small",size3:"Normal",size4:"Medium-large",size5:"Big",size6:"Very big",size7:"Maximum",defaultFont:"Default Font",viewSource:"View Source"},tree:{noNodes:"No nodes available",noResults:"No matching nodes found"}};function is(){const e=Array.isArray(navigator.languages)===!0&&navigator.languages.length!==0?navigator.languages[0]:navigator.language;if(typeof e=="string")return e.split(/[-_]/).map((t,n)=>n===0?t.toLowerCase():n>1||t.length<4?t.toUpperCase():t[0].toUpperCase()+t.slice(1).toLowerCase()).join("-")}const Ze=Ho({__langPack:{}},{getLocale:is,set(e=rs,t){const n={...e,rtl:e.rtl===!0,getLocale:is};{if(n.set=Ze.set,Ze.__langConfig===void 0||Ze.__langConfig.noHtmlAttrs!==!0){const o=document.documentElement;o.setAttribute("dir",n.rtl===!0?"rtl":"ltr"),o.setAttribute("lang",n.isoName)}Object.assign(Ze.__langPack,n),Ze.props=n,Ze.isoName=n.isoName,Ze.nativeName=n.nativeName}},install({$q:e,lang:t,ssrContext:n}){e.lang=Ze.__langPack,Ze.__langConfig=e.config.lang,this.__installed===!0?t!==void 0&&this.set(t):this.set(t||rs)}});function Yf(e,t,n=document.body){if(typeof e!="string")throw new TypeError("Expected a string as propName");if(typeof t!="string")throw new TypeError("Expected a string as value");if(!(n instanceof Element))throw new TypeError("Expected a DOM element");n.style.setProperty(`--q-${e}`,t)}let fa=!1;function Zf(e){fa=e.isComposing===!0}function da(e){return fa===!0||e!==Object(e)||e.isComposing===!0||e.qKeyEvent===!0}function zn(e,t){return da(e)===!0?!1:[].concat(t).includes(e.keyCode)}function ha(e){if(e.ios===!0)return"ios";if(e.android===!0)return"android"}function Jf({is:e,has:t,within:n},o){const r=[e.desktop===!0?"desktop":"mobile",`${t.touch===!1?"no-":""}touch`];if(e.mobile===!0){const i=ha(e);i!==void 0&&r.push("platform-"+i)}if(e.nativeMobile===!0){const i=e.nativeMobileWrapper;r.push(i),r.push("native-mobile"),e.ios===!0&&(o[i]===void 0||o[i].iosStatusBarPadding!==!1)&&r.push("q-ios-padding")}else e.electron===!0?r.push("electron"):e.bex===!0&&r.push("bex");return n.iframe===!0&&r.push("within-iframe"),r}function Xf(){const{is:e}=we,t=document.body.className,n=new Set(t.replace(/ {2}/g," ").split(" "));if(Do!==void 0)n.delete("desktop"),n.add("platform-ios"),n.add("mobile");else if(e.nativeMobile!==!0&&e.electron!==!0&&e.bex!==!0){if(e.desktop===!0)n.delete("mobile"),n.delete("platform-ios"),n.delete("platform-android"),n.add("desktop");else if(e.mobile===!0){n.delete("desktop"),n.add("mobile");const r=ha(e);r!==void 0?(n.add(`platform-${r}`),n.delete(`platform-${r==="ios"?"android":"ios"}`)):(n.delete("platform-ios"),n.delete("platform-android"))}}we.has.touch===!0&&(n.delete("no-touch"),n.add("touch")),we.within.iframe===!0&&n.add("within-iframe");const o=Array.from(n).join(" ");t!==o&&(document.body.className=o)}function Gf(e){for(const t in e)Yf(t,e[t])}var ed={install(e){if(this.__installed!==!0){if(qt.value===!0)Xf();else{const{$q:t}=e;t.config.brand!==void 0&&Gf(t.config.brand);const n=Jf(we,t.config);document.body.classList.add.apply(document.body.classList,n)}we.is.ios===!0&&document.body.addEventListener("touchstart",Pt),window.addEventListener("keydown",Zf,!0)}}},td={name:"material-icons",type:{positive:"check_circle",negative:"warning",info:"info",warning:"priority_high"},arrow:{up:"arrow_upward",right:"arrow_forward",down:"arrow_downward",left:"arrow_back",dropdown:"arrow_drop_down"},chevron:{left:"chevron_left",right:"chevron_right"},colorPicker:{spectrum:"gradient",tune:"tune",palette:"style"},pullToRefresh:{icon:"refresh"},carousel:{left:"chevron_left",right:"chevron_right",up:"keyboard_arrow_up",down:"keyboard_arrow_down",navigationIcon:"lens"},chip:{remove:"cancel",selected:"check"},datetime:{arrowLeft:"chevron_left",arrowRight:"chevron_right",now:"access_time",today:"today"},editor:{bold:"format_bold",italic:"format_italic",strikethrough:"strikethrough_s",underline:"format_underlined",unorderedList:"format_list_bulleted",orderedList:"format_list_numbered",subscript:"vertical_align_bottom",superscript:"vertical_align_top",hyperlink:"link",toggleFullscreen:"fullscreen",quote:"format_quote",left:"format_align_left",center:"format_align_center",right:"format_align_right",justify:"format_align_justify",print:"print",outdent:"format_indent_decrease",indent:"format_indent_increase",removeFormat:"format_clear",formatting:"text_format",fontSize:"format_size",align:"format_align_left",hr:"remove",undo:"undo",redo:"redo",heading:"format_size",code:"code",size:"format_size",font:"font_download",viewSource:"code"},expansionItem:{icon:"keyboard_arrow_down",denseIcon:"arrow_drop_down"},fab:{icon:"add",activeIcon:"close"},field:{clear:"cancel",error:"error"},pagination:{first:"first_page",prev:"keyboard_arrow_left",next:"keyboard_arrow_right",last:"last_page"},rating:{icon:"grade"},stepper:{done:"check",active:"edit",error:"warning"},tabs:{left:"chevron_left",right:"chevron_right",up:"keyboard_arrow_up",down:"keyboard_arrow_down"},table:{arrowUp:"arrow_upward",warning:"warning",firstPage:"first_page",prevPage:"chevron_left",nextPage:"chevron_right",lastPage:"last_page"},tree:{icon:"play_arrow"},uploader:{done:"done",clear:"clear",add:"add_box",upload:"cloud_upload",removeQueue:"clear_all",removeUploaded:"done_all"}};const Eo=Ho({iconMapFn:null,__icons:{}},{set(e,t){const n={...e,rtl:e.rtl===!0};n.set=Eo.set,Object.assign(Eo.__icons,n)},install({$q:e,iconSet:t,ssrContext:n}){e.config.iconMapFn!==void 0&&(this.iconMapFn=e.config.iconMapFn),e.iconSet=this.__icons,bn(e,"iconMapFn",()=>this.iconMapFn,o=>{this.iconMapFn=o}),this.__installed===!0?t!==void 0&&this.set(t):this.set(t||td)}}),nd="_q_",Tm="_q_l_",qm="_q_pc_",od="_q_fo_",Am="_q_tabs_",Mm=()=>{},So={};let ga=!1;function rd(){ga=!0}function nr(e,t){if(e===t)return!0;if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(e.constructor===Array){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(nr(e[o],t[o])!==!0)return!1;return!0}if(e.constructor===Map){if(e.size!==t.size)return!1;let i=e.entries();for(o=i.next();o.done!==!0;){if(t.has(o.value[0])!==!0)return!1;o=i.next()}for(i=e.entries(),o=i.next();o.done!==!0;){if(nr(o.value[1],t.get(o.value[0]))!==!0)return!1;o=i.next()}return!0}if(e.constructor===Set){if(e.size!==t.size)return!1;const i=e.entries();for(o=i.next();o.done!==!0;){if(t.has(o.value[0])!==!0)return!1;o=i.next()}return!0}if(e.buffer!=null&&e.buffer.constructor===ArrayBuffer){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const r=Object.keys(e).filter(i=>e[i]!==void 0);if(n=r.length,n!==Object.keys(t).filter(i=>t[i]!==void 0).length)return!1;for(o=n;o--!==0;){const i=r[o];if(nr(e[i],t[i])!==!0)return!1}return!0}return e!==e&&t!==t}function at(e){return e!==null&&typeof e=="object"&&Array.isArray(e)!==!0}function id(e){return Object.prototype.toString.call(e)==="[object Date]"}function sd(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Om(e){return typeof e=="number"&&isFinite(e)}const ss=[Tr,ed,Ae,Kf,qr,Ze,Eo];function ma(e,t){const n=la(e);n.config.globalProperties=t.config.globalProperties;const{reload:o,...r}=t._context;return Object.assign(n._context,r),n}function ls(e,t){t.forEach(n=>{n.install(e),n.__installed=!0})}function ld(e,t,n){e.config.globalProperties.$q=n.$q,e.provide(nd,n.$q),ls(n,ss),t.components!==void 0&&Object.values(t.components).forEach(o=>{at(o)===!0&&o.name!==void 0&&e.component(o.name,o)}),t.directives!==void 0&&Object.values(t.directives).forEach(o=>{at(o)===!0&&o.name!==void 0&&e.directive(o.name,o)}),t.plugins!==void 0&&ls(n,Object.values(t.plugins).filter(o=>typeof o.install=="function"&&ss.includes(o)===!1)),qt.value===!0&&(n.$q.onSSRHydrated=()=>{n.onSSRHydrated.forEach(o=>{o()}),n.$q.onSSRHydrated=()=>{}})}var ad=function(e,t={}){const n={version:"2.12.3"};ga===!1?(t.config!==void 0&&Object.assign(So,t.config),n.config={...So},rd()):n.config=t.config||{},ld(e,t,{parentApp:e,$q:n,lang:t.lang,iconSet:t.iconSet,onSSRHydrated:[]})},ud={version:"2.12.3",install:ad,lang:Ze,iconSet:Eo},cd=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n};const fd=Lo({name:"App"});function dd(e,t,n,o,r,i){const s=wc("router-view");return Wl(),Yl(s)}var hd=cd(fd,[["render",dd]]);/*! + * vue-router v4.2.4 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */const en=typeof window!="undefined";function gd(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const ge=Object.assign;function or(e,t){const n={};for(const o in t){const r=t[o];n[o]=rt(r)?r.map(e):e(r)}return n}const Ln=()=>{},rt=Array.isArray,md=/\/$/,pd=e=>e.replace(md,"");function rr(e,t,n="/"){let o,r={},i="",s="";const l=t.indexOf("#");let a=t.indexOf("?");return l=0&&(a=-1),a>-1&&(o=t.slice(0,a),i=t.slice(a+1,l>-1?l:t.length),r=e(i)),l>-1&&(o=o||t.slice(0,l),s=t.slice(l,t.length)),o=_d(o!=null?o:t,n),{fullPath:o+(i&&"?")+i+s,path:o,query:r,hash:s}}function vd(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function as(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function bd(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&fn(t.matched[o],n.matched[r])&&pa(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function fn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function pa(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!yd(e[n],t[n]))return!1;return!0}function yd(e,t){return rt(e)?us(e,t):rt(t)?us(t,e):e===t}function us(e,t){return rt(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function _d(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,s,l;for(s=0;s1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(s-(s===o.length?1:0)).join("/")}var Kn;(function(e){e.pop="pop",e.push="push"})(Kn||(Kn={}));var Bn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Bn||(Bn={}));function wd(e){if(!e)if(en){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),pd(e)}const xd=/^[^#]+#/;function Cd(e,t){return e.replace(xd,"#")+t}function kd(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const zo=()=>({left:window.pageXOffset,top:window.pageYOffset});function Ed(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=kd(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function cs(e,t){return(history.state?history.state.position-t:-1)+e}const Ar=new Map;function Sd(e,t){Ar.set(e,t)}function Rd(e){const t=Ar.get(e);return Ar.delete(e),t}let Pd=()=>location.protocol+"//"+location.host;function va(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,a=r.slice(l);return a[0]!=="/"&&(a="/"+a),as(a,"")}return as(n,e)+o+r}function Td(e,t,n,o){let r=[],i=[],s=null;const l=({state:f})=>{const p=va(e,location),y=n.value,T=t.value;let q=0;if(f){if(n.value=p,t.value=f,s&&s===y){s=null;return}q=T?f.position-T.position:0}else o(p);r.forEach(M=>{M(n.value,y,{delta:q,type:Kn.pop,direction:q?q>0?Bn.forward:Bn.back:Bn.unknown})})};function a(){s=n.value}function c(f){r.push(f);const p=()=>{const y=r.indexOf(f);y>-1&&r.splice(y,1)};return i.push(p),p}function u(){const{history:f}=window;!f.state||f.replaceState(ge({},f.state,{scroll:zo()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:a,listen:c,destroy:d}}function fs(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?zo():null}}function qd(e){const{history:t,location:n}=window,o={value:va(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(a,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+a:Pd()+e+a;try{t[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(p){console.error(p),n[u?"replace":"assign"](f)}}function s(a,c){const u=ge({},t.state,fs(r.value.back,a,r.value.forward,!0),c,{position:r.value.position});i(a,u,!0),o.value=a}function l(a,c){const u=ge({},r.value,t.state,{forward:a,scroll:zo()});i(u.current,u,!0);const d=ge({},fs(o.value,a,null),{position:u.position+1},c);i(a,d,!1),o.value=a}return{location:o,state:r,push:l,replace:s}}function Ad(e){e=wd(e);const t=qd(e),n=Td(e,t.state,t.location,t.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=ge({location:"",base:e,go:o,createHref:Cd.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Md(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Ad(e)}function Od(e){return typeof e=="string"||e&&typeof e=="object"}function ba(e){return typeof e=="string"||typeof e=="symbol"}const _t={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},ya=Symbol("");var ds;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(ds||(ds={}));function dn(e,t){return ge(new Error,{type:e,[ya]:!0},t)}function ft(e,t){return e instanceof Error&&ya in e&&(t==null||!!(e.type&t))}const hs="[^/]+?",$d={sensitive:!1,strict:!1,start:!0,end:!0},Ld=/[.+*?^${}()[\]/\\]/g;function Bd(e,t){const n=ge({},$d,t),o=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let d=0;dt.length?t.length===1&&t[0]===40+40?1:-1:0}function Id(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Nd={type:0,value:""},jd=/[a-zA-Z0-9_]/;function Vd(e){if(!e)return[[]];if(e==="/")return[[Nd]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${c}": ${p}`)}let n=0,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let l=0,a,c="",u="";function d(){!c||(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=a}for(;l{s(m)}:Ln}function s(u){if(ba(u)){const d=o.get(u);d&&(o.delete(u),n.splice(n.indexOf(d),1),d.children.forEach(s),d.alias.forEach(s))}else{const d=n.indexOf(u);d>-1&&(n.splice(d,1),u.record.name&&o.delete(u.record.name),u.children.forEach(s),u.alias.forEach(s))}}function l(){return n}function a(u){let d=0;for(;d=0&&(u.record.path!==n[d].record.path||!_a(u,n[d]));)d++;n.splice(d,0,u),u.record.name&&!ps(u)&&o.set(u.record.name,u)}function c(u,d){let f,p={},y,T;if("name"in u&&u.name){if(f=o.get(u.name),!f)throw dn(1,{location:u});T=f.record.name,p=ge(ms(d.params,f.keys.filter(m=>!m.optional).map(m=>m.name)),u.params&&ms(u.params,f.keys.map(m=>m.name))),y=f.stringify(p)}else if("path"in u)y=u.path,f=n.find(m=>m.re.test(y)),f&&(p=f.parse(y),T=f.record.name);else{if(f=d.name?o.get(d.name):n.find(m=>m.re.test(d.path)),!f)throw dn(1,{location:u,currentLocation:d});T=f.record.name,p=ge({},d.params,u.params),y=f.stringify(p)}const q=[];let M=f;for(;M;)q.unshift(M.record),M=M.parent;return{name:T,path:y,params:p,matched:q,meta:Ud(q)}}return e.forEach(u=>i(u)),{addRoute:i,resolve:c,removeRoute:s,getRoutes:l,getRecordMatcher:r}}function ms(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function zd(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Kd(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Kd(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function ps(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ud(e){return e.reduce((t,n)=>ge(t,n.meta),{})}function vs(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function _a(e,t){return t.children.some(n=>n===e||_a(e,n))}const wa=/#/g,Wd=/&/g,Qd=/\//g,Yd=/=/g,Zd=/\?/g,xa=/\+/g,Jd=/%5B/g,Xd=/%5D/g,Ca=/%5E/g,Gd=/%60/g,ka=/%7B/g,eh=/%7C/g,Ea=/%7D/g,th=/%20/g;function ci(e){return encodeURI(""+e).replace(eh,"|").replace(Jd,"[").replace(Xd,"]")}function nh(e){return ci(e).replace(ka,"{").replace(Ea,"}").replace(Ca,"^")}function Mr(e){return ci(e).replace(xa,"%2B").replace(th,"+").replace(wa,"%23").replace(Wd,"%26").replace(Gd,"`").replace(ka,"{").replace(Ea,"}").replace(Ca,"^")}function oh(e){return Mr(e).replace(Yd,"%3D")}function rh(e){return ci(e).replace(wa,"%23").replace(Zd,"%3F")}function ih(e){return e==null?"":rh(e).replace(Qd,"%2F")}function Ro(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function sh(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&Mr(i)):[o&&Mr(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function lh(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=rt(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const ah=Symbol(""),ys=Symbol(""),fi=Symbol(""),Sa=Symbol(""),Or=Symbol("");function xn(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Ct(e,t,n,o,r){const i=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((s,l)=>{const a=d=>{d===!1?l(dn(4,{from:n,to:t})):d instanceof Error?l(d):Od(d)?l(dn(2,{from:t,to:d})):(i&&o.enterCallbacks[r]===i&&typeof d=="function"&&i.push(d),s())},c=e.call(o&&o.instances[r],t,n,a);let u=Promise.resolve(c);e.length<3&&(u=u.then(a)),u.catch(d=>l(d))})}function ir(e,t,n,o){const r=[];for(const i of e)for(const s in i.components){let l=i.components[s];if(!(t!=="beforeRouteEnter"&&!i.instances[s]))if(uh(l)){const c=(l.__vccOpts||l)[t];c&&r.push(Ct(c,n,o,i,s))}else{let a=l();r.push(()=>a.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${s}" at "${i.path}"`));const u=gd(c)?c.default:c;i.components[s]=u;const f=(u.__vccOpts||u)[t];return f&&Ct(f,n,o,i,s)()}))}}return r}function uh(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function _s(e){const t=ut(fi),n=ut(Sa),o=R(()=>t.resolve(Vt(e.to))),r=R(()=>{const{matched:a}=o.value,{length:c}=a,u=a[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(fn.bind(null,u));if(f>-1)return f;const p=ws(a[c-2]);return c>1&&ws(u)===p&&d[d.length-1].path!==p?d.findIndex(fn.bind(null,a[c-2])):f}),i=R(()=>r.value>-1&&hh(n.params,o.value.params)),s=R(()=>r.value>-1&&r.value===n.matched.length-1&&pa(n.params,o.value.params));function l(a={}){return dh(a)?t[Vt(e.replace)?"replace":"push"](Vt(e.to)).catch(Ln):Promise.resolve()}return{route:o,href:R(()=>o.value.href),isActive:i,isExactActive:s,navigate:l}}const ch=Lo({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:_s,setup(e,{slots:t}){const n=pn(_s(e)),{options:o}=ut(fi),r=R(()=>({[xs(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[xs(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:E("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),fh=ch;function dh(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function hh(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!rt(r)||r.length!==o.length||o.some((i,s)=>i!==r[s]))return!1}return!0}function ws(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const xs=(e,t,n)=>e!=null?e:t!=null?t:n,gh=Lo({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=ut(Or),r=R(()=>e.route||o.value),i=ut(ys,0),s=R(()=>{let c=Vt(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),l=R(()=>r.value.matched[s.value]);fo(ys,R(()=>s.value+1)),fo(ah,l),fo(Or,r);const a=he();return be(()=>[a.value,l.value,e.name],([c,u,d],[f,p,y])=>{u&&(u.instances[d]=c,p&&p!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=p.leaveGuards),u.updateGuards.size||(u.updateGuards=p.updateGuards))),c&&u&&(!p||!fn(u,p)||!f)&&(u.enterCallbacks[d]||[]).forEach(T=>T(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=l.value,f=d&&d.components[u];if(!f)return Cs(n.default,{Component:f,route:c});const p=d.props[u],y=p?p===!0?c.params:typeof p=="function"?p(c):p:null,q=E(f,ge({},y,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(d.instances[u]=null)},ref:a}));return Cs(n.default,{Component:q,route:c})||q}}});function Cs(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const mh=gh;function ph(e){const t=Hd(e.routes,e),n=e.parseQuery||sh,o=e.stringifyQuery||bs,r=e.history,i=xn(),s=xn(),l=xn(),a=Wu(_t);let c=_t;en&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=or.bind(null,S=>""+S),d=or.bind(null,ih),f=or.bind(null,Ro);function p(S,Q){let z,X;return ba(S)?(z=t.getRecordMatcher(S),X=Q):X=S,t.addRoute(X,z)}function y(S){const Q=t.getRecordMatcher(S);Q&&t.removeRoute(Q)}function T(){return t.getRoutes().map(S=>S.record)}function q(S){return!!t.getRecordMatcher(S)}function M(S,Q){if(Q=ge({},Q||a.value),typeof S=="string"){const b=rr(n,S,Q.path),P=t.resolve({path:b.path},Q),O=r.createHref(b.fullPath);return ge(b,P,{params:f(P.params),hash:Ro(b.hash),redirectedFrom:void 0,href:O})}let z;if("path"in S)z=ge({},S,{path:rr(n,S.path,Q.path).path});else{const b=ge({},S.params);for(const P in b)b[P]==null&&delete b[P];z=ge({},S,{params:d(b)}),Q.params=d(Q.params)}const X=t.resolve(z,Q),de=S.hash||"";X.params=u(f(X.params));const h=vd(o,ge({},S,{hash:nh(de),path:X.path})),g=r.createHref(h);return ge({fullPath:h,hash:de,query:o===bs?lh(S.query):S.query||{}},X,{redirectedFrom:void 0,href:g})}function m(S){return typeof S=="string"?rr(n,S,a.value.path):ge({},S)}function _(S,Q){if(c!==S)return dn(8,{from:Q,to:S})}function w(S){return V(S)}function F(S){return w(ge(m(S),{replace:!0}))}function j(S){const Q=S.matched[S.matched.length-1];if(Q&&Q.redirect){const{redirect:z}=Q;let X=typeof z=="function"?z(S):z;return typeof X=="string"&&(X=X.includes("?")||X.includes("#")?X=m(X):{path:X},X.params={}),ge({query:S.query,hash:S.hash,params:"path"in X?{}:S.params},X)}}function V(S,Q){const z=c=M(S),X=a.value,de=S.state,h=S.force,g=S.replace===!0,b=j(z);if(b)return V(ge(m(b),{state:typeof b=="object"?ge({},de,b.state):de,force:h,replace:g}),Q||z);const P=z;P.redirectedFrom=Q;let O;return!h&&bd(o,X,z)&&(O=dn(16,{to:P,from:X}),fe(X,X,!0,!1)),(O?Promise.resolve(O):x(P,X)).catch(B=>ft(B)?ft(B,2)?B:se(B):W(B,P,X)).then(B=>{if(B){if(ft(B,2))return V(ge({replace:g},m(B.to),{state:typeof B.to=="object"?ge({},de,B.to.state):de,force:h}),Q||P)}else B=v(P,X,!0,g,de);return $(P,X,B),B})}function N(S,Q){const z=_(S,Q);return z?Promise.reject(z):Promise.resolve()}function C(S){const Q=Re.values().next().value;return Q&&typeof Q.runWithContext=="function"?Q.runWithContext(S):S()}function x(S,Q){let z;const[X,de,h]=vh(S,Q);z=ir(X.reverse(),"beforeRouteLeave",S,Q);for(const b of X)b.leaveGuards.forEach(P=>{z.push(Ct(P,S,Q))});const g=N.bind(null,S,Q);return z.push(g),ne(z).then(()=>{z=[];for(const b of i.list())z.push(Ct(b,S,Q));return z.push(g),ne(z)}).then(()=>{z=ir(de,"beforeRouteUpdate",S,Q);for(const b of de)b.updateGuards.forEach(P=>{z.push(Ct(P,S,Q))});return z.push(g),ne(z)}).then(()=>{z=[];for(const b of h)if(b.beforeEnter)if(rt(b.beforeEnter))for(const P of b.beforeEnter)z.push(Ct(P,S,Q));else z.push(Ct(b.beforeEnter,S,Q));return z.push(g),ne(z)}).then(()=>(S.matched.forEach(b=>b.enterCallbacks={}),z=ir(h,"beforeRouteEnter",S,Q),z.push(g),ne(z))).then(()=>{z=[];for(const b of s.list())z.push(Ct(b,S,Q));return z.push(g),ne(z)}).catch(b=>ft(b,8)?b:Promise.reject(b))}function $(S,Q,z){l.list().forEach(X=>C(()=>X(S,Q,z)))}function v(S,Q,z,X,de){const h=_(S,Q);if(h)return h;const g=Q===_t,b=en?history.state:{};z&&(X||g?r.replace(S.fullPath,ge({scroll:g&&b&&b.scroll},de)):r.push(S.fullPath,de)),a.value=S,fe(S,Q,z,g),se()}let H;function k(){H||(H=r.listen((S,Q,z)=>{if(!oe.listening)return;const X=M(S),de=j(X);if(de){V(ge(de,{replace:!0}),X).catch(Ln);return}c=X;const h=a.value;en&&Sd(cs(h.fullPath,z.delta),zo()),x(X,h).catch(g=>ft(g,12)?g:ft(g,2)?(V(g.to,X).then(b=>{ft(b,20)&&!z.delta&&z.type===Kn.pop&&r.go(-1,!1)}).catch(Ln),Promise.reject()):(z.delta&&r.go(-z.delta,!1),W(g,X,h))).then(g=>{g=g||v(X,h,!1),g&&(z.delta&&!ft(g,8)?r.go(-z.delta,!1):z.type===Kn.pop&&ft(g,20)&&r.go(-1,!1)),$(X,h,g)}).catch(Ln)}))}let Z=xn(),Y=xn(),A;function W(S,Q,z){se(S);const X=Y.list();return X.length?X.forEach(de=>de(S,Q,z)):console.error(S),Promise.reject(S)}function _e(){return A&&a.value!==_t?Promise.resolve():new Promise((S,Q)=>{Z.add([S,Q])})}function se(S){return A||(A=!S,k(),Z.list().forEach(([Q,z])=>S?z(S):Q()),Z.reset()),S}function fe(S,Q,z,X){const{scrollBehavior:de}=e;if(!en||!de)return Promise.resolve();const h=!z&&Rd(cs(S.fullPath,0))||(X||!z)&&history.state&&history.state.scroll||null;return je().then(()=>de(S,Q,h)).then(g=>g&&Ed(g)).catch(g=>W(g,S,Q))}const L=S=>r.go(S);let ue;const Re=new Set,oe={currentRoute:a,listening:!0,addRoute:p,removeRoute:y,hasRoute:q,getRoutes:T,resolve:M,options:e,push:w,replace:F,go:L,back:()=>L(-1),forward:()=>L(1),beforeEach:i.add,beforeResolve:s.add,afterEach:l.add,onError:Y.add,isReady:_e,install(S){const Q=this;S.component("RouterLink",fh),S.component("RouterView",mh),S.config.globalProperties.$router=Q,Object.defineProperty(S.config.globalProperties,"$route",{enumerable:!0,get:()=>Vt(a)}),en&&!ue&&a.value===_t&&(ue=!0,w(r.location).catch(de=>{}));const z={};for(const de in _t)Object.defineProperty(z,de,{get:()=>a.value[de],enumerable:!0});S.provide(fi,Q),S.provide(Sa,gl(z)),S.provide(Or,a);const X=S.unmount;Re.add(S),S.unmount=function(){Re.delete(S),Re.size<1&&(c=_t,H&&H(),H=null,a.value=_t,ue=!1,A=!1),X()}}};function ne(S){return S.reduce((Q,z)=>Q.then(()=>C(z)),Promise.resolve())}return oe}function vh(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let s=0;sfn(c,l))?o.push(l):n.push(l));const a=e.matched[s];a&&(t.matched.find(c=>fn(c,a))||r.push(a))}return[n,o,r]}const bh=function(){const t=document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),ks={},yh="/nostrmarket/static/market/",sr=function(t,n){return!n||n.length===0?t():Promise.all(n.map(o=>{if(o=`${yh}${o}`,o in ks)return;ks[o]=!0;const r=o.endsWith(".css"),i=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${i}`))return;const s=document.createElement("link");if(s.rel=r?"stylesheet":bh,r||(s.as="script",s.crossOrigin=""),s.href=o,document.head.appendChild(s),r)return new Promise((l,a)=>{s.addEventListener("load",l),s.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())},_h=[{path:"/",component:()=>sr(()=>import("./MainLayout.421c5479.js"),["assets/MainLayout.421c5479.js","assets/QResizeObserver.bcb70109.js"]),children:[{path:"",component:()=>sr(()=>import("./MarketPage.2aa781b5.js"),["assets/MarketPage.2aa781b5.js","assets/QResizeObserver.bcb70109.js"])}]},{path:"/:catchAll(.*)*",component:()=>sr(()=>import("./ErrorNotFound.db627eb7.js"),[])}];var lr=function(){return ph({scrollBehavior:()=>({left:0,top:0}),routes:_h,history:Md("/nostrmarket/static/market/")})};async function wh(e,t){const n=e(hd);n.use(ud,t);const o=vn(typeof lr=="function"?await lr({}):lr);return{app:n,router:o}}const $r={xs:18,sm:24,md:32,lg:38,xl:46},Yn={size:String};function Zn(e,t=$r){return R(()=>e.size!==void 0?{fontSize:e.size in t?`${t[e.size]}px`:e.size}:null)}const $e=e=>vn(Lo(e)),xh=e=>vn(e);function tt(e,t){return e!==void 0&&e()||t}function $m(e,t){if(e!==void 0){const n=e();if(n!=null)return n.slice()}return t}function It(e,t){return e!==void 0?t.concat(e()):t}function Ch(e,t){return e===void 0?t:t!==void 0?t.concat(e()):e()}function Lm(e,t,n,o,r,i){t.key=o+r;const s=E(e,t,n);return r===!0?ql(s,i()):s}const Es="0 0 24 24",Ss=e=>e,ar=e=>`ionicons ${e}`,Ra={"mdi-":e=>`mdi ${e}`,"icon-":Ss,"bt-":e=>`bt ${e}`,"eva-":e=>`eva ${e}`,"ion-md":ar,"ion-ios":ar,"ion-logo":ar,"iconfont ":Ss,"ti-":e=>`themify-icon ${e}`,"bi-":e=>`bootstrap-icons ${e}`},Pa={o_:"-outlined",r_:"-round",s_:"-sharp"},Ta={sym_o_:"-outlined",sym_r_:"-rounded",sym_s_:"-sharp"},kh=new RegExp("^("+Object.keys(Ra).join("|")+")"),Eh=new RegExp("^("+Object.keys(Pa).join("|")+")"),Rs=new RegExp("^("+Object.keys(Ta).join("|")+")"),Sh=/^[Mm]\s?[-+]?\.?\d/,Rh=/^img:/,Ph=/^svguse:/,Th=/^ion-/,qh=/^(fa-(sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /;var pt=$e({name:"QIcon",props:{...Yn,tag:{type:String,default:"i"},name:String,color:String,left:Boolean,right:Boolean},setup(e,{slots:t}){const{proxy:{$q:n}}=ke(),o=Zn(e),r=R(()=>"q-icon"+(e.left===!0?" on-left":"")+(e.right===!0?" on-right":"")+(e.color!==void 0?` text-${e.color}`:"")),i=R(()=>{let s,l=e.name;if(l==="none"||!l)return{none:!0};if(n.iconMapFn!==null){const u=n.iconMapFn(l);if(u!==void 0)if(u.icon!==void 0){if(l=u.icon,l==="none"||!l)return{none:!0}}else return{cls:u.cls,content:u.content!==void 0?u.content:" "}}if(Sh.test(l)===!0){const[u,d=Es]=l.split("|");return{svg:!0,viewBox:d,nodes:u.split("&&").map(f=>{const[p,y,T]=f.split("@@");return E("path",{style:y,d:p,transform:T})})}}if(Rh.test(l)===!0)return{img:!0,src:l.substring(4)};if(Ph.test(l)===!0){const[u,d=Es]=l.split("|");return{svguse:!0,src:u.substring(7),viewBox:d}}let a=" ";const c=l.match(kh);if(c!==null)s=Ra[c[1]](l);else if(qh.test(l)===!0)s=l;else if(Th.test(l)===!0)s=`ionicons ion-${n.platform.is.ios===!0?"ios":"md"}${l.substring(3)}`;else if(Rs.test(l)===!0){s="notranslate material-symbols";const u=l.match(Rs);u!==null&&(l=l.substring(6),s+=Ta[u[1]]),a=l}else{s="notranslate material-icons";const u=l.match(Eh);u!==null&&(l=l.substring(2),s+=Pa[u[1]]),a=l}return{cls:s,content:a}});return()=>{const s={class:r.value,style:o.value,"aria-hidden":"true",role:"presentation"};return i.value.none===!0?E(e.tag,s,tt(t.default)):i.value.img===!0?E("span",s,It(t.default,[E("img",{src:i.value.src})])):i.value.svg===!0?E("span",s,It(t.default,[E("svg",{viewBox:i.value.viewBox||"0 0 24 24"},i.value.nodes)])):i.value.svguse===!0?E("span",s,It(t.default,[E("svg",{viewBox:i.value.viewBox},[E("use",{"xlink:href":i.value.src})])])):(i.value.cls!==void 0&&(s.class+=" "+i.value.cls),E(e.tag,s,It(t.default,[i.value.content])))}}}),Ah=$e({name:"QAvatar",props:{...Yn,fontSize:String,color:String,textColor:String,icon:String,square:Boolean,rounded:Boolean},setup(e,{slots:t}){const n=Zn(e),o=R(()=>"q-avatar"+(e.color?` bg-${e.color}`:"")+(e.textColor?` text-${e.textColor} q-chip--colored`:"")+(e.square===!0?" q-avatar--square":e.rounded===!0?" rounded-borders":"")),r=R(()=>e.fontSize?{fontSize:e.fontSize}:null);return()=>{const i=e.icon!==void 0?[E(pt,{name:e.icon})]:void 0;return E("div",{class:o.value,style:n.value},[E("div",{class:"q-avatar__content row flex-center overflow-hidden",style:r.value},Ch(t.default,i))])}}});const Mh={size:{type:[Number,String],default:"1em"},color:String};function Oh(e){return{cSize:R(()=>e.size in $r?`${$r[e.size]}px`:e.size),classes:R(()=>"q-spinner"+(e.color?` text-${e.color}`:""))}}var Un=$e({name:"QSpinner",props:{...Mh,thickness:{type:Number,default:5}},setup(e){const{cSize:t,classes:n}=Oh(e);return()=>E("svg",{class:n.value+" q-spinner-mat",width:t.value,height:t.value,viewBox:"25 25 50 50"},[E("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none",stroke:"currentColor","stroke-width":e.thickness,"stroke-miterlimit":"10"})])}});function Bm(e){return e===window?window.innerHeight:e.getBoundingClientRect().height}function Lr(e,t){const n=e.style;for(const o in t)n[o]=t[o]}function $h(e){if(e==null)return;if(typeof e=="string")try{return document.querySelector(e)||void 0}catch{return}const t=Vt(e);if(t)return t.$el||t}function Lh(e,t){if(e==null||e.contains(t)===!0)return!0;for(let n=e.nextElementSibling;n!==null;n=n.nextElementSibling)if(n.contains(t))return!0;return!1}function Bh(e,t=250){let n=!1,o;return function(){return n===!1&&(n=!0,setTimeout(()=>{n=!1},t),o=e.apply(this,arguments)),o}}function Ps(e,t,n,o){n.modifiers.stop===!0&&ko(e);const r=n.modifiers.color;let i=n.modifiers.center;i=i===!0||o===!0;const s=document.createElement("span"),l=document.createElement("span"),a=Vf(e),{left:c,top:u,width:d,height:f}=t.getBoundingClientRect(),p=Math.sqrt(d*d+f*f),y=p/2,T=`${(d-p)/2}px`,q=i?T:`${a.left-c-y}px`,M=`${(f-p)/2}px`,m=i?M:`${a.top-u-y}px`;l.className="q-ripple__inner",Lr(l,{height:`${p}px`,width:`${p}px`,transform:`translate3d(${q},${m},0) scale3d(.2,.2,1)`,opacity:0}),s.className=`q-ripple${r?" text-"+r:""}`,s.setAttribute("dir","ltr"),s.appendChild(l),t.appendChild(s);const _=()=>{s.remove(),clearTimeout(w)};n.abort.push(_);let w=setTimeout(()=>{l.classList.add("q-ripple__inner--enter"),l.style.transform=`translate3d(${T},${M},0) scale3d(1,1,1)`,l.style.opacity=.2,w=setTimeout(()=>{l.classList.remove("q-ripple__inner--enter"),l.classList.add("q-ripple__inner--leave"),l.style.opacity=0,w=setTimeout(()=>{s.remove(),n.abort.splice(n.abort.indexOf(_),1)},275)},250)},50)}function Ts(e,{modifiers:t,value:n,arg:o}){const r=Object.assign({},e.cfg.ripple,t,n);e.modifiers={early:r.early===!0,stop:r.stop===!0,center:r.center===!0,color:r.color||o,keyCodes:[].concat(r.keyCodes||13)}}var Fh=xh({name:"ripple",beforeMount(e,t){const n=t.instance.$.appContext.config.globalProperties.$q.config||{};if(n.ripple===!1)return;const o={cfg:n,enabled:t.value!==!1,modifiers:{},abort:[],start(r){o.enabled===!0&&r.qSkipRipple!==!0&&r.type===(o.modifiers.early===!0?"pointerdown":"click")&&Ps(r,e,o,r.qKeyEvent===!0)},keystart:Bh(r=>{o.enabled===!0&&r.qSkipRipple!==!0&&zn(r,o.modifiers.keyCodes)===!0&&r.type===`key${o.modifiers.early===!0?"down":"up"}`&&Ps(r,e,o,!0)},300)};Ts(o,t),e.__qripple=o,Hf(o,"main",[[e,"pointerdown","start","passive"],[e,"click","start","passive"],[e,"keydown","keystart","passive"],[e,"keyup","keystart","passive"]])},updated(e,t){if(t.oldValue!==t.value){const n=e.__qripple;n!==void 0&&(n.enabled=t.value!==!1,n.enabled===!0&&Object(t.value)===t.value&&Ts(n,t))}},beforeUnmount(e){const t=e.__qripple;t!==void 0&&(t.abort.forEach(n=>{n()}),zf(t,"main"),delete e._qripple)}});const qa={left:"start",center:"center",right:"end",between:"between",around:"around",evenly:"evenly",stretch:"stretch"},Ih=Object.keys(qa),Aa={align:{type:String,validator:e=>Ih.includes(e)}};function Ma(e){return R(()=>{const t=e.align===void 0?e.vertical===!0?"stretch":"left":e.align;return`${e.vertical===!0?"items":"justify"}-${qa[t]}`})}function go(e){if(Object(e.$parent)===e.$parent)return e.$parent;let{parent:t}=e.$;for(;Object(t)===t;){if(Object(t.proxy)===t.proxy)return t.proxy;t=t.parent}}function Oa(e,t){typeof t.type=="symbol"?Array.isArray(t.children)===!0&&t.children.forEach(n=>{Oa(e,n)}):e.add(t)}function Fm(e){const t=new Set;return e.forEach(n=>{Oa(t,n)}),Array.from(t)}function $a(e){return e.appContext.config.globalProperties.$router!==void 0}function La(e){return e.isUnmounted===!0||e.isDeactivated===!0}function qs(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}function As(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Nh(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(Array.isArray(r)===!1||r.length!==o.length||o.some((i,s)=>i!==r[s]))return!1}return!0}function Ms(e,t){return Array.isArray(t)===!0?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function jh(e,t){return Array.isArray(e)===!0?Ms(e,t):Array.isArray(t)===!0?Ms(t,e):e===t}function Vh(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(jh(e[n],t[n])===!1)return!1;return!0}const Dh={to:[String,Object],replace:Boolean,exact:Boolean,activeClass:{type:String,default:"q-router-link--active"},exactActiveClass:{type:String,default:"q-router-link--exact-active"},href:String,target:String,disable:Boolean};function Hh({fallbackTag:e,useDisableForRouterLinkProps:t=!0}={}){const n=ke(),{props:o,proxy:r,emit:i}=n,s=$a(n),l=R(()=>o.disable!==!0&&o.href!==void 0),a=R(t===!0?()=>s===!0&&o.disable!==!0&&l.value!==!0&&o.to!==void 0&&o.to!==null&&o.to!=="":()=>s===!0&&l.value!==!0&&o.to!==void 0&&o.to!==null&&o.to!==""),c=R(()=>a.value===!0?m(o.to):null),u=R(()=>c.value!==null),d=R(()=>l.value===!0||u.value===!0),f=R(()=>o.type==="a"||d.value===!0?"a":o.tag||e||"div"),p=R(()=>l.value===!0?{href:o.href,target:o.target}:u.value===!0?{href:c.value.href,target:o.target}:{}),y=R(()=>{if(u.value===!1)return-1;const{matched:F}=c.value,{length:j}=F,V=F[j-1];if(V===void 0)return-1;const N=r.$route.matched;if(N.length===0)return-1;const C=N.findIndex(As.bind(null,V));if(C>-1)return C;const x=qs(F[j-2]);return j>1&&qs(V)===x&&N[N.length-1].path!==x?N.findIndex(As.bind(null,F[j-2])):C}),T=R(()=>u.value===!0&&y.value!==-1&&Nh(r.$route.params,c.value.params)),q=R(()=>T.value===!0&&y.value===r.$route.matched.length-1&&Vh(r.$route.params,c.value.params)),M=R(()=>u.value===!0?q.value===!0?` ${o.exactActiveClass} ${o.activeClass}`:o.exact===!0?"":T.value===!0?` ${o.activeClass}`:"":"");function m(F){try{return r.$router.resolve(F)}catch{}return null}function _(F,{returnRouterError:j,to:V=o.to,replace:N=o.replace}={}){if(o.disable===!0)return F.preventDefault(),Promise.resolve(!1);if(F.metaKey||F.altKey||F.ctrlKey||F.shiftKey||F.button!==void 0&&F.button!==0||o.target==="_blank")return Promise.resolve(!1);F.preventDefault();const C=r.$router[N===!0?"replace":"push"](V);return j===!0?C:C.then(()=>{}).catch(()=>{})}function w(F){if(u.value===!0){const j=V=>_(F,V);i("click",F,j),F.defaultPrevented!==!0&&j()}else i("click",F)}return{hasRouterLink:u,hasHrefLink:l,hasLink:d,linkTag:f,resolvedLink:c,linkIsActive:T,linkIsExactActive:q,linkClass:M,linkAttrs:p,getLink:m,navigateToRouterLink:_,navigateOnClick:w}}const Os={none:0,xs:4,sm:8,md:16,lg:24,xl:32},zh={xs:8,sm:10,md:14,lg:20,xl:24},Kh=["button","submit","reset"],Uh=/[^\s]\/[^\s]/,Wh=["flat","outline","push","unelevated"],Ba=(e,t)=>e.flat===!0?"flat":e.outline===!0?"outline":e.push===!0?"push":e.unelevated===!0?"unelevated":t,Im=e=>{const t=Ba(e);return t!==void 0?{[t]:!0}:{}},Qh={...Yn,...Dh,type:{type:String,default:"button"},label:[Number,String],icon:String,iconRight:String,...Wh.reduce((e,t)=>(e[t]=Boolean)&&e,{}),square:Boolean,round:Boolean,rounded:Boolean,glossy:Boolean,size:String,fab:Boolean,fabMini:Boolean,padding:String,color:String,textColor:String,noCaps:Boolean,noWrap:Boolean,dense:Boolean,tabindex:[Number,String],ripple:{type:[Boolean,Object],default:!0},align:{...Aa.align,default:"center"},stack:Boolean,stretch:Boolean,loading:{type:Boolean,default:null},disable:Boolean};function Yh(e){const t=Zn(e,zh),n=Ma(e),{hasRouterLink:o,hasLink:r,linkTag:i,linkAttrs:s,navigateOnClick:l}=Hh({fallbackTag:"button"}),a=R(()=>{const q=e.fab===!1&&e.fabMini===!1?t.value:{};return e.padding!==void 0?Object.assign({},q,{padding:e.padding.split(/\s+/).map(M=>M in Os?Os[M]+"px":M).join(" "),minWidth:"0",minHeight:"0"}):q}),c=R(()=>e.rounded===!0||e.fab===!0||e.fabMini===!0),u=R(()=>e.disable!==!0&&e.loading!==!0),d=R(()=>u.value===!0?e.tabindex||0:-1),f=R(()=>Ba(e,"standard")),p=R(()=>{const q={tabindex:d.value};return r.value===!0?Object.assign(q,s.value):Kh.includes(e.type)===!0&&(q.type=e.type),i.value==="a"?(e.disable===!0?q["aria-disabled"]="true":q.href===void 0&&(q.role="button"),o.value!==!0&&Uh.test(e.type)===!0&&(q.type=e.type)):e.disable===!0&&(q.disabled="",q["aria-disabled"]="true"),e.loading===!0&&e.percentage!==void 0&&Object.assign(q,{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.percentage}),q}),y=R(()=>{let q;e.color!==void 0?e.flat===!0||e.outline===!0?q=`text-${e.textColor||e.color}`:q=`bg-${e.color} text-${e.textColor||"white"}`:e.textColor&&(q=`text-${e.textColor}`);const M=e.round===!0?"round":`rectangle${c.value===!0?" q-btn--rounded":e.square===!0?" q-btn--square":""}`;return`q-btn--${f.value} q-btn--${M}`+(q!==void 0?" "+q:"")+(u.value===!0?" q-btn--actionable q-focusable q-hoverable":e.disable===!0?" disabled":"")+(e.fab===!0?" q-btn--fab":e.fabMini===!0?" q-btn--fab-mini":"")+(e.noCaps===!0?" q-btn--no-uppercase":"")+(e.dense===!0?" q-btn--dense":"")+(e.stretch===!0?" no-border-radius self-stretch":"")+(e.glossy===!0?" glossy":"")+(e.square?" q-btn--square":"")}),T=R(()=>n.value+(e.stack===!0?" column":" row")+(e.noWrap===!0?" no-wrap text-no-wrap":"")+(e.loading===!0?" q-btn__content--hidden":""));return{classes:y,style:a,innerClasses:T,attributes:p,hasLink:r,linkTag:i,navigateOnClick:l,isActionable:u}}const{passiveCapture:He}=Be;let Jt=null,Xt=null,Gt=null;var Br=$e({name:"QBtn",props:{...Qh,percentage:Number,darkPercentage:Boolean,onTouchstart:[Function,Array]},emits:["click","keydown","mousedown","keyup"],setup(e,{slots:t,emit:n}){const{proxy:o}=ke(),{classes:r,style:i,innerClasses:s,attributes:l,hasLink:a,linkTag:c,navigateOnClick:u,isActionable:d}=Yh(e),f=he(null),p=he(null);let y=null,T,q=null;const M=R(()=>e.label!==void 0&&e.label!==null&&e.label!==""),m=R(()=>e.disable===!0||e.ripple===!1?!1:{keyCodes:a.value===!0?[13,32]:[13],...e.ripple===!0?{}:e.ripple}),_=R(()=>({center:e.round})),w=R(()=>{const k=Math.max(0,Math.min(100,e.percentage));return k>0?{transition:"transform 0.6s",transform:`translateX(${k-100}%)`}:{}}),F=R(()=>{if(e.loading===!0)return{onMousedown:H,onTouchstart:H,onClick:H,onKeydown:H,onKeyup:H};if(d.value===!0){const k={onClick:V,onKeydown:N,onMousedown:x};if(o.$q.platform.has.touch===!0){const Z=e.onTouchstart!==void 0?"":"Passive";k[`onTouchstart${Z}`]=C}return k}return{onClick:Ke}}),j=R(()=>({ref:f,class:"q-btn q-btn-item non-selectable no-outline "+r.value,style:i.value,...l.value,...F.value}));function V(k){if(f.value!==null){if(k!==void 0){if(k.defaultPrevented===!0)return;const Z=document.activeElement;if(e.type==="submit"&&Z!==document.body&&f.value.contains(Z)===!1&&Z.contains(f.value)===!1){f.value.focus();const Y=()=>{document.removeEventListener("keydown",Ke,!0),document.removeEventListener("keyup",Y,He),f.value!==null&&f.value.removeEventListener("blur",Y,He)};document.addEventListener("keydown",Ke,!0),document.addEventListener("keyup",Y,He),f.value.addEventListener("blur",Y,He)}}u(k)}}function N(k){f.value!==null&&(n("keydown",k),zn(k,[13,32])===!0&&Xt!==f.value&&(Xt!==null&&v(),k.defaultPrevented!==!0&&(f.value.focus(),Xt=f.value,f.value.classList.add("q-btn--active"),document.addEventListener("keyup",$,!0),f.value.addEventListener("blur",$,He)),Ke(k)))}function C(k){f.value!==null&&(n("touchstart",k),k.defaultPrevented!==!0&&(Jt!==f.value&&(Jt!==null&&v(),Jt=f.value,y=k.target,y.addEventListener("touchcancel",$,He),y.addEventListener("touchend",$,He)),T=!0,q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,T=!1},200)))}function x(k){f.value!==null&&(k.qSkipRipple=T===!0,n("mousedown",k),k.defaultPrevented!==!0&&Gt!==f.value&&(Gt!==null&&v(),Gt=f.value,f.value.classList.add("q-btn--active"),document.addEventListener("mouseup",$,He)))}function $(k){if(f.value!==null&&!(k!==void 0&&k.type==="blur"&&document.activeElement===f.value)){if(k!==void 0&&k.type==="keyup"){if(Xt===f.value&&zn(k,[13,32])===!0){const Z=new MouseEvent("click",k);Z.qKeyEvent=!0,k.defaultPrevented===!0&&Et(Z),k.cancelBubble===!0&&ko(Z),f.value.dispatchEvent(Z),Ke(k),k.qKeyEvent=!0}n("keyup",k)}v()}}function v(k){const Z=p.value;k!==!0&&(Jt===f.value||Gt===f.value)&&Z!==null&&Z!==document.activeElement&&(Z.setAttribute("tabindex",-1),Z.focus()),Jt===f.value&&(y!==null&&(y.removeEventListener("touchcancel",$,He),y.removeEventListener("touchend",$,He)),Jt=y=null),Gt===f.value&&(document.removeEventListener("mouseup",$,He),Gt=null),Xt===f.value&&(document.removeEventListener("keyup",$,!0),f.value!==null&&f.value.removeEventListener("blur",$,He),Xt=null),f.value!==null&&f.value.classList.remove("q-btn--active")}function H(k){Ke(k),k.qSkipRipple=!0}return We(()=>{v(!0)}),Object.assign(o,{click:V}),()=>{let k=[];e.icon!==void 0&&k.push(E(pt,{name:e.icon,left:e.stack===!1&&M.value===!0,role:"img","aria-hidden":"true"})),M.value===!0&&k.push(E("span",{class:"block"},[e.label])),k=It(t.default,k),e.iconRight!==void 0&&e.round===!1&&k.push(E(pt,{name:e.iconRight,right:e.stack===!1&&M.value===!0,role:"img","aria-hidden":"true"}));const Z=[E("span",{class:"q-focus-helper",ref:p})];return e.loading===!0&&e.percentage!==void 0&&Z.push(E("span",{class:"q-btn__progress absolute-full overflow-hidden"+(e.darkPercentage===!0?" q-btn__progress--dark":"")},[E("span",{class:"q-btn__progress-indicator fit block",style:w.value})])),Z.push(E("span",{class:"q-btn__content text-center col items-center q-anchor--skip "+s.value},k)),e.loading!==null&&Z.push(E(cn,{name:"q-transition--fade"},()=>e.loading===!0?[E("span",{key:"loading",class:"absolute-full flex flex-center"},t.loading!==void 0?t.loading():[E(Un)])]:null)),ql(E(c.value,j.value,Z),[[Fh,m.value,void 0,_.value]])}}});let Zh=1,Jh=document.body;function di(e,t){const n=document.createElement("div");if(n.id=t!==void 0?`q-portal--${t}--${Zh++}`:e,So.globalNodes!==void 0){const o=So.globalNodes.class;o!==void 0&&(n.className=o)}return Jh.appendChild(n),n}function Fa(e){e.remove()}let Xh=0;const mo={},po={},Je={},Ia={},Gh=/^\s*$/,Na=[],hi=["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right","center"],eg=["top-left","top-right","bottom-left","bottom-right"],tn={positive:{icon:e=>e.iconSet.type.positive,color:"positive"},negative:{icon:e=>e.iconSet.type.negative,color:"negative"},warning:{icon:e=>e.iconSet.type.warning,color:"warning",textColor:"dark"},info:{icon:e=>e.iconSet.type.info,color:"info"},ongoing:{group:!1,timeout:0,spinner:!0,color:"grey-8"}};function ja(e,t,n){if(!e)return Cn("parameter required");let o;const r={textColor:"white"};if(e.ignoreDefaults!==!0&&Object.assign(r,mo),at(e)===!1&&(r.type&&Object.assign(r,tn[r.type]),e={message:e}),Object.assign(r,tn[e.type||r.type],e),typeof r.icon=="function"&&(r.icon=r.icon(t)),r.spinner?(r.spinner===!0&&(r.spinner=Un),r.spinner=vn(r.spinner)):r.spinner=!1,r.meta={hasMedia:Boolean(r.spinner!==!1||r.icon||r.avatar),hasText:$s(r.message)||$s(r.caption)},r.position){if(hi.includes(r.position)===!1)return Cn("wrong position",e)}else r.position="bottom";if(r.timeout===void 0)r.timeout=5e3;else{const a=parseInt(r.timeout,10);if(isNaN(a)||a<0)return Cn("wrong timeout",e);r.timeout=a}r.timeout===0?r.progress=!1:r.progress===!0&&(r.meta.progressClass="q-notification__progress"+(r.progressClass?` ${r.progressClass}`:""),r.meta.progressStyle={animationDuration:`${r.timeout+1e3}ms`});const i=(Array.isArray(e.actions)===!0?e.actions:[]).concat(e.ignoreDefaults!==!0&&Array.isArray(mo.actions)===!0?mo.actions:[]).concat(tn[e.type]!==void 0&&Array.isArray(tn[e.type].actions)===!0?tn[e.type].actions:[]),{closeBtn:s}=r;if(s&&i.push({label:typeof s=="string"?s:t.lang.label.close}),r.actions=i.map(({handler:a,noDismiss:c,...u})=>({flat:!0,...u,onClick:typeof a=="function"?()=>{a(),c!==!0&&l()}:()=>{l()}})),r.multiLine===void 0&&(r.multiLine=r.actions.length>1),Object.assign(r.meta,{class:`q-notification row items-stretch q-notification--${r.multiLine===!0?"multi-line":"standard"}`+(r.color!==void 0?` bg-${r.color}`:"")+(r.textColor!==void 0?` text-${r.textColor}`:"")+(r.classes!==void 0?` ${r.classes}`:""),wrapperClass:"q-notification__wrapper col relative-position border-radius-inherit "+(r.multiLine===!0?"column no-wrap justify-center":"row items-center"),contentClass:"q-notification__content row items-center"+(r.multiLine===!0?"":" col"),leftClass:r.meta.hasText===!0?"additional":"single",attrs:{role:"alert",...r.attrs}}),r.group===!1?(r.group=void 0,r.meta.group=void 0):((r.group===void 0||r.group===!0)&&(r.group=[r.message,r.caption,r.multiline].concat(r.actions.map(a=>`${a.label}*${a.icon}`)).join("|")),r.meta.group=r.group+"|"+r.position),r.actions.length===0?r.actions=void 0:r.meta.actionsClass="q-notification__actions row items-center "+(r.multiLine===!0?"justify-end":"col-auto")+(r.meta.hasMedia===!0?" q-notification__actions--with-media":""),n!==void 0){n.notif.meta.timer&&(clearTimeout(n.notif.meta.timer),n.notif.meta.timer=void 0),r.meta.uid=n.notif.meta.uid;const a=Je[r.position].value.indexOf(n.notif);Je[r.position].value[a]=r}else{const a=po[r.meta.group];if(a===void 0){if(r.meta.uid=Xh++,r.meta.badge=1,["left","right","center"].indexOf(r.position)!==-1)Je[r.position].value.splice(Math.floor(Je[r.position].value.length/2),0,r);else{const c=r.position.indexOf("top")>-1?"unshift":"push";Je[r.position].value[c](r)}r.group!==void 0&&(po[r.meta.group]=r)}else{if(a.meta.timer&&(clearTimeout(a.meta.timer),a.meta.timer=void 0),r.badgePosition!==void 0){if(eg.includes(r.badgePosition)===!1)return Cn("wrong badgePosition",e)}else r.badgePosition=`top-${r.position.indexOf("left")>-1?"right":"left"}`;r.meta.uid=a.meta.uid,r.meta.badge=a.meta.badge+1,r.meta.badgeClass=`q-notification__badge q-notification__badge--${r.badgePosition}`+(r.badgeColor!==void 0?` bg-${r.badgeColor}`:"")+(r.badgeTextColor!==void 0?` text-${r.badgeTextColor}`:"")+(r.badgeClass?` ${r.badgeClass}`:"");const c=Je[r.position].value.indexOf(a);Je[r.position].value[c]=po[r.meta.group]=r}}const l=()=>{tg(r),o=void 0};if(r.timeout>0&&(r.meta.timer=setTimeout(()=>{r.meta.timer=void 0,l()},r.timeout+1e3)),r.group!==void 0)return a=>{a!==void 0?Cn("trying to update a grouped one which is forbidden",e):l()};if(o={dismiss:l,config:e,notif:r},n!==void 0){Object.assign(n,o);return}return a=>{if(o!==void 0)if(a===void 0)o.dismiss();else{const c=Object.assign({},o.config,a,{group:!1,position:r.position});ja(c,t,o)}}}function tg(e){e.meta.timer&&(clearTimeout(e.meta.timer),e.meta.timer=void 0);const t=Je[e.position].value.indexOf(e);if(t!==-1){e.group!==void 0&&delete po[e.meta.group];const n=Na[""+e.meta.uid];if(n){const{width:o,height:r}=getComputedStyle(n);n.style.left=`${n.offsetLeft}px`,n.style.width=o,n.style.height=r}Je[e.position].value.splice(t,1),typeof e.onDismiss=="function"&&e.onDismiss()}}function $s(e){return e!=null&&Gh.test(e)!==!0}function Cn(e,t){return console.error(`Notify: ${e}`,t),!1}function ng(){return $e({name:"QNotifications",devtools:{hide:!0},setup(){return()=>E("div",{class:"q-notifications"},hi.map(e=>E(Rf,{key:e,class:Ia[e],tag:"div",name:`q-notification--${e}`},()=>Je[e].value.map(t=>{const n=t.meta,o=[];if(n.hasMedia===!0&&(t.spinner!==!1?o.push(E(t.spinner,{class:"q-notification__spinner q-notification__spinner--"+n.leftClass,color:t.spinnerColor,size:t.spinnerSize})):t.icon?o.push(E(pt,{class:"q-notification__icon q-notification__icon--"+n.leftClass,name:t.icon,color:t.iconColor,size:t.iconSize,role:"img"})):t.avatar&&o.push(E(Ah,{class:"q-notification__avatar q-notification__avatar--"+n.leftClass},()=>E("img",{src:t.avatar,"aria-hidden":"true"})))),n.hasText===!0){let i;const s={class:"q-notification__message col"};if(t.html===!0)s.innerHTML=t.caption?`
${t.message}
${t.caption}
`:t.message;else{const l=[t.message];i=t.caption?[E("div",l),E("div",{class:"q-notification__caption"},[t.caption])]:l}o.push(E("div",s,i))}const r=[E("div",{class:n.contentClass},o)];return t.progress===!0&&r.push(E("div",{key:`${n.uid}|p|${n.badge}`,class:n.progressClass,style:n.progressStyle})),t.actions!==void 0&&r.push(E("div",{class:n.actionsClass},t.actions.map(i=>E(Br,i)))),n.badge>1&&r.push(E("div",{key:`${n.uid}|${n.badge}`,class:t.meta.badgeClass,style:t.badgeStyle},[n.badge])),E("div",{ref:i=>{Na[""+n.uid]=i},key:n.uid,class:n.class,...n.attrs},[E("div",{class:n.wrapperClass},r)])}))))}})}var og={setDefaults(e){at(e)===!0&&Object.assign(mo,e)},registerType(e,t){at(t)===!0&&(tn[e]=t)},install({$q:e,parentApp:t}){if(e.notify=this.create=n=>ja(n,e),e.notify.setDefaults=this.setDefaults,e.notify.registerType=this.registerType,e.config.notify!==void 0&&this.setDefaults(e.config.notify),this.__installed!==!0){hi.forEach(o=>{Je[o]=he([]);const r=["left","center","right"].includes(o)===!0?"center":o.indexOf("top")>-1?"top":"bottom",i=o.indexOf("left")>-1?"start":o.indexOf("right")>-1?"end":"center",s=["left","right"].includes(o)?`items-${o==="left"?"start":"end"} justify-center`:o==="center"?"flex-center":`items-${i}`;Ia[o]=`q-notifications__list q-notifications__list--${r} fixed column no-wrap ${s}`});const n=di("q-notify");ma(ng(),t).mount(n)}}};function rg(e){return id(e)===!0?"__q_date|"+e.toUTCString():sd(e)===!0?"__q_expr|"+e.source:typeof e=="number"?"__q_numb|"+e:typeof e=="boolean"?"__q_bool|"+(e?"1":"0"):typeof e=="string"?"__q_strn|"+e:typeof e=="function"?"__q_strn|"+e.toString():e===Object(e)?"__q_objt|"+JSON.stringify(e):e}function ig(e){if(e.length<9)return e;const n=e.substring(0,8),o=e.substring(9);switch(n){case"__q_date":return new Date(o);case"__q_expr":return new RegExp(o);case"__q_numb":return Number(o);case"__q_bool":return Boolean(o==="1");case"__q_strn":return""+o;case"__q_objt":return JSON.parse(o);default:return e}}function sg(){const e=()=>null;return{has:()=>!1,getLength:()=>0,getItem:e,getIndex:e,getKey:e,getAll:()=>{},getAllKeys:()=>[],set:Pt,remove:Pt,clear:Pt,isEmpty:()=>!0}}function lg(e){const t=window[e+"Storage"],n=o=>{const r=t.getItem(o);return r?ig(r):null};return{has:o=>t.getItem(o)!==null,getLength:()=>t.length,getItem:n,getIndex:o=>oo{let o;const r={},i=t.length;for(let s=0;s{const o=[],r=t.length;for(let i=0;i{t.setItem(o,rg(r))},remove:o=>{t.removeItem(o)},clear:()=>{t.clear()},isEmpty:()=>t.length===0}}const Va=we.has.webStorage===!1?sg():lg("local"),Da={install({$q:e}){e.localStorage=Va}};Object.assign(Da,Va);function ag(e,t,n){let o;function r(){o!==void 0&&(qr.remove(o),o=void 0)}return We(()=>{e.value===!0&&r()}),{removeFromHistory:r,addToHistory(){o={condition:()=>n.value===!0,handler:t},qr.add(o)}}}function ug(){let e=null;const t=ke();function n(){e!==null&&(clearTimeout(e),e=null)}return Fo(n),We(n),{removeTimeout:n,registerTimeout(o,r){n(),La(t)===!1&&(e=setTimeout(o,r))}}}function cg(){let e;const t=ke();function n(){e=void 0}return Fo(n),We(n),{removeTick:n,registerTick(o){e=o,je(()=>{e===o&&(La(t)===!1&&e(),e=void 0)})}}}const fg={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},dg=["beforeShow","show","beforeHide","hide"];function hg({showing:e,canShow:t,hideOnRouteChange:n,handleShow:o,handleHide:r,processOnMount:i}){const s=ke(),{props:l,emit:a,proxy:c}=s;let u;function d(m){e.value===!0?y(m):f(m)}function f(m){if(l.disable===!0||m!==void 0&&m.qAnchorHandled===!0||t!==void 0&&t(m)!==!0)return;const _=l["onUpdate:modelValue"]!==void 0;_===!0&&(a("update:modelValue",!0),u=m,je(()=>{u===m&&(u=void 0)})),(l.modelValue===null||_===!1)&&p(m)}function p(m){e.value!==!0&&(e.value=!0,a("beforeShow",m),o!==void 0?o(m):a("show",m))}function y(m){if(l.disable===!0)return;const _=l["onUpdate:modelValue"]!==void 0;_===!0&&(a("update:modelValue",!1),u=m,je(()=>{u===m&&(u=void 0)})),(l.modelValue===null||_===!1)&&T(m)}function T(m){e.value!==!1&&(e.value=!1,a("beforeHide",m),r!==void 0?r(m):a("hide",m))}function q(m){l.disable===!0&&m===!0?l["onUpdate:modelValue"]!==void 0&&a("update:modelValue",!1):m===!0!==e.value&&(m===!0?p:T)(u)}be(()=>l.modelValue,q),n!==void 0&&$a(s)===!0&&be(()=>c.$route.fullPath,()=>{n.value===!0&&e.value===!0&&y()}),i===!0&&Ut(()=>{q(l.modelValue)});const M={show:f,hide:y,toggle:d};return Object.assign(c,M),M}const gg={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function mg(e,t=()=>{},n=()=>{}){return{transitionProps:R(()=>{const o=`q-transition--${e.transitionShow||t()}`,r=`q-transition--${e.transitionHide||n()}`;return{appear:!0,enterFromClass:`${o}-enter-from`,enterActiveClass:`${o}-enter-active`,enterToClass:`${o}-enter-to`,leaveFromClass:`${r}-leave-from`,leaveActiveClass:`${r}-leave-active`,leaveToClass:`${r}-leave-to`}}),transitionStyle:R(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}let Nt=[],Wn=[];function Ha(e){Wn=Wn.filter(t=>t!==e)}function pg(e){Ha(e),Wn.push(e)}function Ls(e){Ha(e),Wn.length===0&&Nt.length!==0&&(Nt[Nt.length-1](),Nt=[])}function gi(e){Wn.length===0?e():Nt.push(e)}function vg(e){Nt=Nt.filter(t=>t!==e)}const vo=[];function Nm(e){return vo.find(t=>t.contentEl!==null&&t.contentEl.contains(e))}function bg(e,t){do{if(e.$options.name==="QMenu"){if(e.hide(t),e.$props.separateClosePopup===!0)return go(e)}else if(e.__qPortal===!0){const n=go(e);return n!==void 0&&n.$options.name==="QPopupProxy"?(e.hide(t),n):e}e=go(e)}while(e!=null)}function jm(e,t,n){for(;n!==0&&e!==void 0&&e!==null;){if(e.__qPortal===!0){if(n--,e.$options.name==="QMenu"){e=bg(e,t);continue}e.hide(t)}e=go(e)}}function yg(e){for(e=e.parent;e!=null;){if(e.type.name==="QGlobalDialog")return!0;if(e.type.name==="QDialog"||e.type.name==="QMenu")return!1;e=e.parent}return!1}function _g(e,t,n,o){const r=he(!1),i=he(!1);let s=null;const l={},a=o==="dialog"&&yg(e);function c(d){if(d===!0){Ls(l),i.value=!0;return}i.value=!1,r.value===!1&&(a===!1&&s===null&&(s=di(!1,o)),r.value=!0,vo.push(e.proxy),pg(l))}function u(d){if(i.value=!1,d!==!0)return;Ls(l),r.value=!1;const f=vo.indexOf(e.proxy);f!==-1&&vo.splice(f,1),s!==null&&(Fa(s),s=null)}return ri(()=>{u(!0)}),e.proxy.__qPortal=!0,bn(e.proxy,"contentEl",()=>t.value),{showPortal:c,hidePortal:u,portalIsActive:r,portalIsAccessible:i,renderPortal:()=>a===!0?n():r.value===!0?[E(Dc,{to:s},n())]:void 0}}const wg=[null,document,document.body,document.scrollingElement,document.documentElement];function Vm(e,t){let n=$h(t);if(n===void 0){if(e==null)return window;n=e.closest(".scroll,.scroll-y,.overflow-auto")}return wg.includes(n)?window:n}function Dm(e){return(e===window?document.body:e).scrollHeight}function za(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function xg(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function Ka(e,t,n=0){const o=arguments[3]===void 0?performance.now():arguments[3],r=za(e);if(n<=0){r!==t&&Fr(e,t);return}requestAnimationFrame(i=>{const s=i-o,l=r+(t-r)/Math.max(s,n)*s;Fr(e,l),l!==t&&Ka(e,t,n-s,i)})}function Fr(e,t){if(e===window){window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,t);return}e.scrollTop=t}function Hm(e,t,n){if(n){Ka(e,t,n);return}Fr(e,t)}let ro;function zm(){if(ro!==void 0)return ro;const e=document.createElement("p"),t=document.createElement("div");Lr(e,{width:"100%",height:"200px"}),Lr(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const n=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),ro=n-o,ro}function Cg(e,t=!0){return!e||e.nodeType!==Node.ELEMENT_NODE?!1:t?e.scrollHeight>e.clientHeight&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-y"])):e.scrollWidth>e.clientWidth&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-x"]))}let kn=0,ur,cr,Tn,fr=!1,Bs,Fs,Is,$t=null;function kg(e){Eg(e)&&Ke(e)}function Eg(e){if(e.target===document.body||e.target.classList.contains("q-layout__backdrop"))return!0;const t=Df(e),n=e.shiftKey&&!e.deltaX,o=!n&&Math.abs(e.deltaX)<=Math.abs(e.deltaY),r=n||o?e.deltaY:e.deltaX;for(let i=0;i0&&s.scrollTop+s.clientHeight===s.scrollHeight:r<0&&s.scrollLeft===0?!0:r>0&&s.scrollLeft+s.clientWidth===s.scrollWidth}return!0}function Ns(e){e.target===document&&(document.scrollingElement.scrollTop=document.scrollingElement.scrollTop)}function io(e){fr!==!0&&(fr=!0,requestAnimationFrame(()=>{fr=!1;const{height:t}=e.target,{clientHeight:n,scrollTop:o}=document.scrollingElement;(Tn===void 0||t!==window.innerHeight)&&(Tn=n-t,document.scrollingElement.scrollTop=o),o>Tn&&(document.scrollingElement.scrollTop-=Math.ceil((o-Tn)/8))}))}function js(e){const t=document.body,n=window.visualViewport!==void 0;if(e==="add"){const{overflowY:o,overflowX:r}=window.getComputedStyle(t);ur=xg(window),cr=za(window),Bs=t.style.left,Fs=t.style.top,Is=window.location.href,t.style.left=`-${ur}px`,t.style.top=`-${cr}px`,r!=="hidden"&&(r==="scroll"||t.scrollWidth>window.innerWidth)&&t.classList.add("q-body--force-scrollbar-x"),o!=="hidden"&&(o==="scroll"||t.scrollHeight>window.innerHeight)&&t.classList.add("q-body--force-scrollbar-y"),t.classList.add("q-body--prevent-scroll"),document.qScrollPrevented=!0,we.is.ios===!0&&(n===!0?(window.scrollTo(0,0),window.visualViewport.addEventListener("resize",io,Be.passiveCapture),window.visualViewport.addEventListener("scroll",io,Be.passiveCapture),window.scrollTo(0,0)):window.addEventListener("scroll",Ns,Be.passiveCapture))}we.is.desktop===!0&&we.is.mac===!0&&window[`${e}EventListener`]("wheel",kg,Be.notPassive),e==="remove"&&(we.is.ios===!0&&(n===!0?(window.visualViewport.removeEventListener("resize",io,Be.passiveCapture),window.visualViewport.removeEventListener("scroll",io,Be.passiveCapture)):window.removeEventListener("scroll",Ns,Be.passiveCapture)),t.classList.remove("q-body--prevent-scroll"),t.classList.remove("q-body--force-scrollbar-x"),t.classList.remove("q-body--force-scrollbar-y"),document.qScrollPrevented=!1,t.style.left=Bs,t.style.top=Fs,window.location.href===Is&&window.scrollTo(ur,cr),Tn=void 0)}function Sg(e){let t="add";if(e===!0){if(kn++,$t!==null){clearTimeout($t),$t=null;return}if(kn>1)return}else{if(kn===0||(kn--,kn>0))return;if(t="remove",we.is.ios===!0&&we.is.nativeMobile===!0){$t!==null&&clearTimeout($t),$t=setTimeout(()=>{js(t),$t=null},100);return}}js(t)}function Rg(){let e;return{preventBodyScroll(t){t!==e&&(e!==void 0||t===!0)&&(e=t,Sg(t))}}}const Ht=[];let hn;function Pg(e){hn=e.keyCode===27}function Tg(){hn===!0&&(hn=!1)}function qg(e){hn===!0&&(hn=!1,zn(e,27)===!0&&Ht[Ht.length-1](e))}function Ua(e){window[e]("keydown",Pg),window[e]("blur",Tg),window[e]("keyup",qg),hn=!1}function Ag(e){we.is.desktop===!0&&(Ht.push(e),Ht.length===1&&Ua("addEventListener"))}function Vs(e){const t=Ht.indexOf(e);t>-1&&(Ht.splice(t,1),Ht.length===0&&Ua("removeEventListener"))}const zt=[];function Wa(e){zt[zt.length-1](e)}function Mg(e){we.is.desktop===!0&&(zt.push(e),zt.length===1&&document.body.addEventListener("focusin",Wa))}function Ds(e){const t=zt.indexOf(e);t>-1&&(zt.splice(t,1),zt.length===0&&document.body.removeEventListener("focusin",Wa))}let so=0;const Og={standard:"fixed-full flex-center",top:"fixed-top justify-center",bottom:"fixed-bottom justify-center",right:"fixed-right items-center",left:"fixed-left items-center"},Hs={standard:["scale","scale"],top:["slide-down","slide-up"],bottom:["slide-up","slide-down"],right:["slide-left","slide-right"],left:["slide-right","slide-left"]};var $g=$e({name:"QDialog",inheritAttrs:!1,props:{...fg,...gg,transitionShow:String,transitionHide:String,persistent:Boolean,autoClose:Boolean,allowFocusOutside:Boolean,noEscDismiss:Boolean,noBackdropDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,noShake:Boolean,seamless:Boolean,maximized:Boolean,fullWidth:Boolean,fullHeight:Boolean,square:Boolean,position:{type:String,default:"standard",validator:e=>e==="standard"||["top","bottom","left","right"].includes(e)}},emits:[...dg,"shake","click","escapeKey"],setup(e,{slots:t,emit:n,attrs:o}){const r=ke(),i=he(null),s=he(!1),l=he(!1);let a=null,c=null,u,d;const f=R(()=>e.persistent!==!0&&e.noRouteDismiss!==!0&&e.seamless!==!0),{preventBodyScroll:p}=Rg(),{registerTimeout:y}=ug(),{registerTick:T,removeTick:q}=cg(),{transitionProps:M,transitionStyle:m}=mg(e,()=>Hs[e.position][0],()=>Hs[e.position][1]),{showPortal:_,hidePortal:w,portalIsAccessible:F,renderPortal:j}=_g(r,i,Re,"dialog"),{hide:V}=hg({showing:s,hideOnRouteChange:f,handleShow:k,handleHide:Z,processOnMount:!0}),{addToHistory:N,removeFromHistory:C}=ag(s,V,f),x=R(()=>`q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized===!0?"maximized":"minimized"} q-dialog__inner--${e.position} ${Og[e.position]}`+(l.value===!0?" q-dialog__inner--animating":"")+(e.fullWidth===!0?" q-dialog__inner--fullwidth":"")+(e.fullHeight===!0?" q-dialog__inner--fullheight":"")+(e.square===!0?" q-dialog__inner--square":"")),$=R(()=>s.value===!0&&e.seamless!==!0),v=R(()=>e.autoClose===!0?{onClick:fe}:{}),H=R(()=>[`q-dialog fullscreen no-pointer-events q-dialog--${$.value===!0?"modal":"seamless"}`,o.class]);be(()=>e.maximized,oe=>{s.value===!0&&se(oe)}),be($,oe=>{p(oe),oe===!0?(Mg(ue),Ag(W)):(Ds(ue),Vs(W))});function k(oe){N(),c=e.noRefocus===!1&&document.activeElement!==null?document.activeElement:null,se(e.maximized),_(),l.value=!0,e.noFocus!==!0?(document.activeElement!==null&&document.activeElement.blur(),T(Y)):q(),y(()=>{if(r.proxy.$q.platform.is.ios===!0){if(e.seamless!==!0&&document.activeElement){const{top:ne,bottom:S}=document.activeElement.getBoundingClientRect(),{innerHeight:Q}=window,z=window.visualViewport!==void 0?window.visualViewport.height:Q;ne>0&&S>z/2&&(document.scrollingElement.scrollTop=Math.min(document.scrollingElement.scrollHeight-z,S>=Q?1/0:Math.ceil(document.scrollingElement.scrollTop+S-z/2))),document.activeElement.scrollIntoView()}d=!0,i.value.click(),d=!1}_(!0),l.value=!1,n("show",oe)},e.transitionDuration)}function Z(oe){q(),C(),_e(!0),l.value=!0,w(),c!==null&&(((oe&&oe.type.indexOf("key")===0?c.closest('[tabindex]:not([tabindex^="-"])'):void 0)||c).focus(),c=null),y(()=>{w(!0),l.value=!1,n("hide",oe)},e.transitionDuration)}function Y(oe){gi(()=>{let ne=i.value;ne===null||ne.contains(document.activeElement)===!0||(ne=(oe!==""?ne.querySelector(oe):null)||ne.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||ne.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||ne.querySelector("[autofocus], [data-autofocus]")||ne,ne.focus({preventScroll:!0}))})}function A(oe){oe&&typeof oe.focus=="function"?oe.focus({preventScroll:!0}):Y(),n("shake");const ne=i.value;ne!==null&&(ne.classList.remove("q-animate--scale"),ne.classList.add("q-animate--scale"),a!==null&&clearTimeout(a),a=setTimeout(()=>{a=null,i.value!==null&&(ne.classList.remove("q-animate--scale"),Y())},170))}function W(){e.seamless!==!0&&(e.persistent===!0||e.noEscDismiss===!0?e.maximized!==!0&&e.noShake!==!0&&A():(n("escapeKey"),V()))}function _e(oe){a!==null&&(clearTimeout(a),a=null),(oe===!0||s.value===!0)&&(se(!1),e.seamless!==!0&&(p(!1),Ds(ue),Vs(W))),oe!==!0&&(c=null)}function se(oe){oe===!0?u!==!0&&(so<1&&document.body.classList.add("q-body--dialog"),so++,u=!0):u===!0&&(so<2&&document.body.classList.remove("q-body--dialog"),so--,u=!1)}function fe(oe){d!==!0&&(V(oe),n("click",oe))}function L(oe){e.persistent!==!0&&e.noBackdropDismiss!==!0?V(oe):e.noShake!==!0&&A()}function ue(oe){e.allowFocusOutside!==!0&&F.value===!0&&Lh(i.value,oe.target)!==!0&&Y('[tabindex]:not([tabindex="-1"])')}Object.assign(r.proxy,{focus:Y,shake:A,__updateRefocusTarget(oe){c=oe||null}}),We(_e);function Re(){return E("div",{role:"dialog","aria-modal":$.value===!0?"true":"false",...o,class:H.value},[E(cn,{name:"q-transition--fade",appear:!0},()=>$.value===!0?E("div",{class:"q-dialog__backdrop fixed-full",style:m.value,"aria-hidden":"true",tabindex:-1,onClick:L}):null),E(cn,M.value,()=>s.value===!0?E("div",{ref:i,class:x.value,style:m.value,tabindex:-1,...v.value},tt(t.default)):null)])}return j}});const Wt={dark:{type:Boolean,default:null}};function Qt(e,t){return R(()=>e.dark===null?t.dark.isActive:e.dark)}var Lg=$e({name:"QCard",props:{...Wt,tag:{type:String,default:"div"},square:Boolean,flat:Boolean,bordered:Boolean},setup(e,{slots:t}){const{proxy:{$q:n}}=ke(),o=Qt(e,n),r=R(()=>"q-card"+(o.value===!0?" q-card--dark q-dark":"")+(e.bordered===!0?" q-card--bordered":"")+(e.square===!0?" q-card--square no-border-radius":"")+(e.flat===!0?" q-card--flat no-shadow":""));return()=>E(e.tag,{class:r.value},tt(t.default))}}),En=$e({name:"QCardSection",props:{tag:{type:String,default:"div"},horizontal:Boolean},setup(e,{slots:t}){const n=R(()=>`q-card__section q-card__section--${e.horizontal===!0?"horiz row no-wrap":"vert"}`);return()=>E(e.tag,{class:n.value},tt(t.default))}}),Bg=$e({name:"QCardActions",props:{...Aa,vertical:Boolean},setup(e,{slots:t}){const n=Ma(e),o=R(()=>`q-card__actions ${n.value} q-card__actions--${e.vertical===!0?"vert column":"horiz row"}`);return()=>E("div",{class:o.value},tt(t.default))}});const Fg={true:"inset",item:"item-inset","item-thumbnail":"item-thumbnail-inset"},dr={xs:2,sm:4,md:8,lg:16,xl:24};var zs=$e({name:"QSeparator",props:{...Wt,spaced:[Boolean,String],inset:[Boolean,String],vertical:Boolean,color:String,size:String},setup(e){const t=ke(),n=Qt(e,t.proxy.$q),o=R(()=>e.vertical===!0?"vertical":"horizontal"),r=R(()=>` q-separator--${o.value}`),i=R(()=>e.inset!==!1?`${r.value}-${Fg[e.inset]}`:""),s=R(()=>`q-separator${r.value}${i.value}`+(e.color!==void 0?` bg-${e.color}`:"")+(n.value===!0?" q-separator--dark":"")),l=R(()=>{const a={};if(e.size!==void 0&&(a[e.vertical===!0?"width":"height"]=e.size),e.spaced!==!1){const c=e.spaced===!0?`${dr.md}px`:e.spaced in dr?`${dr[e.spaced]}px`:e.spaced,u=e.vertical===!0?["Left","Right"]:["Top","Bottom"];a[`margin${u[0]}`]=a[`margin${u[1]}`]=c}return a});return()=>E("hr",{class:s.value,style:l.value,"aria-orientation":o.value})}});function Ig({validate:e,resetValidation:t,requiresQForm:n}){const o=ut(od,!1);if(o!==!1){const{props:r,proxy:i}=ke();Object.assign(i,{validate:e,resetValidation:t}),be(()=>r.disable,s=>{s===!0?(typeof t=="function"&&t(),o.unbindComponent(i)):o.bindComponent(i)}),Ut(()=>{r.disable!==!0&&o.bindComponent(i)}),We(()=>{r.disable!==!0&&o.unbindComponent(i)})}else n===!0&&console.error("Parent QForm not found on useFormChild()!")}const Ks=/^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/,Us=/^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/,Ws=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,lo=/^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/,ao=/^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/,hr={date:e=>/^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),time:e=>/^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),fulltime:e=>/^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),timeOrFulltime:e=>/^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),email:e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),hexColor:e=>Ks.test(e),hexaColor:e=>Us.test(e),hexOrHexaColor:e=>Ws.test(e),rgbColor:e=>lo.test(e),rgbaColor:e=>ao.test(e),rgbOrRgbaColor:e=>lo.test(e)||ao.test(e),hexOrRgbColor:e=>Ks.test(e)||lo.test(e),hexaOrRgbaColor:e=>Us.test(e)||ao.test(e),anyColor:e=>Ws.test(e)||lo.test(e)||ao.test(e)},Ng=[!0,!1,"ondemand"],jg={modelValue:{},error:{type:Boolean,default:null},errorMessage:String,noErrorIcon:Boolean,rules:Array,reactiveRules:Boolean,lazyRules:{type:[Boolean,String],validator:e=>Ng.includes(e)}};function Vg(e,t){const{props:n,proxy:o}=ke(),r=he(!1),i=he(null),s=he(null);Ig({validate:y,resetValidation:p});let l=0,a;const c=R(()=>n.rules!==void 0&&n.rules!==null&&n.rules.length!==0),u=R(()=>n.disable!==!0&&c.value===!0),d=R(()=>n.error===!0||r.value===!0),f=R(()=>typeof n.errorMessage=="string"&&n.errorMessage.length!==0?n.errorMessage:i.value);be(()=>n.modelValue,()=>{T()}),be(()=>n.reactiveRules,M=>{M===!0?a===void 0&&(a=be(()=>n.rules,()=>{T(!0)})):a!==void 0&&(a(),a=void 0)},{immediate:!0}),be(e,M=>{M===!0?s.value===null&&(s.value=!1):s.value===!1&&(s.value=!0,u.value===!0&&n.lazyRules!=="ondemand"&&t.value===!1&&q())});function p(){l++,t.value=!1,s.value=null,r.value=!1,i.value=null,q.cancel()}function y(M=n.modelValue){if(u.value!==!0)return!0;const m=++l,_=t.value!==!0?()=>{s.value=!0}:()=>{},w=(j,V)=>{j===!0&&_(),r.value=j,i.value=V||null,t.value=!1},F=[];for(let j=0;j{if(j===void 0||Array.isArray(j)===!1||j.length===0)return m===l&&w(!1),!0;const V=j.find(N=>N===!1||typeof N=="string");return m===l&&w(V!==void 0,V),V===void 0},j=>(m===l&&(console.error(j),w(!0)),!1)))}function T(M){u.value===!0&&n.lazyRules!=="ondemand"&&(s.value===!0||n.lazyRules!==!0&&M!==!0)&&q()}const q=ua(y,0);return We(()=>{a!==void 0&&a(),q.cancel()}),Object.assign(o,{resetValidation:p,validate:y}),bn(o,"hasError",()=>d.value),{isDirtyModel:s,hasRules:c,hasError:d,errorMessage:f,validate:y,resetValidation:p}}const Qs=/^on[A-Z]/;function Dg(e,t){const n={listeners:he({}),attributes:he({})};function o(){const r={},i={};for(const s in e)s!=="class"&&s!=="style"&&Qs.test(s)===!1&&(r[s]=e[s]);for(const s in t.props)Qs.test(s)===!0&&(i[s]=t.props[s]);n.attributes.value=r,n.listeners.value=i}return Bl(o),o(),n}let gr,uo=0;const Te=new Array(256);for(let e=0;e<256;e++)Te[e]=(e+256).toString(16).substring(1);const Hg=(()=>{const e=typeof crypto!="undefined"?crypto:typeof window!="undefined"?window.crypto||window.msCrypto:void 0;if(e!==void 0){if(e.randomBytes!==void 0)return e.randomBytes;if(e.getRandomValues!==void 0)return t=>{const n=new Uint8Array(t);return e.getRandomValues(n),n}}return t=>{const n=[];for(let o=t;o>0;o--)n.push(Math.floor(Math.random()*256));return n}})(),Ys=4096;function zg(){(gr===void 0||uo+16>Ys)&&(uo=0,gr=Hg(Ys));const e=Array.prototype.slice.call(gr,uo,uo+=16);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,Te[e[0]]+Te[e[1]]+Te[e[2]]+Te[e[3]]+"-"+Te[e[4]]+Te[e[5]]+"-"+Te[e[6]]+Te[e[7]]+"-"+Te[e[8]]+Te[e[9]]+"-"+Te[e[10]]+Te[e[11]]+Te[e[12]]+Te[e[13]]+Te[e[14]]+Te[e[15]]}function Ir(e){return e===void 0?`f_${zg()}`:e}function Nr(e){return e!=null&&(""+e).length!==0}const Kg={...Wt,...jg,label:String,stackLabel:Boolean,hint:String,hideHint:Boolean,prefix:String,suffix:String,labelColor:String,color:String,bgColor:String,filled:Boolean,outlined:Boolean,borderless:Boolean,standout:[Boolean,String],square:Boolean,loading:Boolean,labelSlot:Boolean,bottomSlots:Boolean,hideBottomSpace:Boolean,rounded:Boolean,dense:Boolean,itemAligned:Boolean,counter:Boolean,clearable:Boolean,clearIcon:String,disable:Boolean,readonly:Boolean,autofocus:Boolean,for:String,maxlength:[Number,String]},Ug=["update:modelValue","clear","focus","blur","popupShow","popupHide"];function Wg(){const{props:e,attrs:t,proxy:n,vnode:o}=ke();return{isDark:Qt(e,n.$q),editable:R(()=>e.disable!==!0&&e.readonly!==!0),innerLoading:he(!1),focused:he(!1),hasPopupOpen:!1,splitAttrs:Dg(t,o),targetUid:he(Ir(e.for)),rootRef:he(null),targetRef:he(null),controlRef:he(null)}}function Qg(e){const{props:t,emit:n,slots:o,attrs:r,proxy:i}=ke(),{$q:s}=i;let l=null;e.hasValue===void 0&&(e.hasValue=R(()=>Nr(t.modelValue))),e.emitValue===void 0&&(e.emitValue=A=>{n("update:modelValue",A)}),e.controlEvents===void 0&&(e.controlEvents={onFocusin:C,onFocusout:x}),Object.assign(e,{clearValue:$,onControlFocusin:C,onControlFocusout:x,focus:V}),e.computedCounter===void 0&&(e.computedCounter=R(()=>{if(t.counter!==!1){const A=typeof t.modelValue=="string"||typeof t.modelValue=="number"?(""+t.modelValue).length:Array.isArray(t.modelValue)===!0?t.modelValue.length:0,W=t.maxlength!==void 0?t.maxlength:t.maxValues;return A+(W!==void 0?" / "+W:"")}}));const{isDirtyModel:a,hasRules:c,hasError:u,errorMessage:d,resetValidation:f}=Vg(e.focused,e.innerLoading),p=e.floatingLabel!==void 0?R(()=>t.stackLabel===!0||e.focused.value===!0||e.floatingLabel.value===!0):R(()=>t.stackLabel===!0||e.focused.value===!0||e.hasValue.value===!0),y=R(()=>t.bottomSlots===!0||t.hint!==void 0||c.value===!0||t.counter===!0||t.error!==null),T=R(()=>t.filled===!0?"filled":t.outlined===!0?"outlined":t.borderless===!0?"borderless":t.standout?"standout":"standard"),q=R(()=>`q-field row no-wrap items-start q-field--${T.value}`+(e.fieldClass!==void 0?` ${e.fieldClass.value}`:"")+(t.rounded===!0?" q-field--rounded":"")+(t.square===!0?" q-field--square":"")+(p.value===!0?" q-field--float":"")+(m.value===!0?" q-field--labeled":"")+(t.dense===!0?" q-field--dense":"")+(t.itemAligned===!0?" q-field--item-aligned q-item-type":"")+(e.isDark.value===!0?" q-field--dark":"")+(e.getControl===void 0?" q-field--auto-height":"")+(e.focused.value===!0?" q-field--focused":"")+(u.value===!0?" q-field--error":"")+(u.value===!0||e.focused.value===!0?" q-field--highlighted":"")+(t.hideBottomSpace!==!0&&y.value===!0?" q-field--with-bottom":"")+(t.disable===!0?" q-field--disabled":t.readonly===!0?" q-field--readonly":"")),M=R(()=>"q-field__control relative-position row no-wrap"+(t.bgColor!==void 0?` bg-${t.bgColor}`:"")+(u.value===!0?" text-negative":typeof t.standout=="string"&&t.standout.length!==0&&e.focused.value===!0?` ${t.standout}`:t.color!==void 0?` text-${t.color}`:"")),m=R(()=>t.labelSlot===!0||t.label!==void 0),_=R(()=>"q-field__label no-pointer-events absolute ellipsis"+(t.labelColor!==void 0&&u.value!==!0?` text-${t.labelColor}`:"")),w=R(()=>({id:e.targetUid.value,editable:e.editable.value,focused:e.focused.value,floatingLabel:p.value,modelValue:t.modelValue,emitValue:e.emitValue})),F=R(()=>{const A={for:e.targetUid.value};return t.disable===!0?A["aria-disabled"]="true":t.readonly===!0&&(A["aria-readonly"]="true"),A});be(()=>t.for,A=>{e.targetUid.value=Ir(A)});function j(){const A=document.activeElement;let W=e.targetRef!==void 0&&e.targetRef.value;W&&(A===null||A.id!==e.targetUid.value)&&(W.hasAttribute("tabindex")===!0||(W=W.querySelector("[tabindex]")),W&&W!==A&&W.focus({preventScroll:!0}))}function V(){gi(j)}function N(){vg(j);const A=document.activeElement;A!==null&&e.rootRef.value.contains(A)&&A.blur()}function C(A){l!==null&&(clearTimeout(l),l=null),e.editable.value===!0&&e.focused.value===!1&&(e.focused.value=!0,n("focus",A))}function x(A,W){l!==null&&clearTimeout(l),l=setTimeout(()=>{l=null,!(document.hasFocus()===!0&&(e.hasPopupOpen===!0||e.controlRef===void 0||e.controlRef.value===null||e.controlRef.value.contains(document.activeElement)!==!1))&&(e.focused.value===!0&&(e.focused.value=!1,n("blur",A)),W!==void 0&&W())})}function $(A){Ke(A),s.platform.is.mobile!==!0?(e.targetRef!==void 0&&e.targetRef.value||e.rootRef.value).focus():e.rootRef.value.contains(document.activeElement)===!0&&document.activeElement.blur(),t.type==="file"&&(e.inputRef.value.value=null),n("update:modelValue",null),n("clear",t.modelValue),je(()=>{f(),s.platform.is.mobile!==!0&&(a.value=!1)})}function v(){const A=[];return o.prepend!==void 0&&A.push(E("div",{class:"q-field__prepend q-field__marginal row no-wrap items-center",key:"prepend",onClick:Et},o.prepend())),A.push(E("div",{class:"q-field__control-container col relative-position row no-wrap q-anchor--skip"},H())),u.value===!0&&t.noErrorIcon===!1&&A.push(Z("error",[E(pt,{name:s.iconSet.field.error,color:"negative"})])),t.loading===!0||e.innerLoading.value===!0?A.push(Z("inner-loading-append",o.loading!==void 0?o.loading():[E(Un,{color:t.color})])):t.clearable===!0&&e.hasValue.value===!0&&e.editable.value===!0&&A.push(Z("inner-clearable-append",[E(pt,{class:"q-field__focusable-action",tag:"button",name:t.clearIcon||s.iconSet.field.clear,tabindex:0,type:"button","aria-hidden":null,role:null,onClick:$})])),o.append!==void 0&&A.push(E("div",{class:"q-field__append q-field__marginal row no-wrap items-center",key:"append",onClick:Et},o.append())),e.getInnerAppend!==void 0&&A.push(Z("inner-append",e.getInnerAppend())),e.getControlChild!==void 0&&A.push(e.getControlChild()),A}function H(){const A=[];return t.prefix!==void 0&&t.prefix!==null&&A.push(E("div",{class:"q-field__prefix no-pointer-events row items-center"},t.prefix)),e.getShadowControl!==void 0&&e.hasShadow.value===!0&&A.push(e.getShadowControl()),e.getControl!==void 0?A.push(e.getControl()):o.rawControl!==void 0?A.push(o.rawControl()):o.control!==void 0&&A.push(E("div",{ref:e.targetRef,class:"q-field__native row",tabindex:-1,...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus===!0||void 0},o.control(w.value))),m.value===!0&&A.push(E("div",{class:_.value},tt(o.label,t.label))),t.suffix!==void 0&&t.suffix!==null&&A.push(E("div",{class:"q-field__suffix no-pointer-events row items-center"},t.suffix)),A.concat(tt(o.default))}function k(){let A,W;u.value===!0?d.value!==null?(A=[E("div",{role:"alert"},d.value)],W=`q--slot-error-${d.value}`):(A=tt(o.error),W="q--slot-error"):(t.hideHint!==!0||e.focused.value===!0)&&(t.hint!==void 0?(A=[E("div",t.hint)],W=`q--slot-hint-${t.hint}`):(A=tt(o.hint),W="q--slot-hint"));const _e=t.counter===!0||o.counter!==void 0;if(t.hideBottomSpace===!0&&_e===!1&&A===void 0)return;const se=E("div",{key:W,class:"q-field__messages col"},A);return E("div",{class:"q-field__bottom row items-start q-field__bottom--"+(t.hideBottomSpace!==!0?"animated":"stale"),onClick:Et},[t.hideBottomSpace===!0?se:E(cn,{name:"q-transition--field-message"},()=>se),_e===!0?E("div",{class:"q-field__counter"},o.counter!==void 0?o.counter():e.computedCounter.value):null])}function Z(A,W){return W===null?null:E("div",{key:A,class:"q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"},W)}let Y=!1;return Fo(()=>{Y=!0}),$l(()=>{Y===!0&&t.autofocus===!0&&i.focus()}),Ut(()=>{qt.value===!0&&t.for===void 0&&(e.targetUid.value=Ir()),t.autofocus===!0&&i.focus()}),We(()=>{l!==null&&clearTimeout(l)}),Object.assign(i,{focus:V,blur:N}),function(){const W=e.getControl===void 0&&o.control===void 0?{...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus===!0||void 0,...F.value}:F.value;return E("label",{ref:e.rootRef,class:[q.value,r.class],style:r.style,...W},[o.before!==void 0?E("div",{class:"q-field__before q-field__marginal row no-wrap items-center",onClick:Et},o.before()):null,E("div",{class:"q-field__inner relative-position col self-stretch"},[E("div",{ref:e.controlRef,class:M.value,tabindex:-1,...e.controlEvents},v()),y.value===!0?k():null]),o.after!==void 0?E("div",{class:"q-field__after q-field__marginal row no-wrap items-center",onClick:Et},o.after()):null])}}const Zs={date:"####/##/##",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"},Po={"#":{pattern:"[\\d]",negate:"[^\\d]"},S:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]"},N:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]"},A:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:e=>e.toLocaleUpperCase()},a:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:e=>e.toLocaleLowerCase()},X:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:e=>e.toLocaleUpperCase()},x:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:e=>e.toLocaleLowerCase()}},Qa=Object.keys(Po);Qa.forEach(e=>{Po[e].regex=new RegExp(Po[e].pattern)});const Yg=new RegExp("\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|(["+Qa.join("")+"])|(.)","g"),Js=/[.*+?^${}()|[\]\\]/g,Se=String.fromCharCode(1),Zg={mask:String,reverseFillMask:Boolean,fillMask:[Boolean,String],unmaskedValue:Boolean};function Jg(e,t,n,o){let r,i,s,l,a,c;const u=he(null),d=he(p());function f(){return e.autogrow===!0||["textarea","text","search","url","tel","password"].includes(e.type)}be(()=>e.type+e.autogrow,T),be(()=>e.mask,C=>{if(C!==void 0)q(d.value,!0);else{const x=V(d.value);T(),e.modelValue!==x&&t("update:modelValue",x)}}),be(()=>e.fillMask+e.reverseFillMask,()=>{u.value===!0&&q(d.value,!0)}),be(()=>e.unmaskedValue,()=>{u.value===!0&&q(d.value)});function p(){if(T(),u.value===!0){const C=F(V(e.modelValue));return e.fillMask!==!1?N(C):C}return e.modelValue}function y(C){if(C-1){for(let H=C-$.length;H>0;H--)x+=Se;$=$.slice(0,v)+x+$.slice(v)}return $}function T(){if(u.value=e.mask!==void 0&&e.mask.length!==0&&f(),u.value===!1){l=void 0,r="",i="";return}const C=Zs[e.mask]===void 0?e.mask:Zs[e.mask],x=typeof e.fillMask=="string"&&e.fillMask.length!==0?e.fillMask.slice(0,1):"_",$=x.replace(Js,"\\$&"),v=[],H=[],k=[];let Z=e.reverseFillMask===!0,Y="",A="";C.replace(Yg,(fe,L,ue,Re,oe)=>{if(Re!==void 0){const ne=Po[Re];k.push(ne),A=ne.negate,Z===!0&&(H.push("(?:"+A+"+)?("+ne.pattern+"+)?(?:"+A+"+)?("+ne.pattern+"+)?"),Z=!1),H.push("(?:"+A+"+)?("+ne.pattern+")?")}else if(ue!==void 0)Y="\\"+(ue==="\\"?"":ue),k.push(ue),v.push("([^"+Y+"]+)?"+Y+"?");else{const ne=L!==void 0?L:oe;Y=ne==="\\"?"\\\\\\\\":ne.replace(Js,"\\\\$&"),k.push(ne),v.push("([^"+Y+"]+)?"+Y+"?")}});const W=new RegExp("^"+v.join("")+"("+(Y===""?".":"[^"+Y+"]")+"+)?"+(Y===""?"":"["+Y+"]*")+"$"),_e=H.length-1,se=H.map((fe,L)=>L===0&&e.reverseFillMask===!0?new RegExp("^"+$+"*"+fe):L===_e?new RegExp("^"+fe+"("+(A===""?".":A)+"+)?"+(e.reverseFillMask===!0?"$":$+"*")):new RegExp("^"+fe));s=k,l=fe=>{const L=W.exec(e.reverseFillMask===!0?fe:fe.slice(0,k.length+1));L!==null&&(fe=L.slice(1).join(""));const ue=[],Re=se.length;for(let oe=0,ne=fe;oetypeof fe=="string"?fe:Se).join(""),i=r.split(Se).join(x)}function q(C,x,$){const v=o.value,H=v.selectionEnd,k=v.value.length-H,Z=V(C);x===!0&&T();const Y=F(Z),A=e.fillMask!==!1?N(Y):Y,W=d.value!==A;v.value!==A&&(v.value=A),W===!0&&(d.value=A),document.activeElement===v&&je(()=>{if(A===i){const se=e.reverseFillMask===!0?i.length:0;v.setSelectionRange(se,se,"forward");return}if($==="insertFromPaste"&&e.reverseFillMask!==!0){const se=v.selectionEnd;let fe=H-1;for(let L=a;L<=fe&&L-1){const se=e.reverseFillMask===!0?H===0?A.length>Y.length?1:0:Math.max(0,A.length-(A===i?0:Math.min(Y.length,k)+1))+1:H;v.setSelectionRange(se,se,"forward");return}if(e.reverseFillMask===!0)if(W===!0){const se=Math.max(0,A.length-(A===i?0:Math.min(Y.length,k+1)));se===1&&H===1?v.setSelectionRange(se,se,"forward"):m.rightReverse(v,se)}else{const se=A.length-k;v.setSelectionRange(se,se,"backward")}else if(W===!0){const se=Math.max(0,r.indexOf(Se),Math.min(Y.length,H)-1);m.right(v,se)}else{const se=H-1;m.right(v,se)}});const _e=e.unmaskedValue===!0?V(A):A;String(e.modelValue)!==_e&&n(_e,!0)}function M(C,x,$){const v=F(V(C.value));x=Math.max(0,r.indexOf(Se),Math.min(v.length,x)),a=x,C.setSelectionRange(x,$,"forward")}const m={left(C,x){const $=r.slice(x-1).indexOf(Se)===-1;let v=Math.max(0,x-1);for(;v>=0;v--)if(r[v]===Se){x=v,$===!0&&x++;break}if(v<0&&r[x]!==void 0&&r[x]!==Se)return m.right(C,0);x>=0&&C.setSelectionRange(x,x,"backward")},right(C,x){const $=C.value.length;let v=Math.min($,x+1);for(;v<=$;v++)if(r[v]===Se){x=v;break}else r[v-1]===Se&&(x=v);if(v>$&&r[x-1]!==void 0&&r[x-1]!==Se)return m.left(C,$);C.setSelectionRange(x,x,"forward")},leftReverse(C,x){const $=y(C.value.length);let v=Math.max(0,x-1);for(;v>=0;v--)if($[v-1]===Se){x=v;break}else if($[v]===Se&&(x=v,v===0))break;if(v<0&&$[x]!==void 0&&$[x]!==Se)return m.rightReverse(C,0);x>=0&&C.setSelectionRange(x,x,"backward")},rightReverse(C,x){const $=C.value.length,v=y($),H=v.slice(0,x+1).indexOf(Se)===-1;let k=Math.min($,x+1);for(;k<=$;k++)if(v[k-1]===Se){x=k,x>0&&H===!0&&x--;break}if(k>$&&v[x-1]!==void 0&&v[x-1]!==Se)return m.leftReverse(C,$);C.setSelectionRange(x,x,"forward")}};function _(C){t("click",C),c=void 0}function w(C){if(t("keydown",C),da(C)===!0)return;const x=o.value,$=x.selectionStart,v=x.selectionEnd;if(C.shiftKey||(c=void 0),C.keyCode===37||C.keyCode===39){C.shiftKey&&c===void 0&&(c=x.selectionDirection==="forward"?$:v);const H=m[(C.keyCode===39?"right":"left")+(e.reverseFillMask===!0?"Reverse":"")];if(C.preventDefault(),H(x,c===$?v:$),C.shiftKey){const k=x.selectionStart;x.setSelectionRange(Math.min(c,k),Math.max(c,k),"forward")}}else C.keyCode===8&&e.reverseFillMask!==!0&&$===v?(m.left(x,$),x.setSelectionRange(x.selectionStart,v,"backward")):C.keyCode===46&&e.reverseFillMask===!0&&$===v&&(m.rightReverse(x,v),x.setSelectionRange($,x.selectionEnd,"forward"))}function F(C){if(C==null||C==="")return"";if(e.reverseFillMask===!0)return j(C);const x=s;let $=0,v="";for(let H=0;H=0&&v>-1;k--){const Z=x[k];let Y=C[v];if(typeof Z=="string")H=Z+H,Y===Z&&v--;else if(Y!==void 0&&Z.regex.test(Y))do H=(Z.transform!==void 0?Z.transform(Y):Y)+H,v--,Y=C[v];while($===k&&Y!==void 0&&Z.regex.test(Y));else return H}return H}function V(C){return typeof C!="string"||l===void 0?typeof C=="number"?l(""+C):C:l(C)}function N(C){return i.length-C.length<=0?C:e.reverseFillMask===!0&&C.length!==0?i.slice(0,-C.length)+C:C+i.slice(C.length)}return{innerValue:d,hasMask:u,moveCursorForPaste:M,updateMaskValue:q,onMaskedKeydown:w,onMaskedClick:_}}const mi={name:String};function Ya(e={}){return(t,n,o)=>{t[n](E("input",{class:"hidden"+(o||""),...e.value}))}}function Xg(e){return R(()=>e.name||e.for)}function Gg(e,t){function n(){const o=e.modelValue;try{const r="DataTransfer"in window?new DataTransfer:"ClipboardEvent"in window?new ClipboardEvent("").clipboardData:void 0;return Object(o)===o&&("length"in o?Array.from(o):[o]).forEach(i=>{r.items.add(i)}),{files:r.files}}catch{return{files:void 0}}}return R(t===!0?()=>{if(e.type==="file")return n()}:n)}const em=/[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/,tm=/[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u,nm=/[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/,om=/[a-z0-9_ -]$/i;function rm(e){return function(n){if(n.type==="compositionend"||n.type==="change"){if(n.target.qComposing!==!0)return;n.target.qComposing=!1,e(n)}else n.type==="compositionupdate"&&n.target.qComposing!==!0&&typeof n.data=="string"&&(we.is.firefox===!0?om.test(n.data)===!1:em.test(n.data)===!0||tm.test(n.data)===!0||nm.test(n.data)===!0)===!0&&(n.target.qComposing=!0)}}var im=$e({name:"QInput",inheritAttrs:!1,props:{...Kg,...Zg,...mi,modelValue:{required:!1},shadowText:String,type:{type:String,default:"text"},debounce:[String,Number],autogrow:Boolean,inputClass:[Array,String,Object],inputStyle:[Array,String,Object]},emits:[...Ug,"paste","change","keydown","click","animationend"],setup(e,{emit:t,attrs:n}){const{proxy:o}=ke(),{$q:r}=o,i={};let s=NaN,l,a,c=null,u;const d=he(null),f=Xg(e),{innerValue:p,hasMask:y,moveCursorForPaste:T,updateMaskValue:q,onMaskedKeydown:M,onMaskedClick:m}=Jg(e,t,Y,d),_=Gg(e,!0),w=R(()=>Nr(p.value)),F=rm(k),j=Wg(),V=R(()=>e.type==="textarea"||e.autogrow===!0),N=R(()=>V.value===!0||["text","search","url","tel","password"].includes(e.type)),C=R(()=>{const L={...j.splitAttrs.listeners.value,onInput:k,onPaste:H,onChange:W,onBlur:_e,onFocus:ko};return L.onCompositionstart=L.onCompositionupdate=L.onCompositionend=F,y.value===!0&&(L.onKeydown=M,L.onClick=m),e.autogrow===!0&&(L.onAnimationend=Z),L}),x=R(()=>{const L={tabindex:0,"data-autofocus":e.autofocus===!0||void 0,rows:e.type==="textarea"?6:void 0,"aria-label":e.label,name:f.value,...j.splitAttrs.attributes.value,id:j.targetUid.value,maxlength:e.maxlength,disabled:e.disable===!0,readonly:e.readonly===!0};return V.value===!1&&(L.type=e.type),e.autogrow===!0&&(L.rows=1),L});be(()=>e.type,()=>{d.value&&(d.value.value=e.modelValue)}),be(()=>e.modelValue,L=>{if(y.value===!0){if(a===!0&&(a=!1,String(L)===s))return;q(L)}else p.value!==L&&(p.value=L,e.type==="number"&&i.hasOwnProperty("value")===!0&&(l===!0?l=!1:delete i.value));e.autogrow===!0&&je(A)}),be(()=>e.autogrow,L=>{L===!0?je(A):d.value!==null&&n.rows>0&&(d.value.style.height="auto")}),be(()=>e.dense,()=>{e.autogrow===!0&&je(A)});function $(){gi(()=>{const L=document.activeElement;d.value!==null&&d.value!==L&&(L===null||L.id!==j.targetUid.value)&&d.value.focus({preventScroll:!0})})}function v(){d.value!==null&&d.value.select()}function H(L){if(y.value===!0&&e.reverseFillMask!==!0){const ue=L.target;T(ue,ue.selectionStart,ue.selectionEnd)}t("paste",L)}function k(L){if(!L||!L.target)return;if(e.type==="file"){t("update:modelValue",L.target.files);return}const ue=L.target.value;if(L.target.qComposing===!0){i.value=ue;return}if(y.value===!0)q(ue,!1,L.inputType);else if(Y(ue),N.value===!0&&L.target===document.activeElement){const{selectionStart:Re,selectionEnd:oe}=L.target;Re!==void 0&&oe!==void 0&&je(()=>{L.target===document.activeElement&&ue.indexOf(L.target.value)===0&&L.target.setSelectionRange(Re,oe)})}e.autogrow===!0&&A()}function Z(L){t("animationend",L),A()}function Y(L,ue){u=()=>{c=null,e.type!=="number"&&i.hasOwnProperty("value")===!0&&delete i.value,e.modelValue!==L&&s!==L&&(s=L,ue===!0&&(a=!0),t("update:modelValue",L),je(()=>{s===L&&(s=NaN)})),u=void 0},e.type==="number"&&(l=!0,i.value=L),e.debounce!==void 0?(c!==null&&clearTimeout(c),i.value=L,c=setTimeout(u,e.debounce)):u()}function A(){requestAnimationFrame(()=>{const L=d.value;if(L!==null){const ue=L.parentNode.style,{scrollTop:Re}=L,{overflowY:oe,maxHeight:ne}=r.platform.is.firefox===!0?{}:window.getComputedStyle(L),S=oe!==void 0&&oe!=="scroll";S===!0&&(L.style.overflowY="hidden"),ue.marginBottom=L.scrollHeight-1+"px",L.style.height="1px",L.style.height=L.scrollHeight+"px",S===!0&&(L.style.overflowY=parseInt(ne,10){d.value!==null&&(d.value.value=p.value!==void 0?p.value:"")})}function se(){return i.hasOwnProperty("value")===!0?i.value:p.value!==void 0?p.value:""}We(()=>{_e()}),Ut(()=>{e.autogrow===!0&&A()}),Object.assign(j,{innerValue:p,fieldClass:R(()=>`q-${V.value===!0?"textarea":"input"}`+(e.autogrow===!0?" q-textarea--autogrow":"")),hasShadow:R(()=>e.type!=="file"&&typeof e.shadowText=="string"&&e.shadowText.length!==0),inputRef:d,emitValue:Y,hasValue:w,floatingLabel:R(()=>w.value===!0&&(e.type!=="number"||isNaN(p.value)===!1)||Nr(e.displayValue)),getControl:()=>E(V.value===!0?"textarea":"input",{ref:d,class:["q-field__native q-placeholder",e.inputClass],style:e.inputStyle,...x.value,...C.value,...e.type!=="file"?{value:se()}:_.value}),getShadowControl:()=>E("div",{class:"q-field__native q-field__shadow absolute-bottom no-pointer-events"+(V.value===!0?"":" text-no-wrap")},[E("span",{class:"invisible"},se()),E("span",e.shadowText)])});const fe=Qg(j);return Object.assign(o,{focus:$,select:v,getNativeElement:()=>d.value}),bn(o,"nativeEl",()=>d.value),fe}});function Za(e,t){const n=he(null),o=R(()=>e.disable===!0?null:E("span",{ref:n,class:"no-outline",tabindex:-1}));function r(i){const s=t.value;i!==void 0&&i.type.indexOf("key")===0?s!==null&&document.activeElement!==s&&s.contains(document.activeElement)===!0&&s.focus():n.value!==null&&(i===void 0||s!==null&&s.contains(i.target)===!0)&&n.value.focus()}return{refocusTargetEl:o,refocusTarget:r}}var Ja={xs:30,sm:35,md:40,lg:50,xl:60};const sm=E("svg",{key:"svg",class:"q-radio__bg absolute non-selectable",viewBox:"0 0 24 24"},[E("path",{d:"M12,22a10,10 0 0 1 -10,-10a10,10 0 0 1 10,-10a10,10 0 0 1 10,10a10,10 0 0 1 -10,10m0,-22a12,12 0 0 0 -12,12a12,12 0 0 0 12,12a12,12 0 0 0 12,-12a12,12 0 0 0 -12,-12"}),E("path",{class:"q-radio__check",d:"M12,6a6,6 0 0 0 -6,6a6,6 0 0 0 6,6a6,6 0 0 0 6,-6a6,6 0 0 0 -6,-6"})]);var lm=$e({name:"QRadio",props:{...Wt,...Yn,...mi,modelValue:{required:!0},val:{required:!0},label:String,leftLabel:Boolean,checkedIcon:String,uncheckedIcon:String,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},emits:["update:modelValue"],setup(e,{slots:t,emit:n}){const{proxy:o}=ke(),r=Qt(e,o.$q),i=Zn(e,Ja),s=he(null),{refocusTargetEl:l,refocusTarget:a}=Za(e,s),c=R(()=>ie(e.modelValue)===ie(e.val)),u=R(()=>"q-radio cursor-pointer no-outline row inline no-wrap items-center"+(e.disable===!0?" disabled":"")+(r.value===!0?" q-radio--dark":"")+(e.dense===!0?" q-radio--dense":"")+(e.leftLabel===!0?" reverse":"")),d=R(()=>{const _=e.color!==void 0&&(e.keepColor===!0||c.value===!0)?` text-${e.color}`:"";return`q-radio__inner relative-position q-radio__inner--${c.value===!0?"truthy":"falsy"}${_}`}),f=R(()=>(c.value===!0?e.checkedIcon:e.uncheckedIcon)||null),p=R(()=>e.disable===!0?-1:e.tabindex||0),y=R(()=>{const _={type:"radio"};return e.name!==void 0&&Object.assign(_,{".checked":c.value===!0,"^checked":c.value===!0?"checked":void 0,name:e.name,value:e.val}),_}),T=Ya(y);function q(_){_!==void 0&&(Ke(_),a(_)),e.disable!==!0&&c.value!==!0&&n("update:modelValue",e.val,_)}function M(_){(_.keyCode===13||_.keyCode===32)&&Ke(_)}function m(_){(_.keyCode===13||_.keyCode===32)&&q(_)}return Object.assign(o,{set:q}),()=>{const _=f.value!==null?[E("div",{key:"icon",class:"q-radio__icon-container absolute-full flex flex-center no-wrap"},[E(pt,{class:"q-radio__icon",name:f.value})])]:[sm];e.disable!==!0&&T(_,"unshift"," q-radio__native q-ma-none q-pa-none");const w=[E("div",{class:d.value,style:i.value,"aria-hidden":"true"},_)];l.value!==null&&w.push(l.value);const F=e.label!==void 0?It(t.default,[e.label]):tt(t.default);return F!==void 0&&w.push(E("div",{class:"q-radio__label q-anchor--skip"},F)),E("div",{ref:s,class:u.value,tabindex:p.value,role:"radio","aria-label":e.label,"aria-checked":c.value===!0?"true":"false","aria-disabled":e.disable===!0?"true":void 0,onClick:q,onKeydown:M,onKeyup:m},w)}}});const Xa={...Wt,...Yn,...mi,modelValue:{required:!0,default:null},val:{},trueValue:{default:!0},falseValue:{default:!1},indeterminateValue:{default:null},checkedIcon:String,uncheckedIcon:String,indeterminateIcon:String,toggleOrder:{type:String,validator:e=>e==="tf"||e==="ft"},toggleIndeterminate:Boolean,label:String,leftLabel:Boolean,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},Ga=["update:modelValue"];function eu(e,t){const{props:n,slots:o,emit:r,proxy:i}=ke(),{$q:s}=i,l=Qt(n,s),a=he(null),{refocusTargetEl:c,refocusTarget:u}=Za(n,a),d=Zn(n,Ja),f=R(()=>n.val!==void 0&&Array.isArray(n.modelValue)),p=R(()=>{const v=ie(n.val);return f.value===!0?n.modelValue.findIndex(H=>ie(H)===v):-1}),y=R(()=>f.value===!0?p.value>-1:ie(n.modelValue)===ie(n.trueValue)),T=R(()=>f.value===!0?p.value===-1:ie(n.modelValue)===ie(n.falseValue)),q=R(()=>y.value===!1&&T.value===!1),M=R(()=>n.disable===!0?-1:n.tabindex||0),m=R(()=>`q-${e} cursor-pointer no-outline row inline no-wrap items-center`+(n.disable===!0?" disabled":"")+(l.value===!0?` q-${e}--dark`:"")+(n.dense===!0?` q-${e}--dense`:"")+(n.leftLabel===!0?" reverse":"")),_=R(()=>{const v=y.value===!0?"truthy":T.value===!0?"falsy":"indet",H=n.color!==void 0&&(n.keepColor===!0||(e==="toggle"?y.value===!0:T.value!==!0))?` text-${n.color}`:"";return`q-${e}__inner relative-position non-selectable q-${e}__inner--${v}${H}`}),w=R(()=>{const v={type:"checkbox"};return n.name!==void 0&&Object.assign(v,{".checked":y.value,"^checked":y.value===!0?"checked":void 0,name:n.name,value:f.value===!0?n.val:n.trueValue}),v}),F=Ya(w),j=R(()=>{const v={tabindex:M.value,role:e==="toggle"?"switch":"checkbox","aria-label":n.label,"aria-checked":q.value===!0?"mixed":y.value===!0?"true":"false"};return n.disable===!0&&(v["aria-disabled"]="true"),v});function V(v){v!==void 0&&(Ke(v),u(v)),n.disable!==!0&&r("update:modelValue",N(),v)}function N(){if(f.value===!0){if(y.value===!0){const v=n.modelValue.slice();return v.splice(p.value,1),v}return n.modelValue.concat([n.val])}if(y.value===!0){if(n.toggleOrder!=="ft"||n.toggleIndeterminate===!1)return n.falseValue}else if(T.value===!0){if(n.toggleOrder==="ft"||n.toggleIndeterminate===!1)return n.trueValue}else return n.toggleOrder!=="ft"?n.trueValue:n.falseValue;return n.indeterminateValue}function C(v){(v.keyCode===13||v.keyCode===32)&&Ke(v)}function x(v){(v.keyCode===13||v.keyCode===32)&&V(v)}const $=t(y,q);return Object.assign(i,{toggle:V}),()=>{const v=$();n.disable!==!0&&F(v,"unshift",` q-${e}__native absolute q-ma-none q-pa-none`);const H=[E("div",{class:_.value,style:d.value,"aria-hidden":"true"},v)];c.value!==null&&H.push(c.value);const k=n.label!==void 0?It(o.default,[n.label]):tt(o.default);return k!==void 0&&H.push(E("div",{class:`q-${e}__label q-anchor--skip`},k)),E("div",{ref:a,class:m.value,...j.value,onClick:V,onKeydown:C,onKeyup:x},H)}}const am=E("div",{key:"svg",class:"q-checkbox__bg absolute"},[E("svg",{class:"q-checkbox__svg fit absolute-full",viewBox:"0 0 24 24"},[E("path",{class:"q-checkbox__truthy",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}),E("path",{class:"q-checkbox__indet",d:"M4,14H20V10H4"})])]);var um=$e({name:"QCheckbox",props:Xa,emits:Ga,setup(e){function t(n,o){const r=R(()=>(n.value===!0?e.checkedIcon:o.value===!0?e.indeterminateIcon:e.uncheckedIcon)||null);return()=>r.value!==null?[E("div",{key:"icon",class:"q-checkbox__icon-container absolute-full flex flex-center no-wrap"},[E(pt,{class:"q-checkbox__icon",name:r.value})])]:[am]}return eu("checkbox",t)}}),cm=$e({name:"QToggle",props:{...Xa,icon:String,iconColor:String},emits:Ga,setup(e){function t(n,o){const r=R(()=>(n.value===!0?e.checkedIcon:o.value===!0?e.indeterminateIcon:e.uncheckedIcon)||e.icon),i=R(()=>n.value===!0?e.iconColor:null);return()=>[E("div",{class:"q-toggle__track"}),E("div",{class:"q-toggle__thumb absolute flex flex-center no-wrap"},r.value!==void 0?[E(pt,{name:r.value,color:i.value})]:void 0)]}return eu("toggle",t)}});const tu={radio:lm,checkbox:um,toggle:cm},fm=Object.keys(tu);var dm=$e({name:"QOptionGroup",props:{...Wt,modelValue:{required:!0},options:{type:Array,validator:e=>e.every(t=>"value"in t&&"label"in t)},name:String,type:{default:"radio",validator:e=>fm.includes(e)},color:String,keepColor:Boolean,dense:Boolean,size:String,leftLabel:Boolean,inline:Boolean,disable:Boolean},emits:["update:modelValue"],setup(e,{emit:t,slots:n}){const{proxy:{$q:o}}=ke(),r=Array.isArray(e.modelValue);e.type==="radio"?r===!0&&console.error("q-option-group: model should not be array"):r===!1&&console.error("q-option-group: model should be array in your case");const i=Qt(e,o),s=R(()=>tu[e.type]),l=R(()=>"q-option-group q-gutter-x-sm"+(e.inline===!0?" q-option-group--inline":"")),a=R(()=>{const u={role:"group"};return e.type==="radio"&&(u.role="radiogroup",e.disable===!0&&(u["aria-disabled"]="true")),u});function c(u){t("update:modelValue",u)}return()=>E("div",{class:l.value,...a.value},e.options.map((u,d)=>{const f=n["label-"+d]!==void 0?()=>n["label-"+d](u):n.label!==void 0?()=>n.label(u):void 0;return E("div",[E(s.value,{modelValue:e.modelValue,val:u.value,name:u.name===void 0?e.name:u.name,disable:e.disable||u.disable,label:f===void 0?u.label:null,leftLabel:u.leftLabel===void 0?e.leftLabel:u.leftLabel,color:u.color===void 0?e.color:u.color,checkedIcon:u.checkedIcon,uncheckedIcon:u.uncheckedIcon,dark:u.dark||i.value,size:u.size===void 0?e.size:u.size,dense:e.dense,keepColor:u.keepColor===void 0?e.keepColor:u.keepColor,"onUpdate:modelValue":c},f)])}))}}),hm=$e({name:"DialogPlugin",props:{...Wt,title:String,message:String,prompt:Object,options:Object,progress:[Boolean,Object],html:Boolean,ok:{type:[String,Object,Boolean],default:!0},cancel:[String,Object,Boolean],focus:{type:String,default:"ok",validator:e=>["ok","cancel","none"].includes(e)},stackButtons:Boolean,color:String,cardClass:[String,Array,Object],cardStyle:[String,Array,Object]},emits:["ok","hide"],setup(e,{emit:t}){const{proxy:n}=ke(),{$q:o}=n,r=Qt(e,o),i=he(null),s=he(e.prompt!==void 0?e.prompt.model:e.options!==void 0?e.options.model:void 0),l=R(()=>"q-dialog-plugin"+(r.value===!0?" q-dialog-plugin--dark q-dark":"")+(e.progress!==!1?" q-dialog-plugin--progress":"")),a=R(()=>e.color||(r.value===!0?"amber":"primary")),c=R(()=>e.progress===!1?null:at(e.progress)===!0?{component:e.progress.spinner||Un,props:{color:e.progress.color||a.value}}:{component:Un,props:{color:a.value}}),u=R(()=>e.prompt!==void 0||e.options!==void 0),d=R(()=>{if(u.value!==!0)return{};const{model:k,isValid:Z,items:Y,...A}=e.prompt!==void 0?e.prompt:e.options;return A}),f=R(()=>at(e.ok)===!0||e.ok===!0?o.lang.label.ok:e.ok),p=R(()=>at(e.cancel)===!0||e.cancel===!0?o.lang.label.cancel:e.cancel),y=R(()=>e.prompt!==void 0?e.prompt.isValid!==void 0&&e.prompt.isValid(s.value)!==!0:e.options!==void 0?e.options.isValid!==void 0&&e.options.isValid(s.value)!==!0:!1),T=R(()=>({color:a.value,label:f.value,ripple:!1,disable:y.value,...at(e.ok)===!0?e.ok:{flat:!0},"data-autofocus":e.focus==="ok"&&u.value!==!0||void 0,onClick:_})),q=R(()=>({color:a.value,label:p.value,ripple:!1,...at(e.cancel)===!0?e.cancel:{flat:!0},"data-autofocus":e.focus==="cancel"&&u.value!==!0||void 0,onClick:w}));be(()=>e.prompt&&e.prompt.model,j),be(()=>e.options&&e.options.model,j);function M(){i.value.show()}function m(){i.value.hide()}function _(){t("ok",ie(s.value)),m()}function w(){m()}function F(){t("hide")}function j(k){s.value=k}function V(k){y.value!==!0&&e.prompt.type!=="textarea"&&zn(k,13)===!0&&_()}function N(k,Z){return e.html===!0?E(En,{class:k,innerHTML:Z}):E(En,{class:k},()=>Z)}function C(){return[E(im,{color:a.value,dense:!0,autofocus:!0,dark:r.value,...d.value,modelValue:s.value,"onUpdate:modelValue":j,onKeyup:V})]}function x(){return[E(dm,{color:a.value,options:e.options.items,dark:r.value,...d.value,modelValue:s.value,"onUpdate:modelValue":j})]}function $(){const k=[];return e.cancel&&k.push(E(Br,q.value)),e.ok&&k.push(E(Br,T.value)),E(Bg,{class:e.stackButtons===!0?"items-end":"",vertical:e.stackButtons,align:"right"},()=>k)}function v(){const k=[];return e.title&&k.push(N("q-dialog__title",e.title)),e.progress!==!1&&k.push(E(En,{class:"q-dialog__progress"},()=>E(c.value.component,c.value.props))),e.message&&k.push(N("q-dialog__message",e.message)),e.prompt!==void 0?k.push(E(En,{class:"scroll q-dialog-plugin__form"},C)):e.options!==void 0&&k.push(E(zs,{dark:r.value}),E(En,{class:"scroll q-dialog-plugin__form"},x),E(zs,{dark:r.value})),(e.ok||e.cancel)&&k.push($()),k}function H(){return[E(Lg,{class:[l.value,e.cardClass],style:e.cardStyle,dark:r.value},v)]}return Object.assign(n,{show:M,hide:m}),()=>E($g,{ref:i,onHide:F},H)}});function nu(e,t){for(const n in t)n!=="spinner"&&Object(t[n])===t[n]?(e[n]=Object(e[n])!==e[n]?{}:{...e[n]},nu(e[n],t[n])):e[n]=t[n]}function gm(e,t,n){return o=>{let r,i;const s=t===!0&&o.component!==void 0;if(s===!0){const{component:m,componentProps:_}=o;r=typeof m=="string"?n.component(m):m,i=_||{}}else{const{class:m,style:_,...w}=o;r=e,i=w,m!==void 0&&(w.cardClass=m),_!==void 0&&(w.cardStyle=_)}let l,a=!1;const c=he(null),u=di(!1,"dialog"),d=m=>{if(c.value!==null&&c.value[m]!==void 0){c.value[m]();return}const _=l.$.subTree;if(_&&_.component){if(_.component.proxy&&_.component.proxy[m]){_.component.proxy[m]();return}if(_.component.subTree&&_.component.subTree.component&&_.component.subTree.component.proxy&&_.component.subTree.component.proxy[m]){_.component.subTree.component.proxy[m]();return}}console.error("[Quasar] Incorrectly defined Dialog component")},f=[],p=[],y={onOk(m){return f.push(m),y},onCancel(m){return p.push(m),y},onDismiss(m){return f.push(m),p.push(m),y},hide(){return d("hide"),y},update(m){if(l!==null){if(s===!0)Object.assign(i,m);else{const{class:_,style:w,...F}=m;_!==void 0&&(F.cardClass=_),w!==void 0&&(F.cardStyle=w),nu(i,F)}l.$forceUpdate()}return y}},T=m=>{a=!0,f.forEach(_=>{_(m)})},q=()=>{M.unmount(u),Fa(u),M=null,l=null,a!==!0&&p.forEach(m=>{m()})};let M=ma({name:"QGlobalDialog",setup:()=>()=>E(r,{...i,ref:c,onOk:T,onHide:q,onVnodeMounted(...m){typeof i.onVnodeMounted=="function"&&i.onVnodeMounted(...m),je(()=>d("show"))}})},n);return l=M.mount(u),y}}var mm={install({$q:e,parentApp:t}){e.dialog=gm(hm,!0,t),this.__installed!==!0&&(this.create=e.dialog)}},pm={config:{staticPath:"/nostrmarket/static/market/"},plugins:{Notify:og,LocalStorage:Da,Dialog:mm}};async function vm({app:e,router:t}){e.use(t),e.mount("#q-app")}wh(la,pm).then(vm);export{Zn as $,Wl as A,Yl as B,rc as C,Jl as D,Fe as E,je as F,zn as G,Et as H,Hf as I,zf as J,vo as K,we as L,fg as M,gg as N,dg as O,Tr as P,cg as Q,ug as R,mg as S,hg as T,_g as U,cn as V,Ke as W,Wt as X,Yn as Y,Qt as Z,cd as _,R as a,_m as a$,Lm as a0,pt as a1,Ch as a2,Fh as a3,ua as a4,mc as a5,Fo as a6,$l as a7,Mh as a8,Oh as a9,Vs as aA,bg as aB,Ag as aC,gi as aD,Lh as aE,mi as aF,Xg as aG,Nr as aH,Bl as aI,oi as aJ,rm as aK,ko as aL,$g as aM,En as aN,zs as aO,Ah as aP,Br as aQ,km as aR,im as aS,Em as aT,Cm as aU,wm as aV,Xe as aW,um as aX,Lg as aY,Uc as aZ,bm as a_,Un as aa,Dh as ab,Hh as ac,Aa as ad,Ma as ae,Fm as af,$m as ag,xh as ah,Nm as ai,jm as aj,nd as ak,Am as al,ql as am,da as an,nr as ao,zg as ap,Rm as aq,Pm as ar,Vf as as,ym as at,Kg as au,Ug as av,Qg as aw,Wg as ax,Mg as ay,Ds as az,tt as b,Bg as b0,Qh as b1,Im as b2,dm as b3,Dm as b4,Hm as b5,Bm as b6,xm as b7,gl as b8,Sm as b9,$a as ba,qr as bb,Om as bc,Ur as bd,Kr as be,Vt as bf,$e as c,qm as d,Mm as e,We as f,ke as g,E as h,ut as i,Vm as j,Be as k,Tm as l,za as m,Pt as n,Ut as o,fo as p,xg as q,he as r,qt as s,zm as t,pn as u,ri as v,be as w,It as x,Lo as y,wc as z}; diff --git a/static/market/favicon.ico b/static/market/favicon.ico new file mode 100644 index 0000000..56a5665 Binary files /dev/null and b/static/market/favicon.ico differ diff --git a/static/market/icons/favicon-128x128.png b/static/market/icons/favicon-128x128.png new file mode 100644 index 0000000..a2844df Binary files /dev/null and b/static/market/icons/favicon-128x128.png differ diff --git a/static/market/icons/favicon-16x16.png b/static/market/icons/favicon-16x16.png new file mode 100644 index 0000000..43a4439 Binary files /dev/null and b/static/market/icons/favicon-16x16.png differ diff --git a/static/market/icons/favicon-32x32.png b/static/market/icons/favicon-32x32.png new file mode 100644 index 0000000..3a028af Binary files /dev/null and b/static/market/icons/favicon-32x32.png differ diff --git a/static/market/icons/favicon-64x64.png b/static/market/icons/favicon-64x64.png new file mode 100644 index 0000000..f1f9d68 Binary files /dev/null and b/static/market/icons/favicon-64x64.png differ diff --git a/static/market/icons/favicon-96x96.png b/static/market/icons/favicon-96x96.png new file mode 100644 index 0000000..7d0aa34 Binary files /dev/null and b/static/market/icons/favicon-96x96.png differ diff --git a/static/market/images/bitcoin-shop.png b/static/market/images/bitcoin-shop.png new file mode 100644 index 0000000..debffbb Binary files /dev/null and b/static/market/images/bitcoin-shop.png differ diff --git a/static/market/images/blank-avatar.webp b/static/market/images/blank-avatar.webp new file mode 100644 index 0000000..513b0f3 Binary files /dev/null and b/static/market/images/blank-avatar.webp differ diff --git a/static/market/images/nostr-avatar.png b/static/market/images/nostr-avatar.png new file mode 100644 index 0000000..c4fc6f9 Binary files /dev/null and b/static/market/images/nostr-avatar.png differ diff --git a/static/market/images/nostr-cover.png b/static/market/images/nostr-cover.png new file mode 100644 index 0000000..d0f2558 Binary files /dev/null and b/static/market/images/nostr-cover.png differ diff --git a/static/market/images/placeholder.png b/static/market/images/placeholder.png new file mode 100644 index 0000000..c7d3a94 Binary files /dev/null and b/static/market/images/placeholder.png differ diff --git a/static/market/index.html b/static/market/index.html new file mode 100644 index 0000000..6cee238 --- /dev/null +++ b/static/market/index.html @@ -0,0 +1,27 @@ + + + + + Nostr Market App + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/static/market/js/bolt11-decoder.js b/static/market/js/bolt11-decoder.js new file mode 100644 index 0000000..7b73260 --- /dev/null +++ b/static/market/js/bolt11-decoder.js @@ -0,0 +1,347 @@ +//TODO - A reader MUST check that the signature is valid (see the n tagged field) +//TODO - Tagged part of type f: the fallback on-chain address should be decoded into an address format +//TODO - A reader MUST check that the SHA-2 256 in the h field exactly matches the hashed description. +//TODO - A reader MUST use the n field to validate the signature instead of performing signature recovery if a valid n field is provided. + +function decode(paymentRequest) { + let input = paymentRequest.toLowerCase() + let splitPosition = input.lastIndexOf('1') + let humanReadablePart = input.substring(0, splitPosition) + let data = input.substring(splitPosition + 1, input.length - 6) + let checksum = input.substring(input.length - 6, input.length) + if ( + !verify_checksum(humanReadablePart, bech32ToFiveBitArray(data + checksum)) + ) { + throw 'Malformed request: checksum is incorrect' // A reader MUST fail if the checksum is incorrect. + } + return { + human_readable_part: decodeHumanReadablePart(humanReadablePart), + data: decodeData(data, humanReadablePart), + checksum: checksum + } +} + +function decodeHumanReadablePart(humanReadablePart) { + let prefixes = ['lnbc', 'lntb', 'lnbcrt', 'lnsb'] + let prefix + prefixes.forEach(value => { + if (humanReadablePart.substring(0, value.length) === value) { + prefix = value + } + }) + if (prefix == null) throw 'Malformed request: unknown prefix' // A reader MUST fail if it does not understand the prefix. + let amount = decodeAmount( + humanReadablePart.substring(prefix.length, humanReadablePart.length) + ) + return { + prefix: prefix, + amount: amount + } +} + +function decodeData(data, humanReadablePart) { + let date32 = data.substring(0, 7) + let dateEpoch = bech32ToInt(date32) + let signature = data.substring(data.length - 104, data.length) + let tagData = data.substring(7, data.length - 104) + let decodedTags = decodeTags(tagData) + let value = bech32ToFiveBitArray(date32 + tagData) + value = fiveBitArrayTo8BitArray(value, true) + value = textToHexString(humanReadablePart).concat(byteArrayToHexString(value)) + return { + time_stamp: dateEpoch, + tags: decodedTags, + signature: decodeSignature(signature), + signing_data: value + } +} + +function decodeSignature(signature) { + let data = fiveBitArrayTo8BitArray(bech32ToFiveBitArray(signature)) + let recoveryFlag = data[data.length - 1] + let r = byteArrayToHexString(data.slice(0, 32)) + let s = byteArrayToHexString(data.slice(32, data.length - 1)) + return { + r: r, + s: s, + recovery_flag: recoveryFlag + } +} + +function decodeAmount(str) { + let multiplier = str.charAt(str.length - 1) + let amount = str.substring(0, str.length - 1) + if (amount.substring(0, 1) === '0') { + throw 'Malformed request: amount cannot contain leading zeros' + } + amount = Number(amount) + if (amount < 0 || !Number.isInteger(amount)) { + throw 'Malformed request: amount must be a positive decimal integer' // A reader SHOULD fail if amount contains a non-digit + } + + switch (multiplier) { + case '': + return 'Any amount' // A reader SHOULD indicate if amount is unspecified + case 'p': + return amount / 10 + case 'n': + return amount * 100 + case 'u': + return amount * 100000 + case 'm': + return amount * 100000000 + default: + // A reader SHOULD fail if amount is followed by anything except a defined multiplier. + throw 'Malformed request: undefined amount multiplier' + } +} + +function decodeTags(tagData) { + let tags = extractTags(tagData) + let decodedTags = [] + tags.forEach(value => + decodedTags.push(decodeTag(value.type, value.length, value.data)) + ) + return decodedTags +} + +function extractTags(str) { + let tags = [] + while (str.length > 0) { + let type = str.charAt(0) + let dataLength = bech32ToInt(str.substring(1, 3)) + let data = str.substring(3, dataLength + 3) + tags.push({ + type: type, + length: dataLength, + data: data + }) + str = str.substring(3 + dataLength, str.length) + } + return tags +} + +function decodeTag(type, length, data) { + switch (type) { + case 'p': + if (length !== 52) break // A reader MUST skip over a 'p' field that does not have data_length 52 + return { + type: type, + length: length, + description: 'payment_hash', + value: byteArrayToHexString( + fiveBitArrayTo8BitArray(bech32ToFiveBitArray(data)) + ) + } + case 'd': + return { + type: type, + length: length, + description: 'description', + value: bech32ToUTF8String(data) + } + case 'n': + if (length !== 53) break // A reader MUST skip over a 'n' field that does not have data_length 53 + return { + type: type, + length: length, + description: 'payee_public_key', + value: byteArrayToHexString( + fiveBitArrayTo8BitArray(bech32ToFiveBitArray(data)) + ) + } + case 'h': + if (length !== 52) break // A reader MUST skip over a 'h' field that does not have data_length 52 + return { + type: type, + length: length, + description: 'description_hash', + value: data + } + case 'x': + return { + type: type, + length: length, + description: 'expiry', + value: bech32ToInt(data) + } + case 'c': + return { + type: type, + length: length, + description: 'min_final_cltv_expiry', + value: bech32ToInt(data) + } + case 'f': + let version = bech32ToFiveBitArray(data.charAt(0))[0] + if (version < 0 || version > 18) break // a reader MUST skip over an f field with unknown version. + data = data.substring(1, data.length) + return { + type: type, + length: length, + description: 'fallback_address', + value: { + version: version, + fallback_address: data + } + } + case 'r': + data = fiveBitArrayTo8BitArray(bech32ToFiveBitArray(data)) + let pubkey = data.slice(0, 33) + let shortChannelId = data.slice(33, 41) + let feeBaseMsat = data.slice(41, 45) + let feeProportionalMillionths = data.slice(45, 49) + let cltvExpiryDelta = data.slice(49, 51) + return { + type: type, + length: length, + description: 'routing_information', + value: { + public_key: byteArrayToHexString(pubkey), + short_channel_id: byteArrayToHexString(shortChannelId), + fee_base_msat: byteArrayToInt(feeBaseMsat), + fee_proportional_millionths: byteArrayToInt( + feeProportionalMillionths + ), + cltv_expiry_delta: byteArrayToInt(cltvExpiryDelta) + } + } + default: + // reader MUST skip over unknown fields + } +} + +function polymod(values) { + let GEN = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3] + let chk = 1 + values.forEach(value => { + let b = chk >> 25 + chk = ((chk & 0x1ffffff) << 5) ^ value + for (let i = 0; i < 5; i++) { + if (((b >> i) & 1) === 1) { + chk ^= GEN[i] + } else { + chk ^= 0 + } + } + }) + return chk +} + +function expand(str) { + let array = [] + for (let i = 0; i < str.length; i++) { + array.push(str.charCodeAt(i) >> 5) + } + array.push(0) + for (let i = 0; i < str.length; i++) { + array.push(str.charCodeAt(i) & 31) + } + return array +} + +function verify_checksum(hrp, data) { + hrp = expand(hrp) + let all = hrp.concat(data) + let bool = polymod(all) + return bool === 1 +} + +const bech32CharValues = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l' + +function byteArrayToInt(byteArray) { + let value = 0 + for (let i = 0; i < byteArray.length; ++i) { + value = (value << 8) + byteArray[i] + } + return value +} + +function bech32ToInt(str) { + let sum = 0 + for (let i = 0; i < str.length; i++) { + sum = sum * 32 + sum = sum + bech32CharValues.indexOf(str.charAt(i)) + } + return sum +} + +function bech32ToFiveBitArray(str) { + let array = [] + for (let i = 0; i < str.length; i++) { + array.push(bech32CharValues.indexOf(str.charAt(i))) + } + return array +} + +function fiveBitArrayTo8BitArray(int5Array, includeOverflow) { + let count = 0 + let buffer = 0 + let byteArray = [] + int5Array.forEach(value => { + buffer = (buffer << 5) + value + count += 5 + if (count >= 8) { + byteArray.push((buffer >> (count - 8)) & 255) + count -= 8 + } + }) + if (includeOverflow && count > 0) { + byteArray.push((buffer << (8 - count)) & 255) + } + return byteArray +} + +function bech32ToUTF8String(str) { + let int5Array = bech32ToFiveBitArray(str) + let byteArray = fiveBitArrayTo8BitArray(int5Array) + + let utf8String = '' + for (let i = 0; i < byteArray.length; i++) { + utf8String += '%' + ('0' + byteArray[i].toString(16)).slice(-2) + } + return decodeURIComponent(utf8String) +} + +function byteArrayToHexString(byteArray) { + return Array.prototype.map + .call(byteArray, function (byte) { + return ('0' + (byte & 0xff).toString(16)).slice(-2) + }) + .join('') +} + +function textToHexString(text) { + let hexString = '' + for (let i = 0; i < text.length; i++) { + hexString += text.charCodeAt(i).toString(16) + } + return hexString +} + +function epochToDate(int) { + let date = new Date(int * 1000) + return date.toUTCString() +} + +function isEmptyOrSpaces(str) { + return str === null || str.match(/^ *$/) !== null +} + +function toFixed(x) { + if (Math.abs(x) < 1.0) { + var e = parseInt(x.toString().split('e-')[1]) + if (e) { + x *= Math.pow(10, e - 1) + x = '0.' + new Array(e).join('0') + x.toString().substring(2) + } + } else { + var e = parseInt(x.toString().split('+')[1]) + if (e > 20) { + e -= 20 + x /= Math.pow(10, e) + x += new Array(e + 1).join('0') + } + } + return x +} diff --git a/static/market/js/nostr.bundle.js b/static/market/js/nostr.bundle.js new file mode 100644 index 0000000..0d41aa7 --- /dev/null +++ b/static/market/js/nostr.bundle.js @@ -0,0 +1,8705 @@ +"use strict"; +var NostrTools = (() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __commonJS = (cb, mod2) => function __require() { + return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( + isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, + mod2 + )); + var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); + + // + var init_define_process = __esm({ + ""() { + } + }); + + // node_modules/@scure/bip39/wordlists/english.js + var require_english = __commonJS({ + "node_modules/@scure/bip39/wordlists/english.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.wordlist = void 0; + exports.wordlist = `abandon +ability +able +about +above +absent +absorb +abstract +absurd +abuse +access +accident +account +accuse +achieve +acid +acoustic +acquire +across +act +action +actor +actress +actual +adapt +add +addict +address +adjust +admit +adult +advance +advice +aerobic +affair +afford +afraid +again +age +agent +agree +ahead +aim +air +airport +aisle +alarm +album +alcohol +alert +alien +all +alley +allow +almost +alone +alpha +already +also +alter +always +amateur +amazing +among +amount +amused +analyst +anchor +ancient +anger +angle +angry +animal +ankle +announce +annual +another +answer +antenna +antique +anxiety +any +apart +apology +appear +apple +approve +april +arch +arctic +area +arena +argue +arm +armed +armor +army +around +arrange +arrest +arrive +arrow +art +artefact +artist +artwork +ask +aspect +assault +asset +assist +assume +asthma +athlete +atom +attack +attend +attitude +attract +auction +audit +august +aunt +author +auto +autumn +average +avocado +avoid +awake +aware +away +awesome +awful +awkward +axis +baby +bachelor +bacon +badge +bag +balance +balcony +ball +bamboo +banana +banner +bar +barely +bargain +barrel +base +basic +basket +battle +beach +bean +beauty +because +become +beef +before +begin +behave +behind +believe +below +belt +bench +benefit +best +betray +better +between +beyond +bicycle +bid +bike +bind +biology +bird +birth +bitter +black +blade +blame +blanket +blast +bleak +bless +blind +blood +blossom +blouse +blue +blur +blush +board +boat +body +boil +bomb +bone +bonus +book +boost +border +boring +borrow +boss +bottom +bounce +box +boy +bracket +brain +brand +brass +brave +bread +breeze +brick +bridge +brief +bright +bring +brisk +broccoli +broken +bronze +broom +brother +brown +brush +bubble +buddy +budget +buffalo +build +bulb +bulk +bullet +bundle +bunker +burden +burger +burst +bus +business +busy +butter +buyer +buzz +cabbage +cabin +cable +cactus +cage +cake +call +calm +camera +camp +can +canal +cancel +candy +cannon +canoe +canvas +canyon +capable +capital +captain +car +carbon +card +cargo +carpet +carry +cart +case +cash +casino +castle +casual +cat +catalog +catch +category +cattle +caught +cause +caution +cave +ceiling +celery +cement +census +century +cereal +certain +chair +chalk +champion +change +chaos +chapter +charge +chase +chat +cheap +check +cheese +chef +cherry +chest +chicken +chief +child +chimney +choice +choose +chronic +chuckle +chunk +churn +cigar +cinnamon +circle +citizen +city +civil +claim +clap +clarify +claw +clay +clean +clerk +clever +click +client +cliff +climb +clinic +clip +clock +clog +close +cloth +cloud +clown +club +clump +cluster +clutch +coach +coast +coconut +code +coffee +coil +coin +collect +color +column +combine +come +comfort +comic +common +company +concert +conduct +confirm +congress +connect +consider +control +convince +cook +cool +copper +copy +coral +core +corn +correct +cost +cotton +couch +country +couple +course +cousin +cover +coyote +crack +cradle +craft +cram +crane +crash +crater +crawl +crazy +cream +credit +creek +crew +cricket +crime +crisp +critic +crop +cross +crouch +crowd +crucial +cruel +cruise +crumble +crunch +crush +cry +crystal +cube +culture +cup +cupboard +curious +current +curtain +curve +cushion +custom +cute +cycle +dad +damage +damp +dance +danger +daring +dash +daughter +dawn +day +deal +debate +debris +decade +december +decide +decline +decorate +decrease +deer +defense +define +defy +degree +delay +deliver +demand +demise +denial +dentist +deny +depart +depend +deposit +depth +deputy +derive +describe +desert +design +desk +despair +destroy +detail +detect +develop +device +devote +diagram +dial +diamond +diary +dice +diesel +diet +differ +digital +dignity +dilemma +dinner +dinosaur +direct +dirt +disagree +discover +disease +dish +dismiss +disorder +display +distance +divert +divide +divorce +dizzy +doctor +document +dog +doll +dolphin +domain +donate +donkey +donor +door +dose +double +dove +draft +dragon +drama +drastic +draw +dream +dress +drift +drill +drink +drip +drive +drop +drum +dry +duck +dumb +dune +during +dust +dutch +duty +dwarf +dynamic +eager +eagle +early +earn +earth +easily +east +easy +echo +ecology +economy +edge +edit +educate +effort +egg +eight +either +elbow +elder +electric +elegant +element +elephant +elevator +elite +else +embark +embody +embrace +emerge +emotion +employ +empower +empty +enable +enact +end +endless +endorse +enemy +energy +enforce +engage +engine +enhance +enjoy +enlist +enough +enrich +enroll +ensure +enter +entire +entry +envelope +episode +equal +equip +era +erase +erode +erosion +error +erupt +escape +essay +essence +estate +eternal +ethics +evidence +evil +evoke +evolve +exact +example +excess +exchange +excite +exclude +excuse +execute +exercise +exhaust +exhibit +exile +exist +exit +exotic +expand +expect +expire +explain +expose +express +extend +extra +eye +eyebrow +fabric +face +faculty +fade +faint +faith +fall +false +fame +family +famous +fan +fancy +fantasy +farm +fashion +fat +fatal +father +fatigue +fault +favorite +feature +february +federal +fee +feed +feel +female +fence +festival +fetch +fever +few +fiber +fiction +field +figure +file +film +filter +final +find +fine +finger +finish +fire +firm +first +fiscal +fish +fit +fitness +fix +flag +flame +flash +flat +flavor +flee +flight +flip +float +flock +floor +flower +fluid +flush +fly +foam +focus +fog +foil +fold +follow +food +foot +force +forest +forget +fork +fortune +forum +forward +fossil +foster +found +fox +fragile +frame +frequent +fresh +friend +fringe +frog +front +frost +frown +frozen +fruit +fuel +fun +funny +furnace +fury +future +gadget +gain +galaxy +gallery +game +gap +garage +garbage +garden +garlic +garment +gas +gasp +gate +gather +gauge +gaze +general +genius +genre +gentle +genuine +gesture +ghost +giant +gift +giggle +ginger +giraffe +girl +give +glad +glance +glare +glass +glide +glimpse +globe +gloom +glory +glove +glow +glue +goat +goddess +gold +good +goose +gorilla +gospel +gossip +govern +gown +grab +grace +grain +grant +grape +grass +gravity +great +green +grid +grief +grit +grocery +group +grow +grunt +guard +guess +guide +guilt +guitar +gun +gym +habit +hair +half +hammer +hamster +hand +happy +harbor +hard +harsh +harvest +hat +have +hawk +hazard +head +health +heart +heavy +hedgehog +height +hello +helmet +help +hen +hero +hidden +high +hill +hint +hip +hire +history +hobby +hockey +hold +hole +holiday +hollow +home +honey +hood +hope +horn +horror +horse +hospital +host +hotel +hour +hover +hub +huge +human +humble +humor +hundred +hungry +hunt +hurdle +hurry +hurt +husband +hybrid +ice +icon +idea +identify +idle +ignore +ill +illegal +illness +image +imitate +immense +immune +impact +impose +improve +impulse +inch +include +income +increase +index +indicate +indoor +industry +infant +inflict +inform +inhale +inherit +initial +inject +injury +inmate +inner +innocent +input +inquiry +insane +insect +inside +inspire +install +intact +interest +into +invest +invite +involve +iron +island +isolate +issue +item +ivory +jacket +jaguar +jar +jazz +jealous +jeans +jelly +jewel +job +join +joke +journey +joy +judge +juice +jump +jungle +junior +junk +just +kangaroo +keen +keep +ketchup +key +kick +kid +kidney +kind +kingdom +kiss +kit +kitchen +kite +kitten +kiwi +knee +knife +knock +know +lab +label +labor +ladder +lady +lake +lamp +language +laptop +large +later +latin +laugh +laundry +lava +law +lawn +lawsuit +layer +lazy +leader +leaf +learn +leave +lecture +left +leg +legal +legend +leisure +lemon +lend +length +lens +leopard +lesson +letter +level +liar +liberty +library +license +life +lift +light +like +limb +limit +link +lion +liquid +list +little +live +lizard +load +loan +lobster +local +lock +logic +lonely +long +loop +lottery +loud +lounge +love +loyal +lucky +luggage +lumber +lunar +lunch +luxury +lyrics +machine +mad +magic +magnet +maid +mail +main +major +make +mammal +man +manage +mandate +mango +mansion +manual +maple +marble +march +margin +marine +market +marriage +mask +mass +master +match +material +math +matrix +matter +maximum +maze +meadow +mean +measure +meat +mechanic +medal +media +melody +melt +member +memory +mention +menu +mercy +merge +merit +merry +mesh +message +metal +method +middle +midnight +milk +million +mimic +mind +minimum +minor +minute +miracle +mirror +misery +miss +mistake +mix +mixed +mixture +mobile +model +modify +mom +moment +monitor +monkey +monster +month +moon +moral +more +morning +mosquito +mother +motion +motor +mountain +mouse +move +movie +much +muffin +mule +multiply +muscle +museum +mushroom +music +must +mutual +myself +mystery +myth +naive +name +napkin +narrow +nasty +nation +nature +near +neck +need +negative +neglect +neither +nephew +nerve +nest +net +network +neutral +never +news +next +nice +night +noble +noise +nominee +noodle +normal +north +nose +notable +note +nothing +notice +novel +now +nuclear +number +nurse +nut +oak +obey +object +oblige +obscure +observe +obtain +obvious +occur +ocean +october +odor +off +offer +office +often +oil +okay +old +olive +olympic +omit +once +one +onion +online +only +open +opera +opinion +oppose +option +orange +orbit +orchard +order +ordinary +organ +orient +original +orphan +ostrich +other +outdoor +outer +output +outside +oval +oven +over +own +owner +oxygen +oyster +ozone +pact +paddle +page +pair +palace +palm +panda +panel +panic +panther +paper +parade +parent +park +parrot +party +pass +patch +path +patient +patrol +pattern +pause +pave +payment +peace +peanut +pear +peasant +pelican +pen +penalty +pencil +people +pepper +perfect +permit +person +pet +phone +photo +phrase +physical +piano +picnic +picture +piece +pig +pigeon +pill +pilot +pink +pioneer +pipe +pistol +pitch +pizza +place +planet +plastic +plate +play +please +pledge +pluck +plug +plunge +poem +poet +point +polar +pole +police +pond +pony +pool +popular +portion +position +possible +post +potato +pottery +poverty +powder +power +practice +praise +predict +prefer +prepare +present +pretty +prevent +price +pride +primary +print +priority +prison +private +prize +problem +process +produce +profit +program +project +promote +proof +property +prosper +protect +proud +provide +public +pudding +pull +pulp +pulse +pumpkin +punch +pupil +puppy +purchase +purity +purpose +purse +push +put +puzzle +pyramid +quality +quantum +quarter +question +quick +quit +quiz +quote +rabbit +raccoon +race +rack +radar +radio +rail +rain +raise +rally +ramp +ranch +random +range +rapid +rare +rate +rather +raven +raw +razor +ready +real +reason +rebel +rebuild +recall +receive +recipe +record +recycle +reduce +reflect +reform +refuse +region +regret +regular +reject +relax +release +relief +rely +remain +remember +remind +remove +render +renew +rent +reopen +repair +repeat +replace +report +require +rescue +resemble +resist +resource +response +result +retire +retreat +return +reunion +reveal +review +reward +rhythm +rib +ribbon +rice +rich +ride +ridge +rifle +right +rigid +ring +riot +ripple +risk +ritual +rival +river +road +roast +robot +robust +rocket +romance +roof +rookie +room +rose +rotate +rough +round +route +royal +rubber +rude +rug +rule +run +runway +rural +sad +saddle +sadness +safe +sail +salad +salmon +salon +salt +salute +same +sample +sand +satisfy +satoshi +sauce +sausage +save +say +scale +scan +scare +scatter +scene +scheme +school +science +scissors +scorpion +scout +scrap +screen +script +scrub +sea +search +season +seat +second +secret +section +security +seed +seek +segment +select +sell +seminar +senior +sense +sentence +series +service +session +settle +setup +seven +shadow +shaft +shallow +share +shed +shell +sheriff +shield +shift +shine +ship +shiver +shock +shoe +shoot +shop +short +shoulder +shove +shrimp +shrug +shuffle +shy +sibling +sick +side +siege +sight +sign +silent +silk +silly +silver +similar +simple +since +sing +siren +sister +situate +six +size +skate +sketch +ski +skill +skin +skirt +skull +slab +slam +sleep +slender +slice +slide +slight +slim +slogan +slot +slow +slush +small +smart +smile +smoke +smooth +snack +snake +snap +sniff +snow +soap +soccer +social +sock +soda +soft +solar +soldier +solid +solution +solve +someone +song +soon +sorry +sort +soul +sound +soup +source +south +space +spare +spatial +spawn +speak +special +speed +spell +spend +sphere +spice +spider +spike +spin +spirit +split +spoil +sponsor +spoon +sport +spot +spray +spread +spring +spy +square +squeeze +squirrel +stable +stadium +staff +stage +stairs +stamp +stand +start +state +stay +steak +steel +stem +step +stereo +stick +still +sting +stock +stomach +stone +stool +story +stove +strategy +street +strike +strong +struggle +student +stuff +stumble +style +subject +submit +subway +success +such +sudden +suffer +sugar +suggest +suit +summer +sun +sunny +sunset +super +supply +supreme +sure +surface +surge +surprise +surround +survey +suspect +sustain +swallow +swamp +swap +swarm +swear +sweet +swift +swim +swing +switch +sword +symbol +symptom +syrup +system +table +tackle +tag +tail +talent +talk +tank +tape +target +task +taste +tattoo +taxi +teach +team +tell +ten +tenant +tennis +tent +term +test +text +thank +that +theme +then +theory +there +they +thing +this +thought +three +thrive +throw +thumb +thunder +ticket +tide +tiger +tilt +timber +time +tiny +tip +tired +tissue +title +toast +tobacco +today +toddler +toe +together +toilet +token +tomato +tomorrow +tone +tongue +tonight +tool +tooth +top +topic +topple +torch +tornado +tortoise +toss +total +tourist +toward +tower +town +toy +track +trade +traffic +tragic +train +transfer +trap +trash +travel +tray +treat +tree +trend +trial +tribe +trick +trigger +trim +trip +trophy +trouble +truck +true +truly +trumpet +trust +truth +try +tube +tuition +tumble +tuna +tunnel +turkey +turn +turtle +twelve +twenty +twice +twin +twist +two +type +typical +ugly +umbrella +unable +unaware +uncle +uncover +under +undo +unfair +unfold +unhappy +uniform +unique +unit +universe +unknown +unlock +until +unusual +unveil +update +upgrade +uphold +upon +upper +upset +urban +urge +usage +use +used +useful +useless +usual +utility +vacant +vacuum +vague +valid +valley +valve +van +vanish +vapor +various +vast +vault +vehicle +velvet +vendor +venture +venue +verb +verify +version +very +vessel +veteran +viable +vibrant +vicious +victory +video +view +village +vintage +violin +virtual +virus +visa +visit +visual +vital +vivid +vocal +voice +void +volcano +volume +vote +voyage +wage +wagon +wait +walk +wall +walnut +want +warfare +warm +warrior +wash +wasp +waste +water +wave +way +wealth +weapon +wear +weasel +weather +web +wedding +weekend +weird +welcome +west +wet +whale +what +wheat +wheel +when +where +whip +whisper +wide +width +wife +wild +will +win +window +wine +wing +wink +winner +winter +wire +wisdom +wise +wish +witness +wolf +woman +wonder +wood +wool +word +work +world +worry +worth +wrap +wreck +wrestle +wrist +write +wrong +yard +year +yellow +you +young +youth +zebra +zero +zone +zoo`.split("\n"); + } + }); + + // node_modules/@noble/hashes/_assert.js + var require_assert = __commonJS({ + "node_modules/@noble/hashes/_assert.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0; + function number2(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); + } + exports.number = number2; + function bool2(b) { + if (typeof b !== "boolean") + throw new Error(`Expected boolean, not ${b}`); + } + exports.bool = bool2; + function bytes2(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); + } + exports.bytes = bytes2; + function hash2(hash3) { + if (typeof hash3 !== "function" || typeof hash3.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number2(hash3.outputLen); + number2(hash3.blockLen); + } + exports.hash = hash2; + function exists2(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance.finished) + throw new Error("Hash#digest() has already been called"); + } + exports.exists = exists2; + function output2(out, instance) { + bytes2(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } + } + exports.output = output2; + var assert2 = { + number: number2, + bool: bool2, + bytes: bytes2, + hash: hash2, + exists: exists2, + output: output2 + }; + exports.default = assert2; + } + }); + + // node_modules/@noble/hashes/crypto.js + var require_crypto = __commonJS({ + "node_modules/@noble/hashes/crypto.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.crypto = void 0; + exports.crypto = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; + } + }); + + // node_modules/@noble/hashes/utils.js + var require_utils = __commonJS({ + "node_modules/@noble/hashes/utils.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0; + var crypto_1 = require_crypto(); + var u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); + exports.u8 = u8; + var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); + exports.u32 = u32; + var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + exports.createView = createView2; + var rotr2 = (word, shift) => word << 32 - shift | word >>> shift; + exports.rotr = rotr2; + exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; + if (!exports.isLE) + throw new Error("Non little-endian hardware is not supported"); + var hexes3 = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex3(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < uint8a.length; i++) { + hex2 += hexes3[uint8a[i]]; + } + return hex2; + } + exports.bytesToHex = bytesToHex3; + function hexToBytes3(hex2) { + if (typeof hex2 !== "string") { + throw new TypeError("hexToBytes: expected string, got " + typeof hex2); + } + if (hex2.length % 2) + throw new Error("hexToBytes: received invalid unpadded hex"); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("Invalid byte sequence"); + array[i] = byte; + } + return array; + } + exports.hexToBytes = hexToBytes3; + var nextTick = async () => { + }; + exports.nextTick = nextTick; + async function asyncLoop(iters, tick, cb) { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await (0, exports.nextTick)(); + ts += diff; + } + } + exports.asyncLoop = asyncLoop; + function utf8ToBytes3(str) { + if (typeof str !== "string") { + throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + exports.utf8ToBytes = utf8ToBytes3; + function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes3(data); + if (!(data instanceof Uint8Array)) + throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`); + return data; + } + exports.toBytes = toBytes2; + function concatBytes3(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error("Uint8Array list expected"); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + exports.concatBytes = concatBytes3; + var Hash2 = class { + clone() { + return this._cloneInto(); + } + }; + exports.Hash = Hash2; + var isPlainObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]" && obj.constructor === Object; + function checkOpts(defaults, opts) { + if (opts !== void 0 && (typeof opts !== "object" || !isPlainObject(opts))) + throw new TypeError("Options should be object or undefined"); + const merged = Object.assign(defaults, opts); + return merged; + } + exports.checkOpts = checkOpts; + function wrapConstructor2(hashConstructor) { + const hashC = (message) => hashConstructor().update(toBytes2(message)).digest(); + const tmp = hashConstructor(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashConstructor(); + return hashC; + } + exports.wrapConstructor = wrapConstructor2; + function wrapConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; + } + exports.wrapConstructorWithOpts = wrapConstructorWithOpts; + function randomBytes2(bytesLength = 32) { + if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") { + return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); + } + exports.randomBytes = randomBytes2; + } + }); + + // node_modules/@noble/hashes/hmac.js + var require_hmac = __commonJS({ + "node_modules/@noble/hashes/hmac.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hmac = void 0; + var _assert_js_1 = require_assert(); + var utils_js_1 = require_utils(); + var HMAC2 = class extends utils_js_1.Hash { + constructor(hash2, _key) { + super(); + this.finished = false; + this.destroyed = false; + _assert_js_1.default.hash(hash2); + const key = (0, utils_js_1.toBytes)(_key); + this.iHash = hash2.create(); + if (typeof this.iHash.update !== "function") + throw new TypeError("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + pad.set(key.length > blockLen ? hash2.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54; + this.iHash.update(pad); + this.oHash = hash2.create(); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54 ^ 92; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + _assert_js_1.default.exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + _assert_js_1.default.exists(this); + _assert_js_1.default.bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + }; + var hmac2 = (hash2, key, message) => new HMAC2(hash2, key).update(message).digest(); + exports.hmac = hmac2; + exports.hmac.create = (hash2, key) => new HMAC2(hash2, key); + } + }); + + // node_modules/@noble/hashes/pbkdf2.js + var require_pbkdf2 = __commonJS({ + "node_modules/@noble/hashes/pbkdf2.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.pbkdf2Async = exports.pbkdf2 = void 0; + var _assert_js_1 = require_assert(); + var hmac_js_1 = require_hmac(); + var utils_js_1 = require_utils(); + function pbkdf2Init(hash2, _password, _salt, _opts) { + _assert_js_1.default.hash(hash2); + const opts = (0, utils_js_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + _assert_js_1.default.number(c); + _assert_js_1.default.number(dkLen); + _assert_js_1.default.number(asyncTick); + if (c < 1) + throw new Error("PBKDF2: iterations (c) should be >= 1"); + const password = (0, utils_js_1.toBytes)(_password); + const salt = (0, utils_js_1.toBytes)(_salt); + const DK = new Uint8Array(dkLen); + const PRF = hmac_js_1.hmac.create(hash2, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; + } + function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + u.fill(0); + return DK; + } + function pbkdf2(hash2, password, salt, opts) { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash2, password, salt, opts); + let prfW; + const arr = new Uint8Array(4); + const view = (0, utils_js_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); + } + exports.pbkdf2 = pbkdf2; + async function pbkdf2Async(hash2, password, salt, opts) { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash2, password, salt, opts); + let prfW; + const arr = new Uint8Array(4); + const view = (0, utils_js_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await (0, utils_js_1.asyncLoop)(c - 1, asyncTick, (i) => { + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i2 = 0; i2 < Ti.length; i2++) + Ti[i2] ^= u[i2]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); + } + exports.pbkdf2Async = pbkdf2Async; + } + }); + + // node_modules/@noble/hashes/_sha2.js + var require_sha2 = __commonJS({ + "node_modules/@noble/hashes/_sha2.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SHA2 = void 0; + var _assert_js_1 = require_assert(); + var utils_js_1 = require_utils(); + function setBigUint642(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE2 ? 4 : 0; + const l = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE2); + view.setUint32(byteOffset + l, wl, isLE2); + } + var SHA22 = class extends utils_js_1.Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = (0, utils_js_1.createView)(this.buffer); + } + update(data) { + _assert_js_1.default.exists(this); + const { view, buffer, blockLen } = this; + data = (0, utils_js_1.toBytes)(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = (0, utils_js_1.createView)(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + _assert_js_1.default.exists(this); + _assert_js_1.default.output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = (0, utils_js_1.createView)(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE2); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + }; + exports.SHA2 = SHA22; + } + }); + + // node_modules/@noble/hashes/sha256.js + var require_sha256 = __commonJS({ + "node_modules/@noble/hashes/sha256.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sha224 = exports.sha256 = void 0; + var _sha2_js_1 = require_sha2(); + var utils_js_1 = require_utils(); + var Chi2 = (a, b, c) => a & b ^ ~a & c; + var Maj2 = (a, b, c) => a & b ^ a & c ^ b & c; + var SHA256_K2 = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + var IV2 = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SHA256_W2 = new Uint32Array(64); + var SHA2562 = class extends _sha2_js_1.SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV2[0] | 0; + this.B = IV2[1] | 0; + this.C = IV2[2] | 0; + this.D = IV2[3] | 0; + this.E = IV2[4] | 0; + this.F = IV2[5] | 0; + this.G = IV2[6] | 0; + this.H = IV2[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W2[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W2[i - 15]; + const W2 = SHA256_W2[i - 2]; + const s0 = (0, utils_js_1.rotr)(W15, 7) ^ (0, utils_js_1.rotr)(W15, 18) ^ W15 >>> 3; + const s1 = (0, utils_js_1.rotr)(W2, 17) ^ (0, utils_js_1.rotr)(W2, 19) ^ W2 >>> 10; + SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0; + } + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = (0, utils_js_1.rotr)(E, 6) ^ (0, utils_js_1.rotr)(E, 11) ^ (0, utils_js_1.rotr)(E, 25); + const T1 = H + sigma1 + Chi2(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0; + const sigma0 = (0, utils_js_1.rotr)(A, 2) ^ (0, utils_js_1.rotr)(A, 13) ^ (0, utils_js_1.rotr)(A, 22); + const T2 = sigma0 + Maj2(A, B, C) | 0; + H = G; + G = F; + F = E; + E = D + T1 | 0; + D = C; + C = B; + B = A; + A = T1 + T2 | 0; + } + A = A + this.A | 0; + B = B + this.B | 0; + C = C + this.C | 0; + D = D + this.D | 0; + E = E + this.E | 0; + F = F + this.F | 0; + G = G + this.G | 0; + H = H + this.H | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W2.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } + }; + var SHA2242 = class extends SHA2562 { + constructor() { + super(); + this.A = 3238371032 | 0; + this.B = 914150663 | 0; + this.C = 812702999 | 0; + this.D = 4144912697 | 0; + this.E = 4290775857 | 0; + this.F = 1750603025 | 0; + this.G = 1694076839 | 0; + this.H = 3204075428 | 0; + this.outputLen = 28; + } + }; + exports.sha256 = (0, utils_js_1.wrapConstructor)(() => new SHA2562()); + exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA2242()); + } + }); + + // node_modules/@noble/hashes/_u64.js + var require_u64 = __commonJS({ + "node_modules/@noble/hashes/_u64.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.add = exports.toBig = exports.split = exports.fromBig = void 0; + var U32_MASK642 = BigInt(2 ** 32 - 1); + var _32n2 = BigInt(32); + function fromBig2(n, le = false) { + if (le) + return { h: Number(n & U32_MASK642), l: Number(n >> _32n2 & U32_MASK642) }; + return { h: Number(n >> _32n2 & U32_MASK642) | 0, l: Number(n & U32_MASK642) | 0 }; + } + exports.fromBig = fromBig2; + function split2(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig2(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + exports.split = split2; + var toBig2 = (h, l) => BigInt(h >>> 0) << _32n2 | BigInt(l >>> 0); + exports.toBig = toBig2; + var shrSH2 = (h, l, s) => h >>> s; + var shrSL2 = (h, l, s) => h << 32 - s | l >>> s; + var rotrSH2 = (h, l, s) => h >>> s | l << 32 - s; + var rotrSL2 = (h, l, s) => h << 32 - s | l >>> s; + var rotrBH2 = (h, l, s) => h << 64 - s | l >>> s - 32; + var rotrBL2 = (h, l, s) => h >>> s - 32 | l << 64 - s; + var rotr32H2 = (h, l) => l; + var rotr32L2 = (h, l) => h; + var rotlSH2 = (h, l, s) => h << s | l >>> 32 - s; + var rotlSL2 = (h, l, s) => l << s | h >>> 32 - s; + var rotlBH2 = (h, l, s) => l << s - 32 | h >>> 64 - s; + var rotlBL2 = (h, l, s) => h << s - 32 | l >>> 64 - s; + function add2(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; + } + exports.add = add2; + var add3L2 = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + var add3H2 = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; + var add4L2 = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + var add4H2 = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; + var add5L2 = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + var add5H2 = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; + var u642 = { + fromBig: fromBig2, + split: split2, + toBig: exports.toBig, + shrSH: shrSH2, + shrSL: shrSL2, + rotrSH: rotrSH2, + rotrSL: rotrSL2, + rotrBH: rotrBH2, + rotrBL: rotrBL2, + rotr32H: rotr32H2, + rotr32L: rotr32L2, + rotlSH: rotlSH2, + rotlSL: rotlSL2, + rotlBH: rotlBH2, + rotlBL: rotlBL2, + add: add2, + add3L: add3L2, + add3H: add3H2, + add4L: add4L2, + add4H: add4H2, + add5H: add5H2, + add5L: add5L2 + }; + exports.default = u642; + } + }); + + // node_modules/@noble/hashes/sha512.js + var require_sha512 = __commonJS({ + "node_modules/@noble/hashes/sha512.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA512 = void 0; + var _sha2_js_1 = require_sha2(); + var _u64_js_1 = require_u64(); + var utils_js_1 = require_utils(); + var [SHA512_Kh2, SHA512_Kl2] = _u64_js_1.default.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" + ].map((n) => BigInt(n))); + var SHA512_W_H2 = new Uint32Array(80); + var SHA512_W_L2 = new Uint32Array(80); + var SHA5122 = class extends _sha2_js_1.SHA2 { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H2[i] = view.getUint32(offset); + SHA512_W_L2[i] = view.getUint32(offset += 4); + } + for (let i = 16; i < 80; i++) { + const W15h = SHA512_W_H2[i - 15] | 0; + const W15l = SHA512_W_L2[i - 15] | 0; + const s0h = _u64_js_1.default.rotrSH(W15h, W15l, 1) ^ _u64_js_1.default.rotrSH(W15h, W15l, 8) ^ _u64_js_1.default.shrSH(W15h, W15l, 7); + const s0l = _u64_js_1.default.rotrSL(W15h, W15l, 1) ^ _u64_js_1.default.rotrSL(W15h, W15l, 8) ^ _u64_js_1.default.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H2[i - 2] | 0; + const W2l = SHA512_W_L2[i - 2] | 0; + const s1h = _u64_js_1.default.rotrSH(W2h, W2l, 19) ^ _u64_js_1.default.rotrBH(W2h, W2l, 61) ^ _u64_js_1.default.shrSH(W2h, W2l, 6); + const s1l = _u64_js_1.default.rotrSL(W2h, W2l, 19) ^ _u64_js_1.default.rotrBL(W2h, W2l, 61) ^ _u64_js_1.default.shrSL(W2h, W2l, 6); + const SUMl = _u64_js_1.default.add4L(s0l, s1l, SHA512_W_L2[i - 7], SHA512_W_L2[i - 16]); + const SUMh = _u64_js_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H2[i - 7], SHA512_W_H2[i - 16]); + SHA512_W_H2[i] = SUMh | 0; + SHA512_W_L2[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + for (let i = 0; i < 80; i++) { + const sigma1h = _u64_js_1.default.rotrSH(Eh, El, 14) ^ _u64_js_1.default.rotrSH(Eh, El, 18) ^ _u64_js_1.default.rotrBH(Eh, El, 41); + const sigma1l = _u64_js_1.default.rotrSL(Eh, El, 14) ^ _u64_js_1.default.rotrSL(Eh, El, 18) ^ _u64_js_1.default.rotrBL(Eh, El, 41); + const CHIh = Eh & Fh ^ ~Eh & Gh; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = _u64_js_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl2[i], SHA512_W_L2[i]); + const T1h = _u64_js_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh2[i], SHA512_W_H2[i]); + const T1l = T1ll | 0; + const sigma0h = _u64_js_1.default.rotrSH(Ah, Al, 28) ^ _u64_js_1.default.rotrBH(Ah, Al, 34) ^ _u64_js_1.default.rotrBH(Ah, Al, 39); + const sigma0l = _u64_js_1.default.rotrSL(Ah, Al, 28) ^ _u64_js_1.default.rotrBL(Ah, Al, 34) ^ _u64_js_1.default.rotrBL(Ah, Al, 39); + const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = _u64_js_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = _u64_js_1.default.add3L(T1l, sigma0l, MAJl); + Ah = _u64_js_1.default.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah, l: Al } = _u64_js_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = _u64_js_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = _u64_js_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = _u64_js_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = _u64_js_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = _u64_js_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = _u64_js_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = _u64_js_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + SHA512_W_H2.fill(0); + SHA512_W_L2.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + }; + exports.SHA512 = SHA5122; + var SHA512_2242 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 2352822216 | 0; + this.Al = 424955298 | 0; + this.Bh = 1944164710 | 0; + this.Bl = 2312950998 | 0; + this.Ch = 502970286 | 0; + this.Cl = 855612546 | 0; + this.Dh = 1738396948 | 0; + this.Dl = 1479516111 | 0; + this.Eh = 258812777 | 0; + this.El = 2077511080 | 0; + this.Fh = 2011393907 | 0; + this.Fl = 79989058 | 0; + this.Gh = 1067287976 | 0; + this.Gl = 1780299464 | 0; + this.Hh = 286451373 | 0; + this.Hl = 2446758561 | 0; + this.outputLen = 28; + } + }; + var SHA512_2562 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 573645204 | 0; + this.Al = 4230739756 | 0; + this.Bh = 2673172387 | 0; + this.Bl = 3360449730 | 0; + this.Ch = 596883563 | 0; + this.Cl = 1867755857 | 0; + this.Dh = 2520282905 | 0; + this.Dl = 1497426621 | 0; + this.Eh = 2519219938 | 0; + this.El = 2827943907 | 0; + this.Fh = 3193839141 | 0; + this.Fl = 1401305490 | 0; + this.Gh = 721525244 | 0; + this.Gl = 746961066 | 0; + this.Hh = 246885852 | 0; + this.Hl = 2177182882 | 0; + this.outputLen = 32; + } + }; + var SHA3842 = class extends SHA5122 { + constructor() { + super(); + this.Ah = 3418070365 | 0; + this.Al = 3238371032 | 0; + this.Bh = 1654270250 | 0; + this.Bl = 914150663 | 0; + this.Ch = 2438529370 | 0; + this.Cl = 812702999 | 0; + this.Dh = 355462360 | 0; + this.Dl = 4144912697 | 0; + this.Eh = 1731405415 | 0; + this.El = 4290775857 | 0; + this.Fh = 2394180231 | 0; + this.Fl = 1750603025 | 0; + this.Gh = 3675008525 | 0; + this.Gl = 1694076839 | 0; + this.Hh = 1203062813 | 0; + this.Hl = 3204075428 | 0; + this.outputLen = 48; + } + }; + exports.sha512 = (0, utils_js_1.wrapConstructor)(() => new SHA5122()); + exports.sha512_224 = (0, utils_js_1.wrapConstructor)(() => new SHA512_2242()); + exports.sha512_256 = (0, utils_js_1.wrapConstructor)(() => new SHA512_2562()); + exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA3842()); + } + }); + + // node_modules/@scure/base/lib/index.js + var require_lib = __commonJS({ + "node_modules/@scure/base/lib/index.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64url = exports.base64 = exports.base32crockford = exports.base32hex = exports.base32 = exports.base16 = exports.utils = exports.assertNumber = void 0; + function assertNumber2(n) { + if (!Number.isSafeInteger(n)) + throw new Error(`Wrong integer: ${n}`); + } + exports.assertNumber = assertNumber2; + function chain2(...args) { + const wrap = (a, b) => (c) => a(b(c)); + const encode = Array.from(args).reverse().reduce((acc, i) => acc ? wrap(acc, i.encode) : i.encode, void 0); + const decode2 = args.reduce((acc, i) => acc ? wrap(acc, i.decode) : i.decode, void 0); + return { encode, decode: decode2 }; + } + function alphabet2(alphabet3) { + return { + encode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("alphabet.encode input should be an array of numbers"); + return digits.map((i) => { + assertNumber2(i); + if (i < 0 || i >= alphabet3.length) + throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet3.length})`); + return alphabet3[i]; + }); + }, + decode: (input) => { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("alphabet.decode input should be array of strings"); + return input.map((letter) => { + if (typeof letter !== "string") + throw new Error(`alphabet.decode: not string element=${letter}`); + const index = alphabet3.indexOf(letter); + if (index === -1) + throw new Error(`Unknown letter: "${letter}". Allowed: ${alphabet3}`); + return index; + }); + } + }; + } + function join2(separator = "") { + if (typeof separator !== "string") + throw new Error("join separator should be string"); + return { + encode: (from) => { + if (!Array.isArray(from) || from.length && typeof from[0] !== "string") + throw new Error("join.encode input should be array of strings"); + for (let i of from) + if (typeof i !== "string") + throw new Error(`join.encode: non-string input=${i}`); + return from.join(separator); + }, + decode: (to) => { + if (typeof to !== "string") + throw new Error("join.decode input should be string"); + return to.split(separator); + } + }; + } + function padding2(bits, chr = "=") { + assertNumber2(bits); + if (typeof chr !== "string") + throw new Error("padding chr should be string"); + return { + encode(data) { + if (!Array.isArray(data) || data.length && typeof data[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of data) + if (typeof i !== "string") + throw new Error(`padding.encode: non-string input=${i}`); + while (data.length * bits % 8) + data.push(chr); + return data; + }, + decode(input) { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of input) + if (typeof i !== "string") + throw new Error(`padding.decode: non-string input=${i}`); + let end = input.length; + if (end * bits % 8) + throw new Error("Invalid padding: string should have whole number of bytes"); + for (; end > 0 && input[end - 1] === chr; end--) { + if (!((end - 1) * bits % 8)) + throw new Error("Invalid padding: string has too much padding"); + } + return input.slice(0, end); + } + }; + } + function normalize2(fn) { + if (typeof fn !== "function") + throw new Error("normalize fn should be function"); + return { encode: (from) => from, decode: (to) => fn(to) }; + } + function convertRadix3(data, from, to) { + if (from < 2) + throw new Error(`convertRadix: wrong from=${from}, base cannot be less than 2`); + if (to < 2) + throw new Error(`convertRadix: wrong to=${to}, base cannot be less than 2`); + if (!Array.isArray(data)) + throw new Error("convertRadix: data should be array"); + if (!data.length) + return []; + let pos = 0; + const res = []; + const digits = Array.from(data); + digits.forEach((d) => { + assertNumber2(d); + if (d < 0 || d >= from) + throw new Error(`Wrong integer: ${d}`); + }); + while (true) { + let carry = 0; + let done = true; + for (let i = pos; i < digits.length; i++) { + const digit = digits[i]; + const digitBase = from * carry + digit; + if (!Number.isSafeInteger(digitBase) || from * carry / from !== carry || digitBase - digit !== from * carry) { + throw new Error("convertRadix: carry overflow"); + } + carry = digitBase % to; + digits[i] = Math.floor(digitBase / to); + if (!Number.isSafeInteger(digits[i]) || digits[i] * to + carry !== digitBase) + throw new Error("convertRadix: carry overflow"); + if (!done) + continue; + else if (!digits[i]) + pos = i; + else + done = false; + } + res.push(carry); + if (done) + break; + } + for (let i = 0; i < data.length - 1 && data[i] === 0; i++) + res.push(0); + return res.reverse(); + } + var gcd2 = (a, b) => !b ? a : gcd2(b, a % b); + var radix2carry2 = (from, to) => from + (to - gcd2(from, to)); + function convertRadix22(data, from, to, padding3) { + if (!Array.isArray(data)) + throw new Error("convertRadix2: data should be array"); + if (from <= 0 || from > 32) + throw new Error(`convertRadix2: wrong from=${from}`); + if (to <= 0 || to > 32) + throw new Error(`convertRadix2: wrong to=${to}`); + if (radix2carry2(from, to) > 32) { + throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry2(from, to)}`); + } + let carry = 0; + let pos = 0; + const mask = 2 ** to - 1; + const res = []; + for (const n of data) { + assertNumber2(n); + if (n >= 2 ** from) + throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); + carry = carry << from | n; + if (pos + from > 32) + throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); + pos += from; + for (; pos >= to; pos -= to) + res.push((carry >> pos - to & mask) >>> 0); + carry &= 2 ** pos - 1; + } + carry = carry << to - pos & mask; + if (!padding3 && pos >= from) + throw new Error("Excess padding"); + if (!padding3 && carry) + throw new Error(`Non-zero padding: ${carry}`); + if (padding3 && pos > 0) + res.push(carry >>> 0); + return res; + } + function radix3(num) { + assertNumber2(num); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix.encode input should be Uint8Array"); + return convertRadix3(Array.from(bytes2), 2 ** 8, num); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix.decode input should be array of strings"); + return Uint8Array.from(convertRadix3(digits, num, 2 ** 8)); + } + }; + } + function radix22(bits, revPadding = false) { + assertNumber2(bits); + if (bits <= 0 || bits > 32) + throw new Error("radix2: bits should be in (0..32]"); + if (radix2carry2(8, bits) > 32 || radix2carry2(bits, 8) > 32) + throw new Error("radix2: carry overflow"); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix2.encode input should be Uint8Array"); + return convertRadix22(Array.from(bytes2), 8, bits, !revPadding); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix2.decode input should be array of strings"); + return Uint8Array.from(convertRadix22(digits, bits, 8, revPadding)); + } + }; + } + function unsafeWrapper2(fn) { + if (typeof fn !== "function") + throw new Error("unsafeWrapper fn should be function"); + return function(...args) { + try { + return fn.apply(null, args); + } catch (e) { + } + }; + } + function checksum2(len, fn) { + assertNumber2(len); + if (typeof fn !== "function") + throw new Error("checksum fn should be function"); + return { + encode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.encode: input should be Uint8Array"); + const checksum3 = fn(data).slice(0, len); + const res = new Uint8Array(data.length + len); + res.set(data); + res.set(checksum3, data.length); + return res; + }, + decode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.decode: input should be Uint8Array"); + const payload = data.slice(0, -len); + const newChecksum = fn(payload).slice(0, len); + const oldChecksum = data.slice(-len); + for (let i = 0; i < len; i++) + if (newChecksum[i] !== oldChecksum[i]) + throw new Error("Invalid checksum"); + return payload; + } + }; + } + exports.utils = { alphabet: alphabet2, chain: chain2, checksum: checksum2, radix: radix3, radix2: radix22, join: join2, padding: padding2 }; + exports.base16 = chain2(radix22(4), alphabet2("0123456789ABCDEF"), join2("")); + exports.base32 = chain2(radix22(5), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding2(5), join2("")); + exports.base32hex = chain2(radix22(5), alphabet2("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding2(5), join2("")); + exports.base32crockford = chain2(radix22(5), alphabet2("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join2(""), normalize2((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1"))); + exports.base64 = chain2(radix22(6), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding2(6), join2("")); + exports.base64url = chain2(radix22(6), alphabet2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding2(6), join2("")); + var genBase582 = (abc) => chain2(radix3(58), alphabet2(abc), join2("")); + exports.base58 = genBase582("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); + exports.base58flickr = genBase582("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"); + exports.base58xrp = genBase582("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"); + var XMR_BLOCK_LEN2 = [0, 2, 3, 5, 6, 7, 9, 10, 11]; + exports.base58xmr = { + encode(data) { + let res = ""; + for (let i = 0; i < data.length; i += 8) { + const block = data.subarray(i, i + 8); + res += exports.base58.encode(block).padStart(XMR_BLOCK_LEN2[block.length], "1"); + } + return res; + }, + decode(str) { + let res = []; + for (let i = 0; i < str.length; i += 11) { + const slice = str.slice(i, i + 11); + const blockLen = XMR_BLOCK_LEN2.indexOf(slice.length); + const block = exports.base58.decode(slice); + for (let j = 0; j < block.length - blockLen; j++) { + if (block[j] !== 0) + throw new Error("base58xmr: wrong padding"); + } + res = res.concat(Array.from(block.slice(block.length - blockLen))); + } + return Uint8Array.from(res); + } + }; + var base58check3 = (sha2562) => chain2(checksum2(4, (data) => sha2562(sha2562(data))), exports.base58); + exports.base58check = base58check3; + var BECH_ALPHABET2 = chain2(alphabet2("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join2("")); + var POLYMOD_GENERATORS2 = [996825010, 642813549, 513874426, 1027748829, 705979059]; + function bech32Polymod2(pre) { + const b = pre >> 25; + let chk = (pre & 33554431) << 5; + for (let i = 0; i < POLYMOD_GENERATORS2.length; i++) { + if ((b >> i & 1) === 1) + chk ^= POLYMOD_GENERATORS2[i]; + } + return chk; + } + function bechChecksum2(prefix, words, encodingConst = 1) { + const len = prefix.length; + let chk = 1; + for (let i = 0; i < len; i++) { + const c = prefix.charCodeAt(i); + if (c < 33 || c > 126) + throw new Error(`Invalid prefix (${prefix})`); + chk = bech32Polymod2(chk) ^ c >> 5; + } + chk = bech32Polymod2(chk); + for (let i = 0; i < len; i++) + chk = bech32Polymod2(chk) ^ prefix.charCodeAt(i) & 31; + for (let v of words) + chk = bech32Polymod2(chk) ^ v; + for (let i = 0; i < 6; i++) + chk = bech32Polymod2(chk); + chk ^= encodingConst; + return BECH_ALPHABET2.encode(convertRadix22([chk % 2 ** 30], 30, 5, false)); + } + function genBech322(encoding) { + const ENCODING_CONST = encoding === "bech32" ? 1 : 734539939; + const _words = radix22(5); + const fromWords = _words.decode; + const toWords = _words.encode; + const fromWordsUnsafe = unsafeWrapper2(fromWords); + function encode(prefix, words, limit = 90) { + if (typeof prefix !== "string") + throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`); + if (!Array.isArray(words) || words.length && typeof words[0] !== "number") + throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`); + const actualLength = prefix.length + 7 + words.length; + if (limit !== false && actualLength > limit) + throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); + prefix = prefix.toLowerCase(); + return `${prefix}1${BECH_ALPHABET2.encode(words)}${bechChecksum2(prefix, words, ENCODING_CONST)}`; + } + function decode2(str, limit = 90) { + if (typeof str !== "string") + throw new Error(`bech32.decode input should be string, not ${typeof str}`); + if (str.length < 8 || limit !== false && str.length > limit) + throw new TypeError(`Wrong string length: ${str.length} (${str}). Expected (8..${limit})`); + const lowered = str.toLowerCase(); + if (str !== lowered && str !== str.toUpperCase()) + throw new Error(`String must be lowercase or uppercase`); + str = lowered; + const sepIndex = str.lastIndexOf("1"); + if (sepIndex === 0 || sepIndex === -1) + throw new Error(`Letter "1" must be present between prefix and data only`); + const prefix = str.slice(0, sepIndex); + const _words2 = str.slice(sepIndex + 1); + if (_words2.length < 6) + throw new Error("Data must be at least 6 characters long"); + const words = BECH_ALPHABET2.decode(_words2).slice(0, -6); + const sum = bechChecksum2(prefix, words, ENCODING_CONST); + if (!_words2.endsWith(sum)) + throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); + return { prefix, words }; + } + const decodeUnsafe = unsafeWrapper2(decode2); + function decodeToBytes(str) { + const { prefix, words } = decode2(str, false); + return { prefix, words, bytes: fromWords(words) }; + } + return { encode, decode: decode2, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords }; + } + exports.bech32 = genBech322("bech32"); + exports.bech32m = genBech322("bech32m"); + exports.utf8 = { + encode: (data) => new TextDecoder().decode(data), + decode: (str) => new TextEncoder().encode(str) + }; + exports.hex = chain2(radix22(4), alphabet2("0123456789abcdef"), join2(""), normalize2((s) => { + if (typeof s !== "string" || s.length % 2) + throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); + return s.toLowerCase(); + })); + var CODERS2 = { + utf8: exports.utf8, + hex: exports.hex, + base16: exports.base16, + base32: exports.base32, + base64: exports.base64, + base64url: exports.base64url, + base58: exports.base58, + base58xmr: exports.base58xmr + }; + var coderTypeError2 = `Invalid encoding type. Available types: ${Object.keys(CODERS2).join(", ")}`; + var bytesToString = (type, bytes2) => { + if (typeof type !== "string" || !CODERS2.hasOwnProperty(type)) + throw new TypeError(coderTypeError2); + if (!(bytes2 instanceof Uint8Array)) + throw new TypeError("bytesToString() expects Uint8Array"); + return CODERS2[type].encode(bytes2); + }; + exports.bytesToString = bytesToString; + exports.str = exports.bytesToString; + var stringToBytes = (type, str) => { + if (!CODERS2.hasOwnProperty(type)) + throw new TypeError(coderTypeError2); + if (typeof str !== "string") + throw new TypeError("stringToBytes() expects string"); + return CODERS2[type].decode(str); + }; + exports.stringToBytes = stringToBytes; + exports.bytes = exports.stringToBytes; + } + }); + + // node_modules/@scure/bip39/index.js + var require_bip39 = __commonJS({ + "node_modules/@scure/bip39/index.js"(exports) { + "use strict"; + init_define_process(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.mnemonicToSeedSync = exports.mnemonicToSeed = exports.validateMnemonic = exports.entropyToMnemonic = exports.mnemonicToEntropy = exports.generateMnemonic = void 0; + var _assert_1 = require_assert(); + var pbkdf2_1 = require_pbkdf2(); + var sha256_1 = require_sha256(); + var sha512_1 = require_sha512(); + var utils_1 = require_utils(); + var base_1 = require_lib(); + var isJapanese = (wordlist2) => wordlist2[0] === "\u3042\u3044\u3053\u304F\u3057\u3093"; + function nfkd(str) { + if (typeof str !== "string") + throw new TypeError(`Invalid mnemonic type: ${typeof str}`); + return str.normalize("NFKD"); + } + function normalize2(str) { + const norm = nfkd(str); + const words = norm.split(" "); + if (![12, 15, 18, 21, 24].includes(words.length)) + throw new Error("Invalid mnemonic"); + return { nfkd: norm, words }; + } + function assertEntropy(entropy) { + _assert_1.default.bytes(entropy, 16, 20, 24, 28, 32); + } + function generateMnemonic2(wordlist2, strength = 128) { + _assert_1.default.number(strength); + if (strength % 32 !== 0 || strength > 256) + throw new TypeError("Invalid entropy"); + return entropyToMnemonic((0, utils_1.randomBytes)(strength / 8), wordlist2); + } + exports.generateMnemonic = generateMnemonic2; + var calcChecksum = (entropy) => { + const bitsLeft = 8 - entropy.length / 4; + return new Uint8Array([(0, sha256_1.sha256)(entropy)[0] >> bitsLeft << bitsLeft]); + }; + function getCoder(wordlist2) { + if (!Array.isArray(wordlist2) || wordlist2.length !== 2048 || typeof wordlist2[0] !== "string") + throw new Error("Worlist: expected array of 2048 strings"); + wordlist2.forEach((i) => { + if (typeof i !== "string") + throw new Error(`Wordlist: non-string element: ${i}`); + }); + return base_1.utils.chain(base_1.utils.checksum(1, calcChecksum), base_1.utils.radix2(11, true), base_1.utils.alphabet(wordlist2)); + } + function mnemonicToEntropy(mnemonic, wordlist2) { + const { words } = normalize2(mnemonic); + const entropy = getCoder(wordlist2).decode(words); + assertEntropy(entropy); + return entropy; + } + exports.mnemonicToEntropy = mnemonicToEntropy; + function entropyToMnemonic(entropy, wordlist2) { + assertEntropy(entropy); + const words = getCoder(wordlist2).encode(entropy); + return words.join(isJapanese(wordlist2) ? "\u3000" : " "); + } + exports.entropyToMnemonic = entropyToMnemonic; + function validateMnemonic2(mnemonic, wordlist2) { + try { + mnemonicToEntropy(mnemonic, wordlist2); + } catch (e) { + return false; + } + return true; + } + exports.validateMnemonic = validateMnemonic2; + var salt = (passphrase) => nfkd(`mnemonic${passphrase}`); + function mnemonicToSeed(mnemonic, passphrase = "") { + return (0, pbkdf2_1.pbkdf2Async)(sha512_1.sha512, normalize2(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); + } + exports.mnemonicToSeed = mnemonicToSeed; + function mnemonicToSeedSync2(mnemonic, passphrase = "") { + return (0, pbkdf2_1.pbkdf2)(sha512_1.sha512, normalize2(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); + } + exports.mnemonicToSeedSync = mnemonicToSeedSync2; + } + }); + + // index.ts + var nostr_tools_exports = {}; + __export(nostr_tools_exports, { + Kind: () => Kind, + SimplePool: () => SimplePool, + finishEvent: () => finishEvent, + fj: () => fakejson_exports, + generatePrivateKey: () => generatePrivateKey, + getBlankEvent: () => getBlankEvent, + getEventHash: () => getEventHash, + getPublicKey: () => getPublicKey, + getSignature: () => getSignature, + matchFilter: () => matchFilter, + matchFilters: () => matchFilters, + mergeFilters: () => mergeFilters, + nip04: () => nip04_exports, + nip05: () => nip05_exports, + nip06: () => nip06_exports, + nip10: () => nip10_exports, + nip13: () => nip13_exports, + nip18: () => nip18_exports, + nip19: () => nip19_exports, + nip21: () => nip21_exports, + nip25: () => nip25_exports, + nip26: () => nip26_exports, + nip27: () => nip27_exports, + nip39: () => nip39_exports, + nip42: () => nip42_exports, + nip57: () => nip57_exports, + nip98: () => nip98_exports, + parseReferences: () => parseReferences, + relayInit: () => relayInit, + serializeEvent: () => serializeEvent, + signEvent: () => signEvent, + utils: () => utils_exports2, + validateEvent: () => validateEvent, + verifySignature: () => verifySignature + }); + init_define_process(); + + // keys.ts + init_define_process(); + + // node_modules/@noble/curves/esm/secp256k1.js + init_define_process(); + + // node_modules/@noble/hashes/esm/sha256.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_sha2.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_assert.js + init_define_process(); + function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); + } + function bool(b) { + if (typeof b !== "boolean") + throw new Error(`Expected boolean, not ${b}`); + } + function bytes(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); + } + function hash(hash2) { + if (typeof hash2 !== "function" || typeof hash2.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number(hash2.outputLen); + number(hash2.blockLen); + } + function exists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance.finished) + throw new Error("Hash#digest() has already been called"); + } + function output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } + } + var assert = { + number, + bool, + bytes, + hash, + exists, + output + }; + var assert_default = assert; + + // node_modules/@noble/hashes/esm/utils.js + init_define_process(); + + // node_modules/@noble/hashes/esm/crypto.js + init_define_process(); + var crypto2 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; + + // node_modules/@noble/hashes/esm/utils.js + var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + var rotr = (word, shift) => word << 32 - shift | word >>> shift; + var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; + if (!isLE) + throw new Error("Non little-endian hardware is not supported"); + var hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < uint8a.length; i++) { + hex2 += hexes[uint8a[i]]; + } + return hex2; + } + function hexToBytes(hex2) { + if (typeof hex2 !== "string") { + throw new TypeError("hexToBytes: expected string, got " + typeof hex2); + } + if (hex2.length % 2) + throw new Error("hexToBytes: received invalid unpadded hex"); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("Invalid byte sequence"); + array[i] = byte; + } + return array; + } + function utf8ToBytes(str) { + if (typeof str !== "string") { + throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function toBytes(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + if (!(data instanceof Uint8Array)) + throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`); + return data; + } + function concatBytes(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error("Uint8Array list expected"); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + var Hash = class { + clone() { + return this._cloneInto(); + } + }; + function wrapConstructor(hashConstructor) { + const hashC = (message) => hashConstructor().update(toBytes(message)).digest(); + const tmp = hashConstructor(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashConstructor(); + return hashC; + } + function randomBytes(bytesLength = 32) { + if (crypto2 && typeof crypto2.getRandomValues === "function") { + return crypto2.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); + } + + // node_modules/@noble/hashes/esm/_sha2.js + function setBigUint64(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE2 ? 4 : 0; + const l = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE2); + view.setUint32(byteOffset + l, wl, isLE2); + } + var SHA2 = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + assert_default.exists(this); + const { view, buffer, blockLen } = this; + data = toBytes(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE2); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + }; + + // node_modules/@noble/hashes/esm/sha256.js + var Chi = (a, b, c) => a & b ^ ~a & c; + var Maj = (a, b, c) => a & b ^ a & c ^ b & c; + var SHA256_K = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + var IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SHA256_W = new Uint32Array(64); + var SHA256 = class extends SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; + SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0; + } + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = sigma0 + Maj(A, B, C) | 0; + H = G; + G = F; + F = E; + E = D + T1 | 0; + D = C; + C = B; + B = A; + A = T1 + T2 | 0; + } + A = A + this.A | 0; + B = B + this.B | 0; + C = C + this.C | 0; + D = D + this.D | 0; + E = E + this.E | 0; + F = F + this.F | 0; + G = G + this.G | 0; + H = H + this.H | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } + }; + var SHA224 = class extends SHA256 { + constructor() { + super(); + this.A = 3238371032 | 0; + this.B = 914150663 | 0; + this.C = 812702999 | 0; + this.D = 4144912697 | 0; + this.E = 4290775857 | 0; + this.F = 1750603025 | 0; + this.G = 1694076839 | 0; + this.H = 3204075428 | 0; + this.outputLen = 28; + } + }; + var sha256 = wrapConstructor(() => new SHA256()); + var sha224 = wrapConstructor(() => new SHA224()); + + // node_modules/@noble/curves/esm/abstract/modular.js + init_define_process(); + + // node_modules/@noble/curves/esm/abstract/utils.js + var utils_exports = {}; + __export(utils_exports, { + bitGet: () => bitGet, + bitLen: () => bitLen, + bitMask: () => bitMask, + bitSet: () => bitSet, + bytesToHex: () => bytesToHex2, + bytesToNumberBE: () => bytesToNumberBE, + bytesToNumberLE: () => bytesToNumberLE, + concatBytes: () => concatBytes2, + createHmacDrbg: () => createHmacDrbg, + ensureBytes: () => ensureBytes, + equalBytes: () => equalBytes, + hexToBytes: () => hexToBytes2, + hexToNumber: () => hexToNumber, + numberToBytesBE: () => numberToBytesBE, + numberToBytesLE: () => numberToBytesLE, + numberToHexUnpadded: () => numberToHexUnpadded, + numberToVarBytesBE: () => numberToVarBytesBE, + utf8ToBytes: () => utf8ToBytes2, + validateObject: () => validateObject + }); + init_define_process(); + var _0n = BigInt(0); + var _1n = BigInt(1); + var _2n = BigInt(2); + var u8a = (a) => a instanceof Uint8Array; + var hexes2 = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex2(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + let hex2 = ""; + for (let i = 0; i < bytes2.length; i++) { + hex2 += hexes2[bytes2[i]]; + } + return hex2; + } + function numberToHexUnpadded(num) { + const hex2 = num.toString(16); + return hex2.length & 1 ? `0${hex2}` : hex2; + } + function hexToNumber(hex2) { + if (typeof hex2 !== "string") + throw new Error("hex string expected, got " + typeof hex2); + return BigInt(hex2 === "" ? "0" : `0x${hex2}`); + } + function hexToBytes2(hex2) { + if (typeof hex2 !== "string") + throw new Error("hex string expected, got " + typeof hex2); + if (hex2.length % 2) + throw new Error("hex string is invalid: unpadded " + hex2.length); + const array = new Uint8Array(hex2.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex2.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("invalid byte sequence"); + array[i] = byte; + } + return array; + } + function bytesToNumberBE(bytes2) { + return hexToNumber(bytesToHex2(bytes2)); + } + function bytesToNumberLE(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + return hexToNumber(bytesToHex2(Uint8Array.from(bytes2).reverse())); + } + var numberToBytesBE = (n, len) => hexToBytes2(n.toString(16).padStart(len * 2, "0")); + var numberToBytesLE = (n, len) => numberToBytesBE(n, len).reverse(); + var numberToVarBytesBE = (n) => hexToBytes2(numberToHexUnpadded(n)); + function ensureBytes(title, hex2, expectedLength) { + let res; + if (typeof hex2 === "string") { + try { + res = hexToBytes2(hex2); + } catch (e) { + throw new Error(`${title} must be valid hex string, got "${hex2}". Cause: ${e}`); + } + } else if (u8a(hex2)) { + res = Uint8Array.from(hex2); + } else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === "number" && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; + } + function concatBytes2(...arrs) { + const r = new Uint8Array(arrs.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; + arrs.forEach((a) => { + if (!u8a(a)) + throw new Error("Uint8Array expected"); + r.set(a, pad); + pad += a.length; + }); + return r; + } + function equalBytes(b1, b2) { + if (b1.length !== b2.length) + return false; + for (let i = 0; i < b1.length; i++) + if (b1[i] !== b2[i]) + return false; + return true; + } + function utf8ToBytes2(str) { + if (typeof str !== "string") { + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function bitLen(n) { + let len; + for (len = 0; n > _0n; n >>= _1n, len += 1) + ; + return len; + } + var bitGet = (n, pos) => n >> BigInt(pos) & _1n; + var bitSet = (n, pos, value) => n | (value ? _1n : _0n) << BigInt(pos); + var bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; + var u8n = (data) => new Uint8Array(data); + var u8fr = (arr) => Uint8Array.from(arr); + function createHmacDrbg(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== "number" || hashLen < 2) + throw new Error("hashLen must be a number"); + if (typeof qByteLen !== "number" || qByteLen < 2) + throw new Error("qByteLen must be a number"); + if (typeof hmacFn !== "function") + throw new Error("hmacFn must be a function"); + let v = u8n(hashLen); + let k = u8n(hashLen); + let i = 0; + const reset = () => { + v.fill(1); + k.fill(0); + i = 0; + }; + const h = (...b) => hmacFn(k, v, ...b); + const reseed = (seed = u8n()) => { + k = h(u8fr([0]), seed); + v = h(); + if (seed.length === 0) + return; + k = h(u8fr([1]), seed); + v = h(); + }; + const gen = () => { + if (i++ >= 1e3) + throw new Error("drbg: tried 1000 values"); + let len = 0; + const out = []; + while (len < qByteLen) { + v = h(); + const sl = v.slice(); + out.push(sl); + len += v.length; + } + return concatBytes2(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed(seed); + let res = void 0; + while (!(res = pred(gen()))) + reseed(); + reset(); + return res; + }; + return genUntil; + } + var validatorFns = { + bigint: (val) => typeof val === "bigint", + function: (val) => typeof val === "function", + boolean: (val) => typeof val === "boolean", + string: (val) => typeof val === "string", + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) + }; + function validateObject(object, validators, optValidators = {}) { + const checkField = (fieldName, type, isOptional) => { + const checkVal = validatorFns[type]; + if (typeof checkVal !== "function") + throw new Error(`Invalid validator "${type}", expected function`); + const val = object[fieldName]; + if (isOptional && val === void 0) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); + } + }; + for (const [fieldName, type] of Object.entries(validators)) + checkField(fieldName, type, false); + for (const [fieldName, type] of Object.entries(optValidators)) + checkField(fieldName, type, true); + return object; + } + + // node_modules/@noble/curves/esm/abstract/modular.js + var _0n2 = BigInt(0); + var _1n2 = BigInt(1); + var _2n2 = BigInt(2); + var _3n = BigInt(3); + var _4n = BigInt(4); + var _5n = BigInt(5); + var _8n = BigInt(8); + var _9n = BigInt(9); + var _16n = BigInt(16); + function mod(a, b) { + const result = a % b; + return result >= _0n2 ? result : b + result; + } + function pow(num, power, modulo) { + if (modulo <= _0n2 || power < _0n2) + throw new Error("Expected power/modulo > 0"); + if (modulo === _1n2) + return _0n2; + let res = _1n2; + while (power > _0n2) { + if (power & _1n2) + res = res * num % modulo; + num = num * num % modulo; + power >>= _1n2; + } + return res; + } + function pow2(x, power, modulo) { + let res = x; + while (power-- > _0n2) { + res *= res; + res %= modulo; + } + return res; + } + function invert(number2, modulo) { + if (number2 === _0n2 || modulo <= _0n2) { + throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); + } + let a = mod(number2, modulo); + let b = modulo; + let x = _0n2, y = _1n2, u = _1n2, v = _0n2; + while (a !== _0n2) { + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd2 = b; + if (gcd2 !== _1n2) + throw new Error("invert: does not exist"); + return mod(x, modulo); + } + function tonelliShanks(P) { + const legendreC = (P - _1n2) / _2n2; + let Q, S, Z; + for (Q = P - _1n2, S = 0; Q % _2n2 === _0n2; Q /= _2n2, S++) + ; + for (Z = _2n2; Z < P && pow(Z, legendreC, P) !== P - _1n2; Z++) + ; + if (S === 1) { + const p1div4 = (P + _1n2) / _4n; + return function tonelliFast(Fp2, n) { + const root = Fp2.pow(n, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + const Q1div2 = (Q + _1n2) / _2n2; + return function tonelliSlow(Fp2, n) { + if (Fp2.pow(n, legendreC) === Fp2.neg(Fp2.ONE)) + throw new Error("Cannot find square root"); + let r = S; + let g = Fp2.pow(Fp2.mul(Fp2.ONE, Z), Q); + let x = Fp2.pow(n, Q1div2); + let b = Fp2.pow(n, Q); + while (!Fp2.eql(b, Fp2.ONE)) { + if (Fp2.eql(b, Fp2.ZERO)) + return Fp2.ZERO; + let m = 1; + for (let t2 = Fp2.sqr(b); m < r; m++) { + if (Fp2.eql(t2, Fp2.ONE)) + break; + t2 = Fp2.sqr(t2); + } + const ge2 = Fp2.pow(g, _1n2 << BigInt(r - m - 1)); + g = Fp2.sqr(ge2); + x = Fp2.mul(x, ge2); + b = Fp2.mul(b, g); + r = m; + } + return x; + }; + } + function FpSqrt(P) { + if (P % _4n === _3n) { + const p1div4 = (P + _1n2) / _4n; + return function sqrt3mod4(Fp2, n) { + const root = Fp2.pow(n, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _8n === _5n) { + const c1 = (P - _5n) / _8n; + return function sqrt5mod8(Fp2, n) { + const n2 = Fp2.mul(n, _2n2); + const v = Fp2.pow(n2, c1); + const nv = Fp2.mul(n, v); + const i = Fp2.mul(Fp2.mul(nv, _2n2), v); + const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE)); + if (!Fp2.eql(Fp2.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _16n === _9n) { + } + return tonelliShanks(P); + } + var FIELD_FIELDS = [ + "create", + "isValid", + "is0", + "neg", + "inv", + "sqrt", + "sqr", + "eql", + "add", + "sub", + "mul", + "pow", + "div", + "addN", + "subN", + "mulN", + "sqrN" + ]; + function validateField(field) { + const initial = { + ORDER: "bigint", + MASK: "bigint", + BYTES: "isSafeInteger", + BITS: "isSafeInteger" + }; + const opts = FIELD_FIELDS.reduce((map, val) => { + map[val] = "function"; + return map; + }, initial); + return validateObject(field, opts); + } + function FpPow(f2, num, power) { + if (power < _0n2) + throw new Error("Expected power > 0"); + if (power === _0n2) + return f2.ONE; + if (power === _1n2) + return num; + let p = f2.ONE; + let d = num; + while (power > _0n2) { + if (power & _1n2) + p = f2.mul(p, d); + d = f2.sqr(d); + power >>= _1n2; + } + return p; + } + function FpInvertBatch(f2, nums) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (f2.is0(num)) + return acc; + tmp[i] = acc; + return f2.mul(acc, num); + }, f2.ONE); + const inverted = f2.inv(lastMultiplied); + nums.reduceRight((acc, num, i) => { + if (f2.is0(num)) + return acc; + tmp[i] = f2.mul(acc, tmp[i]); + return f2.mul(acc, num); + }, inverted); + return tmp; + } + function nLength(n, nBitLength) { + const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; + } + function Field(ORDER, bitLen2, isLE2 = false, redef = {}) { + if (ORDER <= _0n2) + throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2); + if (BYTES > 2048) + throw new Error("Field lengths over 2048 bytes are not supported"); + const sqrtP = FpSqrt(ORDER); + const f2 = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: bitMask(BITS), + ZERO: _0n2, + ONE: _1n2, + create: (num) => mod(num, ORDER), + isValid: (num) => { + if (typeof num !== "bigint") + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n2 <= num && num < ORDER; + }, + is0: (num) => num === _0n2, + isOdd: (num) => (num & _1n2) === _1n2, + neg: (num) => mod(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod(num * num, ORDER), + add: (lhs, rhs) => mod(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod(lhs * rhs, ORDER), + pow: (num, power) => FpPow(f2, num, power), + div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert(num, ORDER), + sqrt: redef.sqrt || ((n) => sqrtP(f2, n)), + invertBatch: (lst) => FpInvertBatch(f2, lst), + cmov: (a, b, c) => c ? b : a, + toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), + fromBytes: (bytes2) => { + if (bytes2.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); + return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2); + } + }); + return Object.freeze(f2); + } + function hashToPrivateScalar(hash2, groupOrder, isLE2 = false) { + hash2 = ensureBytes("privateHash", hash2); + const hashLen = hash2.length; + const minLen = nLength(groupOrder).nByteLength + 8; + if (minLen < 24 || hashLen < minLen || hashLen > 1024) + throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); + const num = isLE2 ? bytesToNumberLE(hash2) : bytesToNumberBE(hash2); + return mod(num, groupOrder - _1n2) + _1n2; + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + init_define_process(); + + // node_modules/@noble/curves/esm/abstract/curve.js + init_define_process(); + var _0n3 = BigInt(0); + var _1n3 = BigInt(1); + function wNAF(c, bits) { + const constTimeNegate = (condition, item) => { + const neg = item.negate(); + return condition ? neg : item; + }; + const opts = (W) => { + const windows = Math.ceil(bits / W) + 1; + const windowSize = 2 ** (W - 1); + return { windows, windowSize }; + }; + return { + constTimeNegate, + unsafeLadder(elm, n) { + let p = c.ZERO; + let d = elm; + while (n > _0n3) { + if (n & _1n3) + p = p.add(d); + d = d.double(); + n >>= _1n3; + } + return p; + }, + precomputeWindow(elm, W) { + const { windows, windowSize } = opts(W); + const points = []; + let p = elm; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < windowSize; i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + }, + wNAF(W, precomputes, n) { + const { windows, windowSize } = opts(W); + let p = c.ZERO; + let f2 = c.BASE; + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n3; + } + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; + const cond1 = window % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f2 = f2.add(constTimeNegate(cond1, precomputes[offset1])); + } else { + p = p.add(constTimeNegate(cond2, precomputes[offset2])); + } + } + return { p, f: f2 }; + }, + wNAFCached(P, precomputesMap, n, transform) { + const W = P._WINDOW_SIZE || 1; + let comp = precomputesMap.get(P); + if (!comp) { + comp = this.precomputeWindow(P, W); + if (W !== 1) { + precomputesMap.set(P, transform(comp)); + } + } + return this.wNAF(W, comp, n); + } + }; + } + function validateBasic(curve) { + validateField(curve.Fp); + validateObject(curve, { + n: "bigint", + h: "bigint", + Gx: "field", + Gy: "field" + }, { + nBitLength: "isSafeInteger", + nByteLength: "isSafeInteger" + }); + return Object.freeze({ + ...nLength(curve.n, curve.nBitLength), + ...curve, + ...{ p: curve.Fp.ORDER } + }); + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + function validatePointOpts(curve) { + const opts = validateBasic(curve); + validateObject(opts, { + a: "field", + b: "field" + }, { + allowedPrivateKeyLengths: "array", + wrapPrivateKey: "boolean", + isTorsionFree: "function", + clearCofactor: "function", + allowInfinityPoint: "boolean", + fromBytes: "function", + toBytes: "function" + }); + const { endo, Fp: Fp2, a } = opts; + if (endo) { + if (!Fp2.eql(a, Fp2.ZERO)) { + throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); + } + if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { + throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); + } + } + return Object.freeze({ ...opts }); + } + var { bytesToNumberBE: b2n, hexToBytes: h2b } = utils_exports; + var DER = { + Err: class DERErr extends Error { + constructor(m = "") { + super(m); + } + }, + _parseInt(data) { + const { Err: E } = DER; + if (data.length < 2 || data[0] !== 2) + throw new E("Invalid signature integer tag"); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E("Invalid signature integer: wrong length"); + if (res[0] & 128) + throw new E("Invalid signature integer: negative"); + if (res[0] === 0 && !(res[1] & 128)) + throw new E("Invalid signature integer: unnecessary leading zero"); + return { d: b2n(res), l: data.subarray(len + 2) }; + }, + toSig(hex2) { + const { Err: E } = DER; + const data = typeof hex2 === "string" ? h2b(hex2) : hex2; + if (!(data instanceof Uint8Array)) + throw new Error("ui8a expected"); + let l = data.length; + if (l < 2 || data[0] != 48) + throw new E("Invalid signature tag"); + if (data[1] !== l - 2) + throw new E("Invalid signature: incorrect length"); + const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); + const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); + if (rBytesLeft.length) + throw new E("Invalid signature: left bytes after parsing"); + return { r, s }; + }, + hexFromSig(sig) { + const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2; + const h = (num) => { + const hex2 = num.toString(16); + return hex2.length & 1 ? `0${hex2}` : hex2; + }; + const s = slice(h(sig.s)); + const r = slice(h(sig.r)); + const shl = s.length / 2; + const rhl = r.length / 2; + const sl = h(shl); + const rl = h(rhl); + return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; + } + }; + var _0n4 = BigInt(0); + var _1n4 = BigInt(1); + var _2n3 = BigInt(2); + var _3n2 = BigInt(3); + var _4n2 = BigInt(4); + function weierstrassPoints(opts) { + const CURVE = validatePointOpts(opts); + const { Fp: Fp2 } = CURVE; + const toBytes2 = CURVE.toBytes || ((c, point, isCompressed) => { + const a = point.toAffine(); + return concatBytes2(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y)); + }); + const fromBytes = CURVE.fromBytes || ((bytes2) => { + const tail = bytes2.subarray(1); + const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x, y }; + }); + function weierstrassEquation(x) { + const { a, b } = CURVE; + const x2 = Fp2.sqr(x); + const x3 = Fp2.mul(x2, x); + return Fp2.add(Fp2.add(x3, Fp2.mul(x, a)), b); + } + if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) + throw new Error("bad generator point: equation left != right"); + function isWithinCurveOrder(num) { + return typeof num === "bigint" && _0n4 < num && num < CURVE.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error("Expected valid bigint: 0 < bigint < curve.n"); + } + function normPrivateKeyToScalar(key) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; + if (lengths && typeof key !== "bigint") { + if (key instanceof Uint8Array) + key = bytesToHex2(key); + if (typeof key !== "string" || !lengths.includes(key.length)) + throw new Error("Invalid key"); + key = key.padStart(nByteLength * 2, "0"); + } + let num; + try { + num = typeof key === "bigint" ? key : bytesToNumberBE(ensureBytes("private key", key, nByteLength)); + } catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); + } + if (wrapPrivateKey) + num = mod(num, n); + assertGE(num); + return num; + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point3)) + throw new Error("ProjectivePoint expected"); + } + class Point3 { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp2.isValid(px)) + throw new Error("x required"); + if (py == null || !Fp2.isValid(py)) + throw new Error("y required"); + if (pz == null || !Fp2.isValid(pz)) + throw new Error("z required"); + } + static fromAffine(p) { + const { x, y } = p || {}; + if (!p || !Fp2.isValid(x) || !Fp2.isValid(y)) + throw new Error("invalid affine point"); + if (p instanceof Point3) + throw new Error("projective point not allowed"); + const is0 = (i) => Fp2.eql(i, Fp2.ZERO); + if (is0(x) && is0(y)) + return Point3.ZERO; + return new Point3(x, y, Fp2.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + static normalizeZ(points) { + const toInv = Fp2.invertBatch(points.map((p) => p.pz)); + return points.map((p, i) => p.toAffine(toInv[i])).map(Point3.fromAffine); + } + static fromHex(hex2) { + const P = Point3.fromAffine(fromBytes(ensureBytes("pointHex", hex2))); + P.assertValidity(); + return P; + } + static fromPrivateKey(privateKey) { + return Point3.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + assertValidity() { + if (this.is0()) { + if (CURVE.allowInfinityPoint) + return; + throw new Error("bad point: ZERO"); + } + const { x, y } = this.toAffine(); + if (!Fp2.isValid(x) || !Fp2.isValid(y)) + throw new Error("bad point: x or y not FE"); + const left = Fp2.sqr(y); + const right = weierstrassEquation(x); + if (!Fp2.eql(left, right)) + throw new Error("bad point: equation left != right"); + if (!this.isTorsionFree()) + throw new Error("bad point: not in prime-order subgroup"); + } + hasEvenY() { + const { y } = this.toAffine(); + if (Fp2.isOdd) + return !Fp2.isOdd(y); + throw new Error("Field doesn't support isOdd"); + } + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U1 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); + const U2 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); + return U1 && U2; + } + negate() { + return new Point3(this.px, Fp2.neg(this.py), this.pz); + } + double() { + const { a, b } = CURVE; + const b3 = Fp2.mul(b, _3n2); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + let t0 = Fp2.mul(X1, X1); + let t1 = Fp2.mul(Y1, Y1); + let t2 = Fp2.mul(Z1, Z1); + let t3 = Fp2.mul(X1, Y1); + t3 = Fp2.add(t3, t3); + Z3 = Fp2.mul(X1, Z1); + Z3 = Fp2.add(Z3, Z3); + X3 = Fp2.mul(a, Z3); + Y3 = Fp2.mul(b3, t2); + Y3 = Fp2.add(X3, Y3); + X3 = Fp2.sub(t1, Y3); + Y3 = Fp2.add(t1, Y3); + Y3 = Fp2.mul(X3, Y3); + X3 = Fp2.mul(t3, X3); + Z3 = Fp2.mul(b3, Z3); + t2 = Fp2.mul(a, t2); + t3 = Fp2.sub(t0, t2); + t3 = Fp2.mul(a, t3); + t3 = Fp2.add(t3, Z3); + Z3 = Fp2.add(t0, t0); + t0 = Fp2.add(Z3, t0); + t0 = Fp2.add(t0, t2); + t0 = Fp2.mul(t0, t3); + Y3 = Fp2.add(Y3, t0); + t2 = Fp2.mul(Y1, Z1); + t2 = Fp2.add(t2, t2); + t0 = Fp2.mul(t2, t3); + X3 = Fp2.sub(X3, t0); + Z3 = Fp2.mul(t2, t1); + Z3 = Fp2.add(Z3, Z3); + Z3 = Fp2.add(Z3, Z3); + return new Point3(X3, Y3, Z3); + } + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + const a = CURVE.a; + const b3 = Fp2.mul(CURVE.b, _3n2); + let t0 = Fp2.mul(X1, X2); + let t1 = Fp2.mul(Y1, Y2); + let t2 = Fp2.mul(Z1, Z2); + let t3 = Fp2.add(X1, Y1); + let t4 = Fp2.add(X2, Y2); + t3 = Fp2.mul(t3, t4); + t4 = Fp2.add(t0, t1); + t3 = Fp2.sub(t3, t4); + t4 = Fp2.add(X1, Z1); + let t5 = Fp2.add(X2, Z2); + t4 = Fp2.mul(t4, t5); + t5 = Fp2.add(t0, t2); + t4 = Fp2.sub(t4, t5); + t5 = Fp2.add(Y1, Z1); + X3 = Fp2.add(Y2, Z2); + t5 = Fp2.mul(t5, X3); + X3 = Fp2.add(t1, t2); + t5 = Fp2.sub(t5, X3); + Z3 = Fp2.mul(a, t4); + X3 = Fp2.mul(b3, t2); + Z3 = Fp2.add(X3, Z3); + X3 = Fp2.sub(t1, Z3); + Z3 = Fp2.add(t1, Z3); + Y3 = Fp2.mul(X3, Z3); + t1 = Fp2.add(t0, t0); + t1 = Fp2.add(t1, t0); + t2 = Fp2.mul(a, t2); + t4 = Fp2.mul(b3, t4); + t1 = Fp2.add(t1, t2); + t2 = Fp2.sub(t0, t2); + t2 = Fp2.mul(a, t2); + t4 = Fp2.add(t4, t2); + t0 = Fp2.mul(t1, t4); + Y3 = Fp2.add(Y3, t0); + t0 = Fp2.mul(t5, t4); + X3 = Fp2.mul(t3, X3); + X3 = Fp2.sub(X3, t0); + t0 = Fp2.mul(t3, t1); + Z3 = Fp2.mul(t5, Z3); + Z3 = Fp2.add(Z3, t0); + return new Point3(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point3.ZERO); + } + wNAF(n) { + return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { + const toInv = Fp2.invertBatch(comp.map((p) => p.pz)); + return comp.map((p, i) => p.toAffine(toInv[i])).map(Point3.fromAffine); + }); + } + multiplyUnsafe(n) { + const I = Point3.ZERO; + if (n === _0n4) + return I; + assertGE(n); + if (n === _1n4) + return this; + const { endo } = CURVE; + if (!endo) + return wnaf.unsafeLadder(this, n); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let k1p = I; + let k2p = I; + let d = this; + while (k1 > _0n4 || k2 > _0n4) { + if (k1 & _1n4) + k1p = k1p.add(d); + if (k2 & _1n4) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n4; + k2 >>= _1n4; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point3(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + multiply(scalar) { + assertGE(scalar); + let n = scalar; + let point, fake; + const { endo } = CURVE; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point3(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } else { + const { p, f: f2 } = this.wNAF(n); + point = p; + fake = f2; + } + return Point3.normalizeZ([point, fake])[0]; + } + multiplyAndAddUnsafe(Q, a, b) { + const G = Point3.BASE; + const mul = (P, a2) => a2 === _0n4 || a2 === _1n4 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2); + const sum = mul(this, a).add(mul(Q, b)); + return sum.is0() ? void 0 : sum; + } + toAffine(iz) { + const { px: x, py: y, pz: z } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? Fp2.ONE : Fp2.inv(z); + const ax = Fp2.mul(x, iz); + const ay = Fp2.mul(y, iz); + const zz = Fp2.mul(z, iz); + if (is0) + return { x: Fp2.ZERO, y: Fp2.ZERO }; + if (!Fp2.eql(zz, Fp2.ONE)) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE; + if (cofactor === _1n4) + return true; + if (isTorsionFree) + return isTorsionFree(Point3, this); + throw new Error("isTorsionFree() has not been declared for the elliptic curve"); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE; + if (cofactor === _1n4) + return this; + if (clearCofactor) + return clearCofactor(Point3, this); + return this.multiplyUnsafe(CURVE.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes2(Point3, this, isCompressed); + } + toHex(isCompressed = true) { + return bytesToHex2(this.toRawBytes(isCompressed)); + } + } + Point3.BASE = new Point3(CURVE.Gx, CURVE.Gy, Fp2.ONE); + Point3.ZERO = new Point3(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); + const _bits = CURVE.nBitLength; + const wnaf = wNAF(Point3, CURVE.endo ? Math.ceil(_bits / 2) : _bits); + return { + CURVE, + ProjectivePoint: Point3, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder + }; + } + function validateOpts(curve) { + const opts = validateBasic(curve); + validateObject(opts, { + hash: "hash", + hmac: "function", + randomBytes: "function" + }, { + bits2int: "function", + bits2int_modN: "function", + lowS: "boolean" + }); + return Object.freeze({ lowS: true, ...opts }); + } + function weierstrass(curveDef) { + const CURVE = validateOpts(curveDef); + const { Fp: Fp2, n: CURVE_ORDER } = CURVE; + const compressedLen = Fp2.BYTES + 1; + const uncompressedLen = 2 * Fp2.BYTES + 1; + function isValidFieldElement(num) { + return _0n4 < num && num < Fp2.ORDER; + } + function modN2(a) { + return mod(a, CURVE_ORDER); + } + function invN(a) { + return invert(a, CURVE_ORDER); + } + const { ProjectivePoint: Point3, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ + ...CURVE, + toBytes(c, point, isCompressed) { + const a = point.toAffine(); + const x = Fp2.toBytes(a.x); + const cat = concatBytes2; + if (isCompressed) { + return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x); + } else { + return cat(Uint8Array.from([4]), x, Fp2.toBytes(a.y)); + } + }, + fromBytes(bytes2) { + const len = bytes2.length; + const head = bytes2[0]; + const tail = bytes2.subarray(1); + if (len === compressedLen && (head === 2 || head === 3)) { + const x = bytesToNumberBE(tail); + if (!isValidFieldElement(x)) + throw new Error("Point is not on curve"); + const y2 = weierstrassEquation(x); + let y = Fp2.sqrt(y2); + const isYOdd = (y & _1n4) === _1n4; + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y = Fp2.neg(y); + return { x, y }; + } else if (len === uncompressedLen && head === 4) { + const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x, y }; + } else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + } + }); + const numToNByteStr = (num) => bytesToHex2(numberToBytesBE(num, CURVE.nByteLength)); + function isBiggerThanHalfOrder(number2) { + const HALF = CURVE_ORDER >> _1n4; + return number2 > HALF; + } + function normalizeS(s) { + return isBiggerThanHalfOrder(s) ? modN2(-s) : s; + } + const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); + class Signature { + constructor(r, s, recovery) { + this.r = r; + this.s = s; + this.recovery = recovery; + this.assertValidity(); + } + static fromCompact(hex2) { + const l = CURVE.nByteLength; + hex2 = ensureBytes("compactSignature", hex2, l * 2); + return new Signature(slcNum(hex2, 0, l), slcNum(hex2, l, 2 * l)); + } + static fromDER(hex2) { + const { r, s } = DER.toSig(ensureBytes("DER", hex2)); + return new Signature(r, s); + } + assertValidity() { + if (!isWithinCurveOrder(this.r)) + throw new Error("r must be 0 < r < CURVE.n"); + if (!isWithinCurveOrder(this.s)) + throw new Error("s must be 0 < s < CURVE.n"); + } + addRecoveryBit(recovery) { + return new Signature(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r, s, recovery: rec } = this; + const h = bits2int_modN(ensureBytes("msgHash", msgHash)); + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error("recovery id invalid"); + const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; + if (radj >= Fp2.ORDER) + throw new Error("recovery id 2 or 3 invalid"); + const prefix = (rec & 1) === 0 ? "02" : "03"; + const R = Point3.fromHex(prefix + numToNByteStr(radj)); + const ir = invN(radj); + const u1 = modN2(-h * ir); + const u2 = modN2(s * ir); + const Q = Point3.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error("point at infinify"); + Q.assertValidity(); + return Q; + } + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature(this.r, modN2(-this.s), this.recovery) : this; + } + toDERRawBytes() { + return hexToBytes2(this.toDERHex()); + } + toDERHex() { + return DER.hexFromSig({ r: this.r, s: this.s }); + } + toCompactRawBytes() { + return hexToBytes2(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } catch (error) { + return false; + } + }, + normPrivateKeyToScalar, + randomPrivateKey: () => { + const rand = CURVE.randomBytes(Fp2.BYTES + 8); + const num = hashToPrivateScalar(rand, CURVE_ORDER); + return numberToBytesBE(num, CURVE.nByteLength); + }, + precompute(windowSize = 8, point = Point3.BASE) { + point._setWindowSize(windowSize); + point.multiply(BigInt(3)); + return point; + } + }; + function getPublicKey2(privateKey, isCompressed = true) { + return Point3.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === "string"; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point3) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error("first arg must be private key"); + if (!isProbPub(publicB)) + throw new Error("second arg must be public key"); + const b = Point3.fromHex(publicB); + return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + const bits2int = CURVE.bits2int || function(bytes2) { + const num = bytesToNumberBE(bytes2); + const delta = bytes2.length * 8 - CURVE.nBitLength; + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { + return modN2(bits2int(bytes2)); + }; + const ORDER_MASK = bitMask(CURVE.nBitLength); + function int2octets(num) { + if (typeof num !== "bigint") + throw new Error("bigint expected"); + if (!(_0n4 <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); + return numberToBytesBE(num, CURVE.nByteLength); + } + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (["recovered", "canonical"].some((k) => k in opts)) + throw new Error("sign() legacy options not supported"); + const { hash: hash2, randomBytes: randomBytes2 } = CURVE; + let { lowS, prehash, extraEntropy: ent } = opts; + if (lowS == null) + lowS = true; + msgHash = ensureBytes("msgHash", msgHash); + if (prehash) + msgHash = ensureBytes("prehashed msgHash", hash2(msgHash)); + const h1int = bits2int_modN(msgHash); + const d = normPrivateKeyToScalar(privateKey); + const seedArgs = [int2octets(d), int2octets(h1int)]; + if (ent != null) { + const e = ent === true ? randomBytes2(Fp2.BYTES) : ent; + seedArgs.push(ensureBytes("extraEntropy", e, Fp2.BYTES)); + } + const seed = concatBytes2(...seedArgs); + const m = h1int; + function k2sig(kBytes) { + const k = bits2int(kBytes); + if (!isWithinCurveOrder(k)) + return; + const ik = invN(k); + const q = Point3.BASE.multiply(k).toAffine(); + const r = modN2(q.x); + if (r === _0n4) + return; + const s = modN2(ik * modN2(m + r * d)); + if (s === _0n4) + return; + let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n4); + let normS = s; + if (lowS && isBiggerThanHalfOrder(s)) { + normS = normalizeS(s); + recovery ^= 1; + } + return new Signature(r, normS, recovery); + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; + function sign(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); + const drbg = createHmacDrbg(CURVE.hash.outputLen, CURVE.nByteLength, CURVE.hmac); + return drbg(seed, k2sig); + } + Point3.BASE._setWindowSize(8); + function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { + const sg = signature; + msgHash = ensureBytes("msgHash", msgHash); + publicKey = ensureBytes("publicKey", publicKey); + if ("strict" in opts) + throw new Error("options.strict was renamed to lowS"); + const { lowS, prehash } = opts; + let _sig = void 0; + let P; + try { + if (typeof sg === "string" || sg instanceof Uint8Array) { + try { + _sig = Signature.fromDER(sg); + } catch (derError) { + if (!(derError instanceof DER.Err)) + throw derError; + _sig = Signature.fromCompact(sg); + } + } else if (typeof sg === "object" && typeof sg.r === "bigint" && typeof sg.s === "bigint") { + const { r: r2, s: s2 } = sg; + _sig = new Signature(r2, s2); + } else { + throw new Error("PARSE"); + } + P = Point3.fromHex(publicKey); + } catch (error) { + if (error.message === "PARSE") + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig.hasHighS()) + return false; + if (prehash) + msgHash = CURVE.hash(msgHash); + const { r, s } = _sig; + const h = bits2int_modN(msgHash); + const is = invN(s); + const u1 = modN2(h * is); + const u2 = modN2(r * is); + const R = Point3.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); + if (!R) + return false; + const v = modN2(R.x); + return v === r; + } + return { + CURVE, + getPublicKey: getPublicKey2, + getSharedSecret, + sign, + verify, + ProjectivePoint: Point3, + Signature, + utils + }; + } + function SWUFpSqrtRatio(Fp2, Z) { + const q = Fp2.ORDER; + let l = _0n4; + for (let o = q - _1n4; o % _2n3 === _0n4; o /= _2n3) + l += _1n4; + const c1 = l; + const c2 = (q - _1n4) / _2n3 ** c1; + const c3 = (c2 - _1n4) / _2n3; + const c4 = _2n3 ** c1 - _1n4; + const c5 = _2n3 ** (c1 - _1n4); + const c6 = Fp2.pow(Z, c2); + const c7 = Fp2.pow(Z, (c2 + _1n4) / _2n3); + let sqrtRatio = (u, v) => { + let tv1 = c6; + let tv2 = Fp2.pow(v, c4); + let tv3 = Fp2.sqr(tv2); + tv3 = Fp2.mul(tv3, v); + let tv5 = Fp2.mul(u, tv3); + tv5 = Fp2.pow(tv5, c3); + tv5 = Fp2.mul(tv5, tv2); + tv2 = Fp2.mul(tv5, v); + tv3 = Fp2.mul(tv5, u); + let tv4 = Fp2.mul(tv3, tv2); + tv5 = Fp2.pow(tv4, c5); + let isQR = Fp2.eql(tv5, Fp2.ONE); + tv2 = Fp2.mul(tv3, c7); + tv5 = Fp2.mul(tv4, tv1); + tv3 = Fp2.cmov(tv2, tv3, isQR); + tv4 = Fp2.cmov(tv5, tv4, isQR); + for (let i = c1; i > _1n4; i--) { + let tv52 = _2n3 ** (i - _2n3); + let tvv5 = Fp2.pow(tv4, tv52); + const e1 = Fp2.eql(tvv5, Fp2.ONE); + tv2 = Fp2.mul(tv3, tv1); + tv1 = Fp2.mul(tv1, tv1); + tvv5 = Fp2.mul(tv4, tv1); + tv3 = Fp2.cmov(tv2, tv3, e1); + tv4 = Fp2.cmov(tvv5, tv4, e1); + } + return { isValid: isQR, value: tv3 }; + }; + if (Fp2.ORDER % _4n2 === _3n2) { + const c12 = (Fp2.ORDER - _3n2) / _4n2; + const c22 = Fp2.sqrt(Fp2.neg(Z)); + sqrtRatio = (u, v) => { + let tv1 = Fp2.sqr(v); + const tv2 = Fp2.mul(u, v); + tv1 = Fp2.mul(tv1, tv2); + let y1 = Fp2.pow(tv1, c12); + y1 = Fp2.mul(y1, tv2); + const y2 = Fp2.mul(y1, c22); + const tv3 = Fp2.mul(Fp2.sqr(y1), v); + const isQR = Fp2.eql(tv3, u); + let y = Fp2.cmov(y2, y1, isQR); + return { isValid: isQR, value: y }; + }; + } + return sqrtRatio; + } + function mapToCurveSimpleSWU(Fp2, opts) { + validateField(Fp2); + if (!Fp2.isValid(opts.A) || !Fp2.isValid(opts.B) || !Fp2.isValid(opts.Z)) + throw new Error("mapToCurveSimpleSWU: invalid opts"); + const sqrtRatio = SWUFpSqrtRatio(Fp2, opts.Z); + if (!Fp2.isOdd) + throw new Error("Fp.isOdd is not implemented!"); + return (u) => { + let tv1, tv2, tv3, tv4, tv5, tv6, x, y; + tv1 = Fp2.sqr(u); + tv1 = Fp2.mul(tv1, opts.Z); + tv2 = Fp2.sqr(tv1); + tv2 = Fp2.add(tv2, tv1); + tv3 = Fp2.add(tv2, Fp2.ONE); + tv3 = Fp2.mul(tv3, opts.B); + tv4 = Fp2.cmov(opts.Z, Fp2.neg(tv2), !Fp2.eql(tv2, Fp2.ZERO)); + tv4 = Fp2.mul(tv4, opts.A); + tv2 = Fp2.sqr(tv3); + tv6 = Fp2.sqr(tv4); + tv5 = Fp2.mul(tv6, opts.A); + tv2 = Fp2.add(tv2, tv5); + tv2 = Fp2.mul(tv2, tv3); + tv6 = Fp2.mul(tv6, tv4); + tv5 = Fp2.mul(tv6, opts.B); + tv2 = Fp2.add(tv2, tv5); + x = Fp2.mul(tv1, tv3); + const { isValid, value } = sqrtRatio(tv2, tv6); + y = Fp2.mul(tv1, u); + y = Fp2.mul(y, value); + x = Fp2.cmov(x, tv3, isValid); + y = Fp2.cmov(y, value, isValid); + const e1 = Fp2.isOdd(u) === Fp2.isOdd(y); + y = Fp2.cmov(Fp2.neg(y), y, e1); + x = Fp2.div(x, tv4); + return { x, y }; + }; + } + + // node_modules/@noble/curves/esm/abstract/hash-to-curve.js + init_define_process(); + function validateDST(dst) { + if (dst instanceof Uint8Array) + return dst; + if (typeof dst === "string") + return utf8ToBytes2(dst); + throw new Error("DST must be Uint8Array or string"); + } + var os2ip = bytesToNumberBE; + function i2osp(value, length) { + if (value < 0 || value >= 1 << 8 * length) { + throw new Error(`bad I2OSP call: value=${value} length=${length}`); + } + const res = Array.from({ length }).fill(0); + for (let i = length - 1; i >= 0; i--) { + res[i] = value & 255; + value >>>= 8; + } + return new Uint8Array(res); + } + function strxor(a, b) { + const arr = new Uint8Array(a.length); + for (let i = 0; i < a.length; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; + } + function isBytes(item) { + if (!(item instanceof Uint8Array)) + throw new Error("Uint8Array expected"); + } + function isNum(item) { + if (!Number.isSafeInteger(item)) + throw new Error("number expected"); + } + function expand_message_xmd(msg, DST, lenInBytes, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + if (DST.length > 255) + DST = H(concatBytes2(utf8ToBytes2("H2C-OVERSIZE-DST-"), DST)); + const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; + const ell = Math.ceil(lenInBytes / b_in_bytes); + if (ell > 255) + throw new Error("Invalid xmd length"); + const DST_prime = concatBytes2(DST, i2osp(DST.length, 1)); + const Z_pad = i2osp(0, r_in_bytes); + const l_i_b_str = i2osp(lenInBytes, 2); + const b = new Array(ell); + const b_0 = H(concatBytes2(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); + b[0] = H(concatBytes2(b_0, i2osp(1, 1), DST_prime)); + for (let i = 1; i <= ell; i++) { + const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; + b[i] = H(concatBytes2(...args)); + } + const pseudo_random_bytes = concatBytes2(...b); + return pseudo_random_bytes.slice(0, lenInBytes); + } + function expand_message_xof(msg, DST, lenInBytes, k, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + if (DST.length > 255) { + const dkLen = Math.ceil(2 * k / 8); + DST = H.create({ dkLen }).update(utf8ToBytes2("H2C-OVERSIZE-DST-")).update(DST).digest(); + } + if (lenInBytes > 65535 || DST.length > 255) + throw new Error("expand_message_xof: invalid lenInBytes"); + return H.create({ dkLen: lenInBytes }).update(msg).update(i2osp(lenInBytes, 2)).update(DST).update(i2osp(DST.length, 1)).digest(); + } + function hash_to_field(msg, count, options) { + validateObject(options, { + DST: "string", + p: "bigint", + m: "isSafeInteger", + k: "isSafeInteger", + hash: "hash" + }); + const { p, k, m, hash: hash2, expand, DST: _DST } = options; + isBytes(msg); + isNum(count); + const DST = validateDST(_DST); + const log2p = p.toString(2).length; + const L = Math.ceil((log2p + k) / 8); + const len_in_bytes = count * m * L; + let prb; + if (expand === "xmd") { + prb = expand_message_xmd(msg, DST, len_in_bytes, hash2); + } else if (expand === "xof") { + prb = expand_message_xof(msg, DST, len_in_bytes, k, hash2); + } else if (expand === "_internal_pass") { + prb = msg; + } else { + throw new Error('expand must be "xmd" or "xof"'); + } + const u = new Array(count); + for (let i = 0; i < count; i++) { + const e = new Array(m); + for (let j = 0; j < m; j++) { + const elm_offset = L * (j + i * m); + const tv = prb.subarray(elm_offset, elm_offset + L); + e[j] = mod(os2ip(tv), p); + } + u[i] = e; + } + return u; + } + function isogenyMap(field, map) { + const COEFF = map.map((i) => Array.from(i).reverse()); + return (x, y) => { + const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); + x = field.div(xNum, xDen); + y = field.mul(y, field.div(yNum, yDen)); + return { x, y }; + }; + } + function createHasher(Point3, mapToCurve, def) { + if (typeof mapToCurve !== "function") + throw new Error("mapToCurve() must be defined"); + return { + hashToCurve(msg, options) { + const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); + const u0 = Point3.fromAffine(mapToCurve(u[0])); + const u1 = Point3.fromAffine(mapToCurve(u[1])); + const P = u0.add(u1).clearCofactor(); + P.assertValidity(); + return P; + }, + encodeToCurve(msg, options) { + const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); + const P = Point3.fromAffine(mapToCurve(u[0])).clearCofactor(); + P.assertValidity(); + return P; + } + }; + } + + // node_modules/@noble/curves/esm/_shortw_utils.js + init_define_process(); + + // node_modules/@noble/hashes/esm/hmac.js + init_define_process(); + var HMAC = class extends Hash { + constructor(hash2, _key) { + super(); + this.finished = false; + this.destroyed = false; + assert_default.hash(hash2); + const key = toBytes(_key); + this.iHash = hash2.create(); + if (typeof this.iHash.update !== "function") + throw new TypeError("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + pad.set(key.length > blockLen ? hash2.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54; + this.iHash.update(pad); + this.oHash = hash2.create(); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54 ^ 92; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + assert_default.exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + }; + var hmac = (hash2, key, message) => new HMAC(hash2, key).update(message).digest(); + hmac.create = (hash2, key) => new HMAC(hash2, key); + + // node_modules/@noble/curves/esm/_shortw_utils.js + function getHash(hash2) { + return { + hash: hash2, + hmac: (key, ...msgs) => hmac(hash2, key, concatBytes(...msgs)), + randomBytes + }; + } + function createCurve(curveDef, defHash) { + const create = (hash2) => weierstrass({ ...curveDef, ...getHash(hash2) }); + return Object.freeze({ ...create(defHash), create }); + } + + // node_modules/@noble/curves/esm/secp256k1.js + var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); + var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); + var _1n5 = BigInt(1); + var _2n4 = BigInt(2); + var divNearest = (a, b) => (a + b / _2n4) / b; + function sqrtMod(y) { + const P = secp256k1P; + const _3n3 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); + const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); + const b2 = y * y * y % P; + const b3 = b2 * b2 * y % P; + const b6 = pow2(b3, _3n3, P) * b3 % P; + const b9 = pow2(b6, _3n3, P) * b3 % P; + const b11 = pow2(b9, _2n4, P) * b2 % P; + const b22 = pow2(b11, _11n, P) * b11 % P; + const b44 = pow2(b22, _22n, P) * b22 % P; + const b88 = pow2(b44, _44n, P) * b44 % P; + const b176 = pow2(b88, _88n, P) * b88 % P; + const b220 = pow2(b176, _44n, P) * b44 % P; + const b223 = pow2(b220, _3n3, P) * b3 % P; + const t1 = pow2(b223, _23n, P) * b22 % P; + const t2 = pow2(t1, _6n, P) * b2 % P; + const root = pow2(t2, _2n4, P); + if (!Fp.eql(Fp.sqr(root), y)) + throw new Error("Cannot find square root"); + return root; + } + var Fp = Field(secp256k1P, void 0, void 0, { sqrt: sqrtMod }); + var secp256k1 = createCurve({ + a: BigInt(0), + b: BigInt(7), + Fp, + n: secp256k1N, + Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), + Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), + h: BigInt(1), + lowS: true, + endo: { + beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), + splitScalar: (k) => { + const n = secp256k1N; + const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); + const b1 = -_1n5 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); + const a2 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); + const b2 = a1; + const POW_2_128 = BigInt("0x100000000000000000000000000000000"); + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = mod(k - c1 * a1 - c2 * a2, n); + let k2 = mod(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error("splitScalar: Endomorphism failed, k=" + k); + } + return { k1neg, k1, k2neg, k2 }; + } + } + }, sha256); + var _0n5 = BigInt(0); + var fe = (x) => typeof x === "bigint" && _0n5 < x && x < secp256k1P; + var ge = (x) => typeof x === "bigint" && _0n5 < x && x < secp256k1N; + var TAGGED_HASH_PREFIXES = {}; + function taggedHash(tag, ...messages) { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === void 0) { + const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes2(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return sha256(concatBytes2(tagP, ...messages)); + } + var pointToBytes = (point) => point.toRawBytes(true).slice(1); + var numTo32b = (n) => numberToBytesBE(n, 32); + var modP = (x) => mod(x, secp256k1P); + var modN = (x) => mod(x, secp256k1N); + var Point = secp256k1.ProjectivePoint; + var GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); + function schnorrGetExtPubKey(priv) { + let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); + let p = Point.fromPrivateKey(d_); + const scalar = p.hasEvenY() ? d_ : modN(-d_); + return { scalar, bytes: pointToBytes(p) }; + } + function lift_x(x) { + if (!fe(x)) + throw new Error("bad x: need 0 < x < p"); + const xx = modP(x * x); + const c = modP(xx * x + BigInt(7)); + let y = sqrtMod(c); + if (y % _2n4 !== _0n5) + y = modP(-y); + const p = new Point(x, y, _1n5); + p.assertValidity(); + return p; + } + function challenge(...args) { + return modN(bytesToNumberBE(taggedHash("BIP0340/challenge", ...args))); + } + function schnorrGetPublicKey(privateKey) { + return schnorrGetExtPubKey(privateKey).bytes; + } + function schnorrSign(message, privateKey, auxRand = randomBytes(32)) { + const m = ensureBytes("message", message); + const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); + const a = ensureBytes("auxRand", auxRand, 32); + const t = numTo32b(d ^ bytesToNumberBE(taggedHash("BIP0340/aux", a))); + const rand = taggedHash("BIP0340/nonce", t, px, m); + const k_ = modN(bytesToNumberBE(rand)); + if (k_ === _0n5) + throw new Error("sign failed: k is zero"); + const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); + const e = challenge(rx, px, m); + const sig = new Uint8Array(64); + sig.set(rx, 0); + sig.set(numTo32b(modN(k + e * d)), 32); + if (!schnorrVerify(sig, m, px)) + throw new Error("sign: Invalid signature produced"); + return sig; + } + function schnorrVerify(signature, message, publicKey) { + const sig = ensureBytes("signature", signature, 64); + const m = ensureBytes("message", message); + const pub = ensureBytes("publicKey", publicKey, 32); + try { + const P = lift_x(bytesToNumberBE(pub)); + const r = bytesToNumberBE(sig.subarray(0, 32)); + if (!fe(r)) + return false; + const s = bytesToNumberBE(sig.subarray(32, 64)); + if (!ge(s)) + return false; + const e = challenge(numTo32b(r), pointToBytes(P), m); + const R = GmulAdd(P, s, modN(-e)); + if (!R || !R.hasEvenY() || R.toAffine().x !== r) + return false; + return true; + } catch (error) { + return false; + } + } + var schnorr = { + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + utils: { + randomPrivateKey: secp256k1.utils.randomPrivateKey, + lift_x, + pointToBytes, + numberToBytesBE, + bytesToNumberBE, + taggedHash, + mod + } + }; + var isoMap = isogenyMap(Fp, [ + [ + "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7", + "0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581", + "0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262", + "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c" + ], + [ + "0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b", + "0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + [ + "0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c", + "0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3", + "0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931", + "0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84" + ], + [ + "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b", + "0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573", + "0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ] + ].map((i) => i.map((j) => BigInt(j)))); + var mapSWU = mapToCurveSimpleSWU(Fp, { + A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"), + B: BigInt("1771"), + Z: Fp.create(BigInt("-11")) + }); + var { hashToCurve, encodeToCurve } = createHasher(secp256k1.ProjectivePoint, (scalars) => { + const { x, y } = mapSWU(Fp.create(scalars[0])); + return isoMap(x, y); + }, { + DST: "secp256k1_XMD:SHA-256_SSWU_RO_", + encodeDST: "secp256k1_XMD:SHA-256_SSWU_NU_", + p: Fp.ORDER, + m: 1, + k: 128, + expand: "xmd", + hash: sha256 + }); + + // keys.ts + function generatePrivateKey() { + return bytesToHex(schnorr.utils.randomPrivateKey()); + } + function getPublicKey(privateKey) { + return bytesToHex(schnorr.getPublicKey(privateKey)); + } + + // relay.ts + init_define_process(); + + // event.ts + init_define_process(); + + // utils.ts + var utils_exports2 = {}; + __export(utils_exports2, { + MessageNode: () => MessageNode, + MessageQueue: () => MessageQueue, + insertEventIntoAscendingList: () => insertEventIntoAscendingList, + insertEventIntoDescendingList: () => insertEventIntoDescendingList, + normalizeURL: () => normalizeURL, + utf8Decoder: () => utf8Decoder, + utf8Encoder: () => utf8Encoder + }); + init_define_process(); + var utf8Decoder = new TextDecoder("utf-8"); + var utf8Encoder = new TextEncoder(); + function normalizeURL(url) { + let p = new URL(url); + p.pathname = p.pathname.replace(/\/+/g, "/"); + if (p.pathname.endsWith("/")) + p.pathname = p.pathname.slice(0, -1); + if (p.port === "80" && p.protocol === "ws:" || p.port === "443" && p.protocol === "wss:") + p.port = ""; + p.searchParams.sort(); + p.hash = ""; + return p.toString(); + } + function insertEventIntoDescendingList(sortedArray, event) { + let start = 0; + let end = sortedArray.length - 1; + let midPoint; + let position = start; + if (end < 0) { + position = 0; + } else if (event.created_at < sortedArray[end].created_at) { + position = end + 1; + } else if (event.created_at >= sortedArray[start].created_at) { + position = start; + } else + while (true) { + if (end <= start + 1) { + position = end; + break; + } + midPoint = Math.floor(start + (end - start) / 2); + if (sortedArray[midPoint].created_at > event.created_at) { + start = midPoint; + } else if (sortedArray[midPoint].created_at < event.created_at) { + end = midPoint; + } else { + position = midPoint; + break; + } + } + if (sortedArray[position]?.id !== event.id) { + return [ + ...sortedArray.slice(0, position), + event, + ...sortedArray.slice(position) + ]; + } + return sortedArray; + } + function insertEventIntoAscendingList(sortedArray, event) { + let start = 0; + let end = sortedArray.length - 1; + let midPoint; + let position = start; + if (end < 0) { + position = 0; + } else if (event.created_at > sortedArray[end].created_at) { + position = end + 1; + } else if (event.created_at <= sortedArray[start].created_at) { + position = start; + } else + while (true) { + if (end <= start + 1) { + position = end; + break; + } + midPoint = Math.floor(start + (end - start) / 2); + if (sortedArray[midPoint].created_at < event.created_at) { + start = midPoint; + } else if (sortedArray[midPoint].created_at > event.created_at) { + end = midPoint; + } else { + position = midPoint; + break; + } + } + if (sortedArray[position]?.id !== event.id) { + return [ + ...sortedArray.slice(0, position), + event, + ...sortedArray.slice(position) + ]; + } + return sortedArray; + } + var MessageNode = class { + _value; + _next; + get value() { + return this._value; + } + set value(message) { + this._value = message; + } + get next() { + return this._next; + } + set next(node) { + this._next = node; + } + constructor(message) { + this._value = message; + this._next = null; + } + }; + var MessageQueue = class { + _first; + _last; + get first() { + return this._first; + } + set first(messageNode) { + this._first = messageNode; + } + get last() { + return this._last; + } + set last(messageNode) { + this._last = messageNode; + } + _size; + get size() { + return this._size; + } + set size(v) { + this._size = v; + } + constructor() { + this._first = null; + this._last = null; + this._size = 0; + } + enqueue(message) { + const newNode = new MessageNode(message); + if (this._size === 0 || !this._last) { + this._first = newNode; + this._last = newNode; + } else { + this._last.next = newNode; + this._last = newNode; + } + this._size++; + return true; + } + dequeue() { + if (this._size === 0 || !this._first) + return null; + let prev = this._first; + this._first = prev.next; + prev.next = null; + this._size--; + return prev.value; + } + }; + + // event.ts + var Kind = /* @__PURE__ */ ((Kind3) => { + Kind3[Kind3["Metadata"] = 0] = "Metadata"; + Kind3[Kind3["Text"] = 1] = "Text"; + Kind3[Kind3["RecommendRelay"] = 2] = "RecommendRelay"; + Kind3[Kind3["Contacts"] = 3] = "Contacts"; + Kind3[Kind3["EncryptedDirectMessage"] = 4] = "EncryptedDirectMessage"; + Kind3[Kind3["EventDeletion"] = 5] = "EventDeletion"; + Kind3[Kind3["Repost"] = 6] = "Repost"; + Kind3[Kind3["Reaction"] = 7] = "Reaction"; + Kind3[Kind3["BadgeAward"] = 8] = "BadgeAward"; + Kind3[Kind3["ChannelCreation"] = 40] = "ChannelCreation"; + Kind3[Kind3["ChannelMetadata"] = 41] = "ChannelMetadata"; + Kind3[Kind3["ChannelMessage"] = 42] = "ChannelMessage"; + Kind3[Kind3["ChannelHideMessage"] = 43] = "ChannelHideMessage"; + Kind3[Kind3["ChannelMuteUser"] = 44] = "ChannelMuteUser"; + Kind3[Kind3["Blank"] = 255] = "Blank"; + Kind3[Kind3["Report"] = 1984] = "Report"; + Kind3[Kind3["ZapRequest"] = 9734] = "ZapRequest"; + Kind3[Kind3["Zap"] = 9735] = "Zap"; + Kind3[Kind3["RelayList"] = 10002] = "RelayList"; + Kind3[Kind3["ClientAuth"] = 22242] = "ClientAuth"; + Kind3[Kind3["HttpAuth"] = 27235] = "HttpAuth"; + Kind3[Kind3["ProfileBadge"] = 30008] = "ProfileBadge"; + Kind3[Kind3["BadgeDefinition"] = 30009] = "BadgeDefinition"; + Kind3[Kind3["Article"] = 30023] = "Article"; + return Kind3; + })(Kind || {}); + function getBlankEvent(kind = 255 /* Blank */) { + return { + kind, + content: "", + tags: [], + created_at: 0 + }; + } + function finishEvent(t, privateKey) { + let event = t; + event.pubkey = getPublicKey(privateKey); + event.id = getEventHash(event); + event.sig = getSignature(event, privateKey); + return event; + } + function serializeEvent(evt) { + if (!validateEvent(evt)) + throw new Error("can't serialize event with wrong or missing properties"); + return JSON.stringify([ + 0, + evt.pubkey, + evt.created_at, + evt.kind, + evt.tags, + evt.content + ]); + } + function getEventHash(event) { + let eventHash = sha256(utf8Encoder.encode(serializeEvent(event))); + return bytesToHex(eventHash); + } + var isRecord = (obj) => obj instanceof Object; + function validateEvent(event) { + if (!isRecord(event)) + return false; + if (typeof event.kind !== "number") + return false; + if (typeof event.content !== "string") + return false; + if (typeof event.created_at !== "number") + return false; + if (typeof event.pubkey !== "string") + return false; + if (!event.pubkey.match(/^[a-f0-9]{64}$/)) + return false; + if (!Array.isArray(event.tags)) + return false; + for (let i = 0; i < event.tags.length; i++) { + let tag = event.tags[i]; + if (!Array.isArray(tag)) + return false; + for (let j = 0; j < tag.length; j++) { + if (typeof tag[j] === "object") + return false; + } + } + return true; + } + function verifySignature(event) { + try { + return schnorr.verify(event.sig, getEventHash(event), event.pubkey); + } catch (err) { + return false; + } + } + function signEvent(event, key) { + console.warn( + "nostr-tools: `signEvent` is deprecated and will be removed or changed in the future. Please use `getSignature` instead." + ); + return getSignature(event, key); + } + function getSignature(event, key) { + return bytesToHex(schnorr.sign(getEventHash(event), key)); + } + + // filter.ts + init_define_process(); + function matchFilter(filter, event) { + if (filter.ids && filter.ids.indexOf(event.id) === -1) { + if (!filter.ids.some((prefix) => event.id.startsWith(prefix))) { + return false; + } + } + if (filter.kinds && filter.kinds.indexOf(event.kind) === -1) + return false; + if (filter.authors && filter.authors.indexOf(event.pubkey) === -1) { + if (!filter.authors.some((prefix) => event.pubkey.startsWith(prefix))) { + return false; + } + } + for (let f2 in filter) { + if (f2[0] === "#") { + let tagName = f2.slice(1); + let values = filter[`#${tagName}`]; + if (values && !event.tags.find( + ([t, v]) => t === f2.slice(1) && values.indexOf(v) !== -1 + )) + return false; + } + } + if (filter.since && event.created_at < filter.since) + return false; + if (filter.until && event.created_at > filter.until) + return false; + return true; + } + function matchFilters(filters, event) { + for (let i = 0; i < filters.length; i++) { + if (matchFilter(filters[i], event)) + return true; + } + return false; + } + function mergeFilters(...filters) { + let result = {}; + for (let i = 0; i < filters.length; i++) { + let filter = filters[i]; + Object.entries(filter).forEach(([property, values]) => { + if (property === "kinds" || property === "ids" || property === "authors" || property[0] === "#") { + result[property] = result[property] || []; + for (let v = 0; v < values.length; v++) { + let value = values[v]; + if (!result[property].includes(value)) + result[property].push(value); + } + } + }); + if (filter.limit && (!result.limit || filter.limit > result.limit)) + result.limit = filter.limit; + if (filter.until && (!result.until || filter.until > result.until)) + result.until = filter.until; + if (filter.since && (!result.since || filter.since < result.since)) + result.since = filter.since; + } + return result; + } + + // fakejson.ts + var fakejson_exports = {}; + __export(fakejson_exports, { + getHex64: () => getHex64, + getInt: () => getInt, + getSubscriptionId: () => getSubscriptionId, + matchEventId: () => matchEventId, + matchEventKind: () => matchEventKind, + matchEventPubkey: () => matchEventPubkey + }); + init_define_process(); + function getHex64(json, field) { + let len = field.length + 3; + let idx = json.indexOf(`"${field}":`) + len; + let s = json.slice(idx).indexOf(`"`) + idx + 1; + return json.slice(s, s + 64); + } + function getInt(json, field) { + let len = field.length; + let idx = json.indexOf(`"${field}":`) + len + 3; + let sliced = json.slice(idx); + let end = Math.min(sliced.indexOf(","), sliced.indexOf("}")); + return parseInt(sliced.slice(0, end), 10); + } + function getSubscriptionId(json) { + let idx = json.slice(0, 22).indexOf(`"EVENT"`); + if (idx === -1) + return null; + let pstart = json.slice(idx + 7 + 1).indexOf(`"`); + if (pstart === -1) + return null; + let start = idx + 7 + 1 + pstart; + let pend = json.slice(start + 1, 80).indexOf(`"`); + if (pend === -1) + return null; + let end = start + 1 + pend; + return json.slice(start + 1, end); + } + function matchEventId(json, id) { + return id === getHex64(json, "id"); + } + function matchEventPubkey(json, pubkey) { + return pubkey === getHex64(json, "pubkey"); + } + function matchEventKind(json, kind) { + return kind === getInt(json, "kind"); + } + + // relay.ts + var newListeners = () => ({ + connect: [], + disconnect: [], + error: [], + notice: [], + auth: [] + }); + function relayInit(url, options = {}) { + let { listTimeout = 3e3, getTimeout = 3e3, countTimeout = 3e3 } = options; + var ws; + var openSubs = {}; + var listeners = newListeners(); + var subListeners = {}; + var pubListeners = {}; + var connectionPromise; + async function connectRelay() { + if (connectionPromise) + return connectionPromise; + connectionPromise = new Promise((resolve, reject) => { + try { + ws = new WebSocket(url); + } catch (err) { + reject(err); + } + ws.onopen = () => { + listeners.connect.forEach((cb) => cb()); + resolve(); + }; + ws.onerror = () => { + connectionPromise = void 0; + listeners.error.forEach((cb) => cb()); + reject(); + }; + ws.onclose = async () => { + connectionPromise = void 0; + listeners.disconnect.forEach((cb) => cb()); + }; + let incomingMessageQueue = new MessageQueue(); + let handleNextInterval; + ws.onmessage = (e) => { + incomingMessageQueue.enqueue(e.data); + if (!handleNextInterval) { + handleNextInterval = setInterval(handleNext, 0); + } + }; + function handleNext() { + if (incomingMessageQueue.size === 0) { + clearInterval(handleNextInterval); + handleNextInterval = null; + return; + } + var json = incomingMessageQueue.dequeue(); + if (!json) + return; + let subid = getSubscriptionId(json); + if (subid) { + let so = openSubs[subid]; + if (so && so.alreadyHaveEvent && so.alreadyHaveEvent(getHex64(json, "id"), url)) { + return; + } + } + try { + let data = JSON.parse(json); + switch (data[0]) { + case "EVENT": { + let id2 = data[1]; + let event = data[2]; + if (validateEvent(event) && openSubs[id2] && (openSubs[id2].skipVerification || verifySignature(event)) && matchFilters(openSubs[id2].filters, event)) { + openSubs[id2]; + (subListeners[id2]?.event || []).forEach((cb) => cb(event)); + } + return; + } + case "COUNT": + let id = data[1]; + let payload = data[2]; + if (openSubs[id]) { + ; + (subListeners[id]?.count || []).forEach((cb) => cb(payload)); + } + return; + case "EOSE": { + let id2 = data[1]; + if (id2 in subListeners) { + subListeners[id2].eose.forEach((cb) => cb()); + subListeners[id2].eose = []; + } + return; + } + case "OK": { + let id2 = data[1]; + let ok = data[2]; + let reason = data[3] || ""; + if (id2 in pubListeners) { + if (ok) + pubListeners[id2].ok.forEach((cb) => cb()); + else + pubListeners[id2].failed.forEach((cb) => cb(reason)); + pubListeners[id2].ok = []; + pubListeners[id2].failed = []; + } + return; + } + case "NOTICE": + let notice = data[1]; + listeners.notice.forEach((cb) => cb(notice)); + return; + case "AUTH": { + let challenge2 = data[1]; + listeners.auth?.forEach((cb) => cb(challenge2)); + return; + } + } + } catch (err) { + return; + } + } + }); + return connectionPromise; + } + function connected() { + return ws?.readyState === 1; + } + async function connect() { + if (connected()) + return; + await connectRelay(); + } + async function trySend(params) { + let msg = JSON.stringify(params); + if (!connected()) { + await new Promise((resolve) => setTimeout(resolve, 1e3)); + if (!connected()) { + return; + } + } + try { + ws.send(msg); + } catch (err) { + console.log(err); + } + } + const sub = (filters, { + verb = "REQ", + skipVerification = false, + alreadyHaveEvent = null, + id = Math.random().toString().slice(2) + } = {}) => { + let subid = id; + openSubs[subid] = { + id: subid, + filters, + skipVerification, + alreadyHaveEvent + }; + trySend([verb, subid, ...filters]); + return { + sub: (newFilters, newOpts = {}) => sub(newFilters || filters, { + skipVerification: newOpts.skipVerification || skipVerification, + alreadyHaveEvent: newOpts.alreadyHaveEvent || alreadyHaveEvent, + id: subid + }), + unsub: () => { + delete openSubs[subid]; + delete subListeners[subid]; + trySend(["CLOSE", subid]); + }, + on: (type, cb) => { + subListeners[subid] = subListeners[subid] || { + event: [], + count: [], + eose: [] + }; + subListeners[subid][type].push(cb); + }, + off: (type, cb) => { + let listeners2 = subListeners[subid]; + let idx = listeners2[type].indexOf(cb); + if (idx >= 0) + listeners2[type].splice(idx, 1); + } + }; + }; + function _publishEvent(event, type) { + if (!event.id) + throw new Error(`event ${event} has no id`); + let id = event.id; + trySend([type, event]); + return { + on: (type2, cb) => { + pubListeners[id] = pubListeners[id] || { + ok: [], + failed: [] + }; + pubListeners[id][type2].push(cb); + }, + off: (type2, cb) => { + let listeners2 = pubListeners[id]; + if (!listeners2) + return; + let idx = listeners2[type2].indexOf(cb); + if (idx >= 0) + listeners2[type2].splice(idx, 1); + } + }; + } + return { + url, + sub, + on: (type, cb) => { + listeners[type].push(cb); + if (type === "connect" && ws?.readyState === 1) { + ; + cb(); + } + }, + off: (type, cb) => { + let index = listeners[type].indexOf(cb); + if (index !== -1) + listeners[type].splice(index, 1); + }, + list: (filters, opts) => new Promise((resolve) => { + let s = sub(filters, opts); + let events = []; + let timeout = setTimeout(() => { + s.unsub(); + resolve(events); + }, listTimeout); + s.on("eose", () => { + s.unsub(); + clearTimeout(timeout); + resolve(events); + }); + s.on("event", (event) => { + events.push(event); + }); + }), + get: (filter, opts) => new Promise((resolve) => { + let s = sub([filter], opts); + let timeout = setTimeout(() => { + s.unsub(); + resolve(null); + }, getTimeout); + s.on("event", (event) => { + s.unsub(); + clearTimeout(timeout); + resolve(event); + }); + }), + count: (filters) => new Promise((resolve) => { + let s = sub(filters, { ...sub, verb: "COUNT" }); + let timeout = setTimeout(() => { + s.unsub(); + resolve(null); + }, countTimeout); + s.on("count", (event) => { + s.unsub(); + clearTimeout(timeout); + resolve(event); + }); + }), + publish(event) { + return _publishEvent(event, "EVENT"); + }, + auth(event) { + return _publishEvent(event, "AUTH"); + }, + connect, + close() { + listeners = newListeners(); + subListeners = {}; + pubListeners = {}; + if (ws.readyState === WebSocket.OPEN) { + ws?.close(); + } + }, + get status() { + return ws?.readyState ?? 3; + } + }; + } + + // pool.ts + init_define_process(); + var SimplePool = class { + _conn; + _seenOn = {}; + eoseSubTimeout; + getTimeout; + seenOnEnabled = true; + constructor(options = {}) { + this._conn = {}; + this.eoseSubTimeout = options.eoseSubTimeout || 3400; + this.getTimeout = options.getTimeout || 3400; + this.seenOnEnabled = options.seenOnEnabled !== false; + } + close(relays) { + relays.forEach((url) => { + let relay = this._conn[normalizeURL(url)]; + if (relay) + relay.close(); + }); + } + async ensureRelay(url) { + const nm = normalizeURL(url); + if (!this._conn[nm]) { + this._conn[nm] = relayInit(nm, { + getTimeout: this.getTimeout * 0.9, + listTimeout: this.getTimeout * 0.9 + }); + } + const relay = this._conn[nm]; + await relay.connect(); + return relay; + } + sub(relays, filters, opts) { + let _knownIds = /* @__PURE__ */ new Set(); + let modifiedOpts = { ...opts || {} }; + modifiedOpts.alreadyHaveEvent = (id, url) => { + if (opts?.alreadyHaveEvent?.(id, url)) { + return true; + } + if (this.seenOnEnabled) { + let set = this._seenOn[id] || /* @__PURE__ */ new Set(); + set.add(url); + this._seenOn[id] = set; + } + return _knownIds.has(id); + }; + let subs = []; + let eventListeners = /* @__PURE__ */ new Set(); + let eoseListeners = /* @__PURE__ */ new Set(); + let eosesMissing = relays.length; + let eoseSent = false; + let eoseTimeout = setTimeout(() => { + eoseSent = true; + for (let cb of eoseListeners.values()) + cb(); + }, this.eoseSubTimeout); + relays.forEach(async (relay) => { + let r; + try { + r = await this.ensureRelay(relay); + } catch (err) { + handleEose(); + return; + } + if (!r) + return; + let s = r.sub(filters, modifiedOpts); + s.on("event", (event) => { + _knownIds.add(event.id); + for (let cb of eventListeners.values()) + cb(event); + }); + s.on("eose", () => { + if (eoseSent) + return; + handleEose(); + }); + subs.push(s); + function handleEose() { + eosesMissing--; + if (eosesMissing === 0) { + clearTimeout(eoseTimeout); + for (let cb of eoseListeners.values()) + cb(); + } + } + }); + let greaterSub = { + sub(filters2, opts2) { + subs.forEach((sub) => sub.sub(filters2, opts2)); + return greaterSub; + }, + unsub() { + subs.forEach((sub) => sub.unsub()); + }, + on(type, cb) { + if (type === "event") { + eventListeners.add(cb); + } else if (type === "eose") { + eoseListeners.add(cb); + } + }, + off(type, cb) { + if (type === "event") { + eventListeners.delete(cb); + } else if (type === "eose") + eoseListeners.delete(cb); + } + }; + return greaterSub; + } + get(relays, filter, opts) { + return new Promise((resolve) => { + let sub = this.sub(relays, [filter], opts); + let timeout = setTimeout(() => { + sub.unsub(); + resolve(null); + }, this.getTimeout); + sub.on("event", (event) => { + resolve(event); + clearTimeout(timeout); + sub.unsub(); + }); + }); + } + list(relays, filters, opts) { + return new Promise((resolve) => { + let events = []; + let sub = this.sub(relays, filters, opts); + sub.on("event", (event) => { + events.push(event); + }); + sub.on("eose", () => { + sub.unsub(); + resolve(events); + }); + }); + } + publish(relays, event) { + const pubPromises = relays.map(async (relay) => { + let r; + try { + r = await this.ensureRelay(relay); + return r.publish(event); + } catch (_) { + return { on() { + }, off() { + } }; + } + }); + const callbackMap = /* @__PURE__ */ new Map(); + return { + on(type, cb) { + relays.forEach(async (relay, i) => { + let pub = await pubPromises[i]; + let callback = () => cb(relay); + callbackMap.set(cb, callback); + pub.on(type, callback); + }); + }, + off(type, cb) { + relays.forEach(async (_, i) => { + let callback = callbackMap.get(cb); + if (callback) { + let pub = await pubPromises[i]; + pub.off(type, callback); + } + }); + } + }; + } + seenOn(id) { + return Array.from(this._seenOn[id]?.values?.() || []); + } + }; + + // references.ts + init_define_process(); + + // nip19.ts + var nip19_exports = {}; + __export(nip19_exports, { + BECH32_REGEX: () => BECH32_REGEX, + decode: () => decode, + naddrEncode: () => naddrEncode, + neventEncode: () => neventEncode, + noteEncode: () => noteEncode, + nprofileEncode: () => nprofileEncode, + npubEncode: () => npubEncode, + nrelayEncode: () => nrelayEncode, + nsecEncode: () => nsecEncode + }); + init_define_process(); + + // node_modules/@scure/base/lib/esm/index.js + init_define_process(); + function assertNumber(n) { + if (!Number.isSafeInteger(n)) + throw new Error(`Wrong integer: ${n}`); + } + function chain(...args) { + const wrap = (a, b) => (c) => a(b(c)); + const encode = Array.from(args).reverse().reduce((acc, i) => acc ? wrap(acc, i.encode) : i.encode, void 0); + const decode2 = args.reduce((acc, i) => acc ? wrap(acc, i.decode) : i.decode, void 0); + return { encode, decode: decode2 }; + } + function alphabet(alphabet2) { + return { + encode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("alphabet.encode input should be an array of numbers"); + return digits.map((i) => { + assertNumber(i); + if (i < 0 || i >= alphabet2.length) + throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet2.length})`); + return alphabet2[i]; + }); + }, + decode: (input) => { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("alphabet.decode input should be array of strings"); + return input.map((letter) => { + if (typeof letter !== "string") + throw new Error(`alphabet.decode: not string element=${letter}`); + const index = alphabet2.indexOf(letter); + if (index === -1) + throw new Error(`Unknown letter: "${letter}". Allowed: ${alphabet2}`); + return index; + }); + } + }; + } + function join(separator = "") { + if (typeof separator !== "string") + throw new Error("join separator should be string"); + return { + encode: (from) => { + if (!Array.isArray(from) || from.length && typeof from[0] !== "string") + throw new Error("join.encode input should be array of strings"); + for (let i of from) + if (typeof i !== "string") + throw new Error(`join.encode: non-string input=${i}`); + return from.join(separator); + }, + decode: (to) => { + if (typeof to !== "string") + throw new Error("join.decode input should be string"); + return to.split(separator); + } + }; + } + function padding(bits, chr = "=") { + assertNumber(bits); + if (typeof chr !== "string") + throw new Error("padding chr should be string"); + return { + encode(data) { + if (!Array.isArray(data) || data.length && typeof data[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of data) + if (typeof i !== "string") + throw new Error(`padding.encode: non-string input=${i}`); + while (data.length * bits % 8) + data.push(chr); + return data; + }, + decode(input) { + if (!Array.isArray(input) || input.length && typeof input[0] !== "string") + throw new Error("padding.encode input should be array of strings"); + for (let i of input) + if (typeof i !== "string") + throw new Error(`padding.decode: non-string input=${i}`); + let end = input.length; + if (end * bits % 8) + throw new Error("Invalid padding: string should have whole number of bytes"); + for (; end > 0 && input[end - 1] === chr; end--) { + if (!((end - 1) * bits % 8)) + throw new Error("Invalid padding: string has too much padding"); + } + return input.slice(0, end); + } + }; + } + function normalize(fn) { + if (typeof fn !== "function") + throw new Error("normalize fn should be function"); + return { encode: (from) => from, decode: (to) => fn(to) }; + } + function convertRadix(data, from, to) { + if (from < 2) + throw new Error(`convertRadix: wrong from=${from}, base cannot be less than 2`); + if (to < 2) + throw new Error(`convertRadix: wrong to=${to}, base cannot be less than 2`); + if (!Array.isArray(data)) + throw new Error("convertRadix: data should be array"); + if (!data.length) + return []; + let pos = 0; + const res = []; + const digits = Array.from(data); + digits.forEach((d) => { + assertNumber(d); + if (d < 0 || d >= from) + throw new Error(`Wrong integer: ${d}`); + }); + while (true) { + let carry = 0; + let done = true; + for (let i = pos; i < digits.length; i++) { + const digit = digits[i]; + const digitBase = from * carry + digit; + if (!Number.isSafeInteger(digitBase) || from * carry / from !== carry || digitBase - digit !== from * carry) { + throw new Error("convertRadix: carry overflow"); + } + carry = digitBase % to; + digits[i] = Math.floor(digitBase / to); + if (!Number.isSafeInteger(digits[i]) || digits[i] * to + carry !== digitBase) + throw new Error("convertRadix: carry overflow"); + if (!done) + continue; + else if (!digits[i]) + pos = i; + else + done = false; + } + res.push(carry); + if (done) + break; + } + for (let i = 0; i < data.length - 1 && data[i] === 0; i++) + res.push(0); + return res.reverse(); + } + var gcd = (a, b) => !b ? a : gcd(b, a % b); + var radix2carry = (from, to) => from + (to - gcd(from, to)); + function convertRadix2(data, from, to, padding2) { + if (!Array.isArray(data)) + throw new Error("convertRadix2: data should be array"); + if (from <= 0 || from > 32) + throw new Error(`convertRadix2: wrong from=${from}`); + if (to <= 0 || to > 32) + throw new Error(`convertRadix2: wrong to=${to}`); + if (radix2carry(from, to) > 32) { + throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`); + } + let carry = 0; + let pos = 0; + const mask = 2 ** to - 1; + const res = []; + for (const n of data) { + assertNumber(n); + if (n >= 2 ** from) + throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); + carry = carry << from | n; + if (pos + from > 32) + throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); + pos += from; + for (; pos >= to; pos -= to) + res.push((carry >> pos - to & mask) >>> 0); + carry &= 2 ** pos - 1; + } + carry = carry << to - pos & mask; + if (!padding2 && pos >= from) + throw new Error("Excess padding"); + if (!padding2 && carry) + throw new Error(`Non-zero padding: ${carry}`); + if (padding2 && pos > 0) + res.push(carry >>> 0); + return res; + } + function radix(num) { + assertNumber(num); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix.encode input should be Uint8Array"); + return convertRadix(Array.from(bytes2), 2 ** 8, num); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix.decode input should be array of strings"); + return Uint8Array.from(convertRadix(digits, num, 2 ** 8)); + } + }; + } + function radix2(bits, revPadding = false) { + assertNumber(bits); + if (bits <= 0 || bits > 32) + throw new Error("radix2: bits should be in (0..32]"); + if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) + throw new Error("radix2: carry overflow"); + return { + encode: (bytes2) => { + if (!(bytes2 instanceof Uint8Array)) + throw new Error("radix2.encode input should be Uint8Array"); + return convertRadix2(Array.from(bytes2), 8, bits, !revPadding); + }, + decode: (digits) => { + if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number") + throw new Error("radix2.decode input should be array of strings"); + return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); + } + }; + } + function unsafeWrapper(fn) { + if (typeof fn !== "function") + throw new Error("unsafeWrapper fn should be function"); + return function(...args) { + try { + return fn.apply(null, args); + } catch (e) { + } + }; + } + function checksum(len, fn) { + assertNumber(len); + if (typeof fn !== "function") + throw new Error("checksum fn should be function"); + return { + encode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.encode: input should be Uint8Array"); + const checksum2 = fn(data).slice(0, len); + const res = new Uint8Array(data.length + len); + res.set(data); + res.set(checksum2, data.length); + return res; + }, + decode(data) { + if (!(data instanceof Uint8Array)) + throw new Error("checksum.decode: input should be Uint8Array"); + const payload = data.slice(0, -len); + const newChecksum = fn(payload).slice(0, len); + const oldChecksum = data.slice(-len); + for (let i = 0; i < len; i++) + if (newChecksum[i] !== oldChecksum[i]) + throw new Error("Invalid checksum"); + return payload; + } + }; + } + var base16 = chain(radix2(4), alphabet("0123456789ABCDEF"), join("")); + var base32 = chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join("")); + var base32hex = chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join("")); + var base32crockford = chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join(""), normalize((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1"))); + var base64 = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join("")); + var base64url = chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join("")); + var genBase58 = (abc) => chain(radix(58), alphabet(abc), join("")); + var base58 = genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); + var base58flickr = genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"); + var base58xrp = genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"); + var XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; + var base58xmr = { + encode(data) { + let res = ""; + for (let i = 0; i < data.length; i += 8) { + const block = data.subarray(i, i + 8); + res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], "1"); + } + return res; + }, + decode(str) { + let res = []; + for (let i = 0; i < str.length; i += 11) { + const slice = str.slice(i, i + 11); + const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); + const block = base58.decode(slice); + for (let j = 0; j < block.length - blockLen; j++) { + if (block[j] !== 0) + throw new Error("base58xmr: wrong padding"); + } + res = res.concat(Array.from(block.slice(block.length - blockLen))); + } + return Uint8Array.from(res); + } + }; + var base58check = (sha2562) => chain(checksum(4, (data) => sha2562(sha2562(data))), base58); + var BECH_ALPHABET = chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join("")); + var POLYMOD_GENERATORS = [996825010, 642813549, 513874426, 1027748829, 705979059]; + function bech32Polymod(pre) { + const b = pre >> 25; + let chk = (pre & 33554431) << 5; + for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { + if ((b >> i & 1) === 1) + chk ^= POLYMOD_GENERATORS[i]; + } + return chk; + } + function bechChecksum(prefix, words, encodingConst = 1) { + const len = prefix.length; + let chk = 1; + for (let i = 0; i < len; i++) { + const c = prefix.charCodeAt(i); + if (c < 33 || c > 126) + throw new Error(`Invalid prefix (${prefix})`); + chk = bech32Polymod(chk) ^ c >> 5; + } + chk = bech32Polymod(chk); + for (let i = 0; i < len; i++) + chk = bech32Polymod(chk) ^ prefix.charCodeAt(i) & 31; + for (let v of words) + chk = bech32Polymod(chk) ^ v; + for (let i = 0; i < 6; i++) + chk = bech32Polymod(chk); + chk ^= encodingConst; + return BECH_ALPHABET.encode(convertRadix2([chk % 2 ** 30], 30, 5, false)); + } + function genBech32(encoding) { + const ENCODING_CONST = encoding === "bech32" ? 1 : 734539939; + const _words = radix2(5); + const fromWords = _words.decode; + const toWords = _words.encode; + const fromWordsUnsafe = unsafeWrapper(fromWords); + function encode(prefix, words, limit = 90) { + if (typeof prefix !== "string") + throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`); + if (!Array.isArray(words) || words.length && typeof words[0] !== "number") + throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`); + const actualLength = prefix.length + 7 + words.length; + if (limit !== false && actualLength > limit) + throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); + prefix = prefix.toLowerCase(); + return `${prefix}1${BECH_ALPHABET.encode(words)}${bechChecksum(prefix, words, ENCODING_CONST)}`; + } + function decode2(str, limit = 90) { + if (typeof str !== "string") + throw new Error(`bech32.decode input should be string, not ${typeof str}`); + if (str.length < 8 || limit !== false && str.length > limit) + throw new TypeError(`Wrong string length: ${str.length} (${str}). Expected (8..${limit})`); + const lowered = str.toLowerCase(); + if (str !== lowered && str !== str.toUpperCase()) + throw new Error(`String must be lowercase or uppercase`); + str = lowered; + const sepIndex = str.lastIndexOf("1"); + if (sepIndex === 0 || sepIndex === -1) + throw new Error(`Letter "1" must be present between prefix and data only`); + const prefix = str.slice(0, sepIndex); + const _words2 = str.slice(sepIndex + 1); + if (_words2.length < 6) + throw new Error("Data must be at least 6 characters long"); + const words = BECH_ALPHABET.decode(_words2).slice(0, -6); + const sum = bechChecksum(prefix, words, ENCODING_CONST); + if (!_words2.endsWith(sum)) + throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); + return { prefix, words }; + } + const decodeUnsafe = unsafeWrapper(decode2); + function decodeToBytes(str) { + const { prefix, words } = decode2(str, false); + return { prefix, words, bytes: fromWords(words) }; + } + return { encode, decode: decode2, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords }; + } + var bech32 = genBech32("bech32"); + var bech32m = genBech32("bech32m"); + var utf8 = { + encode: (data) => new TextDecoder().decode(data), + decode: (str) => new TextEncoder().encode(str) + }; + var hex = chain(radix2(4), alphabet("0123456789abcdef"), join(""), normalize((s) => { + if (typeof s !== "string" || s.length % 2) + throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); + return s.toLowerCase(); + })); + var CODERS = { + utf8, + hex, + base16, + base32, + base64, + base64url, + base58, + base58xmr + }; + var coderTypeError = `Invalid encoding type. Available types: ${Object.keys(CODERS).join(", ")}`; + + // nip19.ts + var Bech32MaxSize = 5e3; + var BECH32_REGEX = /[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/; + function decode(nip19) { + let { prefix, words } = bech32.decode(nip19, Bech32MaxSize); + let data = new Uint8Array(bech32.fromWords(words)); + switch (prefix) { + case "nprofile": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nprofile"); + if (tlv[0][0].length !== 32) + throw new Error("TLV 0 should be 32 bytes"); + return { + type: "nprofile", + data: { + pubkey: bytesToHex(tlv[0][0]), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [] + } + }; + } + case "nevent": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nevent"); + if (tlv[0][0].length !== 32) + throw new Error("TLV 0 should be 32 bytes"); + if (tlv[2] && tlv[2][0].length !== 32) + throw new Error("TLV 2 should be 32 bytes"); + return { + type: "nevent", + data: { + id: bytesToHex(tlv[0][0]), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [], + author: tlv[2]?.[0] ? bytesToHex(tlv[2][0]) : void 0 + } + }; + } + case "naddr": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for naddr"); + if (!tlv[2]?.[0]) + throw new Error("missing TLV 2 for naddr"); + if (tlv[2][0].length !== 32) + throw new Error("TLV 2 should be 32 bytes"); + if (!tlv[3]?.[0]) + throw new Error("missing TLV 3 for naddr"); + if (tlv[3][0].length !== 4) + throw new Error("TLV 3 should be 4 bytes"); + return { + type: "naddr", + data: { + identifier: utf8Decoder.decode(tlv[0][0]), + pubkey: bytesToHex(tlv[2][0]), + kind: parseInt(bytesToHex(tlv[3][0]), 16), + relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [] + } + }; + } + case "nrelay": { + let tlv = parseTLV(data); + if (!tlv[0]?.[0]) + throw new Error("missing TLV 0 for nrelay"); + return { + type: "nrelay", + data: utf8Decoder.decode(tlv[0][0]) + }; + } + case "nsec": + case "npub": + case "note": + return { type: prefix, data: bytesToHex(data) }; + default: + throw new Error(`unknown prefix ${prefix}`); + } + } + function parseTLV(data) { + let result = {}; + let rest = data; + while (rest.length > 0) { + let t = rest[0]; + let l = rest[1]; + if (!l) + throw new Error(`malformed TLV ${t}`); + let v = rest.slice(2, 2 + l); + rest = rest.slice(2 + l); + if (v.length < l) + throw new Error(`not enough data to read on TLV ${t}`); + result[t] = result[t] || []; + result[t].push(v); + } + return result; + } + function nsecEncode(hex2) { + return encodeBytes("nsec", hex2); + } + function npubEncode(hex2) { + return encodeBytes("npub", hex2); + } + function noteEncode(hex2) { + return encodeBytes("note", hex2); + } + function encodeBech32(prefix, data) { + let words = bech32.toWords(data); + return bech32.encode(prefix, words, Bech32MaxSize); + } + function encodeBytes(prefix, hex2) { + let data = hexToBytes(hex2); + return encodeBech32(prefix, data); + } + function nprofileEncode(profile) { + let data = encodeTLV({ + 0: [hexToBytes(profile.pubkey)], + 1: (profile.relays || []).map((url) => utf8Encoder.encode(url)) + }); + return encodeBech32("nprofile", data); + } + function neventEncode(event) { + let data = encodeTLV({ + 0: [hexToBytes(event.id)], + 1: (event.relays || []).map((url) => utf8Encoder.encode(url)), + 2: event.author ? [hexToBytes(event.author)] : [] + }); + return encodeBech32("nevent", data); + } + function naddrEncode(addr) { + let kind = new ArrayBuffer(4); + new DataView(kind).setUint32(0, addr.kind, false); + let data = encodeTLV({ + 0: [utf8Encoder.encode(addr.identifier)], + 1: (addr.relays || []).map((url) => utf8Encoder.encode(url)), + 2: [hexToBytes(addr.pubkey)], + 3: [new Uint8Array(kind)] + }); + return encodeBech32("naddr", data); + } + function nrelayEncode(url) { + let data = encodeTLV({ + 0: [utf8Encoder.encode(url)] + }); + return encodeBech32("nrelay", data); + } + function encodeTLV(tlv) { + let entries = []; + Object.entries(tlv).forEach(([t, vs]) => { + vs.forEach((v) => { + let entry = new Uint8Array(v.length + 2); + entry.set([parseInt(t)], 0); + entry.set([v.length], 1); + entry.set(v, 2); + entries.push(entry); + }); + }); + return concatBytes(...entries); + } + + // references.ts + var mentionRegex = /\bnostr:((note|npub|naddr|nevent|nprofile)1\w+)\b|#\[(\d+)\]/g; + function parseReferences(evt) { + let references = []; + for (let ref of evt.content.matchAll(mentionRegex)) { + if (ref[2]) { + try { + let { type, data } = decode(ref[1]); + switch (type) { + case "npub": { + references.push({ + text: ref[0], + profile: { pubkey: data, relays: [] } + }); + break; + } + case "nprofile": { + references.push({ + text: ref[0], + profile: data + }); + break; + } + case "note": { + references.push({ + text: ref[0], + event: { id: data, relays: [] } + }); + break; + } + case "nevent": { + references.push({ + text: ref[0], + event: data + }); + break; + } + case "naddr": { + references.push({ + text: ref[0], + address: data + }); + break; + } + } + } catch (err) { + } + } else if (ref[3]) { + let idx = parseInt(ref[3], 10); + let tag = evt.tags[idx]; + if (!tag) + continue; + switch (tag[0]) { + case "p": { + references.push({ + text: ref[0], + profile: { pubkey: tag[1], relays: tag[2] ? [tag[2]] : [] } + }); + break; + } + case "e": { + references.push({ + text: ref[0], + event: { id: tag[1], relays: tag[2] ? [tag[2]] : [] } + }); + break; + } + case "a": { + try { + let [kind, pubkey, identifier] = tag[1].split(":"); + references.push({ + text: ref[0], + address: { + identifier, + pubkey, + kind: parseInt(kind, 10), + relays: tag[2] ? [tag[2]] : [] + } + }); + } catch (err) { + } + break; + } + } + } + } + return references; + } + + // nip04.ts + var nip04_exports = {}; + __export(nip04_exports, { + decrypt: () => decrypt, + encrypt: () => encrypt + }); + init_define_process(); + if (typeof crypto !== "undefined" && !crypto.subtle && crypto.webcrypto) { + crypto.subtle = crypto.webcrypto.subtle; + } + async function encrypt(privkey, pubkey, text) { + const key = secp256k1.getSharedSecret(privkey, "02" + pubkey); + const normalizedKey = getNormalizedX(key); + let iv = Uint8Array.from(randomBytes(16)); + let plaintext = utf8Encoder.encode(text); + let cryptoKey = await crypto.subtle.importKey( + "raw", + normalizedKey, + { name: "AES-CBC" }, + false, + ["encrypt"] + ); + let ciphertext = await crypto.subtle.encrypt( + { name: "AES-CBC", iv }, + cryptoKey, + plaintext + ); + let ctb64 = base64.encode(new Uint8Array(ciphertext)); + let ivb64 = base64.encode(new Uint8Array(iv.buffer)); + return `${ctb64}?iv=${ivb64}`; + } + async function decrypt(privkey, pubkey, data) { + let [ctb64, ivb64] = data.split("?iv="); + let key = secp256k1.getSharedSecret(privkey, "02" + pubkey); + let normalizedKey = getNormalizedX(key); + let cryptoKey = await crypto.subtle.importKey( + "raw", + normalizedKey, + { name: "AES-CBC" }, + false, + ["decrypt"] + ); + let ciphertext = base64.decode(ctb64); + let iv = base64.decode(ivb64); + let plaintext = await crypto.subtle.decrypt( + { name: "AES-CBC", iv }, + cryptoKey, + ciphertext + ); + let text = utf8Decoder.decode(plaintext); + return text; + } + function getNormalizedX(key) { + return key.slice(1, 33); + } + + // nip05.ts + var nip05_exports = {}; + __export(nip05_exports, { + NIP05_REGEX: () => NIP05_REGEX, + queryProfile: () => queryProfile, + searchDomain: () => searchDomain, + useFetchImplementation: () => useFetchImplementation + }); + init_define_process(); + var NIP05_REGEX = /^(?:([\w.+-]+)@)?([\w.-]+)$/; + var _fetch; + try { + _fetch = fetch; + } catch { + } + function useFetchImplementation(fetchImplementation) { + _fetch = fetchImplementation; + } + async function searchDomain(domain, query = "") { + try { + let res = await (await _fetch(`https://${domain}/.well-known/nostr.json?name=${query}`)).json(); + return res.names; + } catch (_) { + return {}; + } + } + async function queryProfile(fullname) { + const match = fullname.match(NIP05_REGEX); + if (!match) + return null; + const [_, name = "_", domain] = match; + try { + const res = await _fetch(`https://${domain}/.well-known/nostr.json?name=${name}`); + const { names, relays } = parseNIP05Result(await res.json()); + const pubkey = names[name]; + return pubkey ? { pubkey, relays: relays?.[pubkey] } : null; + } catch (_e) { + return null; + } + } + function parseNIP05Result(json) { + const result = { + names: {} + }; + for (const [name, pubkey] of Object.entries(json.names)) { + if (typeof name === "string" && typeof pubkey === "string") { + result.names[name] = pubkey; + } + } + if (json.relays) { + result.relays = {}; + for (const [pubkey, relays] of Object.entries(json.relays)) { + if (typeof pubkey === "string" && Array.isArray(relays)) { + result.relays[pubkey] = relays.filter((relay) => typeof relay === "string"); + } + } + } + return result; + } + + // nip06.ts + var nip06_exports = {}; + __export(nip06_exports, { + generateSeedWords: () => generateSeedWords, + privateKeyFromSeedWords: () => privateKeyFromSeedWords, + validateWords: () => validateWords + }); + init_define_process(); + var import_english = __toESM(require_english()); + var import_bip39 = __toESM(require_bip39()); + + // node_modules/@scure/bip32/lib/esm/index.js + init_define_process(); + + // node_modules/@noble/hashes/esm/ripemd160.js + init_define_process(); + var Rho = new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); + var Id = Uint8Array.from({ length: 16 }, (_, i) => i); + var Pi = Id.map((i) => (9 * i + 5) % 16); + var idxL = [Id]; + var idxR = [Pi]; + for (let i = 0; i < 4; i++) + for (let j of [idxL, idxR]) + j.push(j[i].map((k) => Rho[k])); + var shifts = [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5] + ].map((i) => new Uint8Array(i)); + var shiftsL = idxL.map((idx, i) => idx.map((j) => shifts[i][j])); + var shiftsR = idxR.map((idx, i) => idx.map((j) => shifts[i][j])); + var Kl = new Uint32Array([0, 1518500249, 1859775393, 2400959708, 2840853838]); + var Kr = new Uint32Array([1352829926, 1548603684, 1836072691, 2053994217, 0]); + var rotl = (word, shift) => word << shift | word >>> 32 - shift; + function f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + else if (group === 1) + return x & y | ~x & z; + else if (group === 2) + return (x | ~y) ^ z; + else if (group === 3) + return x & z | y & ~z; + else + return x ^ (y | ~z); + } + var BUF = new Uint32Array(16); + var RIPEMD160 = class extends SHA2 { + constructor() { + super(64, 20, 8, true); + this.h0 = 1732584193 | 0; + this.h1 = 4023233417 | 0; + this.h2 = 2562383102 | 0; + this.h3 = 271733878 | 0; + this.h4 = 3285377520 | 0; + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF[i] = view.getUint32(offset, true); + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl[group], hbr = Kr[group]; + const rl = idxL[group], rr = idxR[group]; + const sl = shiftsL[group], sr = shiftsR[group]; + for (let i = 0; i < 16; i++) { + const tl = rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; + } + for (let i = 0; i < 16; i++) { + const tr = rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; + } + } + this.set(this.h1 + cl + dr | 0, this.h2 + dl + er | 0, this.h3 + el + ar | 0, this.h4 + al + br | 0, this.h0 + bl + cr | 0); + } + roundClean() { + BUF.fill(0); + } + destroy() { + this.destroyed = true; + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0); + } + }; + var ripemd160 = wrapConstructor(() => new RIPEMD160()); + + // node_modules/@noble/hashes/esm/sha512.js + init_define_process(); + + // node_modules/@noble/hashes/esm/_u64.js + init_define_process(); + var U32_MASK64 = BigInt(2 ** 32 - 1); + var _32n = BigInt(32); + function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) }; + return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; + } + function split(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0); + var shrSH = (h, l, s) => h >>> s; + var shrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrSH = (h, l, s) => h >>> s | l << 32 - s; + var rotrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32; + var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s; + var rotr32H = (h, l) => l; + var rotr32L = (h, l) => h; + var rotlSH = (h, l, s) => h << s | l >>> 32 - s; + var rotlSL = (h, l, s) => l << s | h >>> 32 - s; + var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; + var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; + function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; + } + var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; + var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; + var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; + var u64 = { + fromBig, + split, + toBig, + shrSH, + shrSL, + rotrSH, + rotrSL, + rotrBH, + rotrBL, + rotr32H, + rotr32L, + rotlSH, + rotlSL, + rotlBH, + rotlBL, + add, + add3L, + add3H, + add4L, + add4H, + add5H, + add5L + }; + var u64_default = u64; + + // node_modules/@noble/hashes/esm/sha512.js + var [SHA512_Kh, SHA512_Kl] = u64_default.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" + ].map((n) => BigInt(n))); + var SHA512_W_H = new Uint32Array(80); + var SHA512_W_L = new Uint32Array(80); + var SHA512 = class extends SHA2 { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32(offset += 4); + } + for (let i = 16; i < 80; i++) { + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = u64_default.rotrSH(W15h, W15l, 1) ^ u64_default.rotrSH(W15h, W15l, 8) ^ u64_default.shrSH(W15h, W15l, 7); + const s0l = u64_default.rotrSL(W15h, W15l, 1) ^ u64_default.rotrSL(W15h, W15l, 8) ^ u64_default.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = u64_default.rotrSH(W2h, W2l, 19) ^ u64_default.rotrBH(W2h, W2l, 61) ^ u64_default.shrSH(W2h, W2l, 6); + const s1l = u64_default.rotrSL(W2h, W2l, 19) ^ u64_default.rotrBL(W2h, W2l, 61) ^ u64_default.shrSL(W2h, W2l, 6); + const SUMl = u64_default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = u64_default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + for (let i = 0; i < 80; i++) { + const sigma1h = u64_default.rotrSH(Eh, El, 14) ^ u64_default.rotrSH(Eh, El, 18) ^ u64_default.rotrBH(Eh, El, 41); + const sigma1l = u64_default.rotrSL(Eh, El, 14) ^ u64_default.rotrSL(Eh, El, 18) ^ u64_default.rotrBL(Eh, El, 41); + const CHIh = Eh & Fh ^ ~Eh & Gh; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = u64_default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = u64_default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + const sigma0h = u64_default.rotrSH(Ah, Al, 28) ^ u64_default.rotrBH(Ah, Al, 34) ^ u64_default.rotrBH(Ah, Al, 39); + const sigma0l = u64_default.rotrSL(Ah, Al, 28) ^ u64_default.rotrBL(Ah, Al, 34) ^ u64_default.rotrBL(Ah, Al, 39); + const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = u64_default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = u64_default.add3L(T1l, sigma0l, MAJl); + Ah = u64_default.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah, l: Al } = u64_default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = u64_default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = u64_default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = u64_default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = u64_default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = u64_default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = u64_default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = u64_default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + SHA512_W_H.fill(0); + SHA512_W_L.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + }; + var SHA512_224 = class extends SHA512 { + constructor() { + super(); + this.Ah = 2352822216 | 0; + this.Al = 424955298 | 0; + this.Bh = 1944164710 | 0; + this.Bl = 2312950998 | 0; + this.Ch = 502970286 | 0; + this.Cl = 855612546 | 0; + this.Dh = 1738396948 | 0; + this.Dl = 1479516111 | 0; + this.Eh = 258812777 | 0; + this.El = 2077511080 | 0; + this.Fh = 2011393907 | 0; + this.Fl = 79989058 | 0; + this.Gh = 1067287976 | 0; + this.Gl = 1780299464 | 0; + this.Hh = 286451373 | 0; + this.Hl = 2446758561 | 0; + this.outputLen = 28; + } + }; + var SHA512_256 = class extends SHA512 { + constructor() { + super(); + this.Ah = 573645204 | 0; + this.Al = 4230739756 | 0; + this.Bh = 2673172387 | 0; + this.Bl = 3360449730 | 0; + this.Ch = 596883563 | 0; + this.Cl = 1867755857 | 0; + this.Dh = 2520282905 | 0; + this.Dl = 1497426621 | 0; + this.Eh = 2519219938 | 0; + this.El = 2827943907 | 0; + this.Fh = 3193839141 | 0; + this.Fl = 1401305490 | 0; + this.Gh = 721525244 | 0; + this.Gl = 746961066 | 0; + this.Hh = 246885852 | 0; + this.Hl = 2177182882 | 0; + this.outputLen = 32; + } + }; + var SHA384 = class extends SHA512 { + constructor() { + super(); + this.Ah = 3418070365 | 0; + this.Al = 3238371032 | 0; + this.Bh = 1654270250 | 0; + this.Bl = 914150663 | 0; + this.Ch = 2438529370 | 0; + this.Cl = 812702999 | 0; + this.Dh = 355462360 | 0; + this.Dl = 4144912697 | 0; + this.Eh = 1731405415 | 0; + this.El = 4290775857 | 0; + this.Fh = 2394180231 | 0; + this.Fl = 1750603025 | 0; + this.Gh = 3675008525 | 0; + this.Gl = 1694076839 | 0; + this.Hh = 1203062813 | 0; + this.Hl = 3204075428 | 0; + this.outputLen = 48; + } + }; + var sha512 = wrapConstructor(() => new SHA512()); + var sha512_224 = wrapConstructor(() => new SHA512_224()); + var sha512_256 = wrapConstructor(() => new SHA512_256()); + var sha384 = wrapConstructor(() => new SHA384()); + + // node_modules/@scure/bip32/lib/esm/index.js + var Point2 = secp256k1.ProjectivePoint; + var base58check2 = base58check(sha256); + function bytesToNumber(bytes2) { + return BigInt(`0x${bytesToHex(bytes2)}`); + } + function numberToBytes(num) { + return hexToBytes(num.toString(16).padStart(64, "0")); + } + var MASTER_SECRET = utf8ToBytes("Bitcoin seed"); + var BITCOIN_VERSIONS = { private: 76066276, public: 76067358 }; + var HARDENED_OFFSET = 2147483648; + var hash160 = (data) => ripemd160(sha256(data)); + var fromU32 = (data) => createView(data).getUint32(0, false); + var toU32 = (n) => { + if (!Number.isSafeInteger(n) || n < 0 || n > 2 ** 32 - 1) { + throw new Error(`Invalid number=${n}. Should be from 0 to 2 ** 32 - 1`); + } + const buf = new Uint8Array(4); + createView(buf).setUint32(0, n, false); + return buf; + }; + var HDKey = class { + get fingerprint() { + if (!this.pubHash) { + throw new Error("No publicKey set!"); + } + return fromU32(this.pubHash); + } + get identifier() { + return this.pubHash; + } + get pubKeyHash() { + return this.pubHash; + } + get privateKey() { + return this.privKeyBytes || null; + } + get publicKey() { + return this.pubKey || null; + } + get privateExtendedKey() { + const priv = this.privateKey; + if (!priv) { + throw new Error("No private key"); + } + return base58check2.encode(this.serialize(this.versions.private, concatBytes(new Uint8Array([0]), priv))); + } + get publicExtendedKey() { + if (!this.pubKey) { + throw new Error("No public key"); + } + return base58check2.encode(this.serialize(this.versions.public, this.pubKey)); + } + static fromMasterSeed(seed, versions = BITCOIN_VERSIONS) { + bytes(seed); + if (8 * seed.length < 128 || 8 * seed.length > 512) { + throw new Error(`HDKey: wrong seed length=${seed.length}. Should be between 128 and 512 bits; 256 bits is advised)`); + } + const I = hmac(sha512, MASTER_SECRET, seed); + return new HDKey({ + versions, + chainCode: I.slice(32), + privateKey: I.slice(0, 32) + }); + } + static fromExtendedKey(base58key, versions = BITCOIN_VERSIONS) { + const keyBuffer = base58check2.decode(base58key); + const keyView = createView(keyBuffer); + const version = keyView.getUint32(0, false); + const opt = { + versions, + depth: keyBuffer[4], + parentFingerprint: keyView.getUint32(5, false), + index: keyView.getUint32(9, false), + chainCode: keyBuffer.slice(13, 45) + }; + const key = keyBuffer.slice(45); + const isPriv = key[0] === 0; + if (version !== versions[isPriv ? "private" : "public"]) { + throw new Error("Version mismatch"); + } + if (isPriv) { + return new HDKey({ ...opt, privateKey: key.slice(1) }); + } else { + return new HDKey({ ...opt, publicKey: key }); + } + } + static fromJSON(json) { + return HDKey.fromExtendedKey(json.xpriv); + } + constructor(opt) { + this.depth = 0; + this.index = 0; + this.chainCode = null; + this.parentFingerprint = 0; + if (!opt || typeof opt !== "object") { + throw new Error("HDKey.constructor must not be called directly"); + } + this.versions = opt.versions || BITCOIN_VERSIONS; + this.depth = opt.depth || 0; + this.chainCode = opt.chainCode; + this.index = opt.index || 0; + this.parentFingerprint = opt.parentFingerprint || 0; + if (!this.depth) { + if (this.parentFingerprint || this.index) { + throw new Error("HDKey: zero depth with non-zero index/parent fingerprint"); + } + } + if (opt.publicKey && opt.privateKey) { + throw new Error("HDKey: publicKey and privateKey at same time."); + } + if (opt.privateKey) { + if (!secp256k1.utils.isValidPrivateKey(opt.privateKey)) { + throw new Error("Invalid private key"); + } + this.privKey = typeof opt.privateKey === "bigint" ? opt.privateKey : bytesToNumber(opt.privateKey); + this.privKeyBytes = numberToBytes(this.privKey); + this.pubKey = secp256k1.getPublicKey(opt.privateKey, true); + } else if (opt.publicKey) { + this.pubKey = Point2.fromHex(opt.publicKey).toRawBytes(true); + } else { + throw new Error("HDKey: no public or private key provided"); + } + this.pubHash = hash160(this.pubKey); + } + derive(path) { + if (!/^[mM]'?/.test(path)) { + throw new Error('Path must start with "m" or "M"'); + } + if (/^[mM]'?$/.test(path)) { + return this; + } + const parts = path.replace(/^[mM]'?\//, "").split("/"); + let child = this; + for (const c of parts) { + const m = /^(\d+)('?)$/.exec(c); + if (!m || m.length !== 3) { + throw new Error(`Invalid child index: ${c}`); + } + let idx = +m[1]; + if (!Number.isSafeInteger(idx) || idx >= HARDENED_OFFSET) { + throw new Error("Invalid index"); + } + if (m[2] === "'") { + idx += HARDENED_OFFSET; + } + child = child.deriveChild(idx); + } + return child; + } + deriveChild(index) { + if (!this.pubKey || !this.chainCode) { + throw new Error("No publicKey or chainCode set"); + } + let data = toU32(index); + if (index >= HARDENED_OFFSET) { + const priv = this.privateKey; + if (!priv) { + throw new Error("Could not derive hardened child key"); + } + data = concatBytes(new Uint8Array([0]), priv, data); + } else { + data = concatBytes(this.pubKey, data); + } + const I = hmac(sha512, this.chainCode, data); + const childTweak = bytesToNumber(I.slice(0, 32)); + const chainCode = I.slice(32); + if (!secp256k1.utils.isValidPrivateKey(childTweak)) { + throw new Error("Tweak bigger than curve order"); + } + const opt = { + versions: this.versions, + chainCode, + depth: this.depth + 1, + parentFingerprint: this.fingerprint, + index + }; + try { + if (this.privateKey) { + const added = mod(this.privKey + childTweak, secp256k1.CURVE.n); + if (!secp256k1.utils.isValidPrivateKey(added)) { + throw new Error("The tweak was out of range or the resulted private key is invalid"); + } + opt.privateKey = added; + } else { + const added = Point2.fromHex(this.pubKey).add(Point2.fromPrivateKey(childTweak)); + if (added.equals(Point2.ZERO)) { + throw new Error("The tweak was equal to negative P, which made the result key invalid"); + } + opt.publicKey = added.toRawBytes(true); + } + return new HDKey(opt); + } catch (err) { + return this.deriveChild(index + 1); + } + } + sign(hash2) { + if (!this.privateKey) { + throw new Error("No privateKey set!"); + } + bytes(hash2, 32); + return secp256k1.sign(hash2, this.privKey).toCompactRawBytes(); + } + verify(hash2, signature) { + bytes(hash2, 32); + bytes(signature, 64); + if (!this.publicKey) { + throw new Error("No publicKey set!"); + } + let sig; + try { + sig = secp256k1.Signature.fromCompact(signature); + } catch (error) { + return false; + } + return secp256k1.verify(sig, hash2, this.publicKey); + } + wipePrivateData() { + this.privKey = void 0; + if (this.privKeyBytes) { + this.privKeyBytes.fill(0); + this.privKeyBytes = void 0; + } + return this; + } + toJSON() { + return { + xpriv: this.privateExtendedKey, + xpub: this.publicExtendedKey + }; + } + serialize(version, key) { + if (!this.chainCode) { + throw new Error("No chainCode set"); + } + bytes(key, 33); + return concatBytes(toU32(version), new Uint8Array([this.depth]), toU32(this.parentFingerprint), toU32(this.index), this.chainCode, key); + } + }; + + // nip06.ts + function privateKeyFromSeedWords(mnemonic, passphrase) { + let root = HDKey.fromMasterSeed((0, import_bip39.mnemonicToSeedSync)(mnemonic, passphrase)); + let privateKey = root.derive(`m/44'/1237'/0'/0/0`).privateKey; + if (!privateKey) + throw new Error("could not derive private key"); + return bytesToHex(privateKey); + } + function generateSeedWords() { + return (0, import_bip39.generateMnemonic)(import_english.wordlist); + } + function validateWords(words) { + return (0, import_bip39.validateMnemonic)(words, import_english.wordlist); + } + + // nip10.ts + var nip10_exports = {}; + __export(nip10_exports, { + parse: () => parse + }); + init_define_process(); + function parse(event) { + const result = { + reply: void 0, + root: void 0, + mentions: [], + profiles: [] + }; + const eTags = []; + for (const tag of event.tags) { + if (tag[0] === "e" && tag[1]) { + eTags.push(tag); + } + if (tag[0] === "p" && tag[1]) { + result.profiles.push({ + pubkey: tag[1], + relays: tag[2] ? [tag[2]] : [] + }); + } + } + for (let eTagIndex = 0; eTagIndex < eTags.length; eTagIndex++) { + const eTag = eTags[eTagIndex]; + const [_, eTagEventId, eTagRelayUrl, eTagMarker] = eTag; + const eventPointer = { + id: eTagEventId, + relays: eTagRelayUrl ? [eTagRelayUrl] : [] + }; + const isFirstETag = eTagIndex === 0; + const isLastETag = eTagIndex === eTags.length - 1; + if (eTagMarker === "root") { + result.root = eventPointer; + continue; + } + if (eTagMarker === "reply") { + result.reply = eventPointer; + continue; + } + if (eTagMarker === "mention") { + result.mentions.push(eventPointer); + continue; + } + if (isFirstETag) { + result.root = eventPointer; + continue; + } + if (isLastETag) { + result.reply = eventPointer; + continue; + } + result.mentions.push(eventPointer); + } + return result; + } + + // nip13.ts + var nip13_exports = {}; + __export(nip13_exports, { + getPow: () => getPow + }); + init_define_process(); + function getPow(id) { + return getLeadingZeroBits(hexToBytes(id)); + } + function getLeadingZeroBits(hash2) { + let total, i, bits; + for (i = 0, total = 0; i < hash2.length; i++) { + bits = msb(hash2[i]); + total += bits; + if (bits !== 8) { + break; + } + } + return total; + } + function msb(b) { + let n = 0; + if (b === 0) { + return 8; + } + while (b >>= 1) { + n++; + } + return 7 - n; + } + + // nip18.ts + var nip18_exports = {}; + __export(nip18_exports, { + finishRepostEvent: () => finishRepostEvent, + getRepostedEvent: () => getRepostedEvent, + getRepostedEventPointer: () => getRepostedEventPointer + }); + init_define_process(); + function finishRepostEvent(t, reposted, relayUrl, privateKey) { + return finishEvent({ + kind: 6 /* Repost */, + tags: [ + ...t.tags ?? [], + ["e", reposted.id, relayUrl], + ["p", reposted.pubkey] + ], + content: t.content === "" ? "" : JSON.stringify(reposted), + created_at: t.created_at + }, privateKey); + } + function getRepostedEventPointer(event) { + if (event.kind !== 6 /* Repost */) { + return void 0; + } + let lastETag; + let lastPTag; + for (let i = event.tags.length - 1; i >= 0 && (lastETag === void 0 || lastPTag === void 0); i--) { + const tag = event.tags[i]; + if (tag.length >= 2) { + if (tag[0] === "e" && lastETag === void 0) { + lastETag = tag; + } else if (tag[0] === "p" && lastPTag === void 0) { + lastPTag = tag; + } + } + } + if (lastETag === void 0) { + return void 0; + } + return { + id: lastETag[1], + relays: [lastETag[2], lastPTag?.[2]].filter((x) => typeof x === "string"), + author: lastPTag?.[1] + }; + } + function getRepostedEvent(event, { skipVerification } = {}) { + const pointer = getRepostedEventPointer(event); + if (pointer === void 0 || event.content === "") { + return void 0; + } + let repostedEvent; + try { + repostedEvent = JSON.parse(event.content); + } catch (error) { + return void 0; + } + if (repostedEvent.id !== pointer.id) { + return void 0; + } + if (!skipVerification && !verifySignature(repostedEvent)) { + return void 0; + } + return repostedEvent; + } + + // nip21.ts + var nip21_exports = {}; + __export(nip21_exports, { + NOSTR_URI_REGEX: () => NOSTR_URI_REGEX, + parse: () => parse2, + test: () => test + }); + init_define_process(); + var NOSTR_URI_REGEX = new RegExp(`nostr:(${BECH32_REGEX.source})`); + function test(value) { + return typeof value === "string" && new RegExp(`^${NOSTR_URI_REGEX.source}$`).test(value); + } + function parse2(uri) { + const match = uri.match(new RegExp(`^${NOSTR_URI_REGEX.source}$`)); + if (!match) + throw new Error(`Invalid Nostr URI: ${uri}`); + return { + uri: match[0], + value: match[1], + decoded: decode(match[1]) + }; + } + + // nip25.ts + var nip25_exports = {}; + __export(nip25_exports, { + finishReactionEvent: () => finishReactionEvent, + getReactedEventPointer: () => getReactedEventPointer + }); + init_define_process(); + function finishReactionEvent(t, reacted, privateKey) { + const inheritedTags = reacted.tags.filter( + (tag) => tag.length >= 2 && (tag[0] === "e" || tag[0] === "p") + ); + return finishEvent({ + ...t, + kind: 7 /* Reaction */, + tags: [ + ...t.tags ?? [], + ...inheritedTags, + ["e", reacted.id], + ["p", reacted.pubkey] + ], + content: t.content ?? "+" + }, privateKey); + } + function getReactedEventPointer(event) { + if (event.kind !== 7 /* Reaction */) { + return void 0; + } + let lastETag; + let lastPTag; + for (let i = event.tags.length - 1; i >= 0 && (lastETag === void 0 || lastPTag === void 0); i--) { + const tag = event.tags[i]; + if (tag.length >= 2) { + if (tag[0] === "e" && lastETag === void 0) { + lastETag = tag; + } else if (tag[0] === "p" && lastPTag === void 0) { + lastPTag = tag; + } + } + } + if (lastETag === void 0 || lastPTag === void 0) { + return void 0; + } + return { + id: lastETag[1], + relays: [lastETag[2], lastPTag[2]].filter((x) => x !== void 0), + author: lastPTag[1] + }; + } + + // nip26.ts + var nip26_exports = {}; + __export(nip26_exports, { + createDelegation: () => createDelegation, + getDelegator: () => getDelegator + }); + init_define_process(); + function createDelegation(privateKey, parameters) { + let conditions = []; + if ((parameters.kind || -1) >= 0) + conditions.push(`kind=${parameters.kind}`); + if (parameters.until) + conditions.push(`created_at<${parameters.until}`); + if (parameters.since) + conditions.push(`created_at>${parameters.since}`); + let cond = conditions.join("&"); + if (cond === "") + throw new Error("refusing to create a delegation without any conditions"); + let sighash = sha256( + utf8Encoder.encode(`nostr:delegation:${parameters.pubkey}:${cond}`) + ); + let sig = bytesToHex( + schnorr.sign(sighash, privateKey) + ); + return { + from: getPublicKey(privateKey), + to: parameters.pubkey, + cond, + sig + }; + } + function getDelegator(event) { + let tag = event.tags.find((tag2) => tag2[0] === "delegation" && tag2.length >= 4); + if (!tag) + return null; + let pubkey = tag[1]; + let cond = tag[2]; + let sig = tag[3]; + let conditions = cond.split("&"); + for (let i = 0; i < conditions.length; i++) { + let [key, operator, value] = conditions[i].split(/\b/); + if (key === "kind" && operator === "=" && event.kind === parseInt(value)) + continue; + else if (key === "created_at" && operator === "<" && event.created_at < parseInt(value)) + continue; + else if (key === "created_at" && operator === ">" && event.created_at > parseInt(value)) + continue; + else + return null; + } + let sighash = sha256( + utf8Encoder.encode(`nostr:delegation:${event.pubkey}:${cond}`) + ); + if (!schnorr.verify(sig, sighash, pubkey)) + return null; + return pubkey; + } + + // nip27.ts + var nip27_exports = {}; + __export(nip27_exports, { + matchAll: () => matchAll, + regex: () => regex, + replaceAll: () => replaceAll + }); + init_define_process(); + var regex = () => new RegExp(`\\b${NOSTR_URI_REGEX.source}\\b`, "g"); + function* matchAll(content) { + const matches = content.matchAll(regex()); + for (const match of matches) { + try { + const [uri, value] = match; + yield { + uri, + value, + decoded: decode(value), + start: match.index, + end: match.index + uri.length + }; + } catch (_e) { + } + } + } + function replaceAll(content, replacer) { + return content.replaceAll(regex(), (uri, value) => { + return replacer({ + uri, + value, + decoded: decode(value) + }); + }); + } + + // nip39.ts + var nip39_exports = {}; + __export(nip39_exports, { + useFetchImplementation: () => useFetchImplementation2, + validateGithub: () => validateGithub + }); + init_define_process(); + var _fetch2; + try { + _fetch2 = fetch; + } catch { + } + function useFetchImplementation2(fetchImplementation) { + _fetch2 = fetchImplementation; + } + async function validateGithub(pubkey, username, proof) { + try { + let res = await (await _fetch2(`https://gist.github.com/${username}/${proof}/raw`)).text(); + return res === `Verifying that I control the following Nostr public key: ${pubkey}`; + } catch (_) { + return false; + } + } + + // nip42.ts + var nip42_exports = {}; + __export(nip42_exports, { + authenticate: () => authenticate + }); + init_define_process(); + var authenticate = async ({ + challenge: challenge2, + relay, + sign + }) => { + const e = { + kind: 22242 /* ClientAuth */, + created_at: Math.floor(Date.now() / 1e3), + tags: [ + ["relay", relay.url], + ["challenge", challenge2] + ], + content: "" + }; + const pub = relay.auth(await sign(e)); + return new Promise((resolve, reject) => { + pub.on("ok", function ok() { + pub.off("ok", ok); + resolve(); + }); + pub.on("failed", function fail(reason) { + pub.off("failed", fail); + reject(reason); + }); + }); + }; + + // nip57.ts + var nip57_exports = {}; + __export(nip57_exports, { + getZapEndpoint: () => getZapEndpoint, + makeZapReceipt: () => makeZapReceipt, + makeZapRequest: () => makeZapRequest, + useFetchImplementation: () => useFetchImplementation3, + validateZapRequest: () => validateZapRequest + }); + init_define_process(); + var _fetch3; + try { + _fetch3 = fetch; + } catch { + } + function useFetchImplementation3(fetchImplementation) { + _fetch3 = fetchImplementation; + } + async function getZapEndpoint(metadata) { + try { + let lnurl = ""; + let { lud06, lud16 } = JSON.parse(metadata.content); + if (lud06) { + let { words } = bech32.decode(lud06, 1e3); + let data = bech32.fromWords(words); + lnurl = utf8Decoder.decode(data); + } else if (lud16) { + let [name, domain] = lud16.split("@"); + lnurl = `https://${domain}/.well-known/lnurlp/${name}`; + } else { + return null; + } + let res = await _fetch3(lnurl); + let body = await res.json(); + if (body.allowsNostr && body.nostrPubkey) { + return body.callback; + } + } catch (err) { + } + return null; + } + function makeZapRequest({ + profile, + event, + amount, + relays, + comment = "" + }) { + if (!amount) + throw new Error("amount not given"); + if (!profile) + throw new Error("profile not given"); + let zr = { + kind: 9734, + created_at: Math.round(Date.now() / 1e3), + content: comment, + tags: [ + ["p", profile], + ["amount", amount.toString()], + ["relays", ...relays] + ] + }; + if (event) { + zr.tags.push(["e", event]); + } + return zr; + } + function validateZapRequest(zapRequestString) { + let zapRequest; + try { + zapRequest = JSON.parse(zapRequestString); + } catch (err) { + return "Invalid zap request JSON."; + } + if (!validateEvent(zapRequest)) + return "Zap request is not a valid Nostr event."; + if (!verifySignature(zapRequest)) + return "Invalid signature on zap request."; + let p = zapRequest.tags.find(([t, v]) => t === "p" && v); + if (!p) + return "Zap request doesn't have a 'p' tag."; + if (!p[1].match(/^[a-f0-9]{64}$/)) + return "Zap request 'p' tag is not valid hex."; + let e = zapRequest.tags.find(([t, v]) => t === "e" && v); + if (e && !e[1].match(/^[a-f0-9]{64}$/)) + return "Zap request 'e' tag is not valid hex."; + let relays = zapRequest.tags.find(([t, v]) => t === "relays" && v); + if (!relays) + return "Zap request doesn't have a 'relays' tag."; + return null; + } + function makeZapReceipt({ + zapRequest, + preimage, + bolt11, + paidAt + }) { + let zr = JSON.parse(zapRequest); + let tagsFromZapRequest = zr.tags.filter( + ([t]) => t === "e" || t === "p" || t === "a" + ); + let zap = { + kind: 9735, + created_at: Math.round(paidAt.getTime() / 1e3), + content: "", + tags: [ + ...tagsFromZapRequest, + ["bolt11", bolt11], + ["description", zapRequest] + ] + }; + if (preimage) { + zap.tags.push(["preimage", preimage]); + } + return zap; + } + + // nip98.ts + var nip98_exports = {}; + __export(nip98_exports, { + getToken: () => getToken, + validateToken: () => validateToken + }); + init_define_process(); + var _authorizationScheme = "Nostr "; + async function getToken(loginUrl, httpMethod, sign, includeAuthorizationScheme = false) { + if (!loginUrl || !httpMethod) + throw new Error("Missing loginUrl or httpMethod"); + if (httpMethod !== "get" /* Get */ && httpMethod !== "post" /* Post */) + throw new Error("Unknown httpMethod"); + const event = getBlankEvent(27235 /* HttpAuth */); + event.tags = [ + ["u", loginUrl], + ["method", httpMethod] + ]; + event.created_at = Math.round(new Date().getTime() / 1e3); + const signedEvent = await sign(event); + const authorizationScheme = includeAuthorizationScheme ? _authorizationScheme : ""; + return authorizationScheme + base64.encode(utf8Encoder.encode(JSON.stringify(signedEvent))); + } + async function validateToken(token, url, method) { + if (!token) { + throw new Error("Missing token"); + } + token = token.replace(_authorizationScheme, ""); + const eventB64 = utf8Decoder.decode(base64.decode(token)); + if (!eventB64 || eventB64.length === 0 || !eventB64.startsWith("{")) { + throw new Error("Invalid token"); + } + const event = JSON.parse(eventB64); + if (!event) { + throw new Error("Invalid nostr event"); + } + if (!verifySignature(event)) { + throw new Error("Invalid nostr event, signature invalid"); + } + if (event.kind !== 27235 /* HttpAuth */) { + throw new Error("Invalid nostr event, kind invalid"); + } + if (!event.created_at) { + throw new Error("Invalid nostr event, created_at invalid"); + } + if (Math.round(new Date().getTime() / 1e3) - event.created_at > 60) { + throw new Error("Invalid nostr event, expired"); + } + const urlTag = event.tags.find((t) => t[0] === "u"); + if (urlTag?.length !== 1 && urlTag?.[1] !== url) { + throw new Error("Invalid nostr event, url tag invalid"); + } + const methodTag = event.tags.find((t) => t[0] === "method"); + if (methodTag?.length !== 1 && methodTag?.[1].toLowerCase() !== method.toLowerCase()) { + throw new Error("Invalid nostr event, method tag invalid"); + } + return true; + } + return __toCommonJS(nostr_tools_exports); +})(); diff --git a/static/market/js/utils.js b/static/market/js/utils.js new file mode 100644 index 0000000..52058bc --- /dev/null +++ b/static/market/js/utils.js @@ -0,0 +1,167 @@ +var NostrTools = window.NostrTools + +var defaultRelays = [ + 'wss://relay.damus.io', + 'wss://relay.snort.social', + 'wss://nostr-pub.wellorder.net', + 'wss://nostr.zebedee.cloud', + 'wss://nostr.walletofsatoshi.com' +] +var eventToObj = event => { + try { + event.content = JSON.parse(event.content) || null + } catch { + event.content = null + } + + + return { + ...event, + ...Object.values(event.tags).reduce((acc, tag) => { + let [key, value] = tag + if (key == 't') { + return { ...acc, [key]: [...(acc[key] || []), value] } + } else { + return { ...acc, [key]: value } + } + }, {}) + } +} + +function confirm(message) { + return { + message, + ok: { + flat: true, + color: 'primary' + }, + cancel: { + flat: true, + color: 'grey' + } + } +} + + +async function hash(string) { + const utf8 = new TextEncoder().encode(string) + const hashBuffer = await crypto.subtle.digest('SHA-256', utf8) + const hashArray = Array.from(new Uint8Array(hashBuffer)) + const hashHex = hashArray + .map(bytes => bytes.toString(16).padStart(2, '0')) + .join('') + return hashHex +} + +function isJson(str) { + if (typeof str !== 'string') { + return false + } + try { + JSON.parse(str) + return true + } catch (error) { + return false + } +} + +function formatSat(value) { + return new Intl.NumberFormat(window.LOCALE).format(value) +} + +function satOrBtc(val, showUnit = true, showSats = false) { + const value = showSats + ? formatSat(val) + : val == 0 + ? 0.0 + : (val / 100000000).toFixed(8) + if (!showUnit) return value + return showSats ? value + ' sat' : value + ' BTC' +} + +function timeFromNow(time) { + // Get timestamps + let unixTime = new Date(time).getTime() + if (!unixTime) return + let now = new Date().getTime() + + // Calculate difference + let difference = unixTime / 1000 - now / 1000 + + // Setup return object + let tfn = {} + + // Check if time is in the past, present, or future + tfn.when = 'now' + if (difference > 0) { + tfn.when = 'future' + } else if (difference < -1) { + tfn.when = 'past' + } + + // Convert difference to absolute + difference = Math.abs(difference) + + // Calculate time unit + if (difference / (60 * 60 * 24 * 365) > 1) { + // Years + tfn.unitOfTime = 'years' + tfn.time = Math.floor(difference / (60 * 60 * 24 * 365)) + } else if (difference / (60 * 60 * 24 * 45) > 1) { + // Months + tfn.unitOfTime = 'months' + tfn.time = Math.floor(difference / (60 * 60 * 24 * 45)) + } else if (difference / (60 * 60 * 24) > 1) { + // Days + tfn.unitOfTime = 'days' + tfn.time = Math.floor(difference / (60 * 60 * 24)) + } else if (difference / (60 * 60) > 1) { + // Hours + tfn.unitOfTime = 'hours' + tfn.time = Math.floor(difference / (60 * 60)) + } else if (difference / 60 > 1) { + // Minutes + tfn.unitOfTime = 'minutes' + tfn.time = Math.floor(difference / 60) + } else { + // Seconds + tfn.unitOfTime = 'seconds' + tfn.time = Math.floor(difference) + } + + // Return time from now data + return `${tfn.time} ${tfn.unitOfTime}` +} + +function isValidImageUrl(string) { + let url + try { + url = new URL(string) + } catch (_) { + return false + } + return url.protocol === 'http:' || url.protocol === 'https:' +} + +function isValidKey(key, prefix = 'n') { + try { + if (key && key.startsWith(prefix)) { + let { _, data } = NostrTools.nip19.decode(key) + key = data + } + return isValidKeyHex(key) + } catch (error) { + return false + } +} + +function isValidKeyHex(key) { + return key?.toLowerCase()?.match(/^[0-9a-f]{64}$/) +} + +function formatCurrency(value, currency) { + return new Intl.NumberFormat(window.LOCALE, { + style: 'currency', + currency: currency + }).format(value) +} \ No newline at end of file diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index 478894d..6e9edd2 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -230,10 +230,7 @@ } - - - - + diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index a351f2d..c24d374 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -1,314 +1,36 @@ -{% extends "public.html" %} {% block page %} - - -
-
-
-
- - - - - - - - - - - -
- Search - for products on Nostr - - Settings - User - User Config - User - Login - Chat - Orders - - Shopping Cart + + - - - - -
+ + Nostr Market App + + + + + + -
-
-
-
-
-
-
-
+ + + -
- - - -
-
-
-
+ -
-
-
+ + + -
-
-
- - -
- -
-
-
+ + + + -
-
-
+ +
+ -
-
-
- - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - Note - - -
- You can start by adding a merchant public key - Here -
- Or enter a nostr market profile ( naddr) in the - filter input. - -
-
-
- - - -
-
-
- -
- - - -
- -
-
-
-
- - - - - -
Account Setup
- -
- -

Enter your Nostr private key or generate a new one.

-
- - - - - - - - - Close - -
-
- - - - -
-
- -
- - - - -
- -
-
- -
-
- Copy invoice - Close -
-
-
-
-{% endblock %} {% block scripts %} - - - - - - - - - - - - - - - - - - - -{% endblock %} \ No newline at end of file + \ No newline at end of file