From 2b6c4030e5e26b67e65da9b59b0d2bf7da8a114f Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Mon, 20 Jul 2026 18:40:05 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=A1=A5=E5=85=85=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E4=B8=8E=E6=94=AF=E4=BB=98=E6=A8=A1=E5=9D=97=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 + ...000000_create_ecommerce_finance_tables.php | 231 + .../Http/Controllers/Api/Channels.php | 50 + .../Http/Controllers/Api/ImportBatches.php | 58 + .../Http/Controllers/Api/ImportFiles.php | 30 + .../Api/ReconciliationExceptions.php | 19 + .../Http/Controllers/Api/Stores.php | 54 + .../Http/Requests/Channel.php | 31 + .../Http/Requests/ImportBatch.php | 24 + .../Http/Requests/ImportFile.php | 20 + .../EcommerceFinance/Http/Requests/Store.php | 35 + .../Jobs/MatchSettlementLines.php | 73 + .../Jobs/ProcessImportBatch.php | 295 + modules/EcommerceFinance/Models/Channel.php | 26 + .../EcommerceFinance/Models/ImportBatch.php | 40 + modules/EcommerceFinance/Models/Order.php | 55 + .../EcommerceFinance/Models/OrderEvent.php | 32 + modules/EcommerceFinance/Models/OrderItem.php | 38 + .../Models/ReconciliationMatch.php | 38 + .../EcommerceFinance/Models/Settlement.php | 54 + .../Models/SettlementLine.php | 40 + .../EcommerceFinance/Models/SkuMapping.php | 33 + modules/EcommerceFinance/Models/Store.php | 51 + modules/EcommerceFinance/Providers/Event.php | 18 + modules/EcommerceFinance/Providers/Main.php | 25 + .../Resources/lang/en-GB/general.php | 6 + .../Resources/lang/zh-CN/general.php | 6 + .../Resources/views/index.blade.php | 11 + modules/EcommerceFinance/Routes/admin.php | 7 + modules/EcommerceFinance/Routes/api.php | 11 + .../Tests/Feature/ChannelsTest.php | 140 + modules/EcommerceFinance/module.json | 18 + .../.github/workflows/tests.yml | 50 + .../.github/workflows/translations.yml | 37 + modules/OfflinePayments/.gitignore | 7 + .../Http/Controllers/Payment.php | 89 + .../Http/Controllers/Settings.php | 120 + .../OfflinePayments/Http/Requests/Setting.php | 30 + .../Http/Requests/SettingDelete.php | 30 + .../Http/Requests/SettingGet.php | 30 + .../OfflinePayments/Http/Requests/Show.php | 30 + .../Jobs/CreatePaymentMethod.php | 58 + .../Jobs/DeletePaymentMethod.php | 85 + .../Jobs/UpdatePaymentMethod.php | 59 + .../Listeners/AddLandingPage.php | 19 + .../Listeners/FinishInstallation.php | 36 + .../Listeners/ShowAsPaymentMethod.php | 27 + .../Listeners/ShowInSettingsMenu.php | 31 + .../Listeners/Update/Version300.php | 34 + modules/OfflinePayments/Providers/Event.php | 30 + modules/OfflinePayments/Providers/Main.php | 81 + modules/OfflinePayments/README.md | 11 + .../Resources/assets/js/offline-payments.js | 120 + .../assets/js/offline-payments.min.js | 72 + .../Resources/lang/ar-SA/general.php | 21 + .../Resources/lang/ca-ES/general.php | 21 + .../Resources/lang/da-DK/general.php | 21 + .../Resources/lang/de-DE/general.php | 21 + .../Resources/lang/en-GB/general.php | 22 + .../Resources/lang/es-ES/general.php | 21 + .../Resources/lang/fa-IR/general.php | 21 + .../Resources/lang/fr-FR/general.php | 21 + .../Resources/lang/id-ID/general.php | 21 + .../Resources/lang/it-IT/general.php | 21 + .../Resources/lang/ja-JP/general.php | 21 + .../Resources/lang/nb-NO/general.php | 21 + .../Resources/lang/pt-BR/general.php | 21 + .../Resources/lang/sq-AL/general.php | 21 + .../Resources/lang/uk-UA/general.php | 21 + .../Resources/views/confirm.blade.php | 7 + .../Resources/views/edit.blade.php | 124 + .../Resources/views/show.blade.php | 36 + modules/OfflinePayments/Routes/admin.php | 18 + modules/OfflinePayments/Routes/portal.php | 14 + modules/OfflinePayments/Routes/signed.php | 14 + .../Tests/Feature/PaymentsTest.php | 33 + .../Tests/Feature/SettingsTest.php | 102 + modules/OfflinePayments/composer.json | 21 + modules/OfflinePayments/crowdin.yml | 14 + modules/OfflinePayments/mix-manifest.json | 3 + modules/OfflinePayments/module.json | 20 + modules/OfflinePayments/package-lock.json | 15954 ++++++++++++++++ modules/OfflinePayments/package.json | 21 + modules/OfflinePayments/webpack.mix.js | 22 + .../.github/workflows/releases.yml | 292 + .../.github/workflows/tests.yml | 55 + .../.github/workflows/translations.yml | 37 + modules/PaypalStandard/.gitignore | 7 + .../Http/Controllers/Payment.php | 172 + .../Listeners/AddLandingPage.php | 19 + .../Listeners/ShowAsPaymentMethod.php | 23 + modules/PaypalStandard/Providers/Event.php | 30 + modules/PaypalStandard/Providers/Main.php | 81 + modules/PaypalStandard/README.md | 11 + .../Resources/lang/ar-SA/general.php | 20 + .../Resources/lang/ca-ES/general.php | 20 + .../Resources/lang/da-DK/general.php | 20 + .../Resources/lang/de-DE/general.php | 20 + .../Resources/lang/en-GB/general.php | 26 + .../Resources/lang/fa-IR/general.php | 20 + .../Resources/lang/fr-FR/general.php | 25 + .../Resources/lang/id-ID/general.php | 20 + .../Resources/lang/it-IT/general.php | 20 + .../Resources/lang/ja-JP/general.php | 20 + .../Resources/lang/nb-NO/general.php | 20 + .../Resources/lang/pt-BR/general.php | 20 + .../Resources/lang/sq-AL/general.php | 20 + .../Resources/lang/uk-UA/general.php | 20 + .../Resources/views/show.blade.php | 53 + modules/PaypalStandard/Routes/guest.php | 17 + modules/PaypalStandard/Routes/portal.php | 14 + modules/PaypalStandard/Routes/signed.php | 17 + .../Tests/Feature/SettingsTest.php | 39 + modules/PaypalStandard/composer.json | 21 + modules/PaypalStandard/crowdin.yml | 14 + modules/PaypalStandard/module.json | 108 + 116 files changed, 20681 insertions(+) create mode 100644 modules/EcommerceFinance/Database/Migrations/2026_07_18_000000_create_ecommerce_finance_tables.php create mode 100644 modules/EcommerceFinance/Http/Controllers/Api/Channels.php create mode 100644 modules/EcommerceFinance/Http/Controllers/Api/ImportBatches.php create mode 100644 modules/EcommerceFinance/Http/Controllers/Api/ImportFiles.php create mode 100644 modules/EcommerceFinance/Http/Controllers/Api/ReconciliationExceptions.php create mode 100644 modules/EcommerceFinance/Http/Controllers/Api/Stores.php create mode 100644 modules/EcommerceFinance/Http/Requests/Channel.php create mode 100644 modules/EcommerceFinance/Http/Requests/ImportBatch.php create mode 100644 modules/EcommerceFinance/Http/Requests/ImportFile.php create mode 100644 modules/EcommerceFinance/Http/Requests/Store.php create mode 100644 modules/EcommerceFinance/Jobs/MatchSettlementLines.php create mode 100644 modules/EcommerceFinance/Jobs/ProcessImportBatch.php create mode 100644 modules/EcommerceFinance/Models/Channel.php create mode 100644 modules/EcommerceFinance/Models/ImportBatch.php create mode 100644 modules/EcommerceFinance/Models/Order.php create mode 100644 modules/EcommerceFinance/Models/OrderEvent.php create mode 100644 modules/EcommerceFinance/Models/OrderItem.php create mode 100644 modules/EcommerceFinance/Models/ReconciliationMatch.php create mode 100644 modules/EcommerceFinance/Models/Settlement.php create mode 100644 modules/EcommerceFinance/Models/SettlementLine.php create mode 100644 modules/EcommerceFinance/Models/SkuMapping.php create mode 100644 modules/EcommerceFinance/Models/Store.php create mode 100644 modules/EcommerceFinance/Providers/Event.php create mode 100644 modules/EcommerceFinance/Providers/Main.php create mode 100644 modules/EcommerceFinance/Resources/lang/en-GB/general.php create mode 100644 modules/EcommerceFinance/Resources/lang/zh-CN/general.php create mode 100644 modules/EcommerceFinance/Resources/views/index.blade.php create mode 100644 modules/EcommerceFinance/Routes/admin.php create mode 100644 modules/EcommerceFinance/Routes/api.php create mode 100644 modules/EcommerceFinance/Tests/Feature/ChannelsTest.php create mode 100644 modules/EcommerceFinance/module.json create mode 100644 modules/OfflinePayments/.github/workflows/tests.yml create mode 100644 modules/OfflinePayments/.github/workflows/translations.yml create mode 100644 modules/OfflinePayments/.gitignore create mode 100644 modules/OfflinePayments/Http/Controllers/Payment.php create mode 100644 modules/OfflinePayments/Http/Controllers/Settings.php create mode 100644 modules/OfflinePayments/Http/Requests/Setting.php create mode 100644 modules/OfflinePayments/Http/Requests/SettingDelete.php create mode 100644 modules/OfflinePayments/Http/Requests/SettingGet.php create mode 100644 modules/OfflinePayments/Http/Requests/Show.php create mode 100644 modules/OfflinePayments/Jobs/CreatePaymentMethod.php create mode 100644 modules/OfflinePayments/Jobs/DeletePaymentMethod.php create mode 100644 modules/OfflinePayments/Jobs/UpdatePaymentMethod.php create mode 100644 modules/OfflinePayments/Listeners/AddLandingPage.php create mode 100644 modules/OfflinePayments/Listeners/FinishInstallation.php create mode 100644 modules/OfflinePayments/Listeners/ShowAsPaymentMethod.php create mode 100644 modules/OfflinePayments/Listeners/ShowInSettingsMenu.php create mode 100644 modules/OfflinePayments/Listeners/Update/Version300.php create mode 100644 modules/OfflinePayments/Providers/Event.php create mode 100644 modules/OfflinePayments/Providers/Main.php create mode 100644 modules/OfflinePayments/README.md create mode 100644 modules/OfflinePayments/Resources/assets/js/offline-payments.js create mode 100644 modules/OfflinePayments/Resources/assets/js/offline-payments.min.js create mode 100644 modules/OfflinePayments/Resources/lang/ar-SA/general.php create mode 100644 modules/OfflinePayments/Resources/lang/ca-ES/general.php create mode 100644 modules/OfflinePayments/Resources/lang/da-DK/general.php create mode 100644 modules/OfflinePayments/Resources/lang/de-DE/general.php create mode 100644 modules/OfflinePayments/Resources/lang/en-GB/general.php create mode 100644 modules/OfflinePayments/Resources/lang/es-ES/general.php create mode 100644 modules/OfflinePayments/Resources/lang/fa-IR/general.php create mode 100644 modules/OfflinePayments/Resources/lang/fr-FR/general.php create mode 100644 modules/OfflinePayments/Resources/lang/id-ID/general.php create mode 100644 modules/OfflinePayments/Resources/lang/it-IT/general.php create mode 100644 modules/OfflinePayments/Resources/lang/ja-JP/general.php create mode 100644 modules/OfflinePayments/Resources/lang/nb-NO/general.php create mode 100644 modules/OfflinePayments/Resources/lang/pt-BR/general.php create mode 100644 modules/OfflinePayments/Resources/lang/sq-AL/general.php create mode 100644 modules/OfflinePayments/Resources/lang/uk-UA/general.php create mode 100644 modules/OfflinePayments/Resources/views/confirm.blade.php create mode 100644 modules/OfflinePayments/Resources/views/edit.blade.php create mode 100644 modules/OfflinePayments/Resources/views/show.blade.php create mode 100644 modules/OfflinePayments/Routes/admin.php create mode 100644 modules/OfflinePayments/Routes/portal.php create mode 100644 modules/OfflinePayments/Routes/signed.php create mode 100644 modules/OfflinePayments/Tests/Feature/PaymentsTest.php create mode 100644 modules/OfflinePayments/Tests/Feature/SettingsTest.php create mode 100644 modules/OfflinePayments/composer.json create mode 100644 modules/OfflinePayments/crowdin.yml create mode 100644 modules/OfflinePayments/mix-manifest.json create mode 100644 modules/OfflinePayments/module.json create mode 100644 modules/OfflinePayments/package-lock.json create mode 100644 modules/OfflinePayments/package.json create mode 100644 modules/OfflinePayments/webpack.mix.js create mode 100644 modules/PaypalStandard/.github/workflows/releases.yml create mode 100644 modules/PaypalStandard/.github/workflows/tests.yml create mode 100644 modules/PaypalStandard/.github/workflows/translations.yml create mode 100644 modules/PaypalStandard/.gitignore create mode 100644 modules/PaypalStandard/Http/Controllers/Payment.php create mode 100644 modules/PaypalStandard/Listeners/AddLandingPage.php create mode 100644 modules/PaypalStandard/Listeners/ShowAsPaymentMethod.php create mode 100644 modules/PaypalStandard/Providers/Event.php create mode 100644 modules/PaypalStandard/Providers/Main.php create mode 100644 modules/PaypalStandard/README.md create mode 100644 modules/PaypalStandard/Resources/lang/ar-SA/general.php create mode 100644 modules/PaypalStandard/Resources/lang/ca-ES/general.php create mode 100644 modules/PaypalStandard/Resources/lang/da-DK/general.php create mode 100644 modules/PaypalStandard/Resources/lang/de-DE/general.php create mode 100644 modules/PaypalStandard/Resources/lang/en-GB/general.php create mode 100644 modules/PaypalStandard/Resources/lang/fa-IR/general.php create mode 100644 modules/PaypalStandard/Resources/lang/fr-FR/general.php create mode 100644 modules/PaypalStandard/Resources/lang/id-ID/general.php create mode 100644 modules/PaypalStandard/Resources/lang/it-IT/general.php create mode 100644 modules/PaypalStandard/Resources/lang/ja-JP/general.php create mode 100644 modules/PaypalStandard/Resources/lang/nb-NO/general.php create mode 100644 modules/PaypalStandard/Resources/lang/pt-BR/general.php create mode 100644 modules/PaypalStandard/Resources/lang/sq-AL/general.php create mode 100644 modules/PaypalStandard/Resources/lang/uk-UA/general.php create mode 100644 modules/PaypalStandard/Resources/views/show.blade.php create mode 100644 modules/PaypalStandard/Routes/guest.php create mode 100644 modules/PaypalStandard/Routes/portal.php create mode 100644 modules/PaypalStandard/Routes/signed.php create mode 100644 modules/PaypalStandard/Tests/Feature/SettingsTest.php create mode 100644 modules/PaypalStandard/composer.json create mode 100644 modules/PaypalStandard/crowdin.yml create mode 100644 modules/PaypalStandard/module.json diff --git a/.gitignore b/.gitignore index 1c68dc9d..cad4d2d7 100644 --- a/.gitignore +++ b/.gitignore @@ -94,5 +94,11 @@ _ide_helper_models.php .phpunit.result.cache modules/* !modules/.gitkeep +!modules/EcommerceFinance/ +!modules/EcommerceFinance/** +!modules/OfflinePayments/ +!modules/OfflinePayments/** +!modules/PaypalStandard/ +!modules/PaypalStandard/** .laravelstatsrc .DS_Store diff --git a/modules/EcommerceFinance/Database/Migrations/2026_07_18_000000_create_ecommerce_finance_tables.php b/modules/EcommerceFinance/Database/Migrations/2026_07_18_000000_create_ecommerce_finance_tables.php new file mode 100644 index 00000000..851b75f3 --- /dev/null +++ b/modules/EcommerceFinance/Database/Migrations/2026_07_18_000000_create_ecommerce_finance_tables.php @@ -0,0 +1,231 @@ +increments('id'); + $table->unsignedInteger('company_id'); + $table->string('code', 64); + $table->string('name'); + $table->string('type', 32)->default('marketplace'); + $table->boolean('enabled')->default(true); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['company_id', 'code', 'deleted_at']); + }); + + Schema::create('ec_stores', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('channel_id'); + $table->string('name'); + $table->string('external_id', 128); + $table->unsignedInteger('settlement_account_id')->nullable(); + $table->string('timezone', 64)->default('Asia/Shanghai'); + $table->string('currency_code', 3)->default('CNY'); + $table->boolean('enabled')->default(true); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->index(['company_id', 'channel_id']); + $table->unique(['company_id', 'channel_id', 'external_id', 'deleted_at']); + }); + + Schema::create('ec_sku_mappings', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('store_id'); + $table->unsignedInteger('item_id')->nullable(); + $table->string('external_sku_id', 128); + $table->string('external_sku_code', 128)->nullable(); + $table->string('external_sku_name')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['store_id', 'external_sku_id', 'deleted_at']); + $table->index(['company_id', 'item_id']); + }); + + Schema::create('ec_import_batches', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('store_id')->nullable(); + $table->string('source_type', 32); + $table->string('source_file'); + $table->string('checksum', 64); + $table->string('status', 32)->default('queued'); + $table->unsignedInteger('row_count')->default(0); + $table->unsignedInteger('success_count')->default(0); + $table->unsignedInteger('error_count')->default(0); + $table->json('summary')->nullable(); + $table->text('error_message')->nullable(); + $table->timestamp('started_at')->nullable(); + $table->timestamp('completed_at')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['company_id', 'source_type', 'checksum']); + $table->index(['company_id', 'status']); + }); + + Schema::create('ec_orders', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('store_id'); + $table->string('external_order_id', 128); + $table->string('order_status', 32); + $table->dateTime('ordered_at')->nullable(); + $table->dateTime('paid_at')->nullable(); + $table->dateTime('shipped_at')->nullable(); + $table->dateTime('completed_at')->nullable(); + $table->string('currency_code', 3)->default('CNY'); + $table->decimal('gross_amount', 20, 6)->default(0); + $table->decimal('buyer_paid_amount', 20, 6)->default(0); + $table->decimal('platform_subsidy_amount', 20, 6)->default(0); + $table->decimal('merchant_subsidy_amount', 20, 6)->default(0); + $table->decimal('refunded_amount', 20, 6)->default(0); + $table->json('payload')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['store_id', 'external_order_id']); + $table->index(['company_id', 'order_status']); + $table->index(['company_id', 'completed_at']); + }); + + Schema::create('ec_order_items', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('order_id'); + $table->unsignedInteger('item_id')->nullable(); + $table->string('external_line_id', 128); + $table->string('sku_code', 128)->nullable(); + $table->string('name'); + $table->decimal('quantity', 20, 6); + $table->decimal('sale_amount', 20, 6)->default(0); + $table->decimal('discount_amount', 20, 6)->default(0); + $table->decimal('refund_amount', 20, 6)->default(0); + $table->decimal('cost_amount', 20, 6)->default(0); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['order_id', 'external_line_id']); + $table->index(['company_id', 'item_id']); + }); + + Schema::create('ec_order_events', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('order_id'); + $table->string('event_type', 32); + $table->string('external_event_id', 128); + $table->dateTime('event_at'); + $table->json('payload')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['order_id', 'event_type', 'external_event_id']); + $table->index(['company_id', 'event_at']); + }); + + Schema::create('ec_settlements', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('store_id'); + $table->unsignedInteger('transaction_id')->nullable(); + $table->string('external_settlement_id', 128); + $table->dateTime('period_start')->nullable(); + $table->dateTime('period_end')->nullable(); + $table->dateTime('settled_at')->nullable(); + $table->string('currency_code', 3)->default('CNY'); + $table->decimal('gross_amount', 20, 6)->default(0); + $table->decimal('fee_amount', 20, 6)->default(0); + $table->decimal('refund_amount', 20, 6)->default(0); + $table->decimal('net_amount', 20, 6)->default(0); + $table->string('status', 32)->default('imported'); + $table->json('payload')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['store_id', 'external_settlement_id']); + $table->index(['company_id', 'status']); + $table->index(['company_id', 'settled_at']); + }); + + Schema::create('ec_settlement_lines', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('settlement_id'); + $table->string('line_type', 32); + $table->string('external_line_id', 128); + $table->string('external_order_id', 128)->nullable(); + $table->decimal('amount', 20, 6); + $table->dateTime('occurred_at')->nullable(); + $table->json('payload')->nullable(); + $table->unsignedInteger('created_by')->nullable(); + $table->string('created_from', 100)->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['settlement_id', 'external_line_id']); + $table->index(['company_id', 'external_order_id']); + }); + + Schema::create('ec_reconciliation_matches', function (Blueprint $table) { + $table->increments('id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('settlement_line_id'); + $table->unsignedInteger('order_id')->nullable(); + $table->string('match_type', 32); + $table->decimal('matched_amount', 20, 6)->default(0); + $table->string('status', 32)->default('unmatched'); + $table->string('rule_version', 32)->nullable(); + $table->unsignedInteger('confirmed_by')->nullable(); + $table->timestamp('confirmed_at')->nullable(); + $table->text('note')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['settlement_line_id', 'order_id']); + $table->index(['company_id', 'status']); + $table->index(['company_id', 'order_id']); + }); + } + + public function down(): void + { + Schema::dropIfExists('ec_reconciliation_matches'); + Schema::dropIfExists('ec_settlement_lines'); + Schema::dropIfExists('ec_settlements'); + Schema::dropIfExists('ec_order_events'); + Schema::dropIfExists('ec_order_items'); + Schema::dropIfExists('ec_orders'); + Schema::dropIfExists('ec_import_batches'); + Schema::dropIfExists('ec_sku_mappings'); + Schema::dropIfExists('ec_stores'); + Schema::dropIfExists('ec_channels'); + } +}; diff --git a/modules/EcommerceFinance/Http/Controllers/Api/Channels.php b/modules/EcommerceFinance/Http/Controllers/Api/Channels.php new file mode 100644 index 00000000..05c5a0b2 --- /dev/null +++ b/modules/EcommerceFinance/Http/Controllers/Api/Channels.php @@ -0,0 +1,50 @@ +json(Channel::query()->orderBy('name')->paginate($this->limit())); + } + + public function show(Channel $channel) + { + return response()->json($channel); + } + + public function store(Request $request) + { + $channel = Channel::create($this->attributes($request)); + + return response() + ->json($channel, 201) + ->header('Location', route('api.ecommerce-finance.channels.show', $channel)); + } + + public function update(Channel $channel, Request $request) + { + $channel->update($request->validated()); + + return response()->json($channel->fresh()); + } + + private function attributes(Request $request): array + { + return array_merge($request->validated(), [ + 'company_id' => company_id(), + 'created_by' => user_id(), + 'created_from' => 'ecommerce-finance', + ]); + } + + private function limit(): int + { + return min(max((int) request('limit', 25), 1), 100); + } +} diff --git a/modules/EcommerceFinance/Http/Controllers/Api/ImportBatches.php b/modules/EcommerceFinance/Http/Controllers/Api/ImportBatches.php new file mode 100644 index 00000000..18cf850f --- /dev/null +++ b/modules/EcommerceFinance/Http/Controllers/Api/ImportBatches.php @@ -0,0 +1,58 @@ +latest('id') + ->paginate($this->limit()); + + return response()->json($batches); + } + + public function show(ImportBatch $importBatch) + { + return response()->json($importBatch->load('store.channel')); + } + + public function store(Request $request) + { + if (! Storage::disk('uploads')->exists($request->input('source_file'))) { + return $this->errorBadRequest('The source file does not exist in the private uploads storage.'); + } + + try { + $batch = ImportBatch::create(array_merge($request->validated(), [ + 'company_id' => company_id(), + 'status' => 'queued', + 'created_by' => user_id(), + 'created_from' => 'ecommerce-finance', + ])); + } catch (QueryException $exception) { + return $this->errorBadRequest('An identical import batch has already been created.'); + } + + $this->dispatch(new ProcessImportBatch($batch->id)); + + $batch->refresh(); + + return response() + ->json($batch, 201) + ->header('Location', route('api.ecommerce-finance.import-batches.show', $batch)); + } + + private function limit(): int + { + return min(max((int) request('limit', 25), 1), 100); + } +} diff --git a/modules/EcommerceFinance/Http/Controllers/Api/ImportFiles.php b/modules/EcommerceFinance/Http/Controllers/Api/ImportFiles.php new file mode 100644 index 00000000..f38c5790 --- /dev/null +++ b/modules/EcommerceFinance/Http/Controllers/Api/ImportFiles.php @@ -0,0 +1,30 @@ +file('source_file'); + $checksum = hash_file('sha256', $file->getRealPath()); + $extension = strtolower($file->getClientOriginalExtension() ?: 'csv'); + $path = 'ecommerce-finance/' . company_id() . '/' . Str::uuid() . '.' . $extension; + + Storage::disk('uploads')->putFileAs( + dirname($path), + $file, + basename($path) + ); + + return response()->json([ + 'source_file' => $path, + 'checksum' => $checksum, + ], 201); + } +} diff --git a/modules/EcommerceFinance/Http/Controllers/Api/ReconciliationExceptions.php b/modules/EcommerceFinance/Http/Controllers/Api/ReconciliationExceptions.php new file mode 100644 index 00000000..656d8edd --- /dev/null +++ b/modules/EcommerceFinance/Http/Controllers/Api/ReconciliationExceptions.php @@ -0,0 +1,19 @@ +whereIn('status', ['unmatched', 'partial_matched']) + ->latest('id') + ->paginate(min(max((int) request('limit', 25), 1), 100)); + + return response()->json($matches); + } +} diff --git a/modules/EcommerceFinance/Http/Controllers/Api/Stores.php b/modules/EcommerceFinance/Http/Controllers/Api/Stores.php new file mode 100644 index 00000000..2aa32c54 --- /dev/null +++ b/modules/EcommerceFinance/Http/Controllers/Api/Stores.php @@ -0,0 +1,54 @@ +orderBy('name') + ->paginate($this->limit()); + + return response()->json($stores); + } + + public function show(Store $store) + { + return response()->json($store->load('channel', 'settlementAccount')); + } + + public function store(Request $request) + { + $store = Store::create($this->attributes($request)); + + return response() + ->json($store, 201) + ->header('Location', route('api.ecommerce-finance.stores.show', $store)); + } + + public function update(Store $store, Request $request) + { + $store->update($request->validated()); + + return response()->json($store->fresh()->load('channel', 'settlementAccount')); + } + + private function attributes(Request $request): array + { + return array_merge($request->validated(), [ + 'company_id' => company_id(), + 'created_by' => user_id(), + 'created_from' => 'ecommerce-finance', + ]); + } + + private function limit(): int + { + return min(max((int) request('limit', 25), 1), 100); + } +} diff --git a/modules/EcommerceFinance/Http/Requests/Channel.php b/modules/EcommerceFinance/Http/Requests/Channel.php new file mode 100644 index 00000000..cf5d6f2b --- /dev/null +++ b/modules/EcommerceFinance/Http/Requests/Channel.php @@ -0,0 +1,31 @@ + [ + 'required', + 'string', + 'max:64', + Rule::unique('ec_channels', 'code') + ->where('company_id', company_id()) + ->ignore($this->route('channel')), + ], + 'name' => ['required', 'string', 'max:255'], + 'type' => ['required', 'string', 'max:32'], + 'enabled' => ['sometimes', 'boolean'], + ]; + } +} diff --git a/modules/EcommerceFinance/Http/Requests/ImportBatch.php b/modules/EcommerceFinance/Http/Requests/ImportBatch.php new file mode 100644 index 00000000..ec40ac0e --- /dev/null +++ b/modules/EcommerceFinance/Http/Requests/ImportBatch.php @@ -0,0 +1,24 @@ + ['required', 'integer', Rule::exists('ec_stores', 'id')->where('company_id', company_id())], + 'source_type' => ['required', Rule::in(['orders', 'settlements'])], + 'source_file' => ['required', 'string', 'max:255'], + 'checksum' => ['required', 'string', 'size:64', 'regex:/^[a-f0-9]{64}$/i'], + ]; + } +} diff --git a/modules/EcommerceFinance/Http/Requests/ImportFile.php b/modules/EcommerceFinance/Http/Requests/ImportFile.php new file mode 100644 index 00000000..1115a7c7 --- /dev/null +++ b/modules/EcommerceFinance/Http/Requests/ImportFile.php @@ -0,0 +1,20 @@ + ['required', 'file', 'mimes:csv,txt', 'max:10240'], + ]; + } +} diff --git a/modules/EcommerceFinance/Http/Requests/Store.php b/modules/EcommerceFinance/Http/Requests/Store.php new file mode 100644 index 00000000..dce3f69a --- /dev/null +++ b/modules/EcommerceFinance/Http/Requests/Store.php @@ -0,0 +1,35 @@ + ['required', 'integer', Rule::exists('ec_channels', 'id')->where('company_id', company_id())], + 'name' => ['required', 'string', 'max:255'], + 'external_id' => [ + 'required', + 'string', + 'max:128', + Rule::unique('ec_stores', 'external_id') + ->where('company_id', company_id()) + ->where('channel_id', $this->input('channel_id')) + ->ignore($this->route('store')), + ], + 'settlement_account_id' => ['nullable', 'integer', Rule::exists('accounts', 'id')->where('company_id', company_id())], + 'timezone' => ['sometimes', 'timezone'], + 'currency_code' => ['sometimes', 'string', 'size:3'], + 'enabled' => ['sometimes', 'boolean'], + ]; + } +} diff --git a/modules/EcommerceFinance/Jobs/MatchSettlementLines.php b/modules/EcommerceFinance/Jobs/MatchSettlementLines.php new file mode 100644 index 00000000..937608ca --- /dev/null +++ b/modules/EcommerceFinance/Jobs/MatchSettlementLines.php @@ -0,0 +1,73 @@ +findOrFail($this->settlementId); + $lines = SettlementLine::withoutGlobalScopes()->where('settlement_id', $settlement->id)->get(); + + foreach ($lines as $line) { + $order = null; + $status = 'ignored'; + $matchedAmount = '0'; + + if (! empty($line->external_order_id)) { + $order = Order::withoutGlobalScopes() + ->where('store_id', $settlement->store_id) + ->where('external_order_id', $line->external_order_id) + ->first(); + + if (! $order) { + $status = 'unmatched'; + } else { + $matchedAmount = $line->amount; + $status = $this->amountMatches($line->amount, $this->expectedAmount($order, $line->line_type)) + ? 'auto_matched' + : 'partial_matched'; + } + } + + ReconciliationMatch::withoutGlobalScopes()->updateOrCreate( + ['settlement_line_id' => $line->id, 'order_id' => $order?->id], + [ + 'company_id' => $settlement->company_id, + 'match_type' => $status === 'auto_matched' ? 'rule' : 'exception', + 'matched_amount' => $matchedAmount, + 'status' => $status, + 'rule_version' => '1.0', + ] + ); + } + } + + private function expectedAmount(Order $order, string $lineType): string + { + if ($lineType === 'refund') { + return $order->refunded_amount; + } + + return bcsub( + bcadd($order->buyer_paid_amount, $order->platform_subsidy_amount, 6), + $order->refunded_amount, + 6 + ); + } + + private function amountMatches(string $actual, string $expected): bool + { + return bccomp(ltrim($actual, '-'), ltrim($expected, '-'), 6) === 0; + } +} diff --git a/modules/EcommerceFinance/Jobs/ProcessImportBatch.php b/modules/EcommerceFinance/Jobs/ProcessImportBatch.php new file mode 100644 index 00000000..e8789a31 --- /dev/null +++ b/modules/EcommerceFinance/Jobs/ProcessImportBatch.php @@ -0,0 +1,295 @@ +findOrFail($this->batchId); + + if (in_array($batch->status, ['completed', 'completed_with_errors'], true)) { + return; + } + + $batch->update([ + 'status' => 'processing', + 'started_at' => now(), + 'error_message' => null, + ]); + + try { + $summary = $batch->source_type === 'orders' + ? $this->importOrders($batch) + : $this->importSettlements($batch); + + $batch->update([ + 'status' => empty($summary['errors']) ? 'completed' : 'completed_with_errors', + 'row_count' => $summary['rows'], + 'success_count' => $summary['success'], + 'error_count' => count($summary['errors']), + 'summary' => $summary, + 'completed_at' => now(), + ]); + + foreach ($summary['settlement_ids'] ?? [] as $settlementId) { + $this->dispatch(new MatchSettlementLines($settlementId)); + } + } catch (Throwable $exception) { + $batch->update([ + 'status' => 'failed', + 'error_message' => $exception->getMessage(), + 'completed_at' => now(), + ]); + + throw $exception; + } + } + + private function importOrders(ImportBatch $batch): array + { + $summary = ['rows' => 0, 'success' => 0, 'errors' => []]; + + foreach ($this->rows($batch, ['external_order_id', 'external_line_id', 'order_status', 'item_name', 'quantity']) as $line => $row) { + ++$summary['rows']; + + try { + DB::transaction(function () use ($batch, $row) { + $order = Order::withoutGlobalScopes()->withTrashed()->updateOrCreate( + ['store_id' => $batch->store_id, 'external_order_id' => $this->required($row, 'external_order_id')], + [ + 'company_id' => $batch->company_id, + 'order_status' => $this->required($row, 'order_status'), + 'ordered_at' => $this->date($row, 'ordered_at'), + 'paid_at' => $this->date($row, 'paid_at'), + 'shipped_at' => $this->date($row, 'shipped_at'), + 'completed_at' => $this->date($row, 'completed_at'), + 'currency_code' => strtoupper($this->value($row, 'currency_code') ?: 'CNY'), + 'gross_amount' => $this->money($row, 'gross_amount'), + 'buyer_paid_amount' => $this->money($row, 'buyer_paid_amount'), + 'platform_subsidy_amount' => $this->money($row, 'platform_subsidy_amount'), + 'merchant_subsidy_amount' => $this->money($row, 'merchant_subsidy_amount'), + 'refunded_amount' => $this->money($row, 'refunded_amount'), + 'payload' => $row, + 'created_by' => $batch->created_by, + 'created_from' => 'ecommerce-finance:import', + ] + ); + + if ($order->trashed()) { + $order->restore(); + } + + $item = OrderItem::withoutGlobalScopes()->withTrashed()->updateOrCreate( + ['order_id' => $order->id, 'external_line_id' => $this->required($row, 'external_line_id')], + [ + 'company_id' => $batch->company_id, + 'sku_code' => $this->value($row, 'sku_code'), + 'name' => $this->required($row, 'item_name'), + 'quantity' => $this->number($row, 'quantity'), + 'sale_amount' => $this->money($row, 'sale_amount'), + 'discount_amount' => $this->money($row, 'discount_amount'), + 'refund_amount' => $this->money($row, 'refund_amount'), + 'created_by' => $batch->created_by, + 'created_from' => 'ecommerce-finance:import', + ] + ); + + if ($item->trashed()) { + $item->restore(); + } + }); + + ++$summary['success']; + } catch (Throwable $exception) { + $summary['errors'][] = ['line' => $line, 'message' => $exception->getMessage()]; + } + } + + return $summary; + } + + private function importSettlements(ImportBatch $batch): array + { + $summary = ['rows' => 0, 'success' => 0, 'errors' => [], 'settlement_ids' => []]; + + foreach ($this->rows($batch, ['external_settlement_id', 'external_line_id', 'line_type', 'line_amount']) as $line => $row) { + ++$summary['rows']; + + try { + $settlementId = null; + + DB::transaction(function () use ($batch, $row, &$settlementId) { + $settlement = Settlement::withoutGlobalScopes()->withTrashed()->updateOrCreate( + ['store_id' => $batch->store_id, 'external_settlement_id' => $this->required($row, 'external_settlement_id')], + [ + 'company_id' => $batch->company_id, + 'period_start' => $this->date($row, 'period_start'), + 'period_end' => $this->date($row, 'period_end'), + 'settled_at' => $this->date($row, 'settled_at'), + 'currency_code' => strtoupper($this->value($row, 'currency_code') ?: 'CNY'), + 'gross_amount' => $this->money($row, 'gross_amount'), + 'fee_amount' => $this->money($row, 'fee_amount'), + 'refund_amount' => $this->money($row, 'refund_amount'), + 'net_amount' => $this->money($row, 'net_amount'), + 'status' => 'imported', + 'payload' => $row, + 'created_by' => $batch->created_by, + 'created_from' => 'ecommerce-finance:import', + ] + ); + + if ($settlement->trashed()) { + $settlement->restore(); + } + + $item = SettlementLine::withoutGlobalScopes()->withTrashed()->updateOrCreate( + ['settlement_id' => $settlement->id, 'external_line_id' => $this->required($row, 'external_line_id')], + [ + 'company_id' => $batch->company_id, + 'line_type' => $this->required($row, 'line_type'), + 'external_order_id' => $this->value($row, 'external_order_id'), + 'amount' => $this->money($row, 'line_amount'), + 'occurred_at' => $this->date($row, 'occurred_at'), + 'payload' => $row, + 'created_by' => $batch->created_by, + 'created_from' => 'ecommerce-finance:import', + ] + ); + + if ($item->trashed()) { + $item->restore(); + } + + $settlementId = $settlement->id; + }); + + $summary['settlement_ids'][] = $settlementId; + ++$summary['success']; + } catch (Throwable $exception) { + $summary['errors'][] = ['line' => $line, 'message' => $exception->getMessage()]; + } + } + + $summary['settlement_ids'] = array_values(array_unique($summary['settlement_ids'])); + + return $summary; + } + + private function rows(ImportBatch $batch, array $requiredHeaders): iterable + { + $stream = Storage::disk('uploads')->readStream($batch->source_file); + + if (! is_resource($stream)) { + throw new RuntimeException('Unable to read the import source file.'); + } + + try { + $headers = fgetcsv($stream); + + if ($headers === false) { + throw new RuntimeException('The import source file is empty.'); + } + + $headers = array_map(function ($header) { + return trim(preg_replace('/^\xEF\xBB\xBF/', '', (string) $header)); + }, $headers); + + $missingHeaders = array_diff($requiredHeaders, $headers); + + if (! empty($missingHeaders)) { + throw new RuntimeException('Missing CSV columns: ' . implode(', ', $missingHeaders)); + } + + $line = 1; + + while (($values = fgetcsv($stream)) !== false) { + ++$line; + + if ($values === [null] || $values === []) { + continue; + } + + $values = array_pad($values, count($headers), null); + yield $line => array_combine($headers, array_slice($values, 0, count($headers))); + } + } finally { + fclose($stream); + } + } + + private function required(array $row, string $field): string + { + $value = $this->value($row, $field); + + if ($value === null || $value === '') { + throw new RuntimeException("Missing required value: {$field}"); + } + + return $value; + } + + private function value(array $row, string $field): ?string + { + $value = $row[$field] ?? null; + + return $value === null ? null : trim((string) $value); + } + + private function money(array $row, string $field): string + { + $value = $this->value($row, $field); + + if ($value === null || $value === '') { + return '0'; + } + + if (! is_numeric($value)) { + throw new RuntimeException("Invalid monetary value for {$field}"); + } + + return $value; + } + + private function number(array $row, string $field): string + { + $value = $this->required($row, $field); + + if (! is_numeric($value)) { + throw new RuntimeException("Invalid numeric value for {$field}"); + } + + return $value; + } + + private function date(array $row, string $field): ?string + { + $value = $this->value($row, $field); + + if ($value === null || $value === '') { + return null; + } + + try { + return Carbon::parse($value)->toDateTimeString(); + } catch (Throwable) { + throw new RuntimeException("Invalid datetime value for {$field}"); + } + } +} diff --git a/modules/EcommerceFinance/Models/Channel.php b/modules/EcommerceFinance/Models/Channel.php new file mode 100644 index 00000000..8924e1af --- /dev/null +++ b/modules/EcommerceFinance/Models/Channel.php @@ -0,0 +1,26 @@ +hasMany(Store::class); + } +} diff --git a/modules/EcommerceFinance/Models/ImportBatch.php b/modules/EcommerceFinance/Models/ImportBatch.php new file mode 100644 index 00000000..669f89b7 --- /dev/null +++ b/modules/EcommerceFinance/Models/ImportBatch.php @@ -0,0 +1,40 @@ + 'array', + 'started_at' => 'datetime', + 'completed_at' => 'datetime', + ]; + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } +} diff --git a/modules/EcommerceFinance/Models/Order.php b/modules/EcommerceFinance/Models/Order.php new file mode 100644 index 00000000..709bb905 --- /dev/null +++ b/modules/EcommerceFinance/Models/Order.php @@ -0,0 +1,55 @@ + 'datetime', + 'paid_at' => 'datetime', + 'shipped_at' => 'datetime', + 'completed_at' => 'datetime', + 'payload' => 'array', + ]; + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } + + public function items(): HasMany + { + return $this->hasMany(OrderItem::class); + } + + public function events(): HasMany + { + return $this->hasMany(OrderEvent::class); + } +} diff --git a/modules/EcommerceFinance/Models/OrderEvent.php b/modules/EcommerceFinance/Models/OrderEvent.php new file mode 100644 index 00000000..ab97478d --- /dev/null +++ b/modules/EcommerceFinance/Models/OrderEvent.php @@ -0,0 +1,32 @@ + 'datetime', + 'payload' => 'array', + ]; + + public function order(): BelongsTo + { + return $this->belongsTo(Order::class); + } +} diff --git a/modules/EcommerceFinance/Models/OrderItem.php b/modules/EcommerceFinance/Models/OrderItem.php new file mode 100644 index 00000000..d2267b21 --- /dev/null +++ b/modules/EcommerceFinance/Models/OrderItem.php @@ -0,0 +1,38 @@ +belongsTo(Order::class); + } + + public function item(): BelongsTo + { + return $this->belongsTo(Item::class); + } +} diff --git a/modules/EcommerceFinance/Models/ReconciliationMatch.php b/modules/EcommerceFinance/Models/ReconciliationMatch.php new file mode 100644 index 00000000..221a1c2f --- /dev/null +++ b/modules/EcommerceFinance/Models/ReconciliationMatch.php @@ -0,0 +1,38 @@ + 'datetime', + ]; + + public function settlementLine(): BelongsTo + { + return $this->belongsTo(SettlementLine::class); + } + + public function order(): BelongsTo + { + return $this->belongsTo(Order::class); + } +} diff --git a/modules/EcommerceFinance/Models/Settlement.php b/modules/EcommerceFinance/Models/Settlement.php new file mode 100644 index 00000000..47c98da6 --- /dev/null +++ b/modules/EcommerceFinance/Models/Settlement.php @@ -0,0 +1,54 @@ + 'datetime', + 'period_end' => 'datetime', + 'settled_at' => 'datetime', + 'payload' => 'array', + ]; + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } + + public function transaction(): BelongsTo + { + return $this->belongsTo(Transaction::class); + } + + public function lines(): HasMany + { + return $this->hasMany(SettlementLine::class); + } +} diff --git a/modules/EcommerceFinance/Models/SettlementLine.php b/modules/EcommerceFinance/Models/SettlementLine.php new file mode 100644 index 00000000..440e01e2 --- /dev/null +++ b/modules/EcommerceFinance/Models/SettlementLine.php @@ -0,0 +1,40 @@ + 'datetime', + 'payload' => 'array', + ]; + + public function settlement(): BelongsTo + { + return $this->belongsTo(Settlement::class); + } + + public function matches(): HasMany + { + return $this->hasMany(ReconciliationMatch::class); + } +} diff --git a/modules/EcommerceFinance/Models/SkuMapping.php b/modules/EcommerceFinance/Models/SkuMapping.php new file mode 100644 index 00000000..3ba72650 --- /dev/null +++ b/modules/EcommerceFinance/Models/SkuMapping.php @@ -0,0 +1,33 @@ +belongsTo(Store::class); + } + + public function item(): BelongsTo + { + return $this->belongsTo(Item::class); + } +} diff --git a/modules/EcommerceFinance/Models/Store.php b/modules/EcommerceFinance/Models/Store.php new file mode 100644 index 00000000..863126b9 --- /dev/null +++ b/modules/EcommerceFinance/Models/Store.php @@ -0,0 +1,51 @@ +belongsTo(Channel::class); + } + + public function settlementAccount(): BelongsTo + { + return $this->belongsTo(Account::class, 'settlement_account_id'); + } + + public function importBatches(): HasMany + { + return $this->hasMany(ImportBatch::class); + } + + public function orders(): HasMany + { + return $this->hasMany(Order::class); + } + + public function settlements(): HasMany + { + return $this->hasMany(Settlement::class); + } +} diff --git a/modules/EcommerceFinance/Providers/Event.php b/modules/EcommerceFinance/Providers/Event.php new file mode 100644 index 00000000..e0bf152a --- /dev/null +++ b/modules/EcommerceFinance/Providers/Event.php @@ -0,0 +1,18 @@ +loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'ecommerce-finance'); + $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + } + + public function register(): void + { + if (app()->routesAreCached()) { + return; + } + + foreach (['admin.php', 'api.php'] as $route) { + $this->loadRoutesFrom(__DIR__ . '/../Routes/' . $route); + } + } +} diff --git a/modules/EcommerceFinance/Resources/lang/en-GB/general.php b/modules/EcommerceFinance/Resources/lang/en-GB/general.php new file mode 100644 index 00000000..de14195c --- /dev/null +++ b/modules/EcommerceFinance/Resources/lang/en-GB/general.php @@ -0,0 +1,6 @@ + 'E-commerce Finance', + 'description' => 'Reconcile marketplace settlements and calculate e-commerce profitability.', +]; diff --git a/modules/EcommerceFinance/Resources/lang/zh-CN/general.php b/modules/EcommerceFinance/Resources/lang/zh-CN/general.php new file mode 100644 index 00000000..09bf3100 --- /dev/null +++ b/modules/EcommerceFinance/Resources/lang/zh-CN/general.php @@ -0,0 +1,6 @@ + '电商财务', + 'description' => '管理平台结算、差异对账与电商利润核算。', +]; diff --git a/modules/EcommerceFinance/Resources/views/index.blade.php b/modules/EcommerceFinance/Resources/views/index.blade.php new file mode 100644 index 00000000..c442e297 --- /dev/null +++ b/modules/EcommerceFinance/Resources/views/index.blade.php @@ -0,0 +1,11 @@ + + {{ trans('ecommerce-finance::general.name') }} + + + + + diff --git a/modules/EcommerceFinance/Routes/admin.php b/modules/EcommerceFinance/Routes/admin.php new file mode 100644 index 00000000..5a08c09f --- /dev/null +++ b/modules/EcommerceFinance/Routes/admin.php @@ -0,0 +1,7 @@ +name('index'); +}); diff --git a/modules/EcommerceFinance/Routes/api.php b/modules/EcommerceFinance/Routes/api.php new file mode 100644 index 00000000..ee9041b0 --- /dev/null +++ b/modules/EcommerceFinance/Routes/api.php @@ -0,0 +1,11 @@ +name('import-files.store'); + Route::apiResource('channels', 'Channels')->except(['destroy']); + Route::apiResource('stores', 'Stores')->except(['destroy']); + Route::apiResource('import-batches', 'ImportBatches')->only(['index', 'show', 'store']); + Route::get('reconciliation-exceptions', 'ReconciliationExceptions@index')->name('reconciliation-exceptions.index'); +}); diff --git a/modules/EcommerceFinance/Tests/Feature/ChannelsTest.php b/modules/EcommerceFinance/Tests/Feature/ChannelsTest.php new file mode 100644 index 00000000..285f4bee --- /dev/null +++ b/modules/EcommerceFinance/Tests/Feature/ChannelsTest.php @@ -0,0 +1,140 @@ +loginAs(); + Storage::fake('uploads'); + + $file = UploadedFile::fake()->createWithContent('orders.csv', implode("\n", [ + 'external_order_id,external_line_id,order_status,item_name,quantity', + 'order-001,line-001,completed,Wireless Mouse,1', + ])); + + $response = $this->withHeaders($this->apiHeaders()) + ->post(route('api.ecommerce-finance.import-files.store'), ['source_file' => $file]) + ->assertCreated() + ->assertJsonStructure(['source_file', 'checksum']); + + Storage::disk('uploads')->assertExists($response->json('source_file')); + $this->assertSame(hash_file('sha256', $file->getRealPath()), $response->json('checksum')); + } + + public function test_it_creates_a_channel_for_the_current_company(): void + { + $request = [ + 'code' => 'taobao', + 'name' => 'Taobao', + 'type' => 'marketplace', + 'enabled' => true, + ]; + + $this->loginAs(); + + $this->withHeaders($this->apiHeaders()) + ->postJson(route('api.ecommerce-finance.channels.store'), $request) + ->assertCreated() + ->assertJsonPath('company_id', company_id()) + ->assertJsonPath('code', 'taobao'); + + $this->assertDatabaseHas('ec_channels', [ + 'company_id' => company_id(), + 'code' => 'taobao', + 'name' => 'Taobao', + ]); + } + + public function test_it_rejects_a_duplicate_import_batch(): void + { + $this->loginAs(); + Storage::fake('uploads'); + + $channel = Channel::create([ + 'company_id' => company_id(), + 'code' => 'jd', + 'name' => 'JD', + 'type' => 'marketplace', + ]); + + $store = Store::create([ + 'company_id' => company_id(), + 'channel_id' => $channel->id, + 'name' => 'JD Flagship Store', + 'external_id' => 'jd-flagship', + ]); + + $sourceFile = 'ecommerce-finance/imports/jd-orders-20260718.csv'; + + Storage::disk('uploads')->put($sourceFile, implode("\n", [ + 'external_order_id,external_line_id,order_status,item_name,quantity,sale_amount,gross_amount,buyer_paid_amount,currency_code,completed_at', + 'order-001,line-001,completed,Wireless Mouse,2,99.80,99.80,99.80,CNY,2026-07-18 10:00:00', + ])); + + $request = [ + 'store_id' => $store->id, + 'source_type' => 'orders', + 'source_file' => $sourceFile, + 'checksum' => str_repeat('a', 64), + ]; + + $this->withHeaders($this->apiHeaders()) + ->postJson(route('api.ecommerce-finance.import-batches.store'), $request) + ->assertCreated() + ->assertJsonPath('status', 'completed'); + + $this->assertDatabaseHas('ec_orders', [ + 'company_id' => company_id(), + 'store_id' => $store->id, + 'external_order_id' => 'order-001', + ]); + $this->assertDatabaseHas('ec_order_items', [ + 'company_id' => company_id(), + 'external_line_id' => 'line-001', + 'name' => 'Wireless Mouse', + ]); + + $settlementFile = 'ecommerce-finance/imports/jd-settlement-20260718.csv'; + Storage::disk('uploads')->put($settlementFile, implode("\n", [ + 'external_settlement_id,external_line_id,line_type,external_order_id,line_amount,currency_code,settled_at', + 'settlement-001,settlement-line-001,order_payment,order-001,99.80,CNY,2026-07-19 10:00:00', + ])); + + $this->withHeaders($this->apiHeaders()) + ->postJson(route('api.ecommerce-finance.import-batches.store'), [ + 'store_id' => $store->id, + 'source_type' => 'settlements', + 'source_file' => $settlementFile, + 'checksum' => str_repeat('b', 64), + ]) + ->assertCreated() + ->assertJsonPath('status', 'completed'); + + $this->assertDatabaseHas('ec_reconciliation_matches', [ + 'company_id' => company_id(), + 'status' => 'auto_matched', + 'matched_amount' => '99.8', + ]); + + $this->withExceptionHandling(); + + $this->withHeaders($this->apiHeaders()) + ->postJson(route('api.ecommerce-finance.import-batches.store'), $request) + ->assertBadRequest(); + } + + private function apiHeaders(): array + { + return [ + 'Authorization' => 'Basic ' . base64_encode('test@company.com:123456'), + ]; + } +} diff --git a/modules/EcommerceFinance/module.json b/modules/EcommerceFinance/module.json new file mode 100644 index 00000000..ba75a14b --- /dev/null +++ b/modules/EcommerceFinance/module.json @@ -0,0 +1,18 @@ +{ + "alias": "ecommerce-finance", + "icon": "shopping-cart", + "version": "0.1.0", + "active": 1, + "providers": [ + "Modules\\EcommerceFinance\\Providers\\Event", + "Modules\\EcommerceFinance\\Providers\\Main" + ], + "aliases": {}, + "files": [], + "requires": [], + "reports": [], + "widgets": [], + "settings": [], + "extra-modules": {}, + "routes": [] +} diff --git a/modules/OfflinePayments/.github/workflows/tests.yml b/modules/OfflinePayments/.github/workflows/tests.yml new file mode 100644 index 00000000..20a06811 --- /dev/null +++ b/modules/OfflinePayments/.github/workflows/tests.yml @@ -0,0 +1,50 @@ +name: Tests + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: + +jobs: + tests: + + name: PHP ${{ matrix.php }} + + runs-on: ubuntu-latest + + strategy: + matrix: + php: ['7.3', '7.4'] + + steps: + - name: Checkout Akaunting + uses: actions/checkout@v2 + with: + repository: akaunting/akaunting + + - name: Checkout Offline Payments module + uses: actions/checkout@v2 + with: + path: modules/OfflinePayments + + - name: Cache Composer + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: bcmath, ctype, dom, fileinfo, intl, gd, json, mbstring, pdo, pdo_sqlite, openssl, sqlite, xml, zip + coverage: none + + - name: Copy .env + run: cp .env.testing .env + + - name: Install Composer + run: cd modules/OfflinePayments ; composer test ; cd ../.. ; composer test + + - name: Execute tests + run: php artisan test --parallel diff --git a/modules/OfflinePayments/.github/workflows/translations.yml b/modules/OfflinePayments/.github/workflows/translations.yml new file mode 100644 index 00000000..e49dfa6e --- /dev/null +++ b/modules/OfflinePayments/.github/workflows/translations.yml @@ -0,0 +1,37 @@ +name: Translations + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: + +jobs: + sync: + name: Sync + + runs-on: ubuntu-latest + + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Sync with Crowdin + uses: crowdin/github-action@master + with: + upload_sources: true + upload_translations: true + download_translations: true + skip_untranslated_files: true + + localization_branch_name: 'translations' + commit_message: 'new crowdin translations' + pull_request_title: 'New Crowdin translations' + pull_request_body: 'https://crowdin.com/project/akaunting-apps' + pull_request_labels: 'Translation' + + config: 'crowdin.yml' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_APPS_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/modules/OfflinePayments/.gitignore b/modules/OfflinePayments/.gitignore new file mode 100644 index 00000000..f565dba4 --- /dev/null +++ b/modules/OfflinePayments/.gitignore @@ -0,0 +1,7 @@ +/.idea +/.history +/.vscode +/.vagrant +/node_modules +/storage/*.key +/vendor \ No newline at end of file diff --git a/modules/OfflinePayments/Http/Controllers/Payment.php b/modules/OfflinePayments/Http/Controllers/Payment.php new file mode 100644 index 00000000..6343a32e --- /dev/null +++ b/modules/OfflinePayments/Http/Controllers/Payment.php @@ -0,0 +1,89 @@ +json([ + 'code' => '', + 'name' => 'N/A', + 'description' => '', + 'redirect' => redirect()->back()->getTargetUrl(), + 'html' => '', + ]); + } + + $confirm_url = $this->getConfirmUrl($invoice); + + $html = view('offline-payments::show', compact('setting', 'invoice', 'confirm_url'))->render(); + + return response()->json([ + 'code' => $setting['code'], + 'name' => $setting['name'], + 'description' => $setting['description'], + 'redirect' => false, + 'html' => $html, + ]); + } + + public function confirm(Document $invoice, Request $request) + { + try { + event(new PaymentReceived($invoice, $request)); + + $message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]); + + flash($message)->success(); + + $response = [ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => false, + 'redirect' => $this->getFinishUrl($invoice), + ]; + } catch(\Exception $e) { + $message = $e->getMessage(); + + flash($message)->error()->important(); + + $response = [ + 'success' => false, + 'error' => true, + 'message' => $message, + 'data' => false, + 'redirect' => $this->getInvoiceUrl($invoice), + ]; + } + + return response()->json($response); + } +} diff --git a/modules/OfflinePayments/Http/Controllers/Settings.php b/modules/OfflinePayments/Http/Controllers/Settings.php new file mode 100644 index 00000000..a2d3a675 --- /dev/null +++ b/modules/OfflinePayments/Http/Controllers/Settings.php @@ -0,0 +1,120 @@ +get('update_code'), array_column($methods, 'code'))) { + $code_exists = true; + } + + if (!empty($request->get('update_code')) && $code_exists == true) { + $payment_method = $this->dispatch(new UpdatePaymentMethod($request)); + + $message = trans('messages.success.updated', ['type' => $payment_method['name']]); + } else { + $payment_method = $this->dispatch(new CreatePaymentMethod($request)); + + $message = trans('messages.success.added', ['type' => $payment_method['name']]); + } + + flash($message)->success(); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'redirect' => route('offline-payments.settings.edit'), + ]); + } + + /** + * Remove the specified resource from storage. + * + * @param GRequest $request + * + * @return Response + */ + public function get(GRequest $request) + { + $data = []; + + $code = $request->get('code'); + + $methods = json_decode(setting('offline-payments.methods'), true); + + foreach ($methods as $key => $method) { + if ($method['code'] != $code) { + continue; + } + + $method['title'] = trans('offline-payments::offline-payments.edit', ['method' => $method['name']]); + $method['update_code'] = $code; + + $code = explode('.', $method['code']); + + $method['code'] = $code[1]; + + $data = $method; + + break; + } + + return response()->json([ + 'errors' => false, + 'success' => true, + 'data' => $data, + ]); + } + + /** + * Remove the specified resource from storage. + * + * @param DRequest $request + * + * @return Response + */ + public function destroy(DRequest $request) + { + $response = $this->ajaxDispatch(new DeletePaymentMethod($request)); + + if ($response['success']) { + $response['message'] = trans('messages.success.deleted', ['type' => $response['data']['name']]); + } + + return response()->json($response); + } +} diff --git a/modules/OfflinePayments/Http/Requests/Setting.php b/modules/OfflinePayments/Http/Requests/Setting.php new file mode 100644 index 00000000..57f7f84b --- /dev/null +++ b/modules/OfflinePayments/Http/Requests/Setting.php @@ -0,0 +1,30 @@ + 'required|string', + ]; + } +} diff --git a/modules/OfflinePayments/Http/Requests/SettingDelete.php b/modules/OfflinePayments/Http/Requests/SettingDelete.php new file mode 100644 index 00000000..0319d17f --- /dev/null +++ b/modules/OfflinePayments/Http/Requests/SettingDelete.php @@ -0,0 +1,30 @@ + 'required|string', + ]; + } +} diff --git a/modules/OfflinePayments/Http/Requests/SettingGet.php b/modules/OfflinePayments/Http/Requests/SettingGet.php new file mode 100644 index 00000000..1643dfe3 --- /dev/null +++ b/modules/OfflinePayments/Http/Requests/SettingGet.php @@ -0,0 +1,30 @@ + 'required|string', + ]; + } +} diff --git a/modules/OfflinePayments/Http/Requests/Show.php b/modules/OfflinePayments/Http/Requests/Show.php new file mode 100644 index 00000000..be28422c --- /dev/null +++ b/modules/OfflinePayments/Http/Requests/Show.php @@ -0,0 +1,30 @@ + 'required|string', + ]; + } +} diff --git a/modules/OfflinePayments/Jobs/CreatePaymentMethod.php b/modules/OfflinePayments/Jobs/CreatePaymentMethod.php new file mode 100644 index 00000000..0e7656ab --- /dev/null +++ b/modules/OfflinePayments/Jobs/CreatePaymentMethod.php @@ -0,0 +1,58 @@ +request = $this->getRequestInstance($request); + } + + /** + * Execute the job. + * + * @return array + */ + public function handle() + { + $methods = json_decode(setting('offline-payments.methods'), true); + + $code = 'offline-payments.' . Str::slug($this->request->get('name'), '_') . '.' . (count($methods) + 1); + + foreach ($methods as $method) { + if (Str::contains($method['code'], 'offline-payments.' . Str::slug($this->request->get('name'), '_') . '.')) { + return $method; + } + } + + $payment_method = [ + 'code' => $code, + 'name' => $this->request->get('name'), + 'customer' => $this->request->get('customer'), + 'order' => $this->request->get('order'), + 'description' => $this->request->get('description'), + ]; + + $methods[] = $payment_method; + + setting()->set('offline-payments.methods', json_encode($methods)); + + setting()->save(); + + Modules::clearPaymentMethodsCache(); + + return $payment_method; + } +} diff --git a/modules/OfflinePayments/Jobs/DeletePaymentMethod.php b/modules/OfflinePayments/Jobs/DeletePaymentMethod.php new file mode 100644 index 00000000..a030dea5 --- /dev/null +++ b/modules/OfflinePayments/Jobs/DeletePaymentMethod.php @@ -0,0 +1,85 @@ +request = $this->getRequestInstance($request); + } + + /** + * Execute the job. + * + * @return array + */ + public function handle() + { + $this->authorize(); + + $methods = json_decode(setting('offline-payments.methods'), true); + + $payment_method = []; + + $code = $this->request->get('code'); + + foreach ($methods as $key => $method) { + if ($method['code'] != $code) { + continue; + } + + $payment_method = $methods[$key]; + + unset($methods[$key]); + } + + setting()->set('offline-payments.methods', json_encode($methods)); + + setting()->save(); + + Modules::clearPaymentMethodsCache(); + + return $payment_method; + } + + /** + * Determine if this action is applicable. + * + * @return void + */ + public function authorize() + { + if ($relationships = $this->getRelationships()) { + $methods = json_decode(setting('offline-payments.methods'), true); + $method = $methods[array_search($this->request->get('code'), array_column($methods, 'code'))]; + + $message = trans('messages.warning.deleted', ['name' => $method['name'], 'text' => implode(', ', $relationships)]); + + throw new \Exception($message); + } + } + + public function getRelationships() + { + $counter = []; + + if ($transaction_count = Transaction::where('payment_method', $this->request->get('code'))->count()) { + $counter[] = $transaction_count . ' ' . strtolower(trans_choice('general.transactions', ($transaction_count > 1) ? 2 : 1)); + } + + return $counter; + } +} diff --git a/modules/OfflinePayments/Jobs/UpdatePaymentMethod.php b/modules/OfflinePayments/Jobs/UpdatePaymentMethod.php new file mode 100644 index 00000000..a52b3346 --- /dev/null +++ b/modules/OfflinePayments/Jobs/UpdatePaymentMethod.php @@ -0,0 +1,59 @@ +request = $this->getRequestInstance($request); + } + + /** + * Execute the job. + * + * @return array + */ + public function handle() + { + $methods = json_decode(setting('offline-payments.methods'), true); + + $payment_method = []; + + $code = $this->request->get('update_code'); + + foreach ($methods as $key => $method) { + if ($method['code'] != $code) { + continue; + } + + $payment_method = [ + 'code' => $code, + 'name' => $this->request->get('name'), + 'customer' => $this->request->get('customer'), + 'order' => $this->request->get('order'), + 'description' => $this->request->get('description'), + ]; + + $methods[$key] = $payment_method; + } + + setting()->set('offline-payments.methods', json_encode($methods)); + + setting()->save(); + + Modules::clearPaymentMethodsCache(); + + return $payment_method; + } +} diff --git a/modules/OfflinePayments/Listeners/AddLandingPage.php b/modules/OfflinePayments/Listeners/AddLandingPage.php new file mode 100644 index 00000000..87306294 --- /dev/null +++ b/modules/OfflinePayments/Listeners/AddLandingPage.php @@ -0,0 +1,19 @@ +user->landing_pages['offline-payments.settings.edit'] = trans('offline-payments::general.name'); + } +} diff --git a/modules/OfflinePayments/Listeners/FinishInstallation.php b/modules/OfflinePayments/Listeners/FinishInstallation.php new file mode 100644 index 00000000..89a7804e --- /dev/null +++ b/modules/OfflinePayments/Listeners/FinishInstallation.php @@ -0,0 +1,36 @@ +alias != $this->alias) { + return; + } + + $this->updatePermissions(); + } + + protected function updatePermissions() + { + // c=create, r=read, u=update, d=delete + $this->attachPermissionsToAdminRoles([ + $this->alias . '-settings' => 'r,u,d', + ]); + } +} diff --git a/modules/OfflinePayments/Listeners/ShowAsPaymentMethod.php b/modules/OfflinePayments/Listeners/ShowAsPaymentMethod.php new file mode 100644 index 00000000..e324d591 --- /dev/null +++ b/modules/OfflinePayments/Listeners/ShowAsPaymentMethod.php @@ -0,0 +1,27 @@ +modules->payment_methods[] = $method; + } + } +} diff --git a/modules/OfflinePayments/Listeners/ShowInSettingsMenu.php b/modules/OfflinePayments/Listeners/ShowInSettingsMenu.php new file mode 100644 index 00000000..0be83ca9 --- /dev/null +++ b/modules/OfflinePayments/Listeners/ShowInSettingsMenu.php @@ -0,0 +1,31 @@ +moduleIsEnabled('offline-payments')) { + return; + } + + $title = trans('offline-payments::general.name'); + + if ($this->canAccessMenuItem($title, 'read-offline-payments-settings')) { + $event->menu->route('offline-payments.settings.edit', $title, [], 100, ['icon' => 'credit_card', 'search_keywords' => trans('offline-payments::general.description')]); + } + } +} diff --git a/modules/OfflinePayments/Listeners/Update/Version300.php b/modules/OfflinePayments/Listeners/Update/Version300.php new file mode 100644 index 00000000..e9f22bb4 --- /dev/null +++ b/modules/OfflinePayments/Listeners/Update/Version300.php @@ -0,0 +1,34 @@ +skipThisUpdate($event)) { + return; + } + + $this->deleteOldFiles(); + } + + protected function deleteOldFiles() + { + File::delete(base_path('modules/OfflinePayments/Listeners/ShowInSettingsPage.php')); + } +} diff --git a/modules/OfflinePayments/Providers/Event.php b/modules/OfflinePayments/Providers/Event.php new file mode 100644 index 00000000..79369acd --- /dev/null +++ b/modules/OfflinePayments/Providers/Event.php @@ -0,0 +1,30 @@ +loadTranslations(); + $this->loadViews(); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->loadRoutes(); + } + + /** + * Load views. + * + * @return void + */ + public function loadViews() + { + $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'offline-payments'); + } + + /** + * Load translations. + * + * @return void + */ + public function loadTranslations() + { + $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'offline-payments'); + } + + /** + * Load routes. + * + * @return void + */ + public function loadRoutes() + { + if (app()->routesAreCached()) { + return; + } + + $routes = [ + 'admin.php', + 'portal.php', + 'signed.php', + ]; + + foreach ($routes as $route) { + $this->loadRoutesFrom(__DIR__ . '/../Routes/' . $route); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } +} diff --git a/modules/OfflinePayments/README.md b/modules/OfflinePayments/README.md new file mode 100644 index 00000000..600539de --- /dev/null +++ b/modules/OfflinePayments/README.md @@ -0,0 +1,11 @@ +# Offline Payments app for Akaunting + +[![Tests](https://github.com/akaunting/module-offline-payments/workflows/Tests/badge.svg?label=tests)](https://github.com/akaunting/module-offline-payments/actions) + +## Tests + +The workflow runs both [Akaunting](https://github.com/akaunting/akaunting/tree/master/tests) and module test suites. They're configured to run once per week and triggered manually. Therefore, **before** publishing a new release, run the workflow [manually](https://github.com/akaunting/module-offline-payments/actions?query=workflow%3ATests) and make sure it passes. + +## Translations + +[Crowdin](https://crowdin.com/project/akaunting-apps) is the home of translators and it's synced (download & upload) with GitHub. The workflow is configured to run once per week and triggered manually. Therefore, **before** publishing a new release, run the workflow [manually](https://github.com/akaunting/module-offline-payments/actions?query=workflow%3ATranslations) and merge the automatically created PR, if available. Finally, all language files must be listed in the [config](https://github.com/akaunting/module-offline-payments/blob/master/crowdin.yml) file. diff --git a/modules/OfflinePayments/Resources/assets/js/offline-payments.js b/modules/OfflinePayments/Resources/assets/js/offline-payments.js new file mode 100644 index 00000000..9f8dd2f1 --- /dev/null +++ b/modules/OfflinePayments/Resources/assets/js/offline-payments.js @@ -0,0 +1,120 @@ +/** + * First we will load all of this project's JavaScript dependencies which + * includes Vue and other libraries. It is a great starting point when + * building robust, powerful web applications using Vue and Laravel. + */ + +require('./../../../../../resources/assets/js/bootstrap'); + +import Vue from 'vue'; + +import Global from './../../../../../resources/assets/js/mixins/global'; +import Form from './../../../../../resources/assets/js/plugins/form'; +import DashboardPlugin from './../../../../../resources/assets/js/plugins/dashboard-plugin'; + +// plugin setup +Vue.use(DashboardPlugin); + +const app = new Vue({ + el: '#app', + + mixins: [ + Global + ], + + data() { + return { + form: new Form('offline-payment'), + update_code: null, + form_loading: '', + } + }, + + methods:{ + onEdit(event) { + axios.post(url + '/offline-payments/settings/get', { + code: event + }) + .then(response => { + this.form.name = response.data.data.name; + this.form.code = response.data.data.code; + this.form.customer = response.data.data.customer; + this.form.order = response.data.data.order; + this.form.description = response.data.data.description; + this.form.update_code = response.data.data.update_code; + this.update_code = response.data.data.update_code; + this.form.loading = false; + this.form_loading = ''; + }) + .catch(error => { + this.form.loading = false; + this.form_loading = ''; + }); + }, + + // Actions > Delete + confirmDelete(code, title, message, button_cancel, button_delete) { + let confirm = { + code: code, + url: url, + title: title, + message: message, + button_cancel: button_cancel, + button_delete: button_delete, + show: true + }; + + this.component = Vue.component('add-new-component', (resolve, reject) => { + resolve({ + template : '
', + + mixins: [ + Global + ], + + data: function () { + return { + confirm: confirm, + } + }, + + methods: { + // Delete action post + async onDelete() { + Promise.resolve(axios({ + method: 'DELETE', + url: url + '/offline-payments/settings/delete', + data: { + code: this.confirm.code + } + })).then(response => { + var type = (response.data.success) ? 'success' : 'warning'; + + if (response.data.success) { + document.getElementById('method-' + this.confirm.code).remove(); + } + + this.confirm.show = false; + + this.$notify({ + message: response.data.message, + timeout: 5000, + icon: 'info', + type + }); + }) + .catch(error => { + this.success = false; + }); + }, + + // Close modal empty default value + cancelDelete() { + this.confirm.show = false; + }, + } + }) + }); + } + } +}); diff --git a/modules/OfflinePayments/Resources/assets/js/offline-payments.min.js b/modules/OfflinePayments/Resources/assets/js/offline-payments.min.js new file mode 100644 index 00000000..3343ab9e --- /dev/null +++ b/modules/OfflinePayments/Resources/assets/js/offline-payments.min.js @@ -0,0 +1,72 @@ +(function(){var __webpack_modules__={7757:function(e,t,n){e.exports=n(5666)},8650:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7162),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__),vue__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(5803),element_ui__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1486),element_ui__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(element_ui__WEBPACK_IMPORTED_MODULE_1__),_AkauntingModalAddNew__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3179),_AkauntingModal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(2775),_AkauntingMoney__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(7651),_AkauntingRadioGroup__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6548),_AkauntingSelect__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(5596),_AkauntingDate__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(8612),_AkauntingRecurring__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(647),_plugins_form__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(7303),_components;function asyncGeneratorStep(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){asyncGeneratorStep(o,i,r,a,s,"next",e)}function s(e){asyncGeneratorStep(o,i,r,a,s,"throw",e)}a(void 0)}))}}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nr?1:0}},setSortedOptions:function(){this.sorted_options=[];var e=this.dynamicOptions?this.dynamicOptions:this.options;if(this.group)if(Array.isArray(e))e.forEach((function(e,t){"string"==typeof e?this.sorted_options.push({index:t,key:t.toString(),value:e,level:0}):this.sorted_options.push({index:t,key:e.id.toString(),value:e.title?e.title:e.display_name?e.display_name:e.name,level:e.level?e.level:0})}),this);else for(var t=0,n=Object.entries(e);t',components:_defineProperty({AkauntingModalAddNew:_AkauntingModalAddNew__WEBPACK_IMPORTED_MODULE_2__.Z,AkauntingRadioGroup:_AkauntingRadioGroup__WEBPACK_IMPORTED_MODULE_5__.Z,AkauntingSelect:_AkauntingSelect__WEBPACK_IMPORTED_MODULE_6__.Z,AkauntingModal:_AkauntingModal__WEBPACK_IMPORTED_MODULE_3__.Z,AkauntingMoney:_AkauntingMoney__WEBPACK_IMPORTED_MODULE_4__.Z,AkauntingDate:_AkauntingDate__WEBPACK_IMPORTED_MODULE_7__.Z,AkauntingRecurring:_AkauntingRecurring__WEBPACK_IMPORTED_MODULE_8__.Z},element_ui__WEBPACK_IMPORTED_MODULE_1__.ColorPicker.name,element_ui__WEBPACK_IMPORTED_MODULE_1__.ColorPicker),data:function(){return{add_new:n}},methods:{onSubmit:function(e){this.$emit("submit",e)},onCancel:function(e){this.$emit("cancel",e)}}})}))})).catch((function(e){t.errors.push(e)})).finally((function(){}))},onSubmit:function(e){var t=this;this.form=e,this.loading=!0;var n=this.form.data();FormData.prototype.appendRecursive=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(var n in e)t?"object"!=_typeof(e[n])&&e[n].constructor!==Array||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(t+"["+n+"]",e[n]):this.appendRecursive(e[n],t+"["+n+"]"):"object"!=_typeof(e[n])&&e[n].constructor!==Array||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(n,e[n]):this.appendRecursive(e[n],n)};var i=new FormData;i.appendRecursive(n),window.axios({method:this.form.method,url:this.form.action,data:i,headers:{"X-CSRF-TOKEN":window.Laravel.csrfToken,"X-Requested-With":"XMLHttpRequest","Content-Type":"multipart/form-data"}}).then((function(n){(t.loading=!1,t.form.loading=!1,n.data.success)&&(t.sorted_options.push({key:n.data.data[t.add_new.field.key].toString(),value:n.data.data[t.add_new.field.value]}),t.new_options[n.data.data[t.add_new.field.key]]=n.data.data[t.add_new.field.value],t.multiple?t.selected.push(n.data.data[t.add_new.field.key].toString()):t.selected=n.data.data[t.add_new.field.key].toString(),t.add_new.show=!1,t.add_new.html="",t.add_new_html=null,n.data.data.mark_new=!0,t.$emit("new",n.data.data),t.change(),t.$emit("visible-change",e),document.body.classList.remove("overflow-hidden"))})).catch((function(e){t.form.loading=!1,t.form.onFail(e),t.method_show_html=e.message}))},onCancel:function(){this.add_new.show=!1,this.add_new.html=null,this.add_new_html=null,document.body.classList.remove("overflow-hidden")},addModal:function(){}},watch:{selected:function(e){if(this.multiple)if(Array.isArray(this.selected)&&!this.selected.length)this.selected=e;else{var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,""!=e&&n.push(e.toString()))})),t&&(this.selected=n)}else this.selected="string"!=typeof e&&void 0!==e?e.toString():e},value:function(e){if(this.multiple)if(Array.isArray(this.selected)&&!this.selected.length)this.selected=e;else{var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,n.push(e.toString()))})),t&&(this.selected=n)}else this.selected=e.toString();this.change()},model:function(e){if(this.multiple){var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,n.push(e.toString()))})),t&&(this.selected=n)}else this.selected=e.toString();this.change()},dynamicOptions:function(e){if(this.sorted_options=[],this.selected="",this.group)if(Array.isArray(e))e.forEach((function(e,t){"string"==typeof e?this.sorted_options.push({index:t,key:t.toString(),value:e,level:0}):this.sorted_options.push({index:t,key:e.id.toString(),value:e.title?e.title:e.display_name?e.display_name:e.name,level:e.level?e.level:0})}),this);else for(var t=0,n=Object.entries(e);te.length)&&(t=e.length);for(var n=0,i=new Array(t);nr?1:0}},setSortedOptions:function(){this.sorted_options=[];var e=this.dynamicOptions?this.dynamicOptions:this.options;if(this.group)if(Array.isArray(e))e.forEach((function(e,t){"string"==typeof e?this.sorted_options.push({index:t,key:t.toString(),value:e,level:0}):this.sorted_options.push({index:t,key:e.id.toString(),value:e.title?e.title:e.display_name?e.display_name:e.name,level:e.level?e.level:0})}),this);else for(var t=0,n=Object.entries(e);t-1}))):t.sortedOptions=[]})).catch((function(e){})).finally((function(){}))}else this.setSortedOptions()},onAddItem:function(){var e=this;return _asyncToGenerator(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark((function t(){var n;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.multiple?e.$children[0].$children[0].$refs.input.value:(e.title,e.$children[0].$children[0].$children[0].$refs.input.value),"inline"!=e.add_new.type){t.next=8;break}if(""!==n){t.next=4;break}return t.abrupt("return",!1);case 4:return t.next=6,e.addInline(n);case 6:t.next=10;break;case 8:return t.next=10,e.onModal(n);case 10:case"end":return t.stop()}}),t)})))()},addInline:function(e){var t=this;window.axios.post(this.add_new.path,{_token:window.Laravel.csrfToken,type:"inline",field:this.add_new.field.value,value:e}).then((function(e){e.data.success&&(Object.keys(t.options).length||(t.selectOptions=[]),t.selectOptions.push(e.data.data),t.new_options[e.data.data[t.add_new.field.key]]=e.data.data,t.real_model=e.data.data[t.add_new.field.key],t.title?t.$children[0].$children[0].visible=!1:t.$children[0].visible=!1,t.$emit("new",e.data.data),t.change())})).catch((function(e){console.log(e)}))},onModal:function(e){var t=this;this.setSortedOptions();var n=this.add_new;window.axios.get(this.add_new.path).then((function(e){n.show=!0,n.html=e.data.html,t.title?t.$children[0].$children[0].visible=!1:t.$children[0].visible=!1,t.add_new_html=vue__WEBPACK_IMPORTED_MODULE_10__.default.component("add-new-component",(function(e,t){e({template:'
',components:_defineProperty({AkauntingModalAddNew:_AkauntingModalAddNew__WEBPACK_IMPORTED_MODULE_2__.Z,AkauntingRadioGroup:_AkauntingRadioGroup__WEBPACK_IMPORTED_MODULE_5__.Z,AkauntingSelect:_AkauntingSelect__WEBPACK_IMPORTED_MODULE_6__.Z,AkauntingModal:_AkauntingModal__WEBPACK_IMPORTED_MODULE_3__.Z,AkauntingMoney:_AkauntingMoney__WEBPACK_IMPORTED_MODULE_4__.Z,AkauntingDate:_AkauntingDate__WEBPACK_IMPORTED_MODULE_7__.Z,AkauntingRecurring:_AkauntingRecurring__WEBPACK_IMPORTED_MODULE_8__.Z},element_ui__WEBPACK_IMPORTED_MODULE_1__.ColorPicker.name,element_ui__WEBPACK_IMPORTED_MODULE_1__.ColorPicker),data:function(){return{add_new:n}},methods:{onSubmit:function(e){this.$emit("submit",e)},onCancel:function(e){this.$emit("cancel",e)}}})}))})).catch((function(e){t.errors.push(e)})).finally((function(){}))},onSubmit:function(e){var t=this;this.form=e,this.loading=!0;var n=this.form.data();FormData.prototype.appendRecursive=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(var n in e)t?"object"!=_typeof(e[n])&&e[n].constructor!==Array||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(t+"["+n+"]",e[n]):this.appendRecursive(e[n],t+"["+n+"]"):"object"!=_typeof(e[n])&&e[n].constructor!==Array||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(n,e[n]):this.appendRecursive(e[n],n)};var i=new FormData;i.appendRecursive(n),window.axios({method:this.form.method,url:this.form.action,data:i,headers:{"X-CSRF-TOKEN":window.Laravel.csrfToken,"X-Requested-With":"XMLHttpRequest","Content-Type":"multipart/form-data"}}).then((function(e){(t.form.loading=!1,e.data.success)&&(t.sorted_options.push({key:e.data.data[t.add_new.field.key].toString(),value:e.data.data[t.add_new.field.value]}),t.new_options[e.data.data[t.add_new.field.key]]=e.data.data[t.add_new.field.value],t.multiple?t.selected.push(e.data.data[t.add_new.field.key].toString()):t.selected=e.data.data[t.add_new.field.key].toString(),t.add_new.show=!1,t.add_new.html="",t.add_new_html=null,t.$emit("new",e.data.data),t.change(),document.body.classList.remove("overflow-hidden"))})).catch((function(e){t.form.loading=!1,t.form.onFail(e),t.method_show_html=e.message}))},onCancel:function(){this.add_new.show=!1,this.add_new.html=null,this.add_new_html=null,document.body.classList.remove("overflow-hidden")},addModal:function(){}},watch:{selected:function(e){if(this.multiple)if(Array.isArray(this.selected)&&!this.selected.length)this.selected=e;else{var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,n.push(e.toString()))})),t&&(this.selected=n)}else this.selected="string"!=typeof e&&void 0!==e?e.toString():e},value:function(e){if(this.multiple)if(Array.isArray(this.selected)&&!this.selected.length)this.selected=e;else{var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,n.push(e.toString()))})),t&&(this.selected=n)}else this.selected=e.toString();this.change()},model:function(e){if(this.multiple){var t=!1,n=[];e.forEach((function(e){"string"!=typeof e&&(t=!0,n.push(e.toString()))})),t&&(this.selected=n)}else this.selected=e.toString();this.change()},dynamicOptions:function(e){if(this.sorted_options=[],this.selected=[],this.group)if(Array.isArray(e))e.forEach((function(e,t){"string"==typeof e?this.sorted_options.push({index:t,key:t.toString(),value:e,level:0}):this.sorted_options.push({index:t,key:e.id.toString(),value:e.title?e.title:e.display_name?e.display_name:e.name,level:e.level?e.level:0})}),this);else for(var t=0,n=Object.entries(e);te.length)&&(t=e.length);for(var n=0,i=new Array(t);n',components:{AkauntingModal:_components_AkauntingModal__WEBPACK_IMPORTED_MODULE_9__.Z},data:function(){return{confirm:o}},methods:{onDelete:function(){var e=this;return _asyncToGenerator(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark((function t(){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Promise.resolve(axios__WEBPACK_IMPORTED_MODULE_1___default()({method:"DELETE",url:e.confirm.url})).then((function(t){t.data.redirect&&(window.location.href=t.data.redirect),e.$emit("deleted",t.data)})).catch((function(t){e.success=!1}));case 2:case"end":return t.stop()}}),t)})))()},cancelDelete:function(){this.confirm.show=!1}}})}))},onChangeAccount:function(e){var t=this;e&&axios__WEBPACK_IMPORTED_MODULE_1___default().get(url+"/banking/accounts/currency",{params:{account_id:e}}).then((function(e){t.currency=e.data,t.form.currency_code=e.data.currency_code,t.form.currency_rate=e.data.currency_rate})).catch((function(e){}))},onChangeCurrency:function(e){var t=this;e&&(this.all_currencies.length?this.all_currencies.forEach((function(t,n){e==t.code&&(this.currency=t,this.form.currency_code=t.code,this.form.currency_rate=t.rate)}),this):Promise.resolve(window.axios.get(url+"/settings/currencies")).then((function(n){n.data.success&&(t.all_currencies=n.data.data),t.all_currencies.forEach((function(t,n){e==t.code&&(this.currency=t,this.form.currency_code=t.code,this.form.currency_rate=t.rate)}),t)})).catch((function(n){t.onChangeCurrency(e)})))},onChangePaginationLimit:function(e){var t="";if(window.location.search.length)if(window.location.search.includes("limit")){var n=[],i=window.location.search;n=(i=i.replace("?","")).split("&"),t=window.location.origin+window.location.pathname,n.forEach((function(n,i){var r=n.split("=");t+=0==i?"?":"&","limit"==r[0]?t+="limit="+e.target.getAttribute("value"):t+=r[0]+"="+r[1]}))}else t=window.location.href+"&limit="+e.target.getAttribute("value");else t=window.location.href+"?limit="+e.target.getAttribute("value");window.location.href=t},onDynamicComponent:function(e){var t=this;axios__WEBPACK_IMPORTED_MODULE_1___default().get(e).then((function(e){var n=e.data.html;t.component=vue__WEBPACK_IMPORTED_MODULE_31__.default.component("add-new-component",(function(e,t){var i;e({template:'
'+n+"
",components:(i={AkauntingSearch:_components_AkauntingSearch__WEBPACK_IMPORTED_MODULE_8__.Z,AkauntingRadioGroup:_components_AkauntingRadioGroup__WEBPACK_IMPORTED_MODULE_12__.Z,AkauntingSelect:_components_AkauntingSelect__WEBPACK_IMPORTED_MODULE_13__.Z,AkauntingSelectRemote:_components_AkauntingSelectRemote__WEBPACK_IMPORTED_MODULE_14__.Z,AkauntingModal:_components_AkauntingModal__WEBPACK_IMPORTED_MODULE_9__.Z,AkauntingModalAddNew:_components_AkauntingModalAddNew__WEBPACK_IMPORTED_MODULE_11__.Z,AkauntingDate:_components_AkauntingDate__WEBPACK_IMPORTED_MODULE_15__.Z,AkauntingRecurring:_components_AkauntingRecurring__WEBPACK_IMPORTED_MODULE_16__.Z},_defineProperty(i,element_ui__WEBPACK_IMPORTED_MODULE_27__.Select.name,element_ui__WEBPACK_IMPORTED_MODULE_27__.Select),_defineProperty(i,element_ui__WEBPACK_IMPORTED_MODULE_27__.Option.name,element_ui__WEBPACK_IMPORTED_MODULE_27__.Option),_defineProperty(i,element_ui__WEBPACK_IMPORTED_MODULE_27__.Steps.name,element_ui__WEBPACK_IMPORTED_MODULE_27__.Steps),_defineProperty(i,element_ui__WEBPACK_IMPORTED_MODULE_27__.Step.name,element_ui__WEBPACK_IMPORTED_MODULE_27__.Step),_defineProperty(i,element_ui__WEBPACK_IMPORTED_MODULE_27__.Button.name,element_ui__WEBPACK_IMPORTED_MODULE_27__.Button),i),created:function(){this.form=new _plugins_form__WEBPACK_IMPORTED_MODULE_28__.Z("form-dynamic-component")},mounted:function(){var e=document.getElementById("dynamic-component").querySelectorAll("form")[1].id;this.form=new _plugins_form__WEBPACK_IMPORTED_MODULE_28__.Z(e)},data:function(){return{form:{},dynamic:{data:dynamic_data}}},methods:{}})}))})).catch((function(e){t.errors.push(e)})).finally((function(){}))},onDynamicFormParams:function onDynamicFormParams(path,params){for(var _this8=this,data={},_i=0,_Object$entries=Object.entries(params);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];data[key]=eval(value)}axios__WEBPACK_IMPORTED_MODULE_1___default().get(path,{params:data}).then((function(e){if(e.data.data){var t=e.data.data;if(Array.isArray(t))t.forEach((function(e,t){this.form[t]=e}),_this8);else for(var n=0,i=Object.entries(t);n',components:{AkauntingModal:_components_AkauntingModal__WEBPACK_IMPORTED_MODULE_9__.Z},data:function(){return{confirm:s}},methods:{onDelete:function(){var e=this;return _asyncToGenerator(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark((function t(){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Promise.resolve(axios__WEBPACK_IMPORTED_MODULE_1___default()({method:"DELETE",url:e.confirm.url,data:a})).then((function(e){e.data.redirect&&(window.location.href=e.data.redirect)})).catch((function(t){e.success=!1}));case 2:case"end":return t.stop()}}),t)})))()},cancelDelete:function(){this.confirm.show=!1}}})}))},onChangeContactCard:function(e){this.form.contact_id=e.id,this.form.contact_name=e.title?e.title:e.display_name?e.display_name:e.name,this.form.contact_email=e.email?e.email:"",this.form.contact_tax_number=e.tax_number?e.tax_number:"",this.form.contact_phone=e.phone?e.phone:"",this.form.contact_address=e.address?e.address:"",this.form.contact_country=e.country?e.country:"",this.form.contact_state=e.state?e.state:"",this.form.contact_zip_code=e.zip_code?e.zip_code:"",this.form.contact_city=e.city?e.city:"";var t=e.currency_code?e.currency_code:this.form.currency_code;this.onChangeCurrency(t)},onShareLink:function(e){var t=this,n={modal:!1,url:e,title:"",html:"",buttons:{}};Promise.resolve(window.axios.get(n.url)).then((function(e){n.modal=!0,n.title=e.data.data.title,n.success_message=e.data.data.success_message,n.html=e.data.html,n.buttons=e.data.data.buttons,t.component=vue__WEBPACK_IMPORTED_MODULE_31__.default.component("add-new-component",(function(e,t){e({template:'
',components:{AkauntingModalAddNew:_components_AkauntingModalAddNew__WEBPACK_IMPORTED_MODULE_11__.Z},data:function(){return{share:n,form:{}}},methods:{onCopyLink:function(e){document.querySelector("#dynamic-share-component #hidden-share").select(),document.execCommand("copy"),this.$notify({message:this.share.success_message,timeout:5e3,icon:"error_outline",type:"success"}),this.onCancel()},onCancel:function(){this.share.modal=!1,this.share.html=null,document.body.classList.remove("modal-open")}}})}))})).catch((function(e){})).finally((function(){}))},onCopyLink:function(){var e=document.getElementById("share"),t=document.querySelector("[data-copied]");e.select(),document.execCommand("copy"),t.classList.remove("hidden"),t.classList.add("flex"),e.classList.add("hidden"),setTimeout((function(){t.classList.add("hidden"),t.classList.remove("flex"),e.classList.remove("hidden")}),800)}}}},7303:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var i=n(7162),r=n.n(i);function o(e,t){for(var n=0;n0}},{key:"set",value:function(e,t){return this.errors[e]=t}},{key:"get",value:function(e){if(this.errors[e])return this.errors[e][0]}},{key:"record",value:function(e){this.errors=e}},{key:"clear",value:function(e){if(e)return delete this.errors[e];this.errors={}}}])&&o(t.prototype,n),i&&o(t,i),e}();function s(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;for(var n in e)"previewElement"!=n&&"previewTemplate"!=n&&(t?"object"!=l(e[n])&&!Array.isArray(e[n])||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(t+"["+n+"]",e[n]):this.appendRecursive(e[n],t+"["+n+"]"):"object"!=l(e[n])&&!Array.isArray(e[n])||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(n,e[n]):this.appendRecursive(e[n],n))},this.loading=!0;var e=this.data(),t=new FormData;t.appendRecursive(e),window.axios({method:this.method,url:this.action,data:t,headers:{"X-CSRF-TOKEN":window.Laravel.csrfToken,"X-Requested-With":"XMLHttpRequest","Content-Type":"multipart/form-data"}}).then(this.onSuccess.bind(this)).catch(this.onFail.bind(this))}},{key:"asyncSubmit",value:(o=r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return FormData.prototype.appendRecursive=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(var n in e)"previewElement"!=n&&"previewTemplate"!=n&&(t?"object"!=l(e[n])&&!Array.isArray(e[n])||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(t+"["+n+"]",e[n]):this.appendRecursive(e[n],t+"["+n+"]"):"object"!=l(e[n])&&!Array.isArray(e[n])||e[n]instanceof File==1||e[n]instanceof Blob==1?this.append(n,e[n]):this.appendRecursive(e[n],n))},this.loading=!0,t=this.data(),(n=new FormData).appendRecursive(t),e.next=7,window.axios({method:this.method,url:this.action,data:n,headers:{"X-CSRF-TOKEN":window.Laravel.csrfToken,"X-Requested-With":"XMLHttpRequest","Content-Type":"multipart/form-data"}}).then(this.onSuccess.bind(this)).catch(this.onFail.bind(this));case 7:case"end":return e.stop()}}),e,this)})),c=function(){var e=this,t=arguments;return new Promise((function(n,i){var r=o.apply(e,t);function a(e){s(r,n,i,a,l,"next",e)}function l(e){s(r,n,i,a,l,"throw",e)}a(void 0)}))},function(){return c.apply(this,arguments)})},{key:"onSuccess",value:function(e){this.errors.clear(),this.loading=!1,e.data.redirect&&(this.loading=!0,window.location.href=e.data.redirect),this.response=e.data}},{key:"onFail",value:function(e){this.errors.record(e.response.data.errors),this.loading=!1}}],n&&d(t.prototype,n),i&&d(t,i),e}()},1809:function(e,t,n){"use strict";var i=n(9644),r=n.n(i),o=n(2521),a=n.n(o);r().interceptors.request.use((function(e){return a().start(),e}),(function(e){return console.log(e),Promise.reject(e)})),r().interceptors.response.use((function(e){return a().done(),e}),(function(e){return a().done(),console.log(e),Promise.reject(e)}))},1165:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,'.flatpickr-calendar{-webkit-animation:none;animation:none;background:transparent;background:#fff;border:0;border-radius:5px;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);-webkit-box-sizing:border-box;box-sizing:border-box;direction:ltr;display:none;font-size:14px;line-height:24px;opacity:0;padding:0;position:absolute;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;visibility:hidden;width:307.875px}.flatpickr-calendar.inline,.flatpickr-calendar.open{max-height:640px;opacity:1;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{display:block;z-index:999}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{border-top:1px solid #e6e6e6;height:40px}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{border:solid transparent;content:"";display:block;height:0;left:22px;pointer-events:none;position:absolute;width:0}.flatpickr-calendar.arrowRight:after,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar.arrowCenter:after,.flatpickr-calendar.arrowCenter:before{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{display:inline-block;position:relative}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{fill:rgba(0,0,0,.9);-webkit-box-flex:1;background:transparent;color:rgba(0,0,0,.9);-webkit-flex:1;-ms-flex:1;flex:1;height:34px;line-height:1;overflow:hidden;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{fill:rgba(0,0,0,.9);color:rgba(0,0,0,.9);cursor:pointer;height:34px;padding:10px;position:absolute;text-decoration:none;top:0;z-index:3}.flatpickr-months .flatpickr-next-month.flatpickr-disabled,.flatpickr-months .flatpickr-prev-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{height:14px;width:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{fill:inherit;-webkit-transition:fill .1s;transition:fill .1s}.numInputWrapper{height:auto;position:relative}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-inner-spin-button,.numInputWrapper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.numInputWrapper span{border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;height:50%;line-height:50%;opacity:0;padding:0 4px 0 2px;position:absolute;right:0;width:14px}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{content:"";display:block;position:absolute}.numInputWrapper span.arrowUp{border-bottom:0;top:0}.numInputWrapper span.arrowUp:after{border-bottom:4px solid rgba(57,57,57,.6);border-left:4px solid transparent;border-right:4px solid transparent;top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{height:auto;width:inherit}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{color:inherit;display:inline-block;font-size:135%;font-weight:300;height:34px;left:12.5%;line-height:inherit;line-height:1;padding:7.48px 0 0;position:absolute;text-align:center;-webkit-transform:translateZ(0);transform:translateZ(0);width:75%}.flatpickr-current-month span.cur-month{color:inherit;display:inline-block;font-family:inherit;font-weight:700;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{display:inline-block;width:6ch;width:7ch\\0}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;display:inline-block;font-family:inherit;font-size:inherit;font-weight:300;height:auto;line-height:inherit;margin:0;padding:0 0 0 .5ch;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{background:transparent;color:rgba(0,0,0,.5);font-size:100%;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;-webkit-appearance:menulist;-moz-appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;-webkit-box-sizing:border-box;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:active,.flatpickr-current-month .flatpickr-monthDropdown-months:focus{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;background:transparent;height:28px;overflow:hidden;text-align:center;width:100%}.flatpickr-weekdays,.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-weekdays .flatpickr-weekdaycontainer,span.flatpickr-weekday{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{background:transparent;color:rgba(0,0,0,.54);cursor:default;display:block;font-size:90%;font-weight:bolder;line-height:1;margin:0;text-align:center}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{-ms-flex-pack:justify;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-webkit-justify-content:space-around;justify-content:space-around;max-width:307.875px;min-width:307.875px;opacity:1;outline:0;padding:0;text-align:left;-webkit-transform:translateZ(0);transform:translateZ(0);width:307.875px}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{-ms-flex-preferred-size:14.2857143%;-webkit-box-pack:center;-ms-flex-pack:center;background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;display:inline-block;-webkit-flex-basis:14.2857143%;flex-basis:14.2857143%;font-weight:400;height:39px;-webkit-justify-content:center;justify-content:center;line-height:39px;margin:0;max-width:39px;position:relative;text-align:center;width:14.2857143%}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{background:#e6e6e6;border-color:#e6e6e6;cursor:pointer;outline:0}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{background:#959ea9;border-color:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;border-color:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{background:transparent;border-color:transparent;color:rgba(57,57,57,.3);cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{color:rgba(57,57,57,.1);cursor:not-allowed}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6;padding:0 12px}.flatpickr-weekwrapper .flatpickr-weekday{float:none;line-height:28px;width:100%}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{background:transparent;border:none;color:rgba(57,57,57,.3);cursor:default;display:block;max-width:none;width:100%}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden}.flatpickr-innerContainer,.flatpickr-rContainer{-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-rContainer{display:inline-block;padding:0}.flatpickr-time{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:0;line-height:40px;max-height:40px;outline:0;overflow:hidden;text-align:center}.flatpickr-time:after{clear:both;content:"";display:table}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;float:left;height:40px;width:40%}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;font-size:14px;height:inherit;line-height:inherit;margin:0;padding:0;position:relative;text-align:center}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{border:0;outline:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{-ms-flex-item-align:center;-webkit-align-self:center;align-self:center;color:#393939;float:left;font-weight:700;height:inherit;line-height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:2%}.flatpickr-time .flatpickr-am-pm{cursor:pointer;font-weight:400;outline:0;text-align:center;width:18%}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}',""]),t.Z=r},5723:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,'.glightbox-container{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:100%;left:0;outline:0;overflow:hidden;position:fixed;top:0;-ms-touch-action:none;touch-action:none;width:100%;z-index:999999!important}.glightbox-container.inactive{display:none}.glightbox-container .gcontainer{height:100%;overflow:hidden;position:relative;width:100%;z-index:9999}.glightbox-container .gslider{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;height:100%;left:0;overflow:hidden;position:relative;top:0;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:-webkit-transform .4s ease;transition:-webkit-transform .4s ease;transition:transform .4s ease;transition:transform .4s ease,-webkit-transform .4s ease}.glightbox-container .gslide,.glightbox-container .gslider{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;justify-content:center;width:100%}.glightbox-container .gslide{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1;opacity:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.glightbox-container .gslide.current{opacity:1;position:relative;z-index:99999}.glightbox-container .gslide.prev{opacity:1;z-index:9999}.glightbox-container .gslide-inner-content{width:100%}.glightbox-container .ginner-container{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100vh;justify-content:center;margin:auto;max-width:100%;position:relative;width:100%}.glightbox-container .ginner-container.gvideo-container{width:100%}.glightbox-container .ginner-container.desc-bottom,.glightbox-container .ginner-container.desc-top{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.glightbox-container .ginner-container.desc-left,.glightbox-container .ginner-container.desc-right{max-width:100%!important}.gslide iframe,.gslide video{-webkit-overflow-scrolling:touch;border:none;min-height:165px;outline:0!important;-ms-touch-action:auto;touch-action:auto}.gslide:not(.current){pointer-events:none}.gslide-image{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.gslide-image img{border:none;display:block;float:none;height:auto;margin:auto;max-height:100vh;max-width:100vw;min-width:200px;-o-object-fit:cover;object-fit:cover;outline:0;padding:0;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto}.desc-bottom .gslide-image img,.desc-top .gslide-image img{width:auto}.desc-left .gslide-image img,.desc-right .gslide-image img{max-width:100%;width:auto}.gslide-image img.zoomable{position:relative}.gslide-image img.dragging{cursor:-webkit-grabbing!important;cursor:grabbing!important;-webkit-transition:none;transition:none}.gslide-video{max-width:100vh;position:relative;width:100%!important}.gslide-video .gvideo-wrapper{margin:auto;width:100%}.gslide-video:before{background:rgba(255,0,0,.34);content:"";display:block;display:none;height:100%;position:absolute;width:100%}.gslide-video.playing:before{display:none}.gslide-video.fullscreen{height:75vh;max-width:100%!important;min-width:100%}.gslide-video.fullscreen video{max-width:100%!important;width:100%!important}.gslide-inline{background:#fff;max-height:calc(100vh - 40px);max-width:100%;overflow:auto;text-align:left}.gslide-inline .ginlined-content{padding:20px;width:100%}.gslide-inline .dragging{cursor:-webkit-grabbing!important;cursor:grabbing!important;-webkit-transition:none;transition:none}.ginlined-content{display:block!important;opacity:1;overflow:auto}.gslide-external{background:#fff;height:100%;max-height:75vh;min-width:100%;overflow:auto;padding:0;width:100%}.gslide-external,.gslide-media{display:-webkit-box;display:-ms-flexbox;display:flex}.gslide-media{width:auto}.zoomed .gslide-media{-webkit-box-shadow:none!important;box-shadow:none!important}.desc-bottom .gslide-media,.desc-top .gslide-media{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 auto}.gslide-description{-webkit-box-flex:1;-ms-flex:1 0 100%;flex:1 0 100%;position:relative}.gslide-description.description-left,.gslide-description.description-right{max-width:100%}.gslide-description.description-bottom,.gslide-description.description-top{margin:0 auto;width:100%}.gslide-description p{margin-bottom:12px}.gslide-description p:last-child{margin-bottom:0}.glightbox-button-hidden,.zoomed .gslide-description{display:none}.glightbox-mobile .glightbox-container .gslide-description{-webkit-box-ordinal-group:3!important;-ms-flex-order:2!important;background:0 0;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,transparent),to(rgba(0,0,0,.75)));background:linear-gradient(180deg,transparent 0,rgba(0,0,0,.75));bottom:0;height:auto!important;max-height:78vh;max-width:100vw!important;order:2!important;overflow:auto!important;padding:19px 11px 50px;position:absolute;-webkit-transition:opacity .3s linear;transition:opacity .3s linear;width:100%}.glightbox-mobile .glightbox-container .gslide-title{color:#fff;font-size:1em}.glightbox-mobile .glightbox-container .gslide-desc{color:#a1a1a1}.glightbox-mobile .glightbox-container .gslide-desc a{color:#fff;font-weight:700}.glightbox-mobile .glightbox-container .gslide-desc *{color:inherit}.glightbox-mobile .glightbox-container .gslide-desc string{color:#fff}.glightbox-mobile .glightbox-container .gslide-desc .desc-more{color:#fff;opacity:.4}.gdesc-open .gslide-media{opacity:.4;-webkit-transition:opacity .5s ease;transition:opacity .5s ease}.gdesc-open .gdesc-inner{padding-bottom:30px}.gdesc-closed .gslide-media{opacity:1;-webkit-transition:opacity .5s ease;transition:opacity .5s ease}.greset{-webkit-transition:all .3s ease;transition:all .3s ease}.gabsolute{position:absolute}.grelative{position:relative}.glightbox-desc{display:none!important}.glightbox-open{overflow:hidden}.gloader{-webkit-animation:lightboxLoader .8s linear infinite;animation:lightboxLoader .8s linear infinite;border:2px solid #fff;border-radius:50%;border-right-color:transparent;display:block;height:25px;left:0;margin:0 auto;position:absolute;right:0;top:47%;width:25px;z-index:9999}.goverlay{height:calc(100vh + 1px);left:0;position:fixed;top:-1px;width:100%;will-change:opacity}.glightbox-mobile .goverlay,.goverlay{background:#000}.gclose,.gnext,.gprev{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;align-items:center;border:none;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:44px;justify-content:center;width:26px;z-index:99999}.gclose svg,.gnext svg,.gprev svg{display:block;height:auto;margin:0;padding:0;width:25px}.gclose.disabled,.gnext.disabled,.gprev.disabled{opacity:.1}.gclose .garrow,.gnext .garrow,.gprev .garrow{stroke:#fff}.gbtn.focused{outline:2px solid #0f3d81}iframe.wait-autoplay{opacity:0}.glightbox-closing .gclose,.glightbox-closing .gnext,.glightbox-closing .gprev{opacity:0!important}.glightbox-clean .gslide-description{background:#fff}.glightbox-clean .gdesc-inner{padding:22px 20px}.glightbox-clean .gslide-title{color:#000;font-family:arial;font-size:1em;font-weight:400;line-height:1.4em;margin-bottom:19px}.glightbox-clean .gslide-desc{font-family:arial;font-size:.86em;line-height:1.4em;margin-bottom:0}.glightbox-clean .gslide-video{background:#000}.glightbox-clean .gclose,.glightbox-clean .gnext,.glightbox-clean .gprev{background-color:rgba(0,0,0,.75);border-radius:4px}.glightbox-clean .gclose path,.glightbox-clean .gnext path,.glightbox-clean .gprev path{fill:#fff}.glightbox-clean .gprev{left:30px}.glightbox-clean .gnext,.glightbox-clean .gprev{height:50px;position:absolute;top:-100%;width:40px}.glightbox-clean .gnext{right:30px}.glightbox-clean .gclose{height:35px;position:absolute;right:10px;top:15px;width:35px}.glightbox-clean .gclose svg{height:auto;width:18px}.glightbox-clean .gclose:hover{opacity:1}.gfadeIn{-webkit-animation:gfadeIn .5s ease;animation:gfadeIn .5s ease}.gfadeOut{-webkit-animation:gfadeOut .5s ease;animation:gfadeOut .5s ease}.gslideOutLeft{-webkit-animation:gslideOutLeft .3s ease;animation:gslideOutLeft .3s ease}.gslideInLeft{-webkit-animation:gslideInLeft .3s ease;animation:gslideInLeft .3s ease}.gslideOutRight{-webkit-animation:gslideOutRight .3s ease;animation:gslideOutRight .3s ease}.gslideInRight{-webkit-animation:gslideInRight .3s ease;animation:gslideInRight .3s ease}.gzoomIn{-webkit-animation:gzoomIn .5s ease;animation:gzoomIn .5s ease}.gzoomOut{-webkit-animation:gzoomOut .5s ease;animation:gzoomOut .5s ease}@-webkit-keyframes lightboxLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes lightboxLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes gfadeIn{0%{opacity:0}to{opacity:1}}@keyframes gfadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes gfadeOut{0%{opacity:1}to{opacity:0}}@keyframes gfadeOut{0%{opacity:1}to{opacity:0}}@-webkit-keyframes gslideInLeft{0%{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}}@keyframes gslideInLeft{0%{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}}@-webkit-keyframes gslideOutLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}to{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0);visibility:hidden}}@keyframes gslideOutLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}to{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0);visibility:hidden}}@-webkit-keyframes gslideInRight{0%{opacity:0;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0);visibility:visible}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes gslideInRight{0%{opacity:0;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0);visibility:visible}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@-webkit-keyframes gslideOutRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}to{opacity:0;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0)}}@keyframes gslideOutRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0);visibility:visible}to{opacity:0;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0)}}@-webkit-keyframes gzoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:1}}@keyframes gzoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:1}}@-webkit-keyframes gzoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes gzoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@media (min-width:769px){.glightbox-container .ginner-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;height:auto;width:auto}.glightbox-container .ginner-container.desc-top .gslide-description{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.glightbox-container .ginner-container.desc-top .gslide-image,.glightbox-container .ginner-container.desc-top .gslide-image img{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.glightbox-container .ginner-container.desc-left .gslide-description{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.glightbox-container .ginner-container.desc-left .gslide-image{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.gslide-image img{max-height:97vh;max-width:100%}.gslide-image img.zoomable{cursor:-webkit-zoom-in;cursor:zoom-in}.zoomed .gslide-image img.zoomable{cursor:-webkit-grab;cursor:grab}.gslide-inline{max-height:95vh}.gslide-external{max-height:100vh}.gslide-description.description-left,.gslide-description.description-right{max-width:275px}.glightbox-open{height:auto}.goverlay{background:rgba(0,0,0,.92)}.glightbox-clean .gslide-media{-webkit-box-shadow:1px 2px 9px 0 rgba(0,0,0,.65);box-shadow:1px 2px 9px 0 rgba(0,0,0,.65)}.glightbox-clean .description-left .gdesc-inner,.glightbox-clean .description-right .gdesc-inner{height:100%;overflow-y:auto;position:absolute}.glightbox-clean .gclose,.glightbox-clean .gnext,.glightbox-clean .gprev{background-color:rgba(0,0,0,.32)}.glightbox-clean .gclose:hover,.glightbox-clean .gnext:hover,.glightbox-clean .gprev:hover{background-color:rgba(0,0,0,.7)}.glightbox-clean .gnext,.glightbox-clean .gprev{top:45%}}@media (min-width:992px){.glightbox-clean .gclose{opacity:.7;right:20px}}@media screen and (max-height:420px){.goverlay{background:#000}}',""]),t.Z=r},1058:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,"#nprogress{pointer-events:none}#nprogress .bar{background:#29d;height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;display:block;height:100%;opacity:1;position:absolute;right:0;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px);width:100px}#nprogress .spinner{display:block;position:fixed;right:15px;top:15px;z-index:1031}#nprogress .spinner-icon{-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite;border-color:#29d transparent transparent #29d;border-radius:50%;border-style:solid;border-width:2px;-webkit-box-sizing:border-box;box-sizing:border-box;height:18px;width:18px}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}",""]),t.Z=r},1358:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".fade-enter-active[data-v-7b0ef450],.fade-leave-active[data-v-7b0ef450]{-webkit-transition:opacity .2s;transition:opacity .2s}.fade-enter[data-v-7b0ef450],.fade-leave-to[data-v-7b0ef450]{opacity:0}",""]),t.Z=r},4723:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".hidden-year-flatpickr{display:none!important}",""]),t.Z=r},5276:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".avatar.hidden{display:none}",""]),t.Z=r},2335:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".highlightItem[data-v-0731b535]:first-child{background-color:#f5f7fa}",""]),t.Z=r},6007:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".text-right.input-price .v-money[data-v-4b6af92c]{text-align:right}",""]),t.Z=r},4523:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".el-input__inner{height:42px}",""]),t.Z=r},5710:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".searh-field .tags-group:hover>span{background:#cbd4de;background-color:#cbd4de;border-color:#cbd4de}.searh-field .el-tag.el-tag--primary .el-tag__close.el-icon-close{color:#8898aa;margin-top:-3px}.searh-field .el-tag.el-tag--primary .el-tag__close.el-icon-close:hover{background-color:transparent}html[dir=ltr] .searh-field .el-tag-option{border-radius:.5rem 0 0 .5rem;margin-left:10px}html[dir=rtl] .searh-field .el-tag-option{border-radius:.5rem;margin-right:10px}.searh-field .el-tag-operator{border-radius:0;margin-left:-1px;margin-right:-1px}html[dir=ltr] .searh-field .el-tag-value{border-radius:0 .5rem .5rem 0;margin-right:10px}html[dir=rtl] .searh-field .el-tag-value{border-radius:.5rem;margin-left:10px}html[dir=rtl] .searh-field .el-tag-operator{border-radius:.5rem}.searh-field .el-select.input-new-tag{width:100%}.searh-field .btn-helptext{color:var(--gray);margin-left:auto}.searh-field .btn:not(:disabled):not(.disabled).active:focus,.searh-field .btn:not(:disabled):not(.disabled):active:focus{-webkit-box-shadow:none!important;box-shadow:none!important}.searh-field .form-control.datepicker.flatpickr-input{padding:inherit!important}.searh-field .dropdown-menu.operator{min-width:50px!important}.btn svg:not(:last-child),.searh-field .dropdown-menu.operator .btn i:not(:last-child){margin-right:inherit!important}.dropdown-menu{display:none;min-width:10rem;z-index:1000}.dropdown-menu.operator li,.dropdown-menu li{margin-bottom:5px}.dropdown-menu li:last-child{margin-bottom:0}.dropdown-menu>li>button{width:100%}.dropdown-menu.show{display:block}",""]),t.Z=r},5326:function(e,t,n){"use strict";var i=n(3645),r=n.n(i)()((function(e){return e[1]}));r.push([e.id,".modal.show{background-color:rgba(0,0,0,.3)}",""]),t.Z=r},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var o=0;o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:D(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},4806:function(e,t,n){"use strict";var i=n(3379),r=n.n(i),o=n(1165),a={insert:"head",singleton:!1};r()(o.Z,a),o.Z.locals},7909:function(e,t,n){"use strict";var i=n(3379),r=n.n(i),o=n(1058),a={insert:"head",singleton:!1};r()(o.Z,a),o.Z.locals},3379:function(e,t,n){"use strict";var i,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:D(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},7162:function(e,t,n){e.exports=n(5396)},5085:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return C}});var i=n(2175),r=n(1390),o=/%[sdj%]/g;function a(){for(var e=arguments.length,t=Array(e),n=0;n=a)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(e){return"[Circular]"}break;default:return e}})),l=t[i];i()\[\]\\.,;:\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,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},m={integer:function(e){return m.number(e)&&parseInt(e,10)===e},float:function(e){return m.number(e)&&!m.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(void 0===e?"undefined":(0,r.Z)(e))&&!m.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.match(p.email)&&e.length<255},url:function(e){return"string"==typeof e&&!!e.match(p.url)},hex:function(e){return"string"==typeof e&&!!e.match(p.hex)}};var v=function(e,t,n,i,o){if(e.required&&void 0===t)h(e,t,n,i,o);else{var s=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?m[s](t)||i.push(a(o.messages.types[s],e.fullField,e.type)):s&&(void 0===t?"undefined":(0,r.Z)(t))!==e.type&&i.push(a(o.messages.types[s],e.fullField,e.type))}};var g={required:h,whitespace:f,type:v,range:function(e,t,n,i,r){var o="number"==typeof e.len,s="number"==typeof e.min,l="number"==typeof e.max,u=t,c=null,d="number"==typeof t,h="string"==typeof t,f=Array.isArray(t);if(d?c="number":h?c="string":f&&(c="array"),!c)return!1;f&&(u=t.length),h&&(u=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),o?u!==e.len&&i.push(a(r.messages[c].len,e.fullField,e.len)):s&&!l&&ue.max?i.push(a(r.messages[c].max,e.fullField,e.max)):s&&l&&(ue.max)&&i.push(a(r.messages[c].range,e.fullField,e.min,e.max))},enum:function(e,t,n,i,r){e.enum=Array.isArray(e.enum)?e.enum:[],-1===e.enum.indexOf(t)&&i.push(a(r.messages.enum,e.fullField,e.enum.join(", ")))},pattern:function(e,t,n,i,r){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(a(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||i.push(a(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}};var y=function(e,t,n,i,o){var a=[],s=Array.isArray(t)?"array":void 0===t?"undefined":(0,r.Z)(t);g.required(e,t,i,a,o,s),n(a)};var b=function(e,t,n,i,r){var o=e.type,a=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t,o)&&!e.required)return n();g.required(e,t,i,a,r,o),s(t,o)||g.type(e,t,i,a,r)}n(a)},_={string:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t,"string")&&!e.required)return n();g.required(e,t,i,o,r,"string"),s(t,"string")||(g.type(e,t,i,o,r),g.range(e,t,i,o,r),g.pattern(e,t,i,o,r),!0===e.whitespace&&g.whitespace(e,t,i,o,r))}n(o)},method:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&g.type(e,t,i,o,r)}n(o)},number:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&(g.type(e,t,i,o,r),g.range(e,t,i,o,r))}n(o)},boolean:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&g.type(e,t,i,o,r)}n(o)},regexp:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),s(t)||g.type(e,t,i,o,r)}n(o)},integer:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&(g.type(e,t,i,o,r),g.range(e,t,i,o,r))}n(o)},float:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&(g.type(e,t,i,o,r),g.range(e,t,i,o,r))}n(o)},array:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t,"array")&&!e.required)return n();g.required(e,t,i,o,r,"array"),s(t,"array")||(g.type(e,t,i,o,r),g.range(e,t,i,o,r))}n(o)},object:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),void 0!==t&&g.type(e,t,i,o,r)}n(o)},enum:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();g.required(e,t,i,o,r),t&&g.enum(e,t,i,o,r)}n(o)},pattern:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t,"string")&&!e.required)return n();g.required(e,t,i,o,r),s(t,"string")||g.pattern(e,t,i,o,r)}n(o)},date:function(e,t,n,i,r){var o=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();if(g.required(e,t,i,o,r),!s(t)){var a=void 0;a="number"==typeof t?new Date(t):t,g.type(e,a,i,o,r),a&&g.range(e,a.getTime(),i,o,r)}}n(o)},url:b,hex:b,email:b,required:y};function w(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var x=w();function k(e){this.rules=null,this._messages=x,this.define(e)}k.prototype={messages:function(e){return e&&(this._messages=d(w(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==(void 0===e?"undefined":(0,r.Z)(e))||Array.isArray(e))throw new Error("Rules must be an object");this.rules={};var t=void 0,n=void 0;for(t in e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments[2],s=e,l=n,h=o;if("function"==typeof l&&(h=l,l={}),this.rules&&0!==Object.keys(this.rules).length){if(l.messages){var f=this.messages();f===x&&(f=w()),d(f,l.messages),l.messages=f}else l.messages=this.messages();var p=void 0,m=void 0,v={},g=l.keys||Object.keys(this.rules);g.forEach((function(n){p=t.rules[n],m=s[n],p.forEach((function(r){var o=r;"function"==typeof o.transform&&(s===e&&(s=(0,i.Z)({},s)),m=s[n]=o.transform(m)),(o="function"==typeof o?{validator:o}:(0,i.Z)({},o)).validator=t.getValidationMethod(o),o.field=n,o.fullField=o.fullField||n,o.type=t.getType(o),o.validator&&(v[n]=v[n]||[],v[n].push({rule:o,value:m,source:s,field:n}))}))}));var y={};u(v,l,(function(e,t){var n=e.rule,o=!("object"!==n.type&&"array"!==n.type||"object"!==(0,r.Z)(n.fields)&&"object"!==(0,r.Z)(n.defaultField));function s(e,t){return(0,i.Z)({},t,{fullField:n.fullField+"."+e})}function u(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=r;if(Array.isArray(u)||(u=[u]),u.length,u.length&&n.message&&(u=[].concat(n.message)),u=u.map(c(n)),l.first&&u.length)return y[n.field]=1,t(u);if(o){if(n.required&&!e.value)return u=n.message?[].concat(n.message).map(c(n)):l.error?[l.error(n,a(l.messages.required,n.field))]:[],t(u);var d={};if(n.defaultField)for(var h in e.value)e.value.hasOwnProperty(h)&&(d[h]=n.defaultField);for(var f in d=(0,i.Z)({},d,e.rule.fields))if(d.hasOwnProperty(f)){var p=Array.isArray(d[f])?d[f]:[d[f]];d[f]=p.map(s.bind(null,f))}var m=new k(d);m.messages(l.messages),e.rule.options&&(e.rule.options.messages=l.messages,e.rule.options.error=l.error),m.validate(e.value,e.rule.options||l,(function(e){t(e&&e.length?u.concat(e):e)}))}else t(u)}o=o&&(n.required||!n.required&&e.value),n.field=e.field;var d=n.validator(n,e.value,u,e.source,l);d&&d.then&&d.then((function(){return u()}),(function(e){return u(e)}))}),(function(e){b(e)}))}else h&&h();function b(e){var t,n=void 0,i=void 0,r=[],o={};for(n=0;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},3644:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},783:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},3044:function(e,t,n){"use strict";var i=n(3644),r=Object.prototype.toString;function o(e){return"[object Array]"===r.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==r.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===r.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,i=e.length;n0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,o=[],a=16383,s=0,l=i-r;sl?l:s+a));1===r?(t=e[i-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,i){for(var r,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8834:function(e,t,n){"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var i=n(5766),r=n(2333),o=n(7906);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(i)return B(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function v(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function g(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,i,r){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var c=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var d=!0,h=0;hr&&(i=r):i=r;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a>8,r=n%256,o.push(r),o.push(i);return o}(t,e.length-n),e,n,i)}function S(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r239?4:u>223?3:u>191?2:1;if(r+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[r+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[r+1],a=e[r+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),r+=d}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,i,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,r),c=e.slice(t,n),d=0;dr)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;ri)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,i,r,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function $(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r>>8*(i?r:1-r)}function j(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r>>8*(i?r:3-r)&255}function I(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(e,t,n,i,o){return o||I(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,o){return o||I(e,0,n,8),r.write(e,t,n,i,52,8),n+8}l.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var i=this[e],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+r]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}},5298:function(e,t,n){n(3647),e.exports=n(788).Object.assign},9365:function(e,t,n){n(4371),n(8158),n(8237),n(9077),e.exports=n(788).Symbol},6408:function(e,t,n){n(506),n(3063),e.exports=n(6426).f("iterator")},160:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},7113:function(e){e.exports=function(){}},8806:function(e,t,n){var i=n(2509);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},9434:function(e,t,n){var i=n(8848),r=n(8711),o=n(6885);e.exports=function(e){return function(t,n,a){var s,l=i(t),u=r(l.length),c=o(a,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},7836:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},788:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},5838:function(e,t,n){var i=n(160);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},3066:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},2401:function(e,t,n){e.exports=!n(7305)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},9547:function(e,t,n){var i=n(2509),r=n(9444).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},6663:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},4858:function(e,t,n){var i=n(3028),r=n(3465),o=n(8366);e.exports=function(e){var t=i(e),n=r.f;if(n)for(var a,s=n(e),l=o.f,u=0;s.length>u;)l.call(e,a=s[u++])&&t.push(a);return t}},5624:function(e,t,n){var i=n(9444),r=n(788),o=n(5838),a=n(3441),s=n(8121),l=function(e,t,n){var u,c,d,h=e&l.F,f=e&l.G,p=e&l.S,m=e&l.P,v=e&l.B,g=e&l.W,y=f?r:r[t]||(r[t]={}),b=y.prototype,_=f?i:p?i[t]:(i[t]||{}).prototype;for(u in f&&(n=t),n)(c=!h&&_&&void 0!==_[u])&&s(y,u)||(d=c?_[u]:n[u],y[u]=f&&"function"!=typeof _[u]?n[u]:v&&c?o(d,i):g&&_[u]==d?function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((y.virtual||(y.virtual={}))[u]=d,e&l.R&&b&&!b[u]&&a(b,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},7305:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9444:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},8121:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},3441:function(e,t,n){var i=n(8497),r=n(7468);e.exports=n(2401)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},1495:function(e,t,n){var i=n(9444).document;e.exports=i&&i.documentElement},7959:function(e,t,n){e.exports=!n(2401)&&!n(7305)((function(){return 7!=Object.defineProperty(n(9547)("div"),"a",{get:function(){return 7}}).a}))},8362:function(e,t,n){var i=n(7836);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},5160:function(e,t,n){var i=n(7836);e.exports=Array.isArray||function(e){return"Array"==i(e)}},2509:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},5874:function(e,t,n){"use strict";var i=n(9183),r=n(7468),o=n(2456),a={};n(3441)(a,n(9682)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=i(a,{next:r(1,n)}),o(e,t+" Iterator")}},3924:function(e,t,n){"use strict";var i=n(2245),r=n(5624),o=n(6538),a=n(3441),s=n(2830),l=n(5874),u=n(2456),c=n(1079),d=n(9682)("iterator"),h=!([].keys&&"next"in[].keys()),f="keys",p="values",m=function(){return this};e.exports=function(e,t,n,v,g,y,b){l(n,t,v);var _,w,x,k=function(e){if(!h&&e in E)return E[e];switch(e){case f:case p:return function(){return new n(this,e)}}return function(){return new n(this,e)}},C=t+" Iterator",S=g==p,O=!1,E=e.prototype,T=E[d]||E["@@iterator"]||g&&E[g],D=T||k(g),A=g?S?k("entries"):D:void 0,M="Array"==t&&E.entries||T;if(M&&(x=c(M.call(new e)))!==Object.prototype&&x.next&&(u(x,C,!0),i||"function"==typeof x[d]||a(x,d,m)),S&&T&&T.name!==p&&(O=!0,D=function(){return T.call(this)}),i&&!b||!h&&!O&&E[d]||a(E,d,D),s[t]=D,s[C]=m,g)if(_={values:S?D:k(p),keys:y?D:k(f),entries:A},b)for(w in _)w in E||o(E,w,_[w]);else r(r.P+r.F*(h||O),t,_);return _}},7264:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},2830:function(e){e.exports={}},2245:function(e){e.exports=!0},2827:function(e,t,n){var i=n(8160)("meta"),r=n(2509),o=n(8121),a=n(8497).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(7305)((function(){return l(Object.preventExtensions({}))})),c=function(e){a(e,i,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,i)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[i].i},getWeak:function(e,t){if(!o(e,i)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[i].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!o(e,i)&&c(e),e}}},5470:function(e,t,n){"use strict";var i=n(2401),r=n(3028),o=n(3465),a=n(8366),s=n(4253),l=n(8362),u=Object.assign;e.exports=!u||n(7305)((function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=i}))?function(e,t){for(var n=s(e),u=arguments.length,c=1,d=o.f,h=a.f;u>c;)for(var f,p=l(arguments[c++]),m=d?r(p).concat(d(p)):r(p),v=m.length,g=0;v>g;)f=m[g++],i&&!h.call(p,f)||(n[f]=p[f]);return n}:u},9183:function(e,t,n){var i=n(8806),r=n(2671),o=n(6663),a=n(7610)("IE_PROTO"),s=function(){},l=function(){var e,t=n(9547)("iframe"),i=o.length;for(t.style.display="none",n(1495).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("